CN110971676B - Equipment state detection method and device, electronic equipment and storage medium - Google Patents

Equipment state detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110971676B
CN110971676B CN201911128268.2A CN201911128268A CN110971676B CN 110971676 B CN110971676 B CN 110971676B CN 201911128268 A CN201911128268 A CN 201911128268A CN 110971676 B CN110971676 B CN 110971676B
Authority
CN
China
Prior art keywords
detection
target
node
request
hosts
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911128268.2A
Other languages
Chinese (zh)
Other versions
CN110971676A (en
Inventor
戚剑锋
张阳平
陈宽
王广伟
洪一帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911128268.2A priority Critical patent/CN110971676B/en
Publication of CN110971676A publication Critical patent/CN110971676A/en
Application granted granted Critical
Publication of CN110971676B publication Critical patent/CN110971676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention relates to the field of communication, and discloses a device state detection method and device, electronic equipment and a storage medium. In the invention, the equipment state detection method comprises the following steps: acquiring node attributes of a detection target; the node attribute comprises the number of hosts of a node where a detection target is located; configuring a detection strategy of a detection target according to the node attribute and a preset detection rule; and sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result. Different detection strategies are configured according to the node attributes of the detection target, the problems that detection periods are too long and detection results are delayed greatly due to the fact that all devices are detected by the same method are solved, and detection efficiency can be improved.

Description

Equipment state detection method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for detecting a device status, an electronic device, and a storage medium.
Background
The basic idea of a CDN (Content Delivery Network) is to avoid bottlenecks and links on the internet that may affect data transmission speed and stability as much as possible, so that Content transmission is faster and more stable. By placing node servers at various positions of the network to form a layer of intelligent virtual network on the basis of the existing internet, the CDN system can redirect the request of a user to a service node closest to the user in real time according to network flow, connection of each node, load condition, distance to the user, response time and other comprehensive information. The method aims to enable the user to obtain the required content nearby, solve the network congestion condition and improve the response speed of the user for accessing the website.
In the prior art, CDN scheduling can be intelligently and dynamically scheduled according to a user IP address source, a domain name accessed by a user and user access content. The common scheduling strategy divides areas according to user IP, refers to network congestion, and selects CDN service nearby according to user requests in different areas.
The inventors of the present invention found that: in the CDN detection method in the prior art, all devices in all nodes are detected one by one, and scheduling is performed after all detection results are obtained. However, the device parameters and the operation principle of each node are different, and the method for detecting the node information in the same mode often causes the problems of data redundancy acquisition and overlong waiting period.
Disclosure of Invention
The embodiment of the invention aims to provide a device state detection method, a device, an electronic device and a storage medium, which can avoid detecting all devices by adopting the same method, further overcome the problems of overlong detection period and larger detection result delay caused by detection in the prior art, and improve the detection efficiency.
In order to solve the above technical problem, an embodiment of the present invention provides an apparatus status detection method, including the following steps: acquiring node attributes of a detection target; the node attribute comprises the number of hosts of a node where a detection target is located; configuring a detection strategy of a detection target according to the node attribute and a preset detection rule; and sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result.
The embodiment of the present invention further provides an apparatus for detecting a device status, including: the acquisition module is used for acquiring the node attribute of the detection target; the node attribute comprises the number of hosts in a node where a detection target is located; the strategy configuration module is used for configuring a detection strategy of a detection target according to the node attribute and a preset detection rule; and the detection module is used for sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result.
An embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the device state detection method.
The embodiment of the invention also provides a storage medium, which stores a computer program, and the computer program realizes the device state detection method when being executed by a processor.
Compared with the prior art, the embodiment of the invention configures the detection strategy of the detection target according to the number of the hosts of the node where the detection target is located; and sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result. Different detection strategies are configured according to the node attributes of the detection target, the problems that detection periods are too long and detection results are delayed greatly due to the fact that all devices are detected by the same method are solved, and detection efficiency can be improved.
In addition, when the node where the detection target is located is a single host node, the detection policy is to send a detection request to the detection target. For a single host node to directly detect a target host, the acquisition mode is quick and effective.
In addition, when the node where the detection target is located comprises a plurality of hosts, the hosts perform redundancy detection mutually to generate a detection list comprising detection results of the hosts, and the detection list is stored in the hosts in a distributed manner; the detection strategy is used for acquiring a detection list; sending a corresponding detection request to a detection target according to a detection strategy, so that the detection target responds to the detection request and feeds back a detection result, comprising: selecting one host from the multiple hosts as a target host; and sending a detection request for calling the detection list to the target host, so that the target host feeds back the detection list in response to the detection request. The detection results of all the devices in the whole node can be obtained by only detecting one device in the same node, so that the detection period is further shortened, and the detection mode is quicker and more effective.
In addition, the node contains load balancing equipment; sending a corresponding detection request to a detection target according to a detection strategy, so that the detection target responds to the detection request and feeds back a detection result, comprising: and sending a detection request to the load balancing equipment so that the load balancing equipment feeds back a detection list in response to the detection request. The method is also suitable for the nodes provided with the load balancing equipment, and can be compatible with diversified deployment architectures.
In addition, a corresponding detection request is sent to the detection target according to the detection strategy, so that the detection target responds to the detection request and feeds back the detection result, and the method comprises the following steps: selecting one host from a plurality of hosts as a target host in a polling way; and sending a detection request for calling the detection list to the target host, so that the target host feeds back the detection list in response to the detection request. And polling detection is carried out, so that the condition that the detection results of other equipment cannot be obtained when a certain equipment in the node is down is avoided, and the robustness of the detection system is improved.
In addition, a corresponding detection request is sent to the detection target according to the detection strategy, so that the detection target responds to the detection request and feeds back the detection result, and the method comprises the following steps: sending query information to a plurality of hosts; recording the response time length of each host responding to the inquiry information; selecting the host with the shortest corresponding response time length from all the hosts as a target host; and sending a detection request for calling the detection list to the target host, so that the target host feeds back the detection list in response to the detection request. And the monitoring list is obtained from the host with the fastest feedback, so that the speed of obtaining the detection result is further increased.
In addition, the detection result includes a state parameter of the detection target; wherein, the state parameter includes one or any combination of the following: CPU parameter, memory parameter, disk parameter, bandwidth parameter, service program running state and interface access delay state; sending a corresponding detection request to a detection target according to a detection strategy so that after the detection target responds to the detection request and feeds back a detection result, the method further comprises the following steps: and evaluating the equipment state of the detection target according to the state parameter. In the CDN detection process, the real-time running condition of the load of the equipment and the hardware index can be considered at the same time, and service rejection caused by equipment overload is avoided.
In addition, a plurality of detection targets are provided; after sending a corresponding detection request to a detection target according to a detection strategy so that the detection target responds to the detection request and feeds back a detection result, the method further comprises the following steps: and selecting a detection target with equipment state meeting specific conditions from a plurality of preset detection targets to carry out task configuration according to the detection results of the plurality of detection targets. When the CDN delivers content, a host in a good state is selected from a plurality of hosts that satisfy allocation conditions to perform task allocation. The method can reduce one-round detection delay, obtain detection results in real time, allocate tasks in real time and avoid service refusal caused by node overload.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a flowchart of a device status detection method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a device status detection method according to a second embodiment of the present invention;
Fig. 3 is a flowchart of a device status detection method according to a third embodiment of the present invention;
FIG. 4 is a schematic diagram of a device status detection method according to a third embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus state detection device according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in a fifth embodiment according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
A first embodiment of the present invention relates to an apparatus state detection method, and the present embodiment is: acquiring node attributes of a detection target; the node attribute comprises the number of hosts of a node where a detection target is located; configuring a detection strategy of a detection target according to the node attribute and a preset detection rule; and sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result. The detection target is detected according to the nodes, different detection strategies are configured for the nodes with different host numbers, the problems that detection periods are too long and detection results are delayed greatly due to the fact that all devices are detected one by one are solved, and detection efficiency can be improved. The following describes implementation details of the device status detection method according to the present embodiment in detail, and the following is only provided for easy understanding and is not necessary for implementing the present embodiment.
As shown in fig. 1, the method for detecting a device state in this embodiment specifically includes:
step 101, acquiring node attributes of a detection target; the node attribute comprises the host number of the node where the detection target is located.
Specifically, the CDN server setting mode is generally deployed according to nodes, each level is provided with a plurality of nodes, and each node may be provided with only one network server or a plurality of network servers. A plurality of servers are arranged in the same node, and the servers are communicated with each other and can perform mutual detection. During content delivery of the CDN, a target node with good link quality is determined first, and then a server with good performance is selected from the target node for task delivery. The traditional detection mode of the CDN is to detect all devices of all nodes in the same level one by one, summarize and compare detection results of all target devices, select a device with a better state to perform task allocation, and thus detect all devices one by one each time when content delivery is performed, and there are more devices detected in a round, resulting in a larger delay of the obtained result during summarization. In this embodiment, different detection modes can be set for different node attributes, and first, the node attribute of the detection target, that is, the number of servers in the node where the detection target is located, needs to be obtained. In this embodiment, the node attributes of the host are divided into a single host node and a multi-host node.
Step 102, judging whether a node where a detection target is located is a single host node; if yes, go to step 103; if not, go to step 104.
Specifically, a single host represents that only one device to be tested is arranged in a node, and a non-single host represents that a plurality of devices to be tested are arranged in the node. And configuring a detection strategy for the detection target according to the number of the hosts in the node, wherein different detection modes are configured for the single-host node and the multi-host node.
Step 103, sending a detection request to the detection target, so that the detection target responds to the detection request and feeds back a detection result.
Specifically, when the node where the detection target is located is a single host node, the detection policy is to send a detection request to the detection target. The condition of only one device to be tested exists in the node, and in order to know the load condition of the node, the load condition of the node can be directly obtained from the only device to be tested of the node, so that the device state of the node can be quickly and effectively obtained.
And 104, performing mutual redundancy detection among a plurality of hosts included in the node where the detection target is located, generating a detection list comprising detection results of the hosts, and storing the detection list in the hosts in a distributed manner.
Specifically, when the node where the detection target is located includes multiple devices to be detected, each device in the node may detect other devices, store the detection results of the other devices and the detection result of the device in a detection list, store the detection list in a storage module of the device, and use the detection policy to obtain the detection list. Therefore, the detection results of all the devices in the node can be obtained by detecting any one device in the node, and the states of all the devices in the node can be directly judged. When the CDN scheduling node is determined, and then the equipment with good state is selected from the target node, the equipment with good state can be selected from the target node without waiting until all the equipment of all the nodes are detected one by one, so that the delay of obtaining the detection result is avoided.
Further, when the number of devices in a certain node is too large, even if the devices in the node perform mutual redundancy detection, the detection target of each device is more, and the detection result is delayed or exists, so that the devices in the node can be grouped to perform mutual redundancy detection in the group in order to reduce the time delay of the detection result; and selecting one device from each group, performing mutual redundancy detection among the groups, and acquiring a detection list of each group.
Step 105, selecting one host from the plurality of hosts as a target host.
Specifically, since each device to be tested in the node stores a detection list of detection results of all devices to be tested in the node, detection results of all devices in the node can be obtained by detecting any one device. A device may be randomly selected from within the node to acquire.
Further, one host may be selected as the target host from a plurality of hosts in a polling manner. Specifically, performance indexes and load conditions of each device in the node are different, and downtime is caused when the load of the device is excessive or a fault occurs. If the selected target equipment is just down, the target host selected in a polling mode can be switched to another equipment in the next round, and the influence on detection is avoided when the equipment is down.
Further, query information may also be sent to multiple hosts; recording response time of each host responding to the inquiry information; and selecting the host with the shortest corresponding response time length from the hosts as the target host. In order to acquire the detection result more quickly, the target host can be selected through the speed of each host responding to the inquiry information, the detection result can be quickly acquired by selecting the device with the highest response speed to acquire the detection list, and the operation burden of the device with larger load is reduced.
Step 106, sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
Specifically, a detection list is directly obtained from the selected target host, and the detection list contains detection results of each device to be detected in the node, so that the detection results of each device in the node, including the detection result of the detection target, are obtained.
It should be noted that, in this embodiment, each device under test in the multi-host node performs mutual redundancy detection, in other embodiments, a device with an optimal performance index in the multi-host node may also be designated as a target host, the target host is responsible for detecting device states of all devices under test in the node, and stores a detection result in the target host in a list form, and the detection result of the entire multi-host node is obtained from the target host during detection, so that resource occupation of each device in the entire node can be reduced.
Further, in this embodiment, different detection policies are configured according to the node attribute classification manner of the single host node and the multi-host node, and in other embodiments, the detection policies may also be configured according to other attributes of the nodes. For example, whether load balancing is performed in a node, whether a dedicated scheduling host is set in a node, or whether a task allocation manner is governed by time in a node, and the like, which is not limited in this embodiment.
According to the embodiment of the invention, different detection strategies are configured according to the node attributes of the detection target, and different detection strategies are configured for the nodes with different host numbers, so that the detection result of the target equipment can be quickly obtained, the problems of overlong detection period and large detection result delay caused by the fact that all equipment is detected by the same method are avoided, and the detection efficiency can be improved.
A second embodiment of the present invention relates to an apparatus state detection method. The second embodiment is substantially the same as the first embodiment, and mainly differs therefrom in that: in the second embodiment, in consideration of the case where a load balancing device may be provided in a node including a plurality of hosts, the load of each device is the same in the node including the load balancing device.
As shown in fig. 2, the method for detecting a device state in this embodiment specifically includes:
step 201, acquiring node attributes of a detection target; the node attribute comprises the host number of the node where the detection target is located.
Step 202, judging whether the node where the detection target is located is a single host node; if it is a single host node, go to step 203; if the node is not a single host node, i.e. the node where the detection target is located includes multiple hosts, step 204 is performed.
Step 203, sending a detection request to a detection target. So that the detection target feeds back the detection result in response to the detection request.
Step 204, performing mutual redundancy detection among a plurality of hosts included in the node where the detection target is located to generate a detection list including detection results of the hosts, wherein the detection list is stored in the hosts in a distributed manner.
Step 205, judging whether the node contains load balancing equipment; if yes, go to step 206; if not, go to step 207.
Step 206, sending a detection request to the load balancing device, so that the load balancing device feeds back a detection list in response to the detection request.
Step 207, select one host as the target host from the plurality of hosts.
Step 208, sending a detection request for invoking the detection list to the target host, so that the target host feeds back the detection list in response to the detection request.
Steps 201 to 204 and steps 207 to 208 in this embodiment are similar to steps 101 to 106 in the first embodiment, and are not repeated herein, and the differences will be described below.
Step 205, judging whether the node contains load balancing equipment; if yes, go to step 206; if not, go to step 207.
Step 206, sending a detection request to the load balancing device, so that the load balancing device feeds back a detection list in response to the detection request.
Those skilled in the art can understand that, for the load balancing device, the load capacity of each device in the node is the same, and the load condition of each device in the node can be obtained only by detecting the load balancing device, so that the detection result can be obtained more quickly.
According to the embodiment of the invention, different detection strategies are configured according to the node attributes of the detection target, and different detection strategies are configured for different nodes, so that the detection result of the target equipment can be quickly obtained, the problems of overlong detection period and larger detection result delay caused by the fact that all equipment is detected by the same method are avoided, and the detection efficiency can be improved.
A third embodiment of the present invention relates to an apparatus state detection method. The third embodiment is substantially the same as the second embodiment, and mainly differs in that: in the third embodiment, a plurality of detection targets are detected, the comprehensive state of the equipment is evaluated according to the detection result, and then the equipment with a better state is selected for task configuration. As can be understood by those skilled in the art, in CDN content delivery, a server with a good load condition needs to be selected for content delivery.
As shown in fig. 3, the method for detecting a device state in this embodiment specifically includes:
301, acquiring node attributes of a plurality of detection targets; the node attribute comprises the host number of the node where the detection target is located.
Step 302, configuring a plurality of detection strategies of detection targets according to the node attributes and preset detection rules.
Step 303, sending corresponding detection requests to a plurality of detection targets according to the detection policy, so that the detection targets respond to the detection requests and feed back detection results.
In the present embodiment, the content of steps 301 to 303 may be detected by using the device state detection methods provided in the first and second embodiments, where the method configures a corresponding detection policy according to a node attribute of a detection target, and detects the plurality of detection targets, and the specific detection policy is not described again.
And step 304, evaluating the equipment state of the detection target according to the state parameters in the detection result.
Specifically, the detection result includes a state parameter of the detection target; wherein, the state parameter includes one or any combination of the following: CPU parameter, memory parameter, disk parameter, bandwidth parameter, service program running state and interface access delay state; and evaluating the equipment state of the detection target according to the state parameter. In practical applications, the detection server may only detect the state parameters of each detection target, and an evaluation needs to be performed on the state parameters of the detection targets to obtain the comprehensive state of the detection targets, so as to compare the states of the devices. The device state checking method is suitable for checking the device state of the target device to be scheduled during CDN content distribution, detecting the device state in real time after responding to a user request, and selecting the device with good load condition for content distribution.
In one example, the state parameters include all the above parameters, i.e., CPU parameters, memory parameters, disk parameters, bandwidth parameters, service program running state, and interface access delay state; the device status may be scored according to the following formula:
device state score value (cpu × a + memory × b + io × c + timeout × d + bandwith × e) × l/x + f
Wherein a, b, c, d, e are weighting coefficients, x is a division factor, which can be set according to actual conditions, and the embodiment is not limited; l is link quality, f is service program running state, CPU, memory, io, timeout, and bandwith represent CPU parameter, memory parameter, disk parameter, interface access delay state, and bandwidth parameter, respectively. The scoring mode considers the link quality and the running state of the server, and a better scheduling path can be selected through the scoring mode. In other embodiments, the device status may also be evaluated in different status parameter setting manners or different device status scoring manners, which is not limited in this embodiment.
And 305, selecting a detection target with equipment state meeting specific conditions from preset detection targets according to detection results of a plurality of detection targets, and performing task configuration.
Specifically, when performing task allocation, in order to select the device with the best status to complete the task, so as to enable the task to be completed efficiently and quickly, after the device status detection method in the present embodiment is used to detect and evaluate a plurality of target devices, a device with the best status is selected from the plurality of devices to allocate the task. For example, in a CDN content delivery scenario, when a resource acquisition request sent by a terminal is received, a scheduling server may select a group of scheduling target lists meeting conditions according to a predetermined scheduling rule according to an IP address of a request terminal, as shown in fig. 4, according to the device status detection method provided in this embodiment, the scheduling server generates a detection policy according to each scheduling target, that is, a node attribute of the detection target and a preset detection rule, and directly detects a device in a single host node; for a multi-host node, mutual redundancy detection is carried out on each device in the node to generate a detection list comprising detection results of each device, and the detection results of each device in the node are obtained from any one device or load balancing device. And finally, according to the detection result. And selecting one device with the optimal load condition from all the devices to be selected as a scheduling target.
Further, the scheduling targets screened in advance may be sorted according to a certain priority, for example, sorted according to a sequence from a near to a far from the target IP address, and finally, the scheduling target list is traversed according to the priority sequence, so as to comprehensively consider the scheduling targets with the highest priority and the device load status meeting the condition.
According to the embodiment of the invention, different detection strategies are configured according to the node attributes of a plurality of detection targets, so that the detection results of a plurality of target devices can be rapidly obtained, and the devices with states meeting specific conditions are selected for task allocation according to the detection results of the plurality of detection targets. The method can quickly and accurately obtain the detection result, avoids detecting all the devices one by one, and improves the efficiency of task allocation, and the detection period is too long, and the detection result is delayed greatly.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A fourth embodiment of the present invention relates to an apparatus state detection device, as shown in fig. 5, including:
an obtaining module 401, configured to obtain a node attribute of a detection target; the node attribute comprises the number of hosts in a node where a detection target is located;
a policy configuration module 402, configured to configure a detection policy of the detection target according to the node attribute and a preset detection rule;
the detecting module 403 is configured to send a corresponding detection request to the detection target according to the detection policy, so that the detection target responds to the detection request and feeds back a detection result.
Specifically, when the node where the detection target is located is a single host node, the detection policy is to send a detection request to the detection target. The detection module 403 directly sends a corresponding detection request to the detection target, so that the detection target responds to the detection request and feeds back a detection result.
When the node where the detection target is located comprises a plurality of hosts, performing redundancy detection among the hosts to generate a detection list comprising detection results of the hosts, wherein the detection list is stored in the hosts in a distributed manner; the detection strategy is used for acquiring a detection list; the detection module 403 selects one host from the multiple hosts as a target host, and sends a detection request for retrieving the detection list to the target host, so that the target host feeds back the detection list in response to the detection request. It should be noted that the detection module 403 may randomly select one target host from a plurality of hosts in the node, or may select one target host in a polling manner.
In one example, the detection module 403 may also send query information to multiple hosts; recording the response time length of each host responding to the inquiry information; selecting the host with the shortest corresponding response time length from all the hosts as a target host; and sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
In another example, if a node with multiple hosts contains load balancing equipment; the detection module 403 may also send a detection request directly to the load balancing device, so that the load balancing device feeds back a detection list in response to the detection request.
Further, the detection result includes a state parameter of the detection target; wherein, the state parameter includes one or any combination of the following: CPU parameter, memory parameter, disk parameter, bandwidth parameter, service program running state and interface access delay state; the device state checking apparatus may further include: and a state evaluation module 404, configured to evaluate a device state of the detection target according to the state parameter.
In one example, the detection target may be plural, and the device status checking means may further include: and a task configuration module 405, configured to select, according to the detection results of the multiple detection targets, a detection target whose device state meets a specific condition from the multiple preset detection targets, and perform task configuration.
The device status checking apparatus in this embodiment configures different detection strategies according to node attributes of multiple detection targets, so as to quickly obtain detection results of multiple target devices, and selects a device whose status satisfies a specific condition for task allocation according to the detection results of the multiple detection targets. The method can quickly and accurately obtain the detection result, avoids detecting all the devices one by one, and improves the efficiency of task allocation, and the detection period is too long, and the detection result is delayed greatly.
It should be understood that this embodiment is a system example corresponding to the third embodiment, and that this embodiment can be implemented in cooperation with the third embodiment. The related technical details mentioned in the third embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the third embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A fifth embodiment of the present invention relates to an electronic apparatus, and a specific structure of the electronic apparatus is shown in fig. 6. Includes at least one processor 502; and a memory 501 communicatively coupled to at least one processor 502. The memory 501 stores instructions executable by the at least one processor 502, and the instructions are executed by the at least one processor 502 to enable the at least one processor 502 to execute the device status detection method in the foregoing embodiments.
In the present embodiment, the processor 502 is exemplified by a Central Processing Unit (CPU), and the Memory 501 is exemplified by a Random Access Memory (RAM). The processor 502 and the memory 501 may be connected by a bus or other means, and fig. 5 illustrates the connection by the bus as an example. The memory 501 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the programs implementing the device state detection method in the embodiments of the present application, in the memory 501. The processor 502 executes various functional applications and data processing of the device by executing nonvolatile software programs, instructions, and modules stored in the memory 501, that is, implements the device state detection method described above.
The memory 501 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory 501 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 501 may optionally include memory located remotely from processor 502, which may be connected to an external device via a network.
One or more program modules are stored in the memory 501 and, when executed by the one or more processors 502, perform the device state detection method of any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, and can refer to the method provided by the embodiment of the application without detailed technical details in the embodiment.
A sixth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. An apparatus status detection method, comprising:
acquiring node attributes of a detection target; the node attribute comprises the number of hosts of the node where the detection target is located;
configuring a detection strategy of the detection target according to the node attribute and a preset detection rule;
Sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result;
when the node where the detection target is located comprises a plurality of hosts, performing redundancy detection among the hosts to generate a detection list comprising detection results of the hosts, wherein the detection list is stored in the hosts in a distributed manner; the detection strategy is used for acquiring the detection list; the sending of the corresponding detection request to the detection target according to the detection policy so that the detection target feeds back a detection result in response to the detection request includes:
selecting one host from the multiple hosts as a target host;
and sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
2. The device status detection method according to claim 1, wherein when the node where the detection target is located is a single host node, the detection policy is to send the detection request to the detection target.
3. The device status detection method according to claim 1, wherein when the node at which the detection target is located includes a plurality of hosts, the node includes a load balancing device;
The sending of the corresponding detection request to the detection target according to the detection policy so that the detection target feeds back a detection result in response to the detection request includes:
and sending the detection request to the load balancing equipment so that the load balancing equipment feeds back the detection list in response to the detection request.
4. The device status detection method according to claim 1, wherein when the node where the detection target is located includes a plurality of hosts, the sending a corresponding detection request to the detection target according to the detection policy, so that the detection target feeds back a detection result in response to the detection request includes:
selecting one host from the plurality of hosts as a target host in a polling manner;
and sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
5. The device status detection method according to claim 1, wherein when the node where the detection target is located includes a plurality of hosts, the sending a corresponding detection request to the detection target according to the detection policy, so that the detection target feeds back a detection result in response to the detection request includes:
Sending query information to the plurality of hosts;
recording the response time length of each host responding to the inquiry information;
selecting the host with the shortest corresponding response time length from all the hosts as a target host;
and sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
6. The apparatus state detection method according to any one of claims 1 to 5, characterized in that the detection result includes a state parameter of the detection target; wherein the state parameters include one or any combination of the following: CPU parameter, memory parameter, disk parameter, bandwidth parameter, service program running state and interface access delay state;
after the sending a corresponding detection request to the detection target according to the detection policy so that the detection target responds to the detection request and feeds back a detection result, the method further includes:
and evaluating the equipment state of the detection target according to the state parameter.
7. The apparatus state detection method according to any one of claims 1 to 5, characterized in that there are a plurality of the detection targets;
after the sending a corresponding detection request to the detection target according to the detection policy so that the detection target responds to the detection request to feed back a detection result, the method further includes:
And selecting a detection target with equipment state meeting specific conditions from a plurality of preset detection targets to carry out task configuration according to the detection results of the plurality of detection targets.
8. An apparatus state detection device, comprising:
the acquisition module is used for acquiring the node attribute of the detection target; the node attribute comprises the number of hosts in the node where the detection target is located;
the strategy configuration module is used for configuring the detection strategy of the detection target according to the node attribute and a preset detection rule;
the detection module is used for sending a corresponding detection request to the detection target according to the detection strategy so that the detection target responds to the detection request and feeds back a detection result;
when the node where the detection target is located comprises a plurality of hosts, performing redundancy detection among the hosts to generate a detection list comprising detection results of the hosts, wherein the detection list is stored in the hosts in a distributed manner; the detection strategy is used for acquiring the detection list; the detection module is used for:
selecting one host from the multiple hosts as a target host;
and sending a detection request for calling the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.
9. An electronic device, comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the device status detection method of any one of claims 1 to 7.
10. A storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the device status detection method of any one of claims 1 to 7.
CN201911128268.2A 2019-11-18 2019-11-18 Equipment state detection method and device, electronic equipment and storage medium Active CN110971676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911128268.2A CN110971676B (en) 2019-11-18 2019-11-18 Equipment state detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911128268.2A CN110971676B (en) 2019-11-18 2019-11-18 Equipment state detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110971676A CN110971676A (en) 2020-04-07
CN110971676B true CN110971676B (en) 2022-07-29

Family

ID=70030987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911128268.2A Active CN110971676B (en) 2019-11-18 2019-11-18 Equipment state detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110971676B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1638291A (en) * 2004-01-08 2005-07-13 三星电子株式会社 Bi-directional detector for enabling a host and a client to detect each other in a collection terminal
CN102111310A (en) * 2010-12-31 2011-06-29 网宿科技股份有限公司 Method and system for monitoring content delivery network (CDN) equipment status
CN105897507A (en) * 2016-03-31 2016-08-24 杭州数梦工场科技有限公司 Node equipment state detection method and node equipment state detection device
WO2017020715A1 (en) * 2015-08-03 2017-02-09 阿里巴巴集团控股有限公司 Method and device for monitoring status of cdn node
CN109698774A (en) * 2019-02-20 2019-04-30 北京百度网讯科技有限公司 Method and device for monitoring device working condition
CN110398264A (en) * 2019-07-31 2019-11-01 联想(北京)有限公司 A kind of equipment condition monitoring method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10686669B2 (en) * 2017-06-16 2020-06-16 Cisco Technology, Inc. Collecting network models and node information from a network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1638291A (en) * 2004-01-08 2005-07-13 三星电子株式会社 Bi-directional detector for enabling a host and a client to detect each other in a collection terminal
CN102111310A (en) * 2010-12-31 2011-06-29 网宿科技股份有限公司 Method and system for monitoring content delivery network (CDN) equipment status
WO2017020715A1 (en) * 2015-08-03 2017-02-09 阿里巴巴集团控股有限公司 Method and device for monitoring status of cdn node
CN105897507A (en) * 2016-03-31 2016-08-24 杭州数梦工场科技有限公司 Node equipment state detection method and node equipment state detection device
CN109698774A (en) * 2019-02-20 2019-04-30 北京百度网讯科技有限公司 Method and device for monitoring device working condition
CN110398264A (en) * 2019-07-31 2019-11-01 联想(北京)有限公司 A kind of equipment condition monitoring method and system

Also Published As

Publication number Publication date
CN110971676A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN106656800B (en) Path selection method and system, network acceleration node and network acceleration system
US9264369B2 (en) Technique for managing traffic at a router
CN107872402B (en) Global flow scheduling method and device and electronic equipment
CN102281190B (en) Networking method for load balancing apparatus, server and client access method
KR101724552B1 (en) Technologies for aligning network flows to processing resources
US8510742B2 (en) Job allocation program for allocating jobs to each computer without intensively managing load state of each computer
US9197566B2 (en) Information processing method, recording medium, and information processing apparatus
US20180176289A1 (en) Information processing device, information processing system, computer-readable recording medium, and information processing method
US9736235B2 (en) Computer system, computer, and load balancing method
CN105103495A (en) Admission control for allowing or rejecting a measurement request between a first device and a second device
CN110113263A (en) A kind of communication path determines method and device
CN104484219B (en) The method and apparatus of distributing policy in virtual platform
CN114500381B (en) Network bandwidth limiting method, system, electronic equipment and readable storage medium
US11757742B2 (en) System and method to distribute traffic flows among a plurality of applications in a data center system
CN110971676B (en) Equipment state detection method and device, electronic equipment and storage medium
CN110380981B (en) Flow distribution method and equipment
CN111555918A (en) Return source optimization method and device and electronic equipment
CN112087336B (en) Deployment and management method and device of virtual IP service system and electronic equipment
CN108156086A (en) A kind of strategy rule downloading method and device
CN112783673A (en) Method and device for determining call chain, computer equipment and storage medium
CN114375565A (en) File block downloading method and device
JP6592387B2 (en) Network quality measuring system, measuring device, control device, network quality measuring method, and program
US11706186B2 (en) Method, apparatus, medium, and device for scheduling access request
CN111800446A (en) Scheduling processing method, device, equipment and storage medium
CN117176728B (en) Industrial Internet of things dispatching method and dispatching system based on cloud edge cooperative technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant