An application service degradation method and device
The BMC-based method addresses the issue of untimely service downgrades during power loss by independently monitoring hardware and initiating downgrades, ensuring reliable service continuity.
Patent Information
- Application Number
- CN202110236516.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-03
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-03-03
AI Technical Summary
In the prior art, when the computer suddenly loses power or restarts, the operating system cannot promptly notify the application service registration center for service downgrade, resulting in the application service being unable to be offline or limit the current in a timely manner.
Hardware information is obtained independently through BMC, the downgrade type is determined based on preset hardware conditions, and the hardware information is sent to the application service through ipmitool to achieve interface current limit or offline, and the service downgrade is carried out independently of the operating system.
Even if the computer suddenly loses power or restarts, BMC can still downgrade the application services in a timely manner, provide detailed downgrade solutions, and improve the reliability of the application services.
Smart Images

Figure CN113760534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technologies, and in particular, to an application service degradation method and apparatus. Background Art
[0002] In actual application scenarios, a distributed system calls application services located in a computer cluster based on an application service registration center. When an abnormality occurs in a certain computer in the cluster, the application services running on the computer usually need to be degraded, such as taking the application services offline or restricting the interface traffic.
[0003] The prior art uses an operating system to monitor information such as the CPU usage rate and network rate of a computer, and degrades application services based on the above information.
[0004] However, when the computer suddenly loses power or is forcibly restarted, the operating system cannot timely notify the application services or the application service registration center to perform service degradation. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an application service degradation method and apparatus, which can timely degrade application services and avoid providing invalid services.
[0006] In a first aspect, an embodiment of the present invention provides an application service degradation method, which is applied to a BMC (Baseboard Management Controller), and includes:
[0007] Obtain hardware information;
[0008] Determine a degradation type corresponding to the hardware information according to the hardware information and preset hardware conditions corresponding to the degradation type;
[0009] Degrade the application service according to the degradation type corresponding to the hardware information.
[0010] Optionally,
[0011] The hardware information includes: event logs;
[0012] The step of determining a degradation type corresponding to the hardware information according to the hardware information and preset hardware conditions corresponding to the degradation type includes:
[0013] Match the event types in the event logs with the event types corresponding to the degradation type to determine the degradation type corresponding to the event logs.
[0014] Optionally,
[0015] The hardware information includes: health indicators of the hardware;
[0016] Determining the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type includes:
[0017] Matching the health indicators of the hardware with the health indicator ranges corresponding to the degradation types to determine the degradation type corresponding to the health indicators of the hardware.
[0018] Optionally,
[0019] The degradation type corresponding to the hardware information is current limiting;
[0020] Degrading the application service according to the degradation type corresponding to the hardware information includes:
[0021] Sending the hardware information to the application service so that the application service restricts the interface traffic according to the hardware information and the preset interface current limiting policy.
[0022] Optionally,
[0023] Sending the hardware information to the application service includes:
[0024] Sending the hardware information to the application service through ipmitool.
[0025] Optionally,
[0026] The degradation type corresponding to the hardware information is current limiting;
[0027] Degrading the application service according to the degradation type corresponding to the hardware information includes:
[0028] Sending the hardware information to the application service so that the application service restricts the log output according to the hardware information and the preset log degradation policy.
[0029] Optionally,
[0030] The degradation type corresponding to the hardware information is offline;
[0031] Further including: obtaining the IP and interface identifier of the application service from the operating system;
[0032] Degrading the application service according to the degradation type corresponding to the hardware information includes:
[0033] Sending the IP and interface identifier of the application service to the application service registry so that the application service registry takes the interface of the application service offline according to the IP and interface identifier of the application service.
[0034] Second aspect, an embodiment of the present invention provides an application service degradation device, which is applied to BMC and includes:
[0035] An acquisition module configured to acquire hardware information;
[0036] A determination module configured to determine the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type;
[0037] A degradation module configured to degrade the application service according to the degradation type corresponding to the hardware information.
[0038] Third aspect, an embodiment of the present invention provides an electronic device, including:
[0039] One or more processors;
[0040] A storage device for storing one or more programs,
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0042] Fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.
[0043] One of the above embodiments of the invention has the following advantages or beneficial effects: This method is applied to BMC. Since BMC is independent of hardware and the operating system, even if the computer suddenly loses power or is forced to restart, this method can still timely degrade the application service. Moreover, this method can implement different degradation types according to the hardware information. For example, interface flow limiting, application service offline, etc., and can provide a more refined degradation solution according to the load situation of the hardware, improving the reliability of the application service.
[0044] The further effects of the above non-conventional optional ways will be described in combination with specific embodiments below. Description of the Drawings
[0045] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:
[0046] Figure 1 is a flowchart of an application service degradation method provided by an embodiment of the present invention;
[0047] Figure 2 is a flowchart of an application service degradation method provided by another embodiment of the present invention;
[0048] Figure 3It is a flowchart of an application service degradation method provided by another embodiment of the present invention;
[0049] Figure 4 It is a schematic diagram of an application service degradation device provided by an embodiment of the present invention;
[0050] Figure 5 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0051] Figure 6 It is a schematic structural diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners
[0052] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to assist understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0053] In the prior art, the operating system monitors the load parameters of computer hardware and determines whether to degrade the application service according to the load parameters. For example, the operating system monitors the CPU usage rate, and when the CPU usage rate exceeds 90%, it notifies the application service registration center to take the application service offline.
[0054] However, if the computer experiences power failure or restart, etc., the operating system cannot notify the application service registration center to take the application service offline in time.
[0055] In view of this, as Figure 1 shown, the embodiments of the present invention provide an application service degradation method, which is applied to BMC and includes:
[0056] Step 101: Obtain hardware information.
[0057] BMC is independent of the hardware and the operating system and has an independent computing chip, storage structure, battery power supply, network interface, etc. In the embodiments of the present invention, BMC can interact with different hardware to obtain information of different hardware. Specifically, the hardware can include: disks, network cards, fans, power adapters, bus controllers, and CPUs, etc. The hardware information can include: CPU temperature, fan speed, voltage of the power adapter, etc. The hardware information can be actively reported by the hardware or actively obtained by BMC according to actual needs.
[0058] Step 102: Determine the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type.
[0059] In an embodiment of the present invention, different degradation types correspond to different hardware conditions. The obtained hardware information is matched with various hardware conditions to determine the degradation type corresponding to the hardware information. The degradation types include: current limiting and offline. Current limiting includes restricting interface traffic and restricting log output. For example, reducing the traffic of a certain interface. Offline means stopping the service provided by the interface.
[0060] It should be noted that according to the hardware information, it may also be determined that the application service does not need to be degraded, so the application service runs in the current state. The embodiments of the present invention only focus on the cases where degradation is required.
[0061] Step 103: Degrade the application service according to the degradation type corresponding to the hardware information.
[0062] This method is applied to the BMC. Since the BMC is independent of the hardware and the operating system, even if the computer suddenly loses power or is forced to restart, this method can still degrade the application service in a timely manner. Moreover, this method can implement different degradation types according to the hardware information. For example, interface current limiting, application service offline, etc., and can provide a more refined degradation scheme according to the load situation of the hardware, improving the reliability of the application service.
[0063] In an embodiment of the present invention, the hardware information includes: event logs;
[0064] Determining the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type includes:
[0065] Matching the event type in the event log with the event types corresponding to the degradation types to determine the degradation type corresponding to the event log.
[0066] The embodiments of the present invention can check whether the hardware reports event logs (Event Log) at regular intervals, for example, every 5 seconds. The event log includes an event identifier and an event type. Among them, the event type includes info (general information), warning (warning), and error (serious exception). The event identifier is used to identify the source of the event log.
[0067] In the embodiments of the present invention, the hardware condition is the event type corresponding to the downgrade type. The correspondence between the event type and the downgrade type can be determined according to actual requirements. For example, if the event type is info, the application service maintains its existing state; if the event type is warning, the corresponding downgrade type is traffic limiting; if the event type is error, the corresponding downgrade type is offline. In actual application scenarios, the downgrade type corresponding to the event type error can also be adjusted to traffic limiting, or the downgrade type corresponding to the event type warning can be adjusted to offline.
[0068] For the same event type of different hardware, it can correspond to the same downgrade type, or it can also correspond to different downgrade types to adapt to the differences of different hardware. For example, the downgrade type corresponding to the event type error of the CPU is offline, and the downgrade type corresponding to the event type error of the network card is traffic limiting.
[0069] The embodiments of the present invention can execute corresponding downgrade policies on the application service according to the event type. Since the event log can reflect the operating state of the hardware, the embodiments of the present invention can more effectively adjust the application service
[0070] In one embodiment of the present invention, the hardware information includes: the health indicators of the hardware;
[0071] Determining the downgrade type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the downgrade type includes:
[0072] Matching the health indicators of the hardware with the health indicator range corresponding to the downgrade type to determine the downgrade type corresponding to the health indicators of the hardware.
[0073] The health indicators of the hardware are used to measure the health degree of the hardware, including: CPU temperature, network card inflow and outflow rate, voltage of the power adapter, fan speed, etc. In the embodiments of the present invention, the hardware condition refers to the health indicator range, such as the CPU temperature range, the power adapter voltage range, etc. Different downgrade types correspond to different health indicator ranges. For example, the CPU temperature range corresponding to traffic limiting is (60°C - 90°C), and the CPU temperature range corresponding to offline is greater than 90°C.
[0074] The embodiments of the present invention adjust the application service based on the health degree of the hardware, taking into account the differences in the health degrees of different hardware, and adjusting the application service more timely to improve the reliability of the application service.
[0075] In one embodiment of the present invention, the downgrade type corresponding to the hardware information is traffic limiting;
[0076] Downgrading the application service according to the downgrade type corresponding to the hardware information includes:
[0077] Send the hardware information to the application service so that the application service can limit the interface traffic according to the hardware information and the preset interface traffic limiting policy.
[0078] The application service can limit the traffic of some interfaces of the application service according to the pre-configured interface traffic limiting policy, which not only considers the running state of the hardware but also ensures the availability of the application service.
[0079] In the embodiment of the present invention, sending the hardware information to the application service includes:
[0080] Send the hardware information to the application service through ipmitool.
[0081] In the embodiment of the present invention, the existing ipmitool is used to send the hardware information to the application service without the need to develop additional tools. Ipmitool runs in the operating system and sends the hardware information to the application service based on the semaphore of the operating system to prevent excessive output of hardware information and reduce the performance of the application service.
[0082] In an embodiment of the present invention, the degradation type corresponding to the hardware information is traffic limiting;
[0083] Degrading the application service according to the degradation type corresponding to the hardware information includes:
[0084] Send the hardware information to the application service so that the application service can limit the log output according to the hardware information and the preset log degradation policy.
[0085] In the embodiment of the present invention, the application service can slow down or terminate the log output because the log output consumes the resources of the hardware. In the case of high hardware load, the log output can be reduced to ensure that the application service processes business requests. In the embodiment of the present invention, the hardware information is sent to the application service through ipmitool.
[0086] In an embodiment of the present invention, the degradation type corresponding to the hardware information is offline;
[0087] Further include: obtaining the IP and interface identifier of the application service from the operating system;
[0088] Degrading the application service according to the degradation type corresponding to the hardware information includes:
[0089] Send the IP and interface identifier of the application service to the application service registration center so that the application service registration center can take the interfaces of the application service offline according to the IP and interface identifier of the application service.
[0090] When there are relatively serious problems with the hardware, the application service cannot provide services externally. At this time, the application service needs to be taken offline. For example, when the CPU temperature exceeds 90°C. In the embodiments of the present invention, through ipmitool, the IP and interface identifier of the application service are obtained from the application service running in the operating system. The application service registration center can take one or more interfaces of the application service offline according to the IP and interface identifier of the application service, and the offline interfaces will terminate providing services. The embodiments of the present invention can take the interface service offline in a timely manner to avoid providing invalid services.
[0091] As Figure 2 shown, the embodiments of the present invention provide an application service degradation method, which is applied to BMC and includes:
[0092] Step 201: Obtain the IP and interface identifier of the application service from the operating system.
[0093] After the application service starts, the IP and interface identifier of the application service are provided to the application service degradation device running on the BMC through ipmitool. The application service degradation device saves the IP and interface identifier of the application service in the cache.
[0094] Step 202: Obtain the event log and the health metrics of the hardware.
[0095] This method can be implemented by a program running on the BMC. This method can obtain the event log and health metrics of hardware such as CPU, network card, disk, power adapter, fan, memory socket, etc. based on the BMC where it is located. The embodiments of the present invention are only illustrated by taking the CPU as an example.
[0096] The CPU obtains the event log and the health metrics of the CPU through the ipmi protocol. Among them, the event type of the event log is error (serious exception), and the health metric of the CPU is the CPU temperature of 95°C.
[0097] Step 203: Match the event type in the event log with the event type corresponding to the degradation type to determine the degradation type corresponding to the event log.
[0098] The preset correspondence between the event type and the degradation type includes: info (general information) corresponding to no degradation, warning (warning) corresponding to traffic limiting, and error (serious exception) corresponding to offline.
[0099] In the embodiments of the present invention, the degradation type corresponding to the event log is offline.
[0100] Step 204: Match the health metrics of the hardware with the health metric range corresponding to the degradation type to determine the degradation type corresponding to the health metrics of the hardware.
[0101] The correspondence between the pre-set CPU temperature range and the degradation type includes: when the CPU temperature is less than 60°C, there is no degradation; when the CPU temperature range is (60°C - 90°C), current limiting is performed; when the CPU temperature range is greater than 90°C, the service is taken offline.
[0102] The CPU temperature range corresponding to current limiting is (60°C - 90°C), and the CPU temperature range corresponding to taking the service offline is greater than 90°C.
[0103] In the embodiment of the present invention, the degradation type corresponding to the health indicator of the hardware is taking the service offline.
[0104] Step 205: Determine the degradation type corresponding to the hardware information according to the degradation type corresponding to the event log and the degradation type corresponding to the health indicator of the hardware.
[0105] In the embodiment of the present invention, since the hardware information includes both the event log and the health indicator of the hardware, in order to avoid inconsistent degradation types determined by the two, resulting in the inability to degrade the application service, the embodiment of the present invention can also pre-set the priorities of the event log and the health indicator of the hardware. If the degradation types determined by the two are different, the degradation type corresponding to the hardware information with the higher priority shall prevail.
[0106] Step 206: Send the IP and interface identifier of the application service to the application service registration center, so that the application service registration center takes offline the interface of the application service according to the IP and interface identifier of the application service.
[0107] The application service registration center will take offline the interface of the application service according to the IP and interface identifier of the application service. The front end will obtain the interfaces of the available application services from the application service registration center and send service requests to the interfaces of the available application services.
[0108] In the embodiment of the present invention, it is possible to determine whether it is necessary to take offline the application service according to the health indicator and event log of the hardware. This method runs on the BMC, independent of the operating system, and can take offline the application service in a timely manner.
[0109] As Figure 3 shown, the embodiment of the present invention provides an application service degradation method, which is applied to the BMC and includes:
[0110] Step 301: Obtain the IP and interface identifier of the application service from the operating system.
[0111] Step 302: Obtain the event log.
[0112] In the embodiment of the present invention, when a bad track occurs on the disk, an event log is generated, and the event type can be warning (warning).
[0113] Step 303: Match the event type in the event log with the event types corresponding to the degradation types to determine the degradation type corresponding to the event log.
[0114] The pre-set correspondence between event types and degradation types includes: info (general information) corresponding to no degradation, warning (warning) corresponding to traffic limiting, and error (severe exception) corresponding to offline.
[0115] In the embodiment of the present invention, the degradation type corresponding to the event log is traffic limiting.
[0116] Step 304: Send the event log to the application service through ipmitool so that the application service restricts the log output according to the event log and the pre-set log degradation policy.
[0117] In an actual application scenario, the application service can perform degradation according to different degradation policies. For example, it can adopt a log degradation policy to limit the log output, or it can limit the interface traffic according to the interface traffic limiting policy. The application service can determine the degradation policy corresponding to the hardware information according to the hardware type or event type, etc.
[0118] Such as Figure 4 As shown, an embodiment of the present invention provides an application service degradation device, which is characterized in that it is applied to BMC and includes:
[0119] An acquisition module 401, configured to acquire hardware information;
[0120] A determination module 402, configured to determine the degradation type corresponding to the hardware information according to the hardware information and the pre-set hardware conditions corresponding to the degradation types;
[0121] A degradation module 403, configured to degrade the application service according to the degradation type corresponding to the hardware information.
[0122] In an embodiment of the present invention, the hardware information includes: event logs;
[0123] The determination module 402 is configured to match the event type in the event log with the event types corresponding to the degradation types to determine the degradation type corresponding to the event log.
[0124] In an embodiment of the present invention, the hardware information includes: the health indicators of the hardware;
[0125] The determination module 402 is configured to match the health indicators of the hardware with the health indicator ranges corresponding to the degradation types to determine the degradation type corresponding to the health indicators of the hardware.
[0126] In an embodiment of the present invention, the degradation type corresponding to the hardware information is traffic limiting;
[0127] The degradation module 403 is configured to send hardware information to the application service, so that the application service restricts the interface traffic according to the hardware information and the preset interface flow limiting policy.
[0128] In one embodiment of the present invention, the degradation module 403 is configured to send the hardware information to the application service through ipmitool.
[0129] In one embodiment of the present invention, the degradation type corresponding to the hardware information is flow limiting;
[0130] The degradation module 403 is configured to send the hardware information to the application service, so that the application service restricts the log output according to the hardware information and the preset log degradation policy.
[0131] In one embodiment of the present invention, the degradation type corresponding to the hardware information is offline;
[0132] The acquisition module 401 is configured to acquire the IP and interface identifier of the application service from the operating system;
[0133] The degradation module is configured to send the IP and interface identifier of the application service to the application service registration center, so that the application service registration center takes the interface of the application service offline according to the IP and interface identifier of the application service.
[0134] An embodiment of the present invention provides an electronic device, including:
[0135] One or more processors;
[0136] A storage device for storing one or more programs,
[0137] When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the above embodiments.
[0138] An embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, characterized in that when the program is executed by a processor, the method of any of the above embodiments is implemented.
[0139] Figure 5 An exemplary system architecture 500 to which the application service degradation method or application service degradation device of the embodiments of the present invention can be applied is shown.
[0140] As Figure 5 shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0141] Users can use terminal devices 501, 502, 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0142] Terminal devices 501, 502, 503 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop computers, desktop computers, and so on.
[0143] Server 505 can be a server that provides various services, such as a background management server that supports shopping websites browsed by users using terminal devices 501, 502, 503 (for example only). The background management server can analyze and process data such as product information query requests received, and feedback the processing results (such as target push information, product information - for example only) to the terminal device.
[0144] It should be noted that the application service degradation method provided by the embodiments of the present invention is generally executed by server 505. Correspondingly, the application service degradation device is generally set in server 505.
[0145] It should be understood that Figure 5 the numbers of terminal devices, networks, and servers in
[0146] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 6 Shown below is a schematic diagram of the structure of computer system 600 of a terminal device suitable for implementing the embodiments of the present invention. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0147] As Figure 6 shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in read-only memory (ROM) 602 or the program loaded from storage section 608 into random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of system 600 are also stored. CPU 601, ROM 602, and RAM 603 are connected to each other via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0148] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as required. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the drive 610 as required so that a computer program read therefrom is installed into the storage section 608 as required.
[0149] Specifically, according to the embodiments disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed by the present invention include a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, the above functions defined in the system of the present invention are executed.
[0150] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. And in the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0152] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the sending module can also be described as "a module that sends a picture acquisition request to the connected server".
[0153] As another aspect, the present invention further provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; it can also exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes:
[0154] Obtain hardware information;
[0155] According to the hardware information and the preset hardware conditions corresponding to the downgrade type, determine the downgrade type corresponding to the hardware information;
[0156] Downgrade the application service according to the downgrade type corresponding to the hardware information.
[0157] According to the technical solution of the embodiments of the present invention, the method is applied to the BMC. Since the BMC is independent of the hardware and the operating system, even if the computer suddenly loses power or is forced to restart, the method can still timely downgrade the application service. And the method can implement different downgrade types according to the hardware information, such as interface current limiting, application service offline, etc., and can provide a more refined downgrade solution according to the load situation of the hardware, improving the reliability of the application service.
[0158] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention should be included within the protection scope of the present invention.
Claims
1. An application service degradation method, characterized in that, Applied to a Baseboard Management Controller (BMC), it includes: Obtain hardware information, where the hardware information includes: event logs; Determine the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type, including: matching the event types in the event logs with the event types corresponding to the degradation type to determine the degradation type corresponding to the event logs; Obtain the IP and interface identifier of the application service from the operating system; Degrade the application service according to the degradation type corresponding to the hardware information, including: when the application service can provide services externally, send the hardware information to the application service so that the application service restricts log output according to the hardware information and the preset log degradation policy; and when the application service cannot provide services externally, send the IP and interface identifier of the application service to the application service registration center so that the application service registration center takes the interface of the application service offline according to the IP and interface identifier of the application service; the degradation type corresponding to the hardware information is traffic limiting or taking offline.
2. The method according to claim 1, wherein The hardware information includes: the health indicators of the hardware; The determining the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type includes: Matching the health indicators of the hardware with the health indicator ranges corresponding to the degradation type to determine the degradation type corresponding to the health indicators of the hardware.
3. The method according to claim 1, wherein The degrading the application service according to the degradation type corresponding to the hardware information includes: Sending the hardware information to the application service so that the application service restricts interface traffic according to the hardware information and the preset interface traffic limiting policy.
4. The method according to claim 3, wherein The sending the hardware information to the application service includes: Sending the hardware information to the application service through ipmitool.
5. An application service degradation device, characterized in that, Applied to BMC, it includes: An obtaining module configured to obtain hardware information, where the hardware information includes: event logs; and is also used to obtain the IP and interface identifier of the application service from the operating system; A determining module configured to determine the degradation type corresponding to the hardware information according to the hardware information and the preset hardware conditions corresponding to the degradation type, including: matching the event types in the event logs with the event types corresponding to the degradation type to determine the degradation type corresponding to the event logs; A degradation module, configured to degrade an application service according to a degradation type corresponding to the hardware information, including: when the application service can provide services externally, sending the hardware information to the application service, so that the application service restricts log output according to the hardware information and a preset log degradation policy; and when the application service cannot provide services externally, sending the IP and interface identifier of the application service to an application service registration center, so that the application service registration center takes the interface of the application service offline according to the IP and interface identifier of the application service; The degradation type corresponding to the hardware information is traffic limiting or taking offline.
6. An electronic device, characterized in that, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the method according to any one of claims 1-4.
7. A computer-readable medium having a computer program stored thereon, characterized in that, The program, when executed by a processor, implements the method according to any one of claims 1-4.
Citation Information
Patent Citations
Method and device for transferring events between components
CN110865889A
Fault degradation method and device
CN111045844A
Communication method, device and system based on TCP connection
CN111107039A