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
host
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

本发明实施例涉及通信领域,公开了一种设备状态检测方法、装置、电子设备及存储介质。本发明中,设备状态检测方法包括:获取检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量;根据节点属性和预设的检测规则配置检测目标的检测策略;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。根据检测目标的节点属性配置不同的检测策略,避免对所有设备采用同一种方法进行探测导致探测周期过长、探测结果延迟较大问题,能够提高检测效率。

Figure 201911128268

Embodiments of the present invention relate to the field of communications, and disclose a device state detection method, device, electronic device, and storage medium. In the present invention, the device state detection method includes: acquiring the node attribute of the detection target; wherein, the node attribute includes the number of hosts of the node where the detection target is located; configuring the detection strategy of the detection target according to the node attribute and the preset detection rule; The detection target sends a corresponding detection request, so that the detection target responds to the detection request and feeds back the detection result. Different detection strategies are configured according to the node attributes of the detection target, so as to avoid the problem that the detection period is too long and the detection result is delayed by using the same method for detection of all devices, which can improve the detection efficiency.

Figure 201911128268

Description

设备状态检测方法、装置、电子设备及存储介质Device state detection method, device, electronic device and storage medium

技术领域technical field

本发明实施例涉及通信领域,特别涉及一种设备状态检测方法、装置、电子设备及存储介质。Embodiments of the present invention relate to the field of communications, and in particular, to a device state detection method, device, electronic device, and storage medium.

背景技术Background technique

CDN(Content Delivery Network,即内容分发网络)的基本思路是尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输得更快、更稳定。通过在网络各处放置节点服务器所构成的在现有的互联网基础之上的一层智能虚拟网络,CDN系统能够实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。其目的是使用户可就近取得所需内容,解决网络拥挤的状况,提高用户访问网站的响应速度。The basic idea of CDN (Content Delivery Network) is to avoid bottlenecks and links on the Internet that may affect the speed and stability of data transmission as much as possible, so that content transmission is faster and more stable. By placing node servers everywhere in the network to form a layer of intelligent virtual network on the basis of the existing Internet, the CDN system can real-time based on network traffic and the connection and load status of each node, as well as the distance to the user and response time Such comprehensive information redirects the user's request to the service node closest to the user. Its purpose is to enable users to obtain the desired content nearby, solve the situation of network congestion, and improve the response speed of users visiting the website.

现有技术中CDN调度会根据用户IP地址来源,用户访问的域名,用户访问内容做智能、动态调度。常见的调度策略会根据用户IP划分区域,参考网络拥塞、将不同地区用户请求就近选择CDN服务。In the prior art, CDN scheduling will perform intelligent and dynamic scheduling according to the source of the user's IP address, the domain name accessed by the user, and the content accessed by the user. Common scheduling strategies divide regions according to user IP, refer to network congestion, and select CDN services from users in different regions nearby.

本发明的发明人发现:现有技术中CDN探测方式,对所有节点中的所有设备一一探测,获取所有探测结果后才进行调度。但是组成每个节点的设备参数和运行原理不尽相同,通过同一种方式探测节点信息的方法,往往会造成采集数据冗余,以及等待周期过长的问题。The inventor of the present invention finds that: in the CDN detection method in the prior art, all devices in all nodes are detected one by one, and all detection results are obtained before scheduling is performed. However, the equipment parameters and operating principles that make up each node are different. The method of detecting node information in the same way often results in redundant data collection and long waiting period.

发明内容SUMMARY OF THE INVENTION

本发明实施方式的目的在于提供一种设备状态检测方法、装置、电子设备及存储介质,能够避免对所有设备采用同一种方法进行探测,进而克服了现有技术中探测产生的探测周期过长、探测结果延迟较大问题,能够提高检测效率。The purpose of the embodiments of the present invention is to provide a device state detection method, device, electronic device and storage medium, which can avoid using the same method for detection of all devices, thereby overcoming the excessively long detection period, excessive detection period, etc. caused by detection in the prior art. The detection result is delayed greatly, which can improve the detection efficiency.

为解决上述技术问题,本发明的实施方式提供了一种设备状态检测方法,包括以下步骤:获取检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量;根据节点属性和预设的检测规则配置检测目标的检测策略;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。In order to solve the above technical problems, embodiments of the present invention provide a device state detection method, which includes the following steps: acquiring a node attribute of a detection target; wherein the node attribute includes the number of hosts of the node where the detection target is located; according to the node attribute and preset The detection rule configures the detection strategy of the detection target; according to the detection strategy, a corresponding detection request is sent to the detection target, so that the detection target responds to the detection request and feeds back the detection result.

本发明的实施方式还提供了一种设备状态检测装置,包括:获取模块,用于获取检测目标的节点属性;其中,节点属性包括检测目标所在节点内的主机数量;策略配置模块,用于根据节点属性和预设的检测规则配置检测目标的检测策略;检测模块,用于根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。An embodiment of the present invention also provides a device state detection device, comprising: an acquisition module for acquiring a node attribute of a detection target; wherein the node attribute includes the number of hosts in the node where the detection target is located; a policy configuration module for according to The node attribute and the preset detection rule configure the detection strategy of the detection target; the detection module is configured to send 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 the detection result.

本发明的实施方式还提供了一种电子设备,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述的设备状态检测方法。Embodiments of the present invention also provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by at least one processor. A processor executes to enable at least one processor to execute the above-mentioned device state detection method.

本发明的实施方式还提供了一种存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述的设备状态检测方法。Embodiments of the present invention further provide a storage medium storing a computer program, and when the computer program is executed by a processor, the foregoing device state detection method is implemented.

本发明实施方式相对于现有技术而言,根据检测目标所在节点的主机数量配置检测目标的检测策略;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。根据检测目标的节点属性配置不同的检测策略,避免对所有设备采用同一种方法进行探测导致探测周期过长、探测结果延迟较大问题,能够提高检测效率。Compared with the prior art, the embodiment of the present invention configures the detection strategy of the detection target according to the number of hosts of the node where the detection target is located; sends 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 the detection result. Different detection strategies are configured according to the node attributes of the detection target, so as to avoid the problem that the detection period is too long and the detection result delay is large due to the detection of all devices by the same method, which can improve the detection efficiency.

另外,当检测目标所在节点为单主机节点时,检测策略为向检测目标发送检测请求。对于单主机节点直接探测目标主机,获取方式快速有效。In addition, when the node where the detection target is located is a single-host node, the detection strategy is to send a detection request to the detection target. For a single-host node to directly detect the target host, the acquisition method is fast and effective.

另外,当检测目标所在节点包含多个主机时,多个主机之间相互进行冗余检测生成包括各个主机检测结果的检测列表,检测列表分布式存储在各主机中;检测策略用于获取检测列表;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果包括:在多个主机中选择一个主机为目标主机;向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。同一节点内只检测一台设备就可以获取整个节点内所有设备的检测结果,进一步减小检测周期,使检测方式更加快速、有效。In addition, when the node where the detection target is located contains multiple hosts, the multiple hosts perform redundancy detection with each other to generate a detection list including the detection results of each host, and the detection list is distributed and stored in each host; the detection strategy is used to obtain the detection list. ; Send 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 the detection result, including: selecting a host from multiple hosts as the target host; Make the target host respond to the detection request and feed back the detection list. Only one device in the same node can be detected to obtain the detection results of all devices in the entire node, which further reduces the detection cycle and makes the detection method faster and more effective.

另外,节点内含有负载均衡设备;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果包括:向负载均衡设备发送检测请求,以使负载均衡设备响应检测请求反馈检测列表。对于配有负载均衡设备的节点也适用,能够兼容多样化的部署架构。In addition, the node contains a load balancing device; 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 the detection result includes: sending a detection request to the load balancing device, so that the load balancing device responds to the detection request and feeds back detection list. It is also applicable to nodes equipped with load balancing devices, which are compatible with diverse deployment architectures.

另外,根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果包括:从多个主机中轮询地选择一个主机为目标主机;向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。轮询探测,避免节点内某一设备宕机时无法获取其他设备的检测结果,提高检测系统健壮性。In addition, 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 the detection result includes: selecting one host as the target host by polling from multiple hosts; Detection request, so that the target host responds to the detection request and returns the detection list. Polling detection avoids that the detection results of other devices cannot be obtained when a device in the node is down, and the robustness of the detection system is improved.

另外,根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果包括:向多个主机发送问询信息;记载各主机响应问询信息的响应时长;选择各主机中对应响应时长最短的主机为目标主机;向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。从反馈最快的主机获取监测列表,进一步加快了获取检测结果的速度。In addition, 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 the detection result includes: sending query information to multiple hosts; recording the response time of each host responding to the query information; The host with the shortest response time is the target host; send a detection request to the target host to retrieve the detection list, so that the target host responds to the detection request and feeds back the detection list. Get the monitoring list from the host with the fastest feedback, further speeding up the acquisition of detection results.

另外,检测结果包括检测目标的状态参数;其中,状态参数包括以下一种或其任意组合:CPU参数、内存参数、磁盘参数、带宽参数、服务程序运行状态、接口访问延迟状态;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果之后,还包括:根据状态参数评估检测目标的设备状态。CDN探测过程中,能够同时考虑设备的负载实时运行情况和硬件指标,避免设备过载导致的服务拒绝。In addition, the detection result includes the 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, interface access delay state; After the detection target sends the corresponding detection request, so that the detection target responds to the detection request and feeds back the detection result, the method further includes: evaluating the device state of the detection target according to the state parameter. During the CDN detection process, the real-time operation status of the device load and hardware indicators can be considered at the same time to avoid service denial caused by device overload.

另外,检测目标有多个;在根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果之后,还包括:根据多个检测目标的检测结果,从预设的多个检测目标中选择设备状态满足特定条件的检测目标进行任务配置。在CDN进行内容分发时,从满足调配条件的多个主机中选择状态良好的主机进行任务调配。能够减少一轮探测延迟,实时获取探测结果,实时进行任务调配,避免节点过载而导致的服务拒绝。In addition, there are multiple detection targets; after 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 the detection result, the method further includes: according to the detection results of the multiple detection targets, from the preset multiple From the detection targets, select the detection target whose device state meets certain conditions for task configuration. When the CDN distributes content, a host in a good state is selected from multiple hosts that meet the provisioning conditions to perform task provisioning. It can reduce the delay of one round of detection, obtain detection results in real time, and allocate tasks in real time to avoid service denial caused by node overload.

附图说明Description of drawings

一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute limitations of the embodiments, and elements with the same reference numerals in the drawings are denoted as similar elements, Unless otherwise stated, the figures in the accompanying drawings do not constitute a scale limitation.

图1是根据本发明第一实施方式中的设备状态检测方法流程图;Fig. 1 is a flow chart of a device state detection method according to a first embodiment of the present invention;

图2是根据本发明第二实施方式中的设备状态检测方法流程图;Fig. 2 is a flow chart of a device state detection method according to a second embodiment of the present invention;

图3是根据本发明第三实施方式中的设备状态检测方法流程图;FIG. 3 is a flowchart of a device state detection method according to a third embodiment of the present invention;

图4是根据本发明第三实施方式中的设备状态检测方法原理示意图;4 is a schematic diagram of the principle of a device state detection method according to a third embodiment of the present invention;

图5是根据本发明第四实施方式中的设备状态检测装置结构示意图;5 is a schematic structural diagram of a device state detection apparatus according to a fourth embodiment of the present invention;

图6是根据本发明第五实施方式中的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本发明的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can appreciate that, in the various embodiments of the present invention, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized. The following divisions of the various embodiments are for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention, and the various embodiments may be combined with each other and referred to each other on the premise of not contradicting each other.

本发明的第一实施方式涉及一种设备状态检测方法,本实施方式在于:获取检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量;根据节点属性和预设的检测规则配置检测目标的检测策略;根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。按节点对检测目标进行检测,对主机数量不同的节点配置不同的检测策略,避免对所有设备进行逐一探测产生的探测周期过长、探测结果延迟较大问题,能够提高检测效率。下面对本实施方式的设备状态检测方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。The first embodiment of the present invention relates to a device state detection method. This embodiment includes: acquiring a node attribute of a detection target; wherein, the node attribute includes the number of hosts of the node where the detection target is located; configuring the detection according to the node attribute and a preset detection rule The detection strategy of the detection target; according to the detection strategy, a corresponding detection request is sent to the detection target, so that the detection target responds to the detection request and feeds back the detection result. The detection target is detected by node, and different detection strategies are configured for nodes with different numbers of hosts, so as to avoid the problems of long detection period and large delay of detection results caused by detecting all devices one by one, which can improve the detection efficiency. The implementation details of the device state detection method of the present embodiment will be specifically described below. The following contents are only provided for the convenience of understanding, and are not necessary for implementing this solution.

本实施方式中的设备状态检测方法如图1所示,具体包括:The device state detection method in this embodiment is shown in FIG. 1 , and specifically includes:

步骤101,获取检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量。Step 101: Obtain the node attribute of the detection target; wherein the node attribute includes the number of hosts of the node where the detection target is located.

具体地说,CDN服务器设置方式一般按节点部署,每一层级设置有多个节点,每个节点内可能只设置有一台网络服务器,也可能设置有多个网络服务器。同一节点内设置多台服务器的,各个服务器之间是相互通信连通的,可以进行相互探测。CDN内容分发时会先确定一个链路质量较好的目标节点,再从目标节点内选择一台性能较好的服务器进行任务下发。传统的CDN的探测方式是对同一层级的所有节点的所有设备逐一进行探测,将所有目标设备的检测结果汇总后对比,选择一台状态较好的设备进行任务分配,这样每次进行内容分发都需要逐一将所有设备探测一次,一轮探测的设备较多,导致汇总时获取的结果延迟较大。本实施方式中,针对不同的节点属性可以设置不同的探测方式,首先需获取到检测目标的节点属性,即检测目标所在节点内的服务器数量。本实施方式中主机的节点属性分为单主机节点和多主机节点。Specifically, the CDN server setting method is generally deployed on a node-by-node basis, with multiple nodes set at each level, and each node may have only one network server or multiple network servers. If multiple servers are set up in the same node, each server communicates with each other and can detect each other. When CDN content is distributed, a target node with better link quality will be determined first, and then a server with better performance will be selected from the target node for task delivery. The traditional CDN detection method is to detect all the devices of all nodes at the same level one by one, summarize the detection results of all target devices and compare them, and select a device with a better state for task assignment, so that every time content is distributed, All devices need to be probed one by one. There are many devices in one round of detection, resulting in a large delay in the results obtained during aggregation. In this embodiment, different detection methods can be set for different node attributes. First, the node attribute of the detection target needs to be acquired, that is, the number of servers in the node where the detection target is located. The node attributes of the hosts in this embodiment are classified into single-host nodes and multi-host nodes.

步骤102,判断检测目标所在节点是否为单主机节点;若是单主机节点,则到步骤103;若不是单主机节点,则到步骤104。Step 102 , determine whether the node where the detection target is located is a single-host node; if it is a single-host node, go to step 103 ; if it is not a single-host node, go to step 104 .

具体地,单主机即表示节点内只有唯一一台待检测设备,非单主机即表示节点内有多台待检测设备。根据节点内主机的数量为检测目标配置检测策略,其中对单主机节点和多主机节点配置不同的检测方式。Specifically, a single host means that there is only one device to be detected in the node, and a non-single host means that there are multiple devices to be detected in the node. The detection strategy is configured for the detection target according to the number of hosts in the node, and different detection methods are configured for single-host nodes and multi-host nodes.

步骤103,向检测目标发送检测请求,以使检测目标响应检测请求反馈检测结果。Step 103: Send a detection request to the detection target, so that the detection target responds to the detection request and feeds back the detection result.

具体地,当检测目标所在节点为单主机节点时,检测策略为向检测目标发送检测请求。节点内只有一台待测设备的情况,为了了解节点的负载情况,可直接从节点的唯一待测设备获取该节点的负载情况,能够快速有效的获得该节点的设备状态。Specifically, when the node where the detection target is located is a single-host node, the detection strategy is to send a detection request to the detection target. When there is only one device to be tested in a node, in order to know the load of the node, the load of the node can be obtained directly from the only device to be tested of the node, which can quickly and effectively obtain the device status of the node.

步骤104,检测目标所在节点包含的多个主机之间相互进行冗余检测,生成包括各个主机检测结果的检测列表,检测列表分布式存储在各主机中。Step 104 , redundancy detection is performed between multiple hosts included in the node where the detection target is located, and a detection list including detection results of each host is generated, and the detection list is distributed and stored in each host.

具体地,当检测目标所在节点包含多个待测设备时,节点内的各个设备可以对其他设备进行检测,并将其他设备的检测结果和本设备的检测结果保存至一检测列表中,并将检测列表存储在本设备的存储模块中,检测策略用于获取这个检测列表。这样只要对节点内的任意一台设备进行检测就可以获取节点内所有设备的检测结果,可以直接判断出节点内各设备状态。当CDN调度节点已经确定的情况下,再从目标节点内选择状态优良的设备时,不用等到逐一把所有节点的所有设备都探测完成就可以从目标节点内选出状态优良的设备,避免获取检测结果延迟。Specifically, when the node where the detection target is located contains multiple devices to be tested, each device in the node can detect other devices, save the detection results of the other devices and the detection results of the device in a detection list, and store the detection results of the other devices in a detection list. The detection list is stored in the storage module of the device, and the detection strategy is used to obtain the detection list. In this way, as long as any device in the node is detected, the detection results of all devices in the node can be obtained, and the status of each device in the node can be directly determined. When the CDN scheduling node has been determined, when selecting a device with a good state from the target node, you can select a device with a good state from the target node without waiting for all the devices of all nodes to be detected one by one. Results are delayed.

进一步地,当某一节点内设备数量太多时,即使节点内设备相互冗余检测,每台设备的检测目标也较多,检测结果延迟还是存在,为了减小检测结果时间上的延迟,可以对节点内设备分小组,在小组内进行相互冗余检测;再从每一小组中选一台设备,在小组之间进行相互冗余检测,获取各小组的检测列表。Further, when there are too many devices in a node, even if the devices in the node are redundantly detected, each device has more detection targets, and the detection result delay still exists. In order to reduce the time delay of the detection result, you can The equipment in the node is divided into groups, and the mutual redundancy detection is carried out within the group; then a device is selected from each group, and the mutual redundancy detection is carried out among the groups to obtain the detection list of each group.

步骤105,在多个主机中选择一个主机为目标主机。Step 105, selecting one host from the multiple hosts as the target host.

具体地说,由于节点内的每个待测设备中都存储有节点内所有待测设备检测结果的检测列表,检测任意一台设备即可获得节点内所有设备的检测结果。可以从节点内随机选择一台设备获取。Specifically, since each device to be tested in the node stores a detection list of the detection results of all the devices to be tested in the node, the detection results of all devices in the node can be obtained by detecting any device. It can be obtained by randomly selecting a device in the node.

进一步地,可以从多个主机中轮询地选择一个主机为目标主机。具体地说,节点内各设备的性能指标、负载情况各不相同,设备负载过量或出现故障时会导致宕机。若选择的目标设备刚好宕机时,轮询地选择目标主机可以在下一轮切换至另一设备,避免设备宕机时影响检测进行。Further, one host may be selected as the target host in a round-robin manner from a plurality of hosts. Specifically, the performance indicators and load conditions of each device in the node are different. When the device is overloaded or fails, it will cause downtime. If the selected target device just goes down, polling to select the target host can switch to another device in the next round to avoid affecting the detection when the device is down.

更进一步地,还可以向多个主机发送问询信息;记载各主机响应问询信息的响应时长;选择各主机中对应响应时长最短的主机为目标主机。为了更加快速的获取检测结果,可以通过各主机响应问询信息的速度选择目标主机,选择从反应速度最快的设备获取检测列表能够快速的得到检测结果,并且减轻已经负载较大的设备的运行负担。Furthermore, query information can be sent to multiple hosts; the response duration of each host to respond to the query information can be recorded; and the host with the shortest corresponding response duration among the hosts is selected as the target host. In order to obtain the test results more quickly, the target host can be selected according to the speed of each host responding to the inquiry information, and the detection list can be obtained from the device with the fastest response speed. burden.

步骤106,向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。Step 106: Send a detection request for retrieving the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.

具体地,直接从选择的目标主机获取检测列表,检测列表含有节点内各个待测设备的检测结果,从而获取节点内各设备的检测结果,包括检测目标的检测结果。Specifically, the detection list is directly obtained from the selected target host, and the detection list contains the detection results of each device to be tested in the node, thereby acquiring the detection results of each device in the node, including the detection results of the detection target.

需要说明的是,本实施方式中,多主机节点内各待测设备作相互冗余检测,在其他实施方式中,还可以指定多主机节点内一性能指标最优的设备作为目标主机,这个目标主机负责检测节点内所有待测设备的设备状态,并将检测结果以列表的形式存储在目标主机中,探测时就从这个目标主机获取整个多主机节点的检测结果,能够降低对整个节点内各设备的资源占用。It should be noted that, in this embodiment, each device under test in the multi-host node performs mutual redundancy detection. In other implementations, a device with the best performance index in the multi-host node can also be designated as the target host. The host is responsible for detecting the device status of all the devices to be tested in the node, and stores the detection results in the target host in the form of a list. When detecting, the detection results of the entire multi-host node are obtained from the target host, which can reduce the need for each node in the entire node. The resource usage of the device.

进一步地,本实施方式中,是按照单主机节点和多主机节点的节点属性分类方式,配置不同的检测策略,其他实施方式中还可以按照节点的其他属性配置检测策略。例如节点内是否负载均衡、节点内是否设置专用的调度主机或者节点内是否按时间支配任务分配方式等等,本实施方式不做限制。Further, in this embodiment, different detection strategies are configured according to the node attribute classification methods of single-host nodes and multi-host nodes. In other embodiments, detection strategies may also be configured according to other attributes of nodes. For example, whether the load is balanced in the node, whether a dedicated scheduling host is set in the node, or whether the task allocation method is governed by time in the node, etc., are not limited in this embodiment.

本发明实施方式根据检测目标的节点属性配置不同的检测策略,对主机数量不同的节点配置不同的检测策略,以便于快速获得目标设备的检测结果,避免对所有设备采用同一种方法进行探测导致探测周期过长、探测结果延迟较大问题,能够提高检测效率。The embodiment of the present invention configures different detection strategies according to the node attributes of the detection target, and configures different detection strategies for nodes with different numbers of hosts, so as to quickly obtain the detection results of the target device, and avoid detection caused by using the same method for all devices. If the period is too long and the detection result is delayed, the detection efficiency can be improved.

本发明的第二实施方式涉及一种设备状态检测方法。第二实施方式与第一实施方式大致相同,主要区别之处在于:第二实施方式中,考虑到了多个主机的节点内可能设有负载均衡设备的情况,在含有负载均衡设备的节点内,各设备的负载是相同的。The second embodiment of the present invention relates to a device state detection method. The second embodiment is roughly the same as the first embodiment, and the main difference is that: in the second embodiment, considering the situation that a load balancing device may be installed in the nodes of multiple hosts, in a node containing a load balancing device, The load on each device is the same.

本实施方式中的设备状态检测方法如图2所示,具体包括:The device state detection method in this embodiment is shown in Figure 2, and specifically includes:

步骤201,获取检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量。Step 201: Obtain the node attribute of the detection target; wherein the node attribute includes the number of hosts of the node where the detection target is located.

步骤202,判断检测目标所在节点是否为单主机节点;若是单主机节点,则到步骤203;若不是单主机节点,即表示检测目标所在节点包含多个主机,则到步骤204。Step 202, determine 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;

步骤203,向检测目标发送检测请求。以使检测目标响应检测请求反馈检测结果。Step 203, sending a detection request to the detection target. So that the detection target responds to the detection request and feeds back the detection result.

步骤204,检测目标所在节点包含的多个主机之间相互进行冗余检测生成包括各个主机检测结果的检测列表,检测列表分布式存储在各主机中。Step 204: Perform redundancy detection among multiple hosts included in the node where the detection target is located to generate a detection list including detection results of each host, and the detection list is distributed and stored in each host.

步骤205,判断节点内是否含有负载均衡设备;若含有则进入步骤206;若没有则进入步骤207。Step 205 , determine whether the node contains a load balancing device; if yes, go to step 206 ; if not, go to step 207 .

步骤206,向负载均衡设备发送检测请求,以使负载均衡设备响应检测请求反馈检测列表。Step 206: Send 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.

步骤207,在多个主机中选择一个主机为目标主机。Step 207, selecting one host from the multiple hosts as the target host.

步骤208,向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。Step 208: Send a detection request for retrieving the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list.

本实施方式中步骤201至步骤204、步骤207至步骤208与第一实施方式中步骤101至步骤106相似,在此不一一赘述,下面对不同之处进行说明。Steps 201 to 204 and steps 207 to 208 in this embodiment are similar to steps 101 to 106 in the first embodiment, and will not be repeated here, and the differences will be described below.

步骤205,判断节点内是否含有负载均衡设备;若含有则进入步骤206;若没有则进入步骤207。Step 205 , determine whether the node contains a load balancing device; if yes, go to step 206 ; if not, go to step 207 .

步骤206,向负载均衡设备发送检测请求,以使负载均衡设备响应检测请求反馈检测列表。Step 206: Send 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 a load balancing device installed, the load of each device in the node is the same, and the load of each device in the node can be obtained only by detecting the load balancing device, and the detection result can be obtained more quickly. .

本发明实施方式根据检测目标的节点属性配置不同的检测策略,对不同的节点配置不同的检测策略,以便于快速获得目标设备的检测结果,避免对所有设备采用同一种方法进行探测导致探测周期过长、探测结果延迟较大问题,能够提高检测效率。The embodiment of the present invention configures different detection strategies according to the node attributes of the detection target, and configures different detection strategies for different nodes, so as to quickly obtain the detection results of the target device, and avoid using the same method for all devices to detect the detection period. It is long and the detection result is delayed, which can improve the detection efficiency.

本发明的第三实施方式涉及一种设备状态检测方法。第三实施方式与第二实施方式大致相同,主要区别之处在于:第三实施方式中,是对多个检测目标进行检测,并根据检测结果评估设备综合状态,进而选择状态较好的设备进行任务配置。本领域技术人员可以理解,在CDN内容分发中,需要选择负载状况良好的服务器进行内容分发。The third embodiment of the present invention relates to a device state detection method. The third embodiment is roughly the same as the second embodiment, and the main difference is that: in the third embodiment, multiple detection targets are detected, and the comprehensive state of the equipment is evaluated according to the detection results, and then the equipment with a better state is selected for testing. task configuration. Those skilled in the art can understand that, in CDN content distribution, it is necessary to select a server with a good load condition for content distribution.

本实施方式中的设备状态检测方法如图3所示,具体包括:The device state detection method in this embodiment is shown in FIG. 3 , and specifically includes:

步骤301,获取多个检测目标的节点属性;其中,节点属性包括检测目标所在节点的主机数量。Step 301: Obtain node attributes of a plurality of detection targets; wherein the node attributes include the number of hosts of the node where the detection targets are located.

步骤302,根据节点属性和预设的检测规则配置多个检测目标的检测策略。Step 302: Configure detection strategies for multiple detection targets according to node attributes and preset detection rules.

步骤303,根据检测策略向多个检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。Step 303: Send corresponding detection requests to multiple detection targets according to the detection strategy, so that the detection targets respond to the detection requests and feed back detection results.

本实施方式步骤301至步骤303的内容可以采用上述第一、第二实施方式中提供的设备状态检测方法对多个检测目标进行检测,都是根据检测目标的节点属性配置相应的检测策略,对多个检测目标进行检测,具体检测策略不再赘述。The content of steps 301 to 303 in this embodiment can be detected by using the device state detection methods provided in the first and second embodiments above to detect multiple detection targets, all of which configure corresponding detection strategies according to the node attributes of the detection targets. Multiple detection targets are detected, and the specific detection strategy is not repeated here.

步骤304,根据检测结果中的状态参数评估检测目标的设备状态。Step 304: Evaluate the device state of the detection target according to the state parameter in the detection result.

具体地说,检测结果包括检测目标的状态参数;其中,状态参数包括以下一种或其任意组合:CPU参数、内存参数、磁盘参数、带宽参数、服务程序运行状态、接口访问延迟状态;根据状态参数评估检测目标的设备状态。实际应用中,检测服务器检测到的可能只是各个检测目标的状态参数,需要对检测目标的状态参数进行一个评估得到检测目标的综合状态,以便将各个设备的状态进行比较。本实施方式设备状态检查方法适用于CDN内容分发时对待调度的目标设备进行设备状态检查,在响应用户请求后,实时进行设备状态检测,选择负载状况良好的设备进行内容分发。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, interface access delay state; according to the state The parameter evaluation detects the device state of the target. In practical applications, the detection server may only detect the status parameters of each detection target. It is necessary to evaluate the status parameters of the detection target to obtain the comprehensive status of the detection target, so as to compare the status of each device. The device status checking method of this embodiment is suitable for checking the device status of the target device to be scheduled during CDN content distribution. After responding to a user request, the device status detection is performed in real time, and a device with a good load condition is selected for content distribution.

在一个例子中,状态参数包括上述所有参数,即CPU参数、内存参数、磁盘参数、带宽参数、服务程序运行状态、接口访问延迟状态;可以按照如下公式对设备状态进行评分:In one example, the status parameters include all the above parameters, namely CPU parameters, memory parameters, disk parameters, bandwidth parameters, service program running status, and interface access delay status; the device status can be scored according to the following formula:

设备状态评分值=(cpu×a+memory×b+io×c+timeout×d+bandwith×e)×l/x+fDevice status score value=(cpu×a+memory×b+io×c+timeout×d+bandwith×e)×l/x+f

其中a,b,c,d,e为权重系数,x为除法因子,可以根据实际情况设置,本实施方式不做限制;l为链路质量,f为服务程序运行状态,cpu、memory、io、timeout、bandwith分别表示CPU参数、内存参数、磁盘参数、接口访问延迟状态、带宽参数。此评分方式考虑到链路质量的同时还考虑了服务器的运行状态,通过此评分方式,能够选择出较优的调度路径。在其他实施方式中,还可以通过不同的状态参数设置方式或者不同的设备状态评分方式对设备状态进行评估,本实施方式不做限制。Among them, a, b, c, d, and e are the weight coefficients, and x is the division factor, which can be set according to the actual situation, and is not limited in this embodiment; l is the link quality, f is the running state of the service program, cpu, memory, io , timeout, and bandwith represent CPU parameters, memory parameters, disk parameters, interface access delay status, and bandwidth parameters, respectively. This scoring method takes into account the link quality and the running status of the server. Through this scoring method, a better scheduling path can be selected. In other embodiments, the device state may also be evaluated through different state parameter setting methods or different device state scoring methods, which are not limited in this embodiment.

步骤305,根据多个检测目标的检测结果,从预设的检测目标中选择设备状态满足特定条件的检测目标进行任务配置。Step 305 , according to the detection results of the multiple detection targets, select a detection target whose device state satisfies a specific condition from preset detection targets to perform task configuration.

具体地说,在进行任务分配时,为了选择状态最优的设备完成任务,使任务能够有效且快速的完成,在通过本实施方式中的设备状态检测方法对多个目标设备进行检测和评估之后,再从多个设备中选择一个状态最好的设备分配任务。例如,在CDN内容分发场景下,当接收到终端发送的资源获取请求时,调度服务器会根据请求终端的IP地址,按照预定的调度规则选择出一组符合条件的调度目标列表,如图4所示,按照本实施方式提供的设备状态检测方法,调度服务器根据各个调度目标,即检测目标的节点属性和预设的检测规则生成检测策略,对单主机节点内的设备直接检测;对多主机节点,在节点内各设备做相互冗余检测生成包括各个设备检测结果的检测列表,从任意一台设备或负载均衡设备获取节点内各设备的检测结果。最后,根据检测结果。从所有待选设备中选出一个负载状况最优的设备作为调度目标。Specifically, during task assignment, in order to select the device with the best state to complete the task, so that the task can be completed effectively and quickly, after detecting and evaluating multiple target devices through the device state detection method in this embodiment , and then select a device with the best status from multiple devices to assign the task. For example, in a CDN content distribution scenario, when receiving a resource acquisition request sent by a terminal, the scheduling server will select a set of eligible scheduling target lists according to the IP address of the requesting terminal and according to predetermined scheduling rules, as shown in Figure 4 As shown, according to the device state detection method provided in this embodiment, the scheduling server generates a detection strategy according to each scheduling target, that is, the node attribute of the detection target and the preset detection rule, and directly detects the devices in a single-host node; , each device in the node performs mutual redundancy detection to generate a detection list including the detection results of each device, and obtains the detection results of each device in the node from any device or load balancing device. Finally, according to the test results. A device with the best load condition is selected from all the candidate devices as the scheduling target.

进一步地,可以将预先筛选出的调度目标按照一定的优先级排序,例如,按照与目标IP地址距离由近到远的顺序排序,最后按照优先级顺序遍历调度目标列表,综合考虑优先级排前的且设备负载状态符合条件的调度目标。Further, the pre-screened scheduling targets can be sorted according to a certain priority, for example, according to the order of distance from the target IP address from the nearest to the farthest, and finally traverse the scheduling target list according to the priority order, and comprehensively consider the priority ranking. , and the device load status satisfies the scheduling target.

本发明实施方式根据多个检测目标的节点属性配置不同的检测策略,以便于快速获得多个目标设备的检测结果,并且根据多个检测目标的检测结果,选择状态满足特定条件的设备进行任务分配。能够快速、准确的获取检测结果,避免对所有设备进行逐一探测,导致检测周期过长,检测结果延迟较大,提高任务分配的效率。The embodiment of the present invention configures different detection strategies according to the node attributes of multiple detection targets, so as to quickly obtain the detection results of multiple target devices, and according to the detection results of multiple detection targets, selects devices whose states meet specific conditions for task assignment . The detection results can be obtained quickly and accurately, avoiding the detection of all devices one by one, resulting in a long detection cycle and a large delay in the detection results, which improves the efficiency of task allocation.

上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above various methods are divided only for the purpose of describing clearly. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent. ; Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of the algorithm and process are within the scope of protection of this patent.

本发明的第四实施方式涉及一种设备状态检测装置,如图5所示,包括:The fourth embodiment of the present invention relates to a device state detection device, as shown in FIG. 5 , including:

获取模块401,用于获取检测目标的节点属性;其中,节点属性包括检测目标所在节点内的主机数量;The obtaining module 401 is used for obtaining the node attribute of the detection target; wherein, the node attribute includes the number of hosts in the node where the detection target is located;

策略配置模块402,用于根据节点属性和预设的检测规则配置检测目标的检测策略;a strategy configuration module 402, configured to configure a detection strategy of the detection target according to node attributes and preset detection rules;

检测模块403,用于根据检测策略向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。The detection module 403 is configured to send 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 the detection result.

具体地说,当检测目标所在节点为单主机节点时,检测策略为向检测目标发送检测请求。检测模块403直接向检测目标发送对应的检测请求,以使检测目标响应检测请求反馈检测结果。Specifically, when the node where the detection target is located is a single-host node, the detection strategy 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 the detection result.

当检测目标所在节点包含多个主机时,多个主机之间相互进行冗余检测生成包括各个主机检测结果的检测列表,检测列表分布式存储在各主机中;检测策略用于获取检测列表;检测模块403在多个主机中选择一个主机为目标主机,并向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。需要说明的是,检测模块403可以从节点内的多个主机中随机的选择一个目标主机也可以轮询地选择一个目标主机。When the node where the detection target is located contains multiple hosts, the multiple hosts perform redundant detection with each other to generate a detection list including the detection results of each host, and the detection list is distributed and stored in each host; the detection strategy is used to obtain the detection list; The module 403 selects one host from the multiple hosts as the target host, and sends a detection request for retrieving the detection list to the target host, so that the target host responds to the detection request and feeds back the detection list. It should be noted that the detection module 403 may randomly select a target host from multiple hosts in the node, or may select a target host by polling.

在一个例子中,检测模块403还可以向多个主机发送问询信息;记载各主机响应问询信息的响应时长;选择各主机中对应响应时长最短的主机为目标主机;并向目标主机发送调取检测列表的检测请求,以使目标主机响应检测请求反馈检测列表。In one example, the detection module 403 can also send query information to multiple hosts; record the response duration of each host in response to the query information; select the host with the shortest corresponding response duration among the hosts as the target host; Get the detection request of the detection list, so that the target host responds to the detection request and feeds back the detection list.

在又一个例子中,若多主机的节点内含有负载均衡设备;检测模块403还可以直接向负载均衡设备发送检测请求,以使负载均衡设备响应检测请求反馈检测列表。In another example, if a multi-host node contains a load balancing device, the detection module 403 may also directly send a detection request to the load balancing device, so that the load balancing device returns a detection list in response to the detection request.

进一步地,检测结果包括检测目标的状态参数;其中,状态参数包括以下一种或其任意组合:CPU参数、内存参数、磁盘参数、带宽参数、服务程序运行状态、接口访问延迟状态;设备状态检查装置还可以包括:状态评估模块404,用于根据状态参数评估检测目标的设备状态。Further, the detection result includes a state parameter of the detection target; wherein, the state parameter includes one of the following or any combination thereof: CPU parameter, memory parameter, disk parameter, bandwidth parameter, service program running state, interface access delay state; device state check The apparatus may further include: a state evaluation module 404, configured to evaluate the device state of the detection target according to the state parameter.

在一个例子中,检测目标有多个,设备状态检查装置还可以包括:任务配置模块405,用于根据多个检测目标的检测结果,从预设的多个检测目标中选择设备状态满足特定条件的检测目标进行任务配置。In an example, there are multiple detection targets, and the device status checking apparatus may further include: a task configuration module 405, configured to select, according to the detection results of the multiple detection targets, the equipment status from the preset multiple detection targets to satisfy a specific condition The detection target for task configuration.

本实施方式中的设备状态检查装置,根据多个检测目标的节点属性配置不同的检测策略,以便于快速获得多个目标设备的检测结果,并且根据多个检测目标的检测结果,选择状态满足特定条件的设备进行任务分配。能够快速、准确的获取检测结果,避免对所有设备进行逐一探测,导致检测周期过长,检测结果延迟较大,提高任务分配的效率。The device status checking apparatus in this embodiment configures different detection strategies according to the node attributes of multiple detection targets, so as to quickly obtain the detection results of the multiple target devices, and selects a status that satisfies a specific status according to the detection results of the multiple detection targets. Conditional equipment for task assignment. The detection results can be obtained quickly and accurately, avoiding the detection of all devices one by one, resulting in a long detection cycle and a large delay in the detection results, which improves the efficiency of task allocation.

不难发现,本实施方式为与第三实施方式相对应的系统实施例,本实施方式可与第三实施方式互相配合实施。第三实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第三实施方式中。It is not difficult to find that this embodiment is a system example corresponding to the third embodiment, and 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 repeated here in order to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the third embodiment.

值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that each module involved in this embodiment is a logical module. In practical applications, a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. A composite implementation of the unit. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.

本发明第五实施方式涉及一种电子设备,该设备具体结构如图6所示。包括至少一个处理器502;以及,与至少一个处理器502通信连接的存储器501。其中,存储器501存储有可被至少一个处理器502执行的指令,指令被至少一个处理器502执行,以使至少一个处理器502能够执行上述实施方式中的设备状态检测方法。The fifth embodiment of the present invention relates to an electronic device, and the specific structure of the device is shown in FIG. 6 . Including at least one processor 502; and, a memory 501 in communication with the 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, so that the at least one processor 502 can execute the device state detection method in the above embodiment.

本实施方式中,处理器502以中央处理器(Central Processing Unit,CPU)为例,存储器501以可读写存储器(Random Access Memory,RAM)为例。处理器502、存储器501可以通过总线或者其他方式连接,图5中以通过总线连接为例。存储器501作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中实现设备状态检测方法的程序就存储于存储器501中。处理器502通过运行存储在存储器501中的非易失性软件程序、指令以及模块,从而执行设备的各种功能应用以及数据处理,即实现上述设备状态检测方法。In this embodiment, the processor 502 is a central processing unit (Central Processing Unit, CPU) as an example, and the memory 501 is a random access memory (Random Access Memory, RAM) as an example. The processor 502 and the memory 501 may be connected through a bus or in other ways, and the connection through a bus is taken as an example in FIG. 5 . As a non-volatile computer-readable storage medium, the memory 501 can be used to store non-volatile software programs, non-volatile computer-executable programs and modules. Stored in the memory 501 . The processor 502 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 501 , that is, the above-mentioned device state detection method is implemented.

存储器501可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储选项列表等。此外,存储器501可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器501可选包括相对于处理器502远程设置的存储器,这些远程存储器可以通过网络连接至外接设备。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 by at least one function; the storage data area may store an option list and the like. In addition, 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 external devices via a network.

一个或者多个程序模块存储在存储器501中,当被一个或者多个处理器502执行时,执行上述任意方法实施方式中的设备状态检测方法。One or more program modules are stored in the memory 501, and when executed by one or more processors 502, perform the device state detection method in any of the above-mentioned method embodiments.

上述产品可执行本申请实施方式所提供的方法,具备执行方法相应的功能模块和有益效果,未在本实施方式中详尽描述的技术细节,可参见本申请实施方式所提供的方法。The above product can execute the method provided by the embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present application.

本发明第六实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。The sixth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The above method embodiments are implemented when the computer program is executed by the processor.

即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.

本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those skilled in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes in form and details can be made without departing from the spirit and the spirit of the present invention. scope.

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
CN108881448B (en) API request processing method and device
US7984147B2 (en) Apparatus and method for identifying a requested level of service for a transaction
CN102281190B (en) Networking method for load balancing apparatus, server and client access method
CN107872402B (en) Global flow scheduling method and device and electronic equipment
JP5931908B2 (en) Techniques for managing traffic in routers
CN108205541B (en) Distributed network crawler task scheduling method and device
US20180285294A1 (en) Quality of service based handling of input/output requests method and apparatus
CN105103495B (en) Admission control for allowing or denying measurement requests between the first and second devices
WO2012024909A1 (en) Long connection management apparatus and link resource management method for long connection communication
JP2002091936A (en) Device for distributing load and method for estimating load
CN106027595A (en) Access log processing method and system for CDN node
US20140115183A1 (en) Information processing method, recording medium, and information processing apparatus
CN105119993B (en) Virtual machine deployment method and device
JP6272190B2 (en) Computer system, computer, load balancing method and program thereof
CN107819825A (en) A kind of service scheduling method, device and electronic equipment
CN109981768A (en) I/o multipath planning method and equipment in distributed network storage system
CN114500381B (en) Network bandwidth limiting method, system, electronic equipment and readable storage medium
CN105872082B (en) Fine granularity resource response system based on container cluster load-balancing algorithm
CN105323290B (en) A content scheduling method and device based on user traffic distribution characteristics
CN110971676B (en) Equipment state detection method and device, electronic equipment and storage medium
US10148518B2 (en) Method and apparatus for managing computer system
CN110222084B (en) Method and device, storage medium, and terminal for reporting hotspot device monitoring information
WO2024255366A1 (en) Cloud computing-oriented memory allocation method and apparatus, cloud computing-oriented memory acquisition method and apparatus, and device
CN106341474B (en) It is a kind of that center and its contents management method are managed based on the data of ICN and SDN network

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