CN108881407A - A kind of information processing method and device - Google Patents
A kind of information processing method and device Download PDFInfo
- Publication number
- CN108881407A CN108881407A CN201810542924.2A CN201810542924A CN108881407A CN 108881407 A CN108881407 A CN 108881407A CN 201810542924 A CN201810542924 A CN 201810542924A CN 108881407 A CN108881407 A CN 108881407A
- Authority
- CN
- China
- Prior art keywords
- service node
- management
- node
- target
- identifier
- 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.)
- Pending
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 19
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000012545 processing Methods 0.000 claims description 15
- 238000000034 method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明实施例公开了一种信息处理方法及装置,包括:管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态。从本发明实施例可见,由于管理节点每隔固定的时间间隔就能接收到集群中服务节点的标识,进而根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,因此无需再向服务节点发送查询请求,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。
The embodiment of the present invention discloses an information processing method and device, including: the management node receives the identifier of the service node sent by the service node in the cluster every first preset time interval as the first target identifier; according to the first target identifier, The management information stored by itself and the cache information maintained by itself determine the current state of the service node. It can be seen from the embodiment of the present invention that since the management node can receive the identification of the service node in the cluster every fixed time interval, and then determine the current state of the service node according to the obtained identification, the management information stored by itself and the cache information maintained by itself , so there is no need to send a query request to the service node, thereby avoiding the encroachment of the resources used in the management and deployment of the service node in the management node, and improving the work efficiency of the cloud platform.
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种信息处理方法及装置。The present invention relates to the field of computer technology, in particular to an information processing method and device.
背景技术Background technique
随着云计算、云平台的快速发展,越来越多的企业选择企业上云来降低在计算资源上的成本管控,而具有稳定高效的云管理技术的产品,也就成为了企业在采购时的首选,因而增强云产品在资源管理上的稳定性、高效性,也就给云产品带来本质上竞争力的提升。With the rapid development of cloud computing and cloud platforms, more and more enterprises choose to go to the cloud to reduce the cost control of computing resources, and products with stable and efficient cloud management technology have become an important choice for enterprises when purchasing. Therefore, enhancing the stability and efficiency of cloud products in resource management will also bring about an essential improvement in the competitiveness of cloud products.
现有云平台在集群的管理上,大多是采用管理节点每个预设时间间隔向服务节点主动发起查询请求,并接收服务节点响应的方式来确认服务节点的活动状态的。In the cluster management of existing cloud platforms, most of them use the management node to actively initiate a query request to the service node every preset time interval and receive the response from the service node to confirm the activity status of the service node.
但是当集群规模较大时,这种方式将大幅度增加对管理节点资源的侵占程度,从而造成管理节点中可用于管理、调配服务节点的资源极具缩小,进而降低云平台的工作效率。However, when the cluster scale is large, this method will greatly increase the degree of encroachment on management node resources, resulting in extremely reduced resources in the management node that can be used to manage and deploy service nodes, thereby reducing the work efficiency of the cloud platform.
发明内容Contents of the invention
为了解决上述技术问题,本发明提供一种信息处理方法,能够避免管理节点中用于管理、调配服务节点的资源被侵占,从而提高云平台的工作效率。In order to solve the above-mentioned technical problems, the present invention provides an information processing method, which can prevent resources used for managing and deploying service nodes in the management node from being encroached, thereby improving the working efficiency of the cloud platform.
为了达到本发明目的,本发明提供了一种信息处理方法,包括:In order to achieve the purpose of the present invention, the present invention provides an information processing method, comprising:
管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;The management node receives the identifier of the service node sent by the service node in the cluster every first preset time interval as the first target identifier;
根据所述第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定所述服务节点的当前状态。The current state of the service node is determined according to the first target identifier, the management information stored by itself, and the cache information maintained by itself.
所述管理信息包括:所述管理节点管理的服务节点的标识和初始状态,所述服务节点缓存信息包括:从所述集群进入工作状态开始所述管理节点接收到的服务节点的标识,所述根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,包括:The management information includes: the ID and initial state of the service node managed by the management node, and the service node cache information includes: the ID of the service node received by the management node since the cluster enters the working state, the Determine the current state of the service node according to the first target identifier, the management information stored by itself, and the cache information maintained by itself, including:
判断所述第一目标标识是否存在于所述缓存信息中;judging whether the first target identifier exists in the cache information;
如果所述第一目标标识不存在于所述缓存信息中,判断所述第一目标标识是否存在于所述管理信息中;If the first target identifier does not exist in the cache information, determine whether the first target identifier exists in the management information;
如果所述第一目标标识存在于所述管理信息中,从所述管理信息中获取与所述第一目标标识对应的服务节点的初始状态;If the first target identifier exists in the management information, acquire the initial state of the service node corresponding to the first target identifier from the management information;
根据获得的初始状态确定所述与第一目标标识对应的服务节点的当前状态。Determine the current state of the service node corresponding to the first target identifier according to the obtained initial state.
所述缓存信息还包括:从所述集群进入工作状态开始所述管理节点接收到的服务节点的标识的最近一次接收时间,如果所述第一目标标识存在于所述缓存信息中,还包括:The cache information also includes: the latest receiving time of the service node identifier received by the management node since the cluster enters the working state, and if the first target identifier exists in the cache information, it also includes:
获取接收到所述第一目标标识的时间,作为第一目标时间;Acquiring the time when the first target identifier is received as the first target time;
从所述缓存信息中获取所述第一目标标识的最近一次接收时间,作为第二目标时间;Acquiring the latest receiving time of the first target identifier from the cache information as the second target time;
用所述第一目标时间替换所述第二目标时间。The second target time is replaced with the first target time.
所述根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定所述服务节点的当前状态之前或之后,还包括:Before or after determining the current state of the service node according to the first target identifier, the management information stored by itself, and the cache information maintained by itself, it further includes:
根据所述缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差;Calculate the time difference between the latest receiving time of the identity of each service node and the current time at every second preset time interval according to the cache information;
获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识;Acquiring the identity of the service node whose time difference between the latest receiving time and the current time exceeds the preset time, as the second target identity;
删除所述第二目标标识与对应的最近一次接收时间,并将所述第二目标标识对应的服务节点的状态修改为下线状态。Delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明还提供了一种信息处理方法,包括:The present invention also provides an information processing method, including:
服务节点每隔第一预设时间向集群中的管理节点发送节点标识,以使得所述管理节点根据根据获得的服务节点的标识、所述管理节点存储的管理信息以及所述管理节点维护的缓存信息确定所述服务节点的当前状态。The service node sends the node identifier to the management node in the cluster every first preset time, so that the management node can use the obtained identifier of the service node, the management information stored by the management node, and the cache maintained by the management node information identifying the current state of the service node.
本发明还提供了一种管理节点,包括:The present invention also provides a management node, including:
接收模块,用于接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;A receiving module, configured to receive the identifier of the service node sent by the service node in the cluster every first preset time interval as the first target identifier;
处理模块,用于根据所述第一目标标识、所述管理节点存储的管理信息以及所述管理节点维护的缓存信息确定所述服务节点的当前状态。A processing module, configured to determine the current state of the service node according to the first target identifier, the management information stored by the management node, and the cache information maintained by the management node.
所述管理信息包括:所述管理节点管理的服务节点的标识和初始状态,所述服务节点缓存信息包括:从所述集群进入工作状态开始所述管理节点接收到的服务节点的标识,所述处理模块具体用于:The management information includes: the ID and initial state of the service node managed by the management node, and the service node cache information includes: the ID of the service node received by the management node since the cluster enters the working state, the The processing module is used specifically for:
判断所述第一目标标识是否存在于所述缓存信息中;judging whether the first target identifier exists in the cache information;
如果所述第一目标标识不存在于所述缓存信息中,判断所述第一目标标识是否存在于所述管理信息中;If the first target identifier does not exist in the cache information, determine whether the first target identifier exists in the management information;
如果所述第一目标标识存在于所述管理信息中,从所述管理信息中获取与所述第一目标标识对应的服务节点的初始状态;If the first target identifier exists in the management information, acquire the initial state of the service node corresponding to the first target identifier from the management information;
根据获得的初始状态确定所述与第一目标标识对应的服务节点的当前状态。Determine the current state of the service node corresponding to the first target identifier according to the obtained initial state.
所述缓存信息还包括:从所述集群进入工作状态开始所述管理节点接收到的服务节点的标识的最近一次接收时间,如果所述第一目标标识存在于所述缓存信息中,所述处理模块还用于:The cache information also includes: the latest receiving time of the ID of the service node received by the management node since the cluster entered the working state, if the first target ID exists in the cache information, the processing Modules are also used to:
获取接收到所述第一目标标识的时间,作为第一目标时间;Acquiring the time when the first target identifier is received as the first target time;
从所述缓存信息中获取所述第一目标标识的最近一次接收时间,作为第二目标时间;Acquiring the latest receiving time of the first target identifier from the cache information as the second target time;
用所述第一目标时间替换所述第二目标时间。The second target time is replaced with the first target time.
所述处理模块还用于:The processing module is also used to:
根据所述缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差;Calculate the time difference between the latest receiving time of the identity of each service node and the current time at every second preset time interval according to the cache information;
获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识;Acquiring the identity of the service node whose time difference between the latest receiving time and the current time exceeds the preset time, as the second target identity;
删除所述第二目标标识与对应的最近一次接收时间,并将所述第二目标标识对应的服务节点的状态修改为下线状态。Delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明还提供了一种服务节点,包括:The present invention also provides a service node, including:
发送模块,用于每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得所述管理节点根据根据获得的服务节点的标识、所述管理节点存储的管理信息以及所述管理节点维护的缓存信息确定所述服务节点的当前状态。A sending module, configured to send a node identifier to a management node in the cluster every first preset time interval, so that the management node can use the obtained identifier of the service node, the management information stored by the management node, and the management The cached information maintained by the node determines the current state of the serving node.
与现有技术相比,本发明至少包括:管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态。从本发明提供的技术方案可见,由于管理节点每隔固定的时间间隔就能接收到集群中服务节点的标识,进而根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,因此无需再向服务节点发送查询请求,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。Compared with the prior art, the present invention at least includes: the management node receives the identification of the service node sent by the service node in the cluster every first preset time interval as the first target identification; according to the first target identification, the management node stored by itself Information and the cached information maintained by itself determine the current state of the service node. It can be seen from the technical solution provided by the present invention that since the management node can receive the identification of the service node in the cluster every fixed time interval, and then determine the identification of the service node according to the obtained identification, the management information stored by itself and the cache information maintained by itself. In the current state, there is no need to send query requests to the service nodes, thereby avoiding the encroachment of resources used to manage and deploy service nodes in the management node, and improving the work efficiency of the cloud platform.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
附图说明Description of drawings
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present invention, and constitute a part of the description, and are used together with the embodiments of the application to explain the technical solution of the present invention, and do not constitute a limitation to the technical solution of the present invention.
图1为本发明实施例提供的一种信息处理方法的流程示意图;FIG. 1 is a schematic flowchart of an information processing method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种信息处理方法的流程示意图;FIG. 2 is a schematic flowchart of another information processing method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种管理节点的结构示意图;FIG. 3 is a schematic structural diagram of a management node provided by an embodiment of the present invention;
图4为本发明实施例提供的一种服务节点的结构示意图。FIG. 4 is a schematic structural diagram of a service node provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solution and advantages of the present invention more clear, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.
本发明实施例提供一种信息处理方法,如图1所示,该方法包括:An embodiment of the present invention provides an information processing method, as shown in FIG. 1, the method includes:
步骤101、管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识。In step 101, the management node receives the identifier of the service node sent by the service nodes in the cluster every first preset time interval as the first target identifier.
需要说明的是,服务节点的标识可以是管理节点预先分配给服务节点的。管理节点可以是用于管理的服务器,服务节点可以是用于提供特定服务的服务器,本发明对此不作限制。It should be noted that the identifier of the service node may be pre-assigned to the service node by the management node. The management node may be a server for management, and the service node may be a server for providing specific services, which is not limited in the present invention.
还需要说明的是,集群中存在一个管理节点和若干个服务节点,管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识指的是:管理节点接收集群中所有服务节点每隔第一预设时间间隔发送的服务节点的标识。It should also be noted that there is one management node and several service nodes in the cluster, and the management node receives the service node identifier sent by the service node in the cluster every first preset time interval means: the management node receives all service nodes in the cluster The identifier of the service node sent by the node every first preset time interval.
具体的,举例来说,假设集群中存在三个服务节点,分别是服务节点A、服务节点B和服务节点C,那么管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识指的是:管理节点接收服务节点A每隔第一预设时间间隔发送的服务节点的标识,接收服务节点B每隔第一预设时间间隔发送的服务节点的标识,接收服务节点C每隔第一预设时间间隔发送的服务节点的标识,即第一目标标识包括:服务节点A的标识、服务节点B的标识和服务节点C的标识。Specifically, for example, assuming that there are three service nodes in the cluster, namely service node A, service node B, and service node C, then the management node receives the service node information sent by the service nodes in the cluster every first preset time interval The identification of refers to: the management node receives the identification of the service node sent by the service node A every first preset time interval, receives the identification of the service node sent by the service node B every first preset time interval, and receives the ID of the service node C sent by the service node C The identifier of the service node sent every first preset time interval, that is, the first target identifier includes: the identifier of the service node A, the identifier of the service node B, and the identifier of the service node C.
步骤102、根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态。Step 102. Determine the current state of the service node according to the first target identifier, the management information stored by itself, and the cache information maintained by itself.
需要说明的是,管理信息是管理节点所管理的服务节点的信息,缓存信息是管理节点接收到的来自服务节点的信息。It should be noted that the management information is the information of the service nodes managed by the management node, and the cache information is the information received by the management node from the service nodes.
具体的,假设第一目标标识包括:服务节点A的标识、服务节点B的标识和服务节点C的标识,那么根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态指的是:根据服务节点A的标识、管理信息以及缓存信息确定服务节点A的当前状态,根据服务节点B的标识、管理信息以及缓存信息确定服务节点B的当前状态,根据服务节点C的标识、管理信息以及缓存信息确定服务节点C的当前状态。Specifically, assuming that the first target ID includes: the ID of service node A, the ID of service node B, and the ID of service node C, then determine the ID of the service node according to the first target ID, the management information stored by itself, and the cache information maintained by itself. The current state refers to: determine the current state of service node A according to the identity, management information and cache information of service node A; determine the current state of service node B according to the identity, management information and cache information of service node B; The identification, management information and cache information of the service node C determine the current state.
本发明实施例所提供的信息处理方法,管理节点接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态。从本发明提供的技术方案可见,由于管理节点每隔固定的时间间隔就能接收到集群中服务节点的标识,进而根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,因此无需再向服务节点发送查询请求,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。In the information processing method provided by the embodiment of the present invention, the management node receives the identification of the service node sent by the service node in the cluster every first preset time interval as the first target identification; according to the first target identification, the management information stored by itself And the cache information maintained by itself determines the current state of the service node. It can be seen from the technical solution provided by the present invention that since the management node can receive the identification of the service node in the cluster every fixed time interval, and then determine the identification of the service node according to the obtained identification, the management information stored by itself and the cache information maintained by itself. In the current state, there is no need to send query requests to the service nodes, thereby avoiding the encroachment of resources used to manage and deploy service nodes in the management node, and improving the work efficiency of the cloud platform.
可选地,管理信息包括:管理节点管理的服务节点的标识和初始状态,服务节点缓存信息包括:从集群进入工作状态开始管理节点接收到的服务节点的标识。根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,包括:Optionally, the management information includes: the identifier and initial state of the service node managed by the management node, and the service node cache information includes: the identifier of the service node received by the management node since the cluster enters the working state. Determine the current state of the service node according to the first target identifier, the management information stored by itself, and the cache information maintained by itself, including:
步骤102a、判断第一目标标识是否存在于缓存信息中。Step 102a, judging whether the first target identifier exists in the cache information.
步骤102b、如果第一目标标识不存在于缓存信息中,判断第一目标标识是否存在于管理信息中。Step 102b, if the first target identifier does not exist in the cache information, determine whether the first target identifier exists in the management information.
步骤102c、如果第一目标标识存在于管理信息中,从管理信息中获取与第一目标标识对应的服务节点的初始状态。Step 102c, if the first target identifier exists in the management information, obtain the initial state of the service node corresponding to the first target identifier from the management information.
步骤102d、根据获得的初始状态确定与第一目标标识对应的服务节点的当前状态。Step 102d: Determine the current state of the service node corresponding to the first target identifier according to the obtained initial state.
可选地,述缓存信息还包括:从集群进入工作状态开始管理节点接收到的服务节点的标识的最近一次接收时间,如果第一目标标识存在于缓存信息中,还包括:Optionally, the cache information also includes: the latest receiving time of the ID of the service node received by the management node since the cluster enters the working state, and if the first target ID exists in the cache information, it also includes:
步骤102e、获取接收到第一目标标识的时间,作为第一目标时间。Step 102e, acquire the time when the first target identifier is received as the first target time.
步骤102f、从缓存信息中获取第一目标标识的最近一次接收时间,作为第二目标时间。Step 102f, acquiring the latest receiving time of the first target identifier from the cached information as the second target time.
步骤102g、用第一目标时间替换第二目标时间。Step 102g, replace the second target time with the first target time.
需要说明的是,最近一次接收时间可以表示成时间戳。缓存信息可以以表的形式表示,即缓存信息为缓存表,当缓存信息为缓存表时,接收到的服务节点的标识和接收到的服务节点的标识的最近一次接收时间可以组成键值对存储在缓存表中。It should be noted that the latest receiving time may be expressed as a timestamp. The cache information can be expressed in the form of a table, that is, the cache information is a cache table. When the cache information is a cache table, the received service node ID and the last receiving time of the received service node ID can form a key-value pair storage in the cache table.
可选地,根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态之前或之后,还包括:Optionally, before or after determining the current state of the service node according to the first target identifier, the management information stored by itself, and the cache information maintained by itself, the method further includes:
步骤103、根据缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差。Step 103 : Calculate the time difference between the latest receiving time of the identifier of each service node and the current time at second preset time intervals according to the cached information.
步骤104、获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识。Step 104: Obtain the identifier of the service node whose time difference between the latest receiving time and the current time exceeds a preset time, as the second target identifier.
步骤105、删除第二目标标识与对应的最近一次接收时间,并将第二目标标识对应的服务节点的状态修改为下线状态。Step 105, delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明实施例还提供一种信息处理方法,如图2所示,该方法包括:The embodiment of the present invention also provides an information processing method, as shown in Figure 2, the method includes:
步骤201、服务节点每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。Step 201, the service node sends the node identifier to the management node in the cluster every first preset time interval, so that the management node determines the The current state of the service node.
本发明实施例所提供的信息处理方法,服务节点每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。从本发明提供的技术方案可见,由于服务节点每隔固定的时间间隔就向集群中管理节点发送标识,因此使得管理节点能够根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。In the information processing method provided by the embodiment of the present invention, the service node sends the node identifier to the management node in the cluster every first preset time interval, so that the management node can obtain the identifier of the service node according to the management information stored by the management node. And the cache information maintained by the management node determines the current state of the service node. It can be seen from the technical solution provided by the present invention that since the service node sends the identification to the management node in the cluster at regular intervals, the management node can determine the service according to the obtained identification, the management information stored by itself and the cache information maintained by itself. The current state of the node avoids the encroachment of resources used to manage and deploy service nodes in the management node, and improves the work efficiency of the cloud platform.
本发明实施例还提供一种管理节点,如图3所示,该管理节点3包括:The embodiment of the present invention also provides a management node. As shown in FIG. 3, the management node 3 includes:
接收模块31,用于接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识。The receiving module 31 is configured to receive the identifier of the service node sent by the service nodes in the cluster every first preset time interval as the first target identifier.
处理模块32,用于根据第一目标标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。The processing module 32 is configured to determine the current state of the service node according to the first target identifier, the management information stored by the management node, and the cache information maintained by the management node.
可选地,管理信息包括:管理节点管理的服务节点的标识和初始状态,服务节点缓存信息包括:从集群进入工作状态开始管理节点接收到的服务节点的标识。处理模块32具体用于:Optionally, the management information includes: the identifier and initial state of the service node managed by the management node, and the service node cache information includes: the identifier of the service node received by the management node since the cluster enters the working state. The processing module 32 is specifically used for:
判断第一目标标识是否存在于缓存信息中。It is judged whether the first target identifier exists in the cache information.
如果第一目标标识不存在于缓存信息中,判断第一目标标识是否存在于管理信息中。If the first target identifier does not exist in the cache information, it is judged whether the first target identifier exists in the management information.
如果第一目标标识存在于管理信息中,从管理信息中获取与第一目标标识对应的服务节点的初始状态。If the first target identifier exists in the management information, the initial state of the service node corresponding to the first target identifier is obtained from the management information.
根据获得的初始状态确定与第一目标标识对应的服务节点的当前状态。The current state of the service node corresponding to the first target identifier is determined according to the obtained initial state.
可选地,缓存信息还包括:从集群进入工作状态开始管理节点接收到的服务节点的标识的最近一次接收时间。如果第一目标标识存在于缓存信息中,处理模块32还具体用于:Optionally, the cache information further includes: the latest receiving time of the identification of the service node received by the management node since the cluster enters the working state. If the first target identifier exists in the cache information, the processing module 32 is further specifically configured to:
获取接收到第一目标标识的时间,作为第一目标时间。The time at which the first target identifier is received is acquired as the first target time.
从缓存信息中获取第一目标标识的最近一次接收时间,作为第二目标时间。The latest receiving time of the first target identifier is acquired from the cache information as the second target time.
用第一目标时间替换第二目标时间。Replace the second target time with the first target time.
可选地,处理模块32还用于:Optionally, the processing module 32 is also used for:
根据缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差。The time difference between the latest receiving time of the identifier of each service node and the current time is calculated every second preset time interval according to the cached information.
获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识。Obtain the identifier of the service node whose time difference between the latest receiving time and the current time exceeds a preset time, as the second target identifier.
删除第二目标标识与对应的最近一次接收时间,并将第二目标标识对应的服务节点的状态修改为下线状态。Delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明实施例所提供的管理节点,接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识;根据第一目标标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态。从本发明提供的技术方案可见,由于管理节点每隔固定的时间间隔就能接收到集群中服务节点的标识,进而根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,因此无需再向服务节点发送查询请求,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。The management node provided by the embodiment of the present invention receives the identification of the service node sent by the service node in the cluster every first preset time interval as the first target identification; according to the first target identification, the management information stored by itself and the self-maintenance The cached information determines the current state of the service node. It can be seen from the technical solution provided by the present invention that since the management node can receive the identification of the service node in the cluster every fixed time interval, and then determine the identification of the service node according to the obtained identification, the management information stored by itself and the cache information maintained by itself. In the current state, there is no need to send query requests to the service nodes, thereby avoiding the encroachment of resources used to manage and deploy service nodes in the management node, and improving the work efficiency of the cloud platform.
在实际应用中,发送模块31和处理模块32均可由位于管理节点中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)或现场可编程门阵列(Field Programmable GateArray,FPGA)等实现。In practical applications, both the sending module 31 and the processing module 32 can be composed of a central processing unit (Central Processing Unit, CPU), a microprocessor (Micro Processor Unit, MPU), a digital signal processor (Digital Signal Processor, DSP) or Field Programmable Gate Array (Field Programmable GateArray, FPGA) and other implementations.
本发明实施例还提供一种服务节点,如图4所示,该服务节点4包括:The embodiment of the present invention also provides a service node. As shown in FIG. 4, the service node 4 includes:
发送模块41,用于每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。The sending module 41 is configured to send the node identification to the management node in the cluster every first preset time interval, so that the management node can obtain the ID of the service node according to the management information stored by the management node and the cache information maintained by the management node. Determine the current state of the service node.
本发明实施例所提供的服务节点,每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。从本发明提供的技术方案可见,由于服务节点每隔固定的时间间隔就向集群中管理节点发送标识,因此使得管理节点能够根据获得的标识、自身存储的管理信息以及自身维护的缓存信息确定服务节点的当前状态,从而避免了管理节点中用于管理、调配服务节点的资源被侵占,提高了云平台的工作效率。The service node provided by the embodiment of the present invention sends node identifiers to the management nodes in the cluster every first preset time interval, so that the management nodes can The cached information maintained determines the current state of the service node. It can be seen from the technical solution provided by the present invention that since the service node sends the identification to the management node in the cluster at regular intervals, the management node can determine the service according to the obtained identification, the management information stored by itself and the cache information maintained by itself. The current state of the node avoids the encroachment of resources used to manage and deploy service nodes in the management node, and improves the work efficiency of the cloud platform.
在实际应用中,发送模块41可由位于服务节点中的CPU、MPU、DSP或FPGA等实现。In practical application, the sending module 41 may be realized by CPU, MPU, DSP or FPGA located in the service node.
本发明实施例还提供一种用于实现信息处理的装置,包括:第一存储器和第一处理器,其中,第一存储器中存储有以下可被处理器执行的指令:An embodiment of the present invention also provides an apparatus for implementing information processing, including: a first memory and a first processor, wherein the first memory stores the following instructions executable by the processor:
接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识。The identifier of the service node sent by the service node in the cluster every first preset time interval is received as the first target identifier.
根据第一目标标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。The current state of the service node is determined according to the first target identifier, the management information stored by the management node, and the cache information maintained by the management node.
可选地,管理信息包括:管理节点管理的服务节点的标识和初始状态,服务节点缓存信息包括:从集群进入工作状态开始管理节点接收到的服务节点的标识。第一存储器中具体存储有以下可被处理器执行的指令:Optionally, the management information includes: the identifier and initial state of the service node managed by the management node, and the service node cache information includes: the identifier of the service node received by the management node since the cluster enters the working state. The following instructions executable by the processor are specifically stored in the first memory:
判断第一目标标识是否存在于缓存信息中。It is judged whether the first target identifier exists in the cache information.
如果第一目标标识不存在于缓存信息中,判断第一目标标识是否存在于管理信息中。If the first target identifier does not exist in the cache information, it is judged whether the first target identifier exists in the management information.
如果第一目标标识存在于管理信息中,从管理信息中获取与第一目标标识对应的服务节点的初始状态。If the first target identifier exists in the management information, the initial state of the service node corresponding to the first target identifier is obtained from the management information.
根据获得的初始状态确定与第一目标标识对应的服务节点的当前状态。The current state of the service node corresponding to the first target identifier is determined according to the obtained initial state.
可选地,缓存信息还包括:从集群进入工作状态开始管理节点接收到的服务节点的标识的最近一次接收时间,如果第一目标标识存在于缓存信息中。第一存储器中还具体存储有以下可被处理器执行的指令:Optionally, the cache information further includes: the latest receiving time of the ID of the service node received by the management node since the cluster enters the working state, if the first target ID exists in the cache information. The first memory also specifically stores the following instructions executable by the processor:
获取接收到第一目标标识的时间,作为第一目标时间。The time at which the first target identifier is received is acquired as the first target time.
从缓存信息中获取第一目标标识的最近一次接收时间,作为第二目标时间。The latest receiving time of the first target identifier is acquired from the cache information as the second target time.
用第一目标时间替换第二目标时间。Replace the second target time with the first target time.
可选地,第一存储器中还存储有以下可被处理器执行的指令:Optionally, the following instructions executable by the processor are also stored in the first memory:
根据缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差。The time difference between the latest receiving time of the identifier of each service node and the current time is calculated every second preset time interval according to the cached information.
获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识。Obtain the identifier of the service node whose time difference between the latest receiving time and the current time exceeds a preset time, as the second target identifier.
删除第二目标标识与对应的最近一次接收时间,并将第二目标标识对应的服务节点的状态修改为下线状态。Delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明实施例还提供一种用于实现信息处理的装置,包括:第二存储器和第二处理器,其中,第二存储器中存储有以下可被处理器执行的指令:An embodiment of the present invention also provides an apparatus for implementing information processing, including: a second memory and a second processor, wherein the second memory stores the following instructions executable by the processor:
每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。Send the node identification to the management node in the cluster every first preset time interval, so that the management node determines the current status of the service node according to the obtained service node identification, management information stored by the management node, and cache information maintained by the management node .
本发明实施例还提供一种计算机可读存储介质,存储介质上存储有计算机可执行指令,计算机可执行指令用于执行以下步骤:The embodiment of the present invention also provides a computer-readable storage medium, on which computer-executable instructions are stored, and the computer-executable instructions are used to perform the following steps:
接收集群中服务节点每隔第一预设时间间隔发送的服务节点的标识,作为第一目标标识。The identifier of the service node sent by the service node in the cluster every first preset time interval is received as the first target identifier.
根据第一目标标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。The current state of the service node is determined according to the first target identifier, the management information stored by the management node, and the cache information maintained by the management node.
可选地,管理信息包括:管理节点管理的服务节点的标识和初始状态,服务节点缓存信息包括:从集群进入工作状态开始管理节点接收到的服务节点的标识。计算机可执行指令具体用于执行以下步骤:Optionally, the management information includes: the identifier and initial state of the service node managed by the management node, and the service node cache information includes: the identifier of the service node received by the management node since the cluster enters the working state. The computer-executable instructions are specifically for performing the following steps:
判断第一目标标识是否存在于缓存信息中。It is judged whether the first target identifier exists in the cache information.
如果第一目标标识不存在于缓存信息中,判断第一目标标识是否存在于管理信息中。If the first target identifier does not exist in the cache information, it is judged whether the first target identifier exists in the management information.
如果第一目标标识存在于管理信息中,从管理信息中获取与第一目标标识对应的服务节点的初始状态。If the first target identifier exists in the management information, the initial state of the service node corresponding to the first target identifier is obtained from the management information.
根据获得的初始状态确定与第一目标标识对应的服务节点的当前状态。The current state of the service node corresponding to the first target identifier is determined according to the obtained initial state.
可选地,缓存信息还包括:从集群进入工作状态开始管理节点接收到的服务节点的标识的最近一次接收时间,如果第一目标标识存在于缓存信息中。计算机可执行指令还具体用于执行以下步骤:Optionally, the cache information further includes: the latest receiving time of the ID of the service node received by the management node since the cluster enters the working state, if the first target ID exists in the cache information. The computer-executable instructions are also specifically operable to perform the steps of:
获取接收到第一目标标识的时间,作为第一目标时间。The time at which the first target identifier is received is acquired as the first target time.
从缓存信息中获取第一目标标识的最近一次接收时间,作为第二目标时间。The latest receiving time of the first target identifier is acquired from the cache information as the second target time.
用第一目标时间替换第二目标时间。Replace the second target time with the first target time.
可选地,计算机可执行指令还用于执行以下步骤:Optionally, the computer-executable instructions are further used to perform the following steps:
根据缓存信息每隔第二预设时间间隔计算每一个服务节点的标识的最近一次接收时间与当前时间的时间差。The time difference between the latest receiving time of the identifier of each service node and the current time is calculated every second preset time interval according to the cached information.
获取最近一次接收时间与当前时间的时间差超过预设时间的服务节点的标识,作为第二目标标识。Obtain the identifier of the service node whose time difference between the latest receiving time and the current time exceeds a preset time, as the second target identifier.
删除第二目标标识与对应的最近一次接收时间,并将第二目标标识对应的服务节点的状态修改为下线状态。Delete the second target ID and the corresponding latest receiving time, and modify the status of the service node corresponding to the second target ID to an offline status.
本发明实施例还提供一种计算机可读存储介质,存储介质上存储有计算机可执行指令,计算机可执行指令用于执行以下步骤:The embodiment of the present invention also provides a computer-readable storage medium, on which computer-executable instructions are stored, and the computer-executable instructions are used to perform the following steps:
每隔第一预设时间间隔向集群中的管理节点发送节点标识,以使得管理节点根据根据获得的服务节点的标识、管理节点存储的管理信息以及管理节点维护的缓存信息确定服务节点的当前状态。Send the node identification to the management node in the cluster every first preset time interval, so that the management node determines the current status of the service node according to the obtained service node identification, management information stored by the management node, and cache information maintained by the management node .
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。Although the embodiments disclosed in the present invention are as above, the described content is only an embodiment adopted for understanding the present invention, and is not intended to limit the present invention. Anyone skilled in the field of the present invention can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed by the present invention, but the scope of patent protection of the present invention must still be The scope defined by the appended claims shall prevail.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810542924.2A CN108881407A (en) | 2018-05-30 | 2018-05-30 | A kind of information processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810542924.2A CN108881407A (en) | 2018-05-30 | 2018-05-30 | A kind of information processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108881407A true CN108881407A (en) | 2018-11-23 |
Family
ID=64336201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810542924.2A Pending CN108881407A (en) | 2018-05-30 | 2018-05-30 | A kind of information processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108881407A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110716985A (en) * | 2019-10-16 | 2020-01-21 | 北京小米移动软件有限公司 | Node information processing method, device and medium |
CN118713976A (en) * | 2024-08-26 | 2024-09-27 | 天翼视联科技有限公司 | Device management method, device, electronic device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105357069A (en) * | 2015-11-04 | 2016-02-24 | 浪潮(北京)电子信息产业有限公司 | Distributed node service state monitoring method, device and system |
CN106161626A (en) * | 2016-07-13 | 2016-11-23 | 上海斐讯数据通信技术有限公司 | A kind of cloud terminal management system and method |
CN107294799A (en) * | 2016-03-31 | 2017-10-24 | 阿里巴巴集团控股有限公司 | A kind for the treatment of method and apparatus of distributed system interior joint |
US20170339005A1 (en) * | 2015-02-10 | 2017-11-23 | Huawei Technologies Co., Ltd. | Method and Device for Processing Failure in at Least One Distributed Cluster, and System |
-
2018
- 2018-05-30 CN CN201810542924.2A patent/CN108881407A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170339005A1 (en) * | 2015-02-10 | 2017-11-23 | Huawei Technologies Co., Ltd. | Method and Device for Processing Failure in at Least One Distributed Cluster, and System |
CN105357069A (en) * | 2015-11-04 | 2016-02-24 | 浪潮(北京)电子信息产业有限公司 | Distributed node service state monitoring method, device and system |
CN107294799A (en) * | 2016-03-31 | 2017-10-24 | 阿里巴巴集团控股有限公司 | A kind for the treatment of method and apparatus of distributed system interior joint |
CN106161626A (en) * | 2016-07-13 | 2016-11-23 | 上海斐讯数据通信技术有限公司 | A kind of cloud terminal management system and method |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110716985A (en) * | 2019-10-16 | 2020-01-21 | 北京小米移动软件有限公司 | Node information processing method, device and medium |
CN118713976A (en) * | 2024-08-26 | 2024-09-27 | 天翼视联科技有限公司 | Device management method, device, electronic device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10764132B2 (en) | Scale-out association method and apparatus, and system | |
CN109669762B (en) | Cloud computing resource management method, device, equipment and computer readable storage medium | |
US20170195282A1 (en) | Address Processing Method, Related Device, and System | |
CN106817432B (en) | Method, system and equipment for elastically stretching virtual resources in cloud computing environment | |
WO2018121334A1 (en) | Web application service providing method, apparatus, electronic device and system | |
WO2017114397A1 (en) | Method, device and system for realizing heartbeat mechanism | |
CN106936623A (en) | The management method of distributed cache system and cache cluster | |
CN105933407A (en) | Method and system for achieving high availability of Redis cluster | |
CN106161076A (en) | Virtual network function extended method and device | |
CN112492574B (en) | Load migration method, device and system | |
WO2021109750A1 (en) | Node management method, device and apparatus, storage medium, and system | |
CN105847352B (en) | Expansion method, device and distributed cache system based on distributed cache system | |
CN110445884A (en) | A kind of container IP address management method and device | |
CN107566470B (en) | Method and device for managing virtual machine in cloud data system | |
CN108881407A (en) | A kind of information processing method and device | |
US10951732B2 (en) | Service processing method and device | |
CN110798492B (en) | Data storage method and device and data processing system | |
CN107534678B (en) | Method, device and system for establishing connection between VNFM and VIM | |
US20180069768A1 (en) | Method and apparatus for establishing interface between vnfms, and system | |
JP5544521B2 (en) | State management method, processing device, and state management program | |
WO2019196926A1 (en) | Device slice processing method and apparatus, and computer readable storage medium | |
CN112422598A (en) | Resource scheduling method, intelligent front-end equipment, intelligent gateway and distributed system | |
CN107615872B (en) | A method, device and system for releasing connection | |
CN104869532B (en) | Group member management method and device | |
CN104038532B (en) | A distributed system interconnection method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181123 |
|
RJ01 | Rejection of invention patent application after publication |