CN111628879B - Service network realization method and device - Google Patents
Service network realization method and device Download PDFInfo
- Publication number
- CN111628879B CN111628879B CN201910146407.8A CN201910146407A CN111628879B CN 111628879 B CN111628879 B CN 111628879B CN 201910146407 A CN201910146407 A CN 201910146407A CN 111628879 B CN111628879 B CN 111628879B
- Authority
- CN
- China
- Prior art keywords
- service
- node
- management node
- network topology
- management
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 78
- 230000009286 beneficial effect Effects 0.000 abstract description 5
- 230000000694 effects Effects 0.000 abstract description 5
- 238000012790 confirmation Methods 0.000 description 28
- 238000013508 migration Methods 0.000 description 12
- 230000005012 migration Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000005540 biological transmission Effects 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 238000011084 recovery Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 239000000969 carrier Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种业务网络的实现方法和装置。所述方法包括:预先配置与各业务对应的网络拓扑并保存;接收第一业务节点发送的业务请求,根据所述业务请求所属的业务查找出对应的网络拓扑;根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。该技术方案可以应用于管理节点中,有益效果在于通过预先进行网络拓扑的配置,可以避免业务节点间互相询问,而是通过网络拓扑快速查找到保存有业务内容的目标业务节点,快速进行业务内容的传递,在流媒体服务等对等待时间有着强需求的业务场景下有着效果良好的应用。
The present invention discloses a method and device for implementing a service network. The method includes: pre-configuring and saving a network topology corresponding to each service; receiving a service request sent by a first service node, and finding the corresponding network topology according to the service to which the service request belongs; determining a second service node according to the found network topology and the service request, and notifying the second service node to send service content to the first service node. This technical solution can be applied to management nodes, and has the beneficial effect that by pre-configuring the network topology, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node where the service content is stored through the network topology, and quickly deliver the service content, which has a good effect in service scenarios such as streaming media services that have a strong demand for waiting time.
Description
技术领域Technical Field
本发明涉及计算机网络领域,具体涉及一种业务网络的实现方法和装置。The present invention relates to the field of computer networks, and in particular to a method and device for implementing a service network.
背景技术Background Art
在流媒体服务等场景下,用户往往分布在广阔的地域中,服务方需要通过不同的集群来向用户提供所需要观看的流媒体内容。集群中的各业务节点并不一定能够保存有用户所需的流媒体内容,因此在接收到用户的观看请求后,如果本业务节点没有相应的流媒体内容,就需要从其他业务节点来获取,如何进行业务内容的有效调度是着需要解决的问题。In scenarios such as streaming services, users are often distributed in a wide area, and the service provider needs to use different clusters to provide users with the streaming content they need to watch. Each service node in the cluster may not be able to store the streaming content required by the user. Therefore, after receiving the user's viewing request, if the service node does not have the corresponding streaming content, it needs to obtain it from other service nodes. How to effectively schedule the service content is a problem that needs to be solved.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种业务网络的实现方法和装置。In view of the above problems, the present invention is proposed to provide a method and device for implementing a service network that overcomes the above problems or at least partially solves the above problems.
依据本发明的一个方面,提供了一种业务网络的实现方法,包括:According to one aspect of the present invention, a method for implementing a service network is provided, comprising:
预先配置与各业务对应的网络拓扑并保存;Pre-configure and save the network topology corresponding to each business;
接收第一业务节点发送的业务请求,根据所述业务请求所属的业务查找出对应的网络拓扑;receiving a service request sent by a first service node, and finding a corresponding network topology according to the service to which the service request belongs;
根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。A second service node is determined according to the found network topology and the service request, and the second service node is notified to send service content to the first service node.
可选地,所述根据所述业务请求所属的业务查找出对应的网络拓扑包括:根据所述业务请求中的业务标识查找出对应的网络拓扑。Optionally, searching for a corresponding network topology according to the service to which the service request belongs includes: searching for a corresponding network topology according to a service identifier in the service request.
可选地,所述根据查找出的网络拓扑和所述业务请求确定第二业务节点包括:Optionally, determining the second service node according to the found network topology and the service request includes:
根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点;至少有一个保存有所述业务内容的业务节点注册在查找出的管理节点上;According to the service content identifier in the service request, a management node storing the service content identifier is searched in the network topology; at least one service node storing the service content is registered on the searched management node;
通知所述管理节点从保存有所述业务内容的业务节点中选出第二业务节点。The management node is notified to select a second service node from the service nodes storing the service content.
可选地,所述预先配置与各业务对应的网络拓扑并保存包括:Optionally, the pre-configuring and saving the network topology corresponding to each service includes:
接收在本管理节点注册的业务节点上报的业务内容标识;Receive the service content identifier reported by the service node registered at the management node;
根据所述业务内容标识确定目标管理节点,将本管理节点中保存有所述业务内容标识作为配置信息告知目标管理节点。The target management node is determined according to the service content identifier, and the service content identifier stored in the current management node is notified as configuration information to the target management node.
可选地,所述根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点包括:Optionally, searching for a management node storing the service content identifier in the network topology according to the service content identifier in the service request includes:
根据所述业务请求中的业务内容标识确定待询问的管理节点,向所述待询问的管理节点询问出保存有所述业务内容标识的管理节点。The management node to be queried is determined according to the service content identifier in the service request, and the management node to be queried is queried for the management node storing the service content identifier.
可选地,所述业务内容为流媒体。Optionally, the service content is streaming media.
依据本发明的另一方面,提供了一种业务网络实现装置,包括:According to another aspect of the present invention, a service network implementation device is provided, comprising:
网络拓扑单元,适于预先配置与各业务对应的网络拓扑并保存;以及适于接收第一业务节点发送的业务请求,根据所述业务请求所属的业务查找出对应的网络拓扑;A network topology unit, adapted to pre-configure and save network topologies corresponding to each service; and adapted to receive a service request sent by a first service node, and find out a corresponding network topology according to the service to which the service request belongs;
业务节点单元,适于根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。The service node unit is adapted to determine a second service node according to the found network topology and the service request, and notify the second service node to send service content to the first service node.
可选地,所述网络拓扑单元,适于根据所述业务请求中的业务标识查找出对应的网络拓扑。Optionally, the network topology unit is adapted to search for a corresponding network topology according to a service identifier in the service request.
可选地,所述业务节点单元,适于根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点;至少有一个保存有所述业务内容的业务节点注册在查找出的管理节点上;通知所述管理节点从保存有所述业务内容的业务节点中选出第二业务节点。Optionally, the service node unit is adapted to search for a management node storing the service content identifier in the network topology according to the service content identifier in the service request; at least one service node storing the service content is registered on the searched management node; and the management node is notified to select a second service node from the service nodes storing the service content.
可选地,所述网络拓扑单元,适于接收在本管理节点注册的业务节点上报的业务内容标识;根据所述业务内容标识确定目标管理节点,将本管理节点中保存有所述业务内容标识作为配置信息告知目标管理节点。Optionally, the network topology unit is adapted to receive a service content identifier reported by a service node registered with the current management node; determine a target management node according to the service content identifier, and inform the target management node that the service content identifier is stored in the current management node as configuration information.
可选地,所述网络拓扑单元,适于根据所述业务请求中的业务内容标识确定待询问的管理节点,向所述待询问的管理节点询问出保存有所述业务内容标识的管理节点。Optionally, the network topology unit is adapted to determine the management node to be queried according to the service content identifier in the service request, and query the management node to be queried for the management node storing the service content identifier.
可选地,所述业务内容为流媒体。Optionally, the service content is streaming media.
依据本发明的又一方面,提供了一种电子设备,包括:处理器;以及被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如上述任一所述的方法。According to another aspect of the present invention, there is provided an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above methods.
依据本发明的再一方面,提供了一种计算机可读存储介质,其中,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被处理器执行时,实现如上述任一所述的方法。According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the one or more programs implement any of the methods described above.
由上述可知,本发明的技术方案,通过构建业务网络,预先配置与各业务对应的网络拓扑并保存,在接收到第一业务节点发送的业务请求后,先根据业务请求所属的业务查找出对应的网络拓扑,再根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。该技术方案可以应用于管理节点中,有益效果在于通过预先进行网络拓扑的配置,可以避免业务节点间互相询问,而是通过网络拓扑快速查找到保存有业务内容的目标业务节点,快速进行业务内容的传递,在流媒体服务等对等待时间有着强需求的业务场景下有着效果良好的应用。As can be seen from the above, the technical solution of the present invention, by constructing a service network, pre-configuring and saving the network topology corresponding to each service, after receiving the service request sent by the first service node, first find out the corresponding network topology according to the service to which the service request belongs, and then determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node. This technical solution can be applied to management nodes, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content, which has a good effect in business scenarios such as streaming media services that have strong requirements for waiting time.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
图1示出了根据本发明一个实施例的一种业务网络的实现方法的流程示意图;FIG1 is a schematic diagram showing a flow chart of a method for implementing a service network according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的一种业务网络的实现装置的结构示意图;FIG2 shows a schematic diagram of the structure of a device for implementing a service network according to an embodiment of the present invention;
图3示出了根据本发明一个实施例的一种节点网络的结构示意图;FIG3 shows a schematic diagram of the structure of a node network according to an embodiment of the present invention;
图4示出了根据本发明一个实施例的电子设备的结构示意图;FIG4 is a schematic diagram showing the structure of an electronic device according to an embodiment of the present invention;
图5示出了根据本发明一个实施例的计算机可读存储介质的结构示意图。FIG. 5 is a schematic diagram showing the structure of a computer-readable storage medium according to an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
图1示出了根据本发明一个实施例的一种业务网络的实现方法的流程示意图。如图1所示,该方法包括:Fig. 1 is a schematic diagram showing a flow chart of a method for implementing a service network according to an embodiment of the present invention. As shown in Fig. 1, the method includes:
步骤S110,预先配置与各业务对应的网络拓扑并保存。Step S110: pre-configure and save the network topology corresponding to each service.
该方法可以应用于管理各业务节点的管理节点中,其中,业务节点可以实现单一业务,也可以实现多个业务,一个管理节点可以管理单一业务相关的业务节点,也可以管理多个业务相关的业务节点。The method can be applied to a management node that manages each service node, wherein a service node can implement a single service or multiple services, and a management node can manage service nodes related to a single service or multiple services.
步骤S120,接收第一业务节点发送的业务请求,根据业务请求所属的业务查找出对应的网络拓扑。Step S120: receiving a service request sent by the first service node, and finding out a corresponding network topology according to the service to which the service request belongs.
例如,用户观看直播,则向第一业务节点发送的是观看需求,如果第一业务节点上没有相应主播的直播流,则第一节点可以向上面的管理节点发送业务请求,即请求相应主播的直播流。而管理节点则第一步先确定直播业务的网络拓扑(即实现直播的各业务节点构成的网络拓扑)。For example, when a user wants to watch a live broadcast, the user sends a viewing request to the first service node. If the first service node does not have the corresponding live broadcast stream of the host, the first node can send a service request to the management node above, that is, request the live broadcast stream of the corresponding host. The management node first determines the network topology of the live broadcast service (that is, the network topology composed of the service nodes that implement the live broadcast).
步骤S130,根据查找出的网络拓扑和业务请求确定第二业务节点,通知第二业务节点向第一业务节点发送业务内容。Step S130: determine the second service node according to the found network topology and service request, and notify the second service node to send service content to the first service node.
例如,通过查找出的网络拓扑和业务请求确定了第二业务节点上保存有相应主播的直播流,则通知第二业务节点将该直播流发送给第一业务节点。For example, if it is determined through the found network topology and service request that the live stream of the corresponding anchor is stored on the second service node, the second service node is notified to send the live stream to the first service node.
可见,图1所示的方法,通过构建业务网络,预先配置与各业务对应的网络拓扑并保存,在接收到第一业务节点发送的业务请求后,先根据业务请求所属的业务查找出对应的网络拓扑,再根据查找出的网络拓扑和业务请求确定第二业务节点,通知第二业务节点向第一业务节点发送业务内容。该技术方案可以应用于管理节点中,有益效果在于通过预先进行网络拓扑的配置,可以避免业务节点间互相询问,而是通过网络拓扑快速查找到保存有业务内容的目标业务节点,快速进行业务内容的传递,在流媒体服务等对等待时间有着强需求的业务场景下有着效果良好的应用。It can be seen that the method shown in Figure 1 constructs a business network, pre-configures and saves the network topology corresponding to each business, and after receiving the business request sent by the first business node, first finds the corresponding network topology according to the business to which the business request belongs, and then determines the second business node according to the found network topology and the business request, and notifies the second business node to send the business content to the first business node. This technical solution can be applied to management nodes. The beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between business nodes, and instead quickly find the target business node that stores the business content through the network topology, and quickly deliver the business content. It has a good application effect in business scenarios such as streaming media services that have strong requirements for waiting time.
本发明的一个实施例中,上述方法中,根据业务请求所属的业务查找出对应的网络拓扑包括:根据业务请求中的业务标识查找出对应的网络拓扑。In one embodiment of the present invention, in the above method, finding out the corresponding network topology according to the service to which the service request belongs includes: finding out the corresponding network topology according to the service identifier in the service request.
例如,为直播、回放等业务分配不同的业务标识,在发送的业务请求中携带相应的业务标识,以便管理节点根据业务标识查找出对应的网络拓扑。For example, different service identifiers are allocated to services such as live broadcast and playback, and the corresponding service identifiers are carried in the service requests sent, so that the management node can find the corresponding network topology according to the service identifiers.
本发明的一个实施例中,上述方法中,根据查找出的网络拓扑和业务请求确定第二业务节点包括:根据业务请求中的业务内容标识在网络拓扑中查找出保存有业务内容标识的管理节点;至少有一个保存有业务内容的业务节点注册在查找出的管理节点上;通知管理节点从保存有业务内容的业务节点中选出第二业务节点。In one embodiment of the present invention, in the above method, determining the second service node based on the found network topology and service request includes: finding a management node storing a service content identifier in the network topology based on the service content identifier in the service request; registering at least one service node storing the service content on the found management node; and notifying the management node to select a second service node from the service nodes storing the service content.
其中,业务标识是用于识别业务类型,而业务内容标识则用于区分例如不同主播的直播流之类的不同业务内容。在具体实现上,可以通过多个管理节点的互相配合来进行第二业务节点的选择。一种情况下,业务节点向管理节点请求业务内容,如果该管理节点上注册的其他业务节点中有相应的业务内容,则从保存有业务内容的业务节点中选出第二业务节点即可。如果该管理节点上注册的其他业务节点中也没有相应的业务内容,则根据业务请求中的业务内容标识在网络拓扑中查找出保存有业务内容标识的管理节点,这也就意味着,该查找出的管理节点上至少注册有一个保存有业务内容的业务节点,然后通知该查找出的管理节点从保存有业务内容的业务节点中选出第二业务节点。Among them, the service identifier is used to identify the service type, and the service content identifier is used to distinguish different service contents such as live streams of different anchors. In specific implementation, the selection of the second service node can be carried out through the cooperation of multiple management nodes. In one case, the service node requests service content from the management node. If there is corresponding service content in other service nodes registered on the management node, the second service node can be selected from the service nodes storing the service content. If there is no corresponding service content in other service nodes registered on the management node, the management node storing the service content identifier is found in the network topology according to the service content identifier in the service request. This means that at least one service node storing the service content is registered on the found management node, and then the found management node is notified to select the second service node from the service nodes storing the service content.
本发明的一个实施例中,上述方法中,预先配置与各业务对应的网络拓扑并保存包括:接收在本管理节点注册的业务节点上报的业务内容标识;根据业务内容标识确定目标管理节点,将本管理节点中保存有业务内容标识作为配置信息告知目标管理节点。In one embodiment of the present invention, in the above method, pre-configuring and saving the network topology corresponding to each service includes: receiving the service content identifier reported by the service node registered in the current management node; determining the target management node according to the service content identifier, and informing the target management node of the service content identifier saved in the current management node as configuration information.
参照上述内容可以确定在业务节点刚收到业务内容时,管理节点是如何通过业务节点上报的内容进行管理的。具体来说,可以由本管理节点注册的业务节点上报业务内容标识,然后通过哈希运算等方式,计算得到一个目标管理节点,然后告知目标管理节点,本管理节点中保存有业务内容标识。By referring to the above content, it can be determined how the management node manages the content reported by the business node when the business node just receives the business content. Specifically, the business node registered by the management node can report the business content identifier, and then calculate a target management node through hash operation and other methods, and then inform the target management node that the business content identifier is stored in the management node.
在一个具体例子中,管理节点1上的业务节点2有一路直播流36012345678(业务内容标识),则通过对其进行哈希运算确定了管理节点3是目标管理节点,将管理节点1上保存有36012345678作为配置信息告知管理节点3。In a specific example, business node 2 on management node 1 has a live stream 36012345678 (business content identifier), and management node 3 is determined to be the target management node by performing a hash operation on it, and management node 3 is informed that 36012345678 is saved on management node 1 as configuration information.
本发明的一个实施例中,上述方法中,根据业务请求中的业务内容标识在网络拓扑中查找出保存有业务内容标识的管理节点包括:根据业务请求中的业务内容标识确定待询问的管理节点,向待询问的管理节点询问出保存有业务内容标识的管理节点。In one embodiment of the present invention, in the above method, searching for a management node storing a business content identifier in the network topology according to the business content identifier in the business request includes: determining a management node to be queried according to the business content identifier in the business request, and inquiring the management node to be queried for the management node storing the business content identifier.
结合上例,当管理节点4上的业务节点5向其请求直播流36012345678时,由于管理节点4上的业务节点都没有这一路直播流,则根据哈希运算,同样可以确定管理节点3是目标管理节点,则向管理节点3询问得到直播流36012345678的业务内容标识保存在管理节点1上,则管理节点4向管理节点1请求该路直播流,就能够使得管理节点1分配一个业务节点如业务节点2,将直播流推送给业务节点5。上述过程描述了一个推拉流的过程,在本发明的一个实施例中,上述方法中,业务内容为流媒体。而其他业务内容的传输可以参照实施,在此不再一一介绍了。Combined with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678, since none of the service nodes on the management node 4 has this live stream, then according to the hash operation, it can also be determined that the management node 3 is the target management node, and the service content identifier of the live stream 36012345678 is stored on the management node 1 after being inquired from the management node 3. Then the management node 4 requests the live stream from the management node 1, so that the management node 1 can allocate a service node such as service node 2 to push the live stream to the service node 5. The above process describes a process of pushing and pulling streams. In one embodiment of the present invention, in the above method, the service content is streaming media. The transmission of other service contents can be implemented with reference, and will not be introduced one by one here.
考虑管理节点的增加和减少的情况,其中减少的情况可以是宕机并没有其他可用管理节点补充,或者根据业务需求主动缩减管理节点数量。则执行流程上与前面类似,要重新计算保存有业务内容标识的管理节点,例如进行流迁移;业务节点上的流量进行调度,等等。Consider the increase and decrease of management nodes. The decrease can be due to downtime and no other available management nodes, or the number of management nodes can be reduced according to business needs. The execution process is similar to the previous one. The management nodes with business content identifiers need to be recalculated, such as flow migration, traffic scheduling on business nodes, etc.
各管理节点和业务节点形成的节点网络,如果考虑容灾,为了避免管理节点宕机影响使用,可以为每个管理节点配置一个备用节点,形成了主从架构,但是存在单点问题,为此本发明的实施例还提供了一种业务节点管理的方法,同样可以应用于管理节点中。The node network formed by each management node and business node, if disaster recovery is considered, in order to avoid the impact of management node failure on usage, a backup node can be configured for each management node, forming a master-slave architecture, but there is a single point problem. For this reason, an embodiment of the present invention also provides a method for business node management, which can also be applied to management nodes.
具体地,先接收业务节点发送的管理节点确认请求。其中,管理节点可以管理在其上注册的业务节点的机器状态、存储的数据、业务信息等。例如,在直播场景下,管理节点可以管理在其上注册的各节点的直播流信息。在一个具体的实施例中,管理节点有多个,管理节点的确认并不等同于管理节点的注册,而是先一步确定要在哪个管理节点上进行注册,这样就基本上可以得到一个可靠的管理节点。Specifically, a management node confirmation request sent by a business node is first received. The management node can manage the machine status, stored data, business information, etc. of the business nodes registered on it. For example, in a live broadcast scenario, the management node can manage the live broadcast stream information of each node registered on it. In a specific embodiment, there are multiple management nodes, and the confirmation of the management node is not equivalent to the registration of the management node, but it is determined in advance which management node to register on, so that a reliable management node can basically be obtained.
其次,根据管理节点确认请求,向业务节点返回与指定管理节点对应的管理节点信息,以使业务节点在指定管理节点上进行注册。具体确认可靠管理节点的实现方式很多,例如维护一个可靠管理节点的表,实时根据各管理节点的状态进行更新,再从中依据空闲状态等参数确定一台具体的管理节点作为指定管理节点等等。业务节点在指定管理节点上注册后就可以上报相应信息实现管理了。Secondly, according to the management node confirmation request, the management node information corresponding to the designated management node is returned to the business node, so that the business node can be registered on the designated management node. There are many ways to confirm reliable management nodes, such as maintaining a table of reliable management nodes, updating it in real time according to the status of each management node, and then determining a specific management node as the designated management node based on parameters such as idle status, etc. After the business node is registered on the designated management node, it can report the corresponding information to achieve management.
可见,上述方法,在接收业务节点发送的管理节点确认请求后,根据管理节点确认请求,向业务节点返回与指定管理节点对应的管理节点信息,以使业务节点在指定管理节点上进行注册。其中,管理节点可以管理在其上注册的业务节点的机器状态、存储的数据、业务信息;而注册过程又分为两步,先确认业务节点需要在哪个管理节点上注册,再由业务节点注册到相应的管理节点上,这样即使注册的管理节点宕机,也可以再重新通过第一步过程确认得到一个新的可用管理节点进行注册,实现了业务节点的妥善管理,并且不必需为每个管理节点都配备一个从节点,在资源的利用率上得到了提升。It can be seen that the above method, after receiving the management node confirmation request sent by the business node, returns the management node information corresponding to the designated management node to the business node according to the management node confirmation request, so that the business node is registered on the designated management node. Among them, the management node can manage the machine status, stored data, and business information of the business nodes registered on it; and the registration process is divided into two steps, first confirming which management node the business node needs to register on, and then the business node registers to the corresponding management node. In this way, even if the registered management node is down, it can be re-confirmed through the first step to obtain a new available management node for registration, which realizes the proper management of the business node, and it is not necessary to equip each management node with a slave node, which improves the utilization of resources.
在本发明的一个实施例中,上述方法中,管理节点确认请求是业务节点在初次上线时发送的;和/或,管理节点确认请求是业务节点在与已注册的管理节点断开连接时。In one embodiment of the present invention, in the above method, the management node confirmation request is sent by the service node when it first comes online; and/or, the management node confirmation request is sent by the service node when it disconnects from a registered management node.
在一个具体的实施例中,业务节点在初次上线时可以根据预先的配置信息确定向哪个管理节点发送管理节点确认请求。其中为了容灾考虑可以按优先级配置为各个业务节点两个或更多个管理节点。例如业务节点1默认向管理节点2发送管理节点确认请求,如果未能成功通信则向管理节点3发送管理节点确认请求。如果能够获得与指定管理节点对应的管理节点信息,就进行注册流程,例如在管理节点4上进行注册。当与管理节点4的连接断开时,就重新向管理节点2或管理节点3(流程与前文类似)发送管理节点确认请求,例如得到新的指定管理节点为管理节点5,则在管理节点5上进行注册。In a specific embodiment, when a business node first goes online, it can determine to which management node to send a management node confirmation request based on pre-configuration information. For disaster recovery considerations, two or more management nodes can be configured for each business node according to priority. For example, business node 1 sends a management node confirmation request to management node 2 by default, and if communication fails, it sends a management node confirmation request to management node 3. If the management node information corresponding to the designated management node can be obtained, the registration process is performed, such as registering on management node 4. When the connection with management node 4 is disconnected, a management node confirmation request is resent to management node 2 or management node 3 (the process is similar to the previous text). For example, if the new designated management node is management node 5, registration is performed on management node 5.
这里如果管理节点4恢复正常,则管理节点5可以通过与业务节点1断开连接,使其重新进行注册,从而注册到管理节点4上。类似地各管理节点还需要进行业务节点的迁移。Here, if the management node 4 recovers to normal, the management node 5 can be disconnected from the service node 1 to re-register, thereby registering with the management node 4. Similarly, each management node also needs to migrate the service node.
在本发明的一个实施例中,上述方法中,该方法还包括:与若干个管理节点建立连接,形成管理节点网络;向业务节点返回与指定管理节点对应的管理节点信息包括:根据管理节点网络确定一个管理节点作为指定管理节点。In one embodiment of the present invention, in the above method, the method also includes: establishing connections with several management nodes to form a management node network; returning management node information corresponding to the designated management node to the business node includes: determining a management node as the designated management node based on the management node network.
具体地,管理节点网络中的各管理节点可以与管理节点网络中的其他管理节点进行连接,例如构成一致性哈希环。Specifically, each management node in the management node network may be connected to other management nodes in the management node network, for example, to form a consistent hash ring.
在本发明的一个实施例中,上述方法中,管理节点请求中包括管理节点标签;根据管理节点网络确定一个管理节点作为指定管理节点包括:判断管理节点标签对应的管理节点是否可用,是则将管理节点标签对应的管理节点作为指定管理节点。In one embodiment of the present invention, in the above method, the management node request includes a management node label; determining a management node as a designated management node based on the management node network includes: judging whether the management node corresponding to the management node label is available, and if so, using the management node corresponding to the management node label as the designated management node.
其中,当管理节点宕机时可以从管理节点网络中排除,即判断理节点标签对应的管理节点是否可用可以简化为判断理节点标签对应的管理节点是否在管理节点网络中。具体地,各业务节点可以被配置有若干个管理节点,例如网络传输更优、效率更高的管理节点,如果这些管理节点可用,则优先选择这样的管理节点,因此可以事先保存为管理节点标签。Among them, when the management node is down, it can be excluded from the management node network, that is, judging whether the management node corresponding to the management node label is available can be simplified to judging whether the management node corresponding to the management node label is in the management node network. Specifically, each service node can be configured with several management nodes, such as management nodes with better network transmission and higher efficiency. If these management nodes are available, such management nodes are preferred, so they can be saved as management node labels in advance.
在本发明的一个实施例中,上述方法中,根据管理节点网络确定一个管理节点作为指定管理节点还包括:若管理节点标签对应的管理节点不可用,则选取一个与业务节点处于同一集群的管理节点作为指定管理节点。In one embodiment of the present invention, in the above method, determining a management node as the designated management node based on the management node network also includes: if the management node corresponding to the management node label is unavailable, selecting a management node in the same cluster as the business node as the designated management node.
这里是考虑了管理节点标签对应的管理节点不可用,即不能够在其上进行注册的情况,为了保证效率(例如数据传输效率),选取一个与业务节点处于同一集群的管理节点作为指定管理节点,使得管理节点在管理业务节点的状态产生的延时相对更小。Here, the situation that the management node corresponding to the management node label is unavailable, that is, registration cannot be performed on it, is considered. In order to ensure efficiency (such as data transmission efficiency), a management node in the same cluster as the business node is selected as the designated management node, so that the delay caused by the management node in managing the state of the business node is relatively smaller.
在本发明的一个实施例中,上述方法中,根据管理节点网络确定一个管理节点作为指定管理节点还包括:若不存在与业务节点处于同一集群的管理节点,则根据管理节点网络中的管理节点数据进行哈希计算,根据计算结果确定指定管理节点。例如前文所述的各管理节点构成一致性哈希环的情况下,就可以根据各管理节点的机器序列号等唯一标识通过哈希计算确定指定管理节点。In one embodiment of the present invention, in the above method, determining a management node as a designated management node based on the management node network further includes: if there is no management node in the same cluster as the service node, performing a hash calculation based on the management node data in the management node network, and determining the designated management node based on the calculation result. For example, in the case where the management nodes described above form a consistent hash ring, the designated management node can be determined by hash calculation based on the unique identifier such as the machine serial number of each management node.
在本发明的一个实施例中,上述方法中,根据管理节点网络确定一个管理节点作为指定管理节点包括:将业务节点原注册的管理节点的备份管理节点作为指定管理节点。In one embodiment of the present invention, in the above method, determining a management node as the designated management node according to the management node network includes: using a backup management node of the management node originally registered by the service node as the designated management node.
这种情况下则是将单点主从与管理节点网络进行了结合,能够进一步更快速地在管理节点宕机时上线新的管理节点。In this case, the single-point master-slave is combined with the management node network, which can further and more quickly launch a new management node when the management node goes down.
在本发明的一个实施例中,上述方法中,与若干个管理节点建立连接,形成管理节点网络包括:根据预先配置的管理节点地址,与各管理节点分别建立连接;记录连接的各管理节点的状态。In one embodiment of the present invention, in the above method, establishing connections with several management nodes to form a management node network includes: establishing connections with each management node respectively according to a pre-configured management node address; and recording the status of each connected management node.
管理节点可以通过状态机的方式记录其他管理节点的状态,例如在线、下线、宕机等等。The management node can record the status of other management nodes through the state machine, such as online, offline, downtime, etc.
在本发明的一个实施例中,上述方法中,记录连接的各管理节点的状态包括:与连接的各管理节点互相发送心跳信息,根据各管理节点的发送的心跳信息确定各管理节点的状态。具体地,在本发明的一个实施例中,上述方法中,心跳信息中包含本管理节点中记录的其他管理节点的状态信息;根据各管理节点的发送的心跳信息确定各管理节点的状态包括:当本管理节点中记录的一个管理节点处于第一状态时,若一个周期内接收到的记录该管理节点处于第一状态的状态信息的数量或比例达到相应的预设值,则通知管理节点网络中的其他管理节点执行与切换第二状态对应的操作,当操作完成后,记录该管理节点处于第二状态。In one embodiment of the present invention, in the above method, recording the status of each connected management node includes: sending heartbeat information to each other with each connected management node, and determining the status of each management node based on the heartbeat information sent by each management node. Specifically, in one embodiment of the present invention, in the above method, the heartbeat information includes the status information of other management nodes recorded in the present management node; determining the status of each management node based on the heartbeat information sent by each management node includes: when a management node recorded in the present management node is in a first state, if the number or proportion of status information recorded that the management node is in the first state received within a cycle reaches a corresponding preset value, then notifying other management nodes in the management node network to perform an operation corresponding to switching to the second state, and when the operation is completed, recording that the management node is in the second state.
当管理节点启动后就根据配置的其他的管理节点的地址,与各管理节点建立连接,互相发送心跳信息。When the management node is started, it establishes connections with other management nodes according to the configured addresses of other management nodes and sends heartbeat information to each other.
在一个具体的实施例中,管理节点1在启动后(即上线)向管理节点2、管理节点3、管理节点4发送了连接请求,管理节点2、管理节点3、管理节点4在收到连接请求时将管理节点1记录为初始状态,当通过连接接收到心跳信息后则将管理节点1记录为在线状态。在互相发送心跳时也携带有自己记录的管理节点1的状态信息,这样管理节点2就会接收到管理节点1、管理节点3和管理节点4发送的管理节点1的状态信息,当其中记录管理节点1为在线状态的状态信息的数量或者比例达到了预设值,则通知管理节点1、管理节点3和管理节点4上线了一台新的管理节点即管理节点1,然后可以执行迁移,例如断开与一部分业务节点的连接,使其注册到管理节点1上。迁移时可以先使用旧环,再创建新环。迁移完成后依然询问其他的管理节点,如果认为迁移完成的管理节点的数量或者比例达到预设值,则将管理节点1的状态置为可用,继续通过心跳进行通知。迁移完成后旧环删除,通过新环提供服务。In a specific embodiment, after the management node 1 is started (i.e., online), it sends a connection request to the management node 2, the management node 3, and the management node 4. When the management node 2, the management node 3, and the management node 4 receive the connection request, the management node 1 is recorded as the initial state, and the management node 1 is recorded as the online state after the heartbeat information is received through the connection. When sending heartbeats to each other, the state information of the management node 1 recorded by itself is also carried, so that the management node 2 will receive the state information of the management node 1 sent by the management node 1, the management node 3, and the management node 4. When the number or proportion of the state information recording the online state of the management node 1 reaches a preset value, the management node 1, the management node 3, and the management node 4 are notified that a new management node, i.e., the management node 1, is online, and then migration can be performed, for example, disconnecting from a part of the service nodes so that they are registered with the management node 1. When migrating, the old ring can be used first, and then a new ring can be created. After the migration is completed, other management nodes are still asked. If it is considered that the number or proportion of the management nodes that have completed the migration reaches the preset value, the state of the management node 1 is set to available, and the notification through the heartbeat continues. After the migration is complete, the old ring is deleted and services are provided through the new ring.
在本发明的一个实施例中,上述方法中,当第一状态为在线状态时,第二状态为可用状态;当第一状态为离线状态时,第二状态为宕机状态;执行与切换第二状态对应的操作包括:对业务节点进行迁移。In one embodiment of the present invention, in the above method, when the first state is an online state, the second state is an available state; when the first state is an offline state, the second state is a downtime state; executing an operation corresponding to switching the second state includes: migrating the business node.
与前文给出的例子相似,当一个管理节点认为另外一个状态原本为可用的管理节点心跳超时时,记录该心跳超时的管理节点下线,并进一步通过与其他管理节点的心跳信息确定该心跳超时的管理节点的状态,如果一个周期内接收到的记录该心跳超时的管理节点处于离线的状态信息的数量或比例达到相应的预设值,则通知其他管理节点,该心跳超时的管理节点宕机,进行业务节点迁移。Similar to the example given above, when a management node believes that the heartbeat of another management node that was originally available has timed out, it records that the management node with the timed out heartbeat is offline, and further determines the status of the management node with the timed out heartbeat through heartbeat information with other management nodes. If the number or proportion of status information recorded as the offline management node with the timed out heartbeat received within a cycle reaches the corresponding preset value, the other management nodes are notified that the management node with the timed out heartbeat is down, and the business node migration is performed.
在本发明的一个实施例中,上述方法中,该方法还包括:接收在本管理节点注册的业务节点上报的业务节点信息;业务节点信息包括:业务节点的状态信息和/或业务信息。In one embodiment of the present invention, in the above method, the method further includes: receiving service node information reported by a service node registered at the management node; the service node information includes: status information and/or service information of the service node.
其中,业务节点的状态信息可以包括机器上的硬件资源消耗等信息,业务信息可以根据实际的业务需求来确定,如直播场景下可以是直播流的相关信息等。Among them, the status information of the business node may include information such as hardware resource consumption on the machine, and the business information can be determined according to actual business needs, such as related information of the live broadcast stream in a live broadcast scenario.
图2示出了根据本发明一个实施例的一种业务网络的实现装置的结构示意图。如图2所示,业务网络的实现装置200包括:Fig. 2 shows a schematic diagram of the structure of a device for implementing a service network according to an embodiment of the present invention. As shown in Fig. 2, the device 200 for implementing a service network includes:
网络拓扑单元210,适于预先配置与各业务对应的网络拓扑并保存;以及适于接收第一业务节点发送的业务请求,根据业务请求所属的业务查找出对应的网络拓扑。The network topology unit 210 is adapted to pre-configure and save the network topology corresponding to each service; and is adapted to receive a service request sent by the first service node, and find out the corresponding network topology according to the service to which the service request belongs.
该装置可以应用于管理各业务节点的管理节点中,其中,业务节点可以实现单一业务,也可以实现多个业务,一个管理节点可以管理单一业务相关的业务节点,也可以管理多个业务相关的业务节点。例如,用户观看直播,则向第一业务节点发送的是观看需求,如果第一业务节点上没有相应主播的直播流,则第一节点可以向上面的管理节点发送业务请求,即请求相应主播的直播流。而管理节点则第一步先确定直播业务的网络拓扑(即实现直播的各业务节点构成的网络拓扑)。The device can be applied to a management node that manages each service node, wherein a service node can implement a single service or multiple services, and a management node can manage service nodes related to a single service or multiple services. For example, when a user watches a live broadcast, a viewing demand is sent to the first service node. If there is no live broadcast stream of the corresponding anchor on the first service node, the first node can send a service request to the upper management node, that is, request the live broadcast stream of the corresponding anchor. The management node first determines the network topology of the live broadcast service (that is, the network topology composed of the service nodes that implement the live broadcast).
业务节点单元220,适于根据查找出的网络拓扑和业务请求确定第二业务节点,通知第二业务节点向第一业务节点发送业务内容。The service node unit 220 is adapted to determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node.
例如,通过查找出的网络拓扑和业务请求确定了第二业务节点上保存有相应主播的直播流,则通知第二业务节点将该直播流发送给第一业务节点。For example, if it is determined through the found network topology and service request that the live stream of the corresponding anchor is stored on the second service node, the second service node is notified to send the live stream to the first service node.
可见,图2所示的装置,通过构建业务网络,预先配置与各业务对应的网络拓扑并保存,在接收到第一业务节点发送的业务请求后,先根据业务请求所属的业务查找出对应的网络拓扑,再根据查找出的网络拓扑和业务请求确定第二业务节点,通知第二业务节点向第一业务节点发送业务内容。该技术方案可以应用于管理节点中,有益效果在于通过预先进行网络拓扑的配置,可以避免业务节点间互相询问,而是通过网络拓扑快速查找到保存有业务内容的目标业务节点,快速进行业务内容的传递,在流媒体服务等对等待时间有着强需求的业务场景下有着效果良好的应用。It can be seen that the device shown in Figure 2, by building a business network, pre-configures and saves the network topology corresponding to each business, and after receiving the business request sent by the first business node, first finds the corresponding network topology according to the business to which the business request belongs, and then determines the second business node according to the found network topology and the business request, and notifies the second business node to send the business content to the first business node. This technical solution can be applied to management nodes. The beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between business nodes, and instead quickly find the target business node that stores the business content through the network topology, and quickly deliver the business content. It has a good application effect in business scenarios such as streaming media services that have strong requirements for waiting time.
本发明的一个实施例中,上述装置中,网络拓扑单元210,适于根据业务请求中的业务标识查找出对应的网络拓扑。In one embodiment of the present invention, in the above-mentioned device, the network topology unit 210 is adapted to find out the corresponding network topology according to the service identifier in the service request.
例如,为直播、回放等业务分配不同的业务标识,在发送的业务请求中携带相应的业务标识,以便管理节点根据业务标识查找出对应的网络拓扑。For example, different service identifiers are allocated to services such as live broadcast and playback, and the corresponding service identifiers are carried in the service requests sent, so that the management node can find the corresponding network topology according to the service identifiers.
本发明的一个实施例中,上述装置中,业务节点单元220,适于根据业务请求中的业务内容标识在网络拓扑中查找出保存有业务内容标识的管理节点;至少有一个保存有业务内容的业务节点注册在查找出的管理节点上;通知管理节点从保存有业务内容的业务节点中选出第二业务节点。In one embodiment of the present invention, in the above-mentioned device, the service node unit 220 is suitable for finding a management node storing a service content identifier in the network topology according to the service content identifier in the service request; at least one service node storing the service content is registered on the found management node; and the management node is notified to select a second service node from the service nodes storing the service content.
其中,业务标识是用于识别业务类型,而业务内容标识则用于区分例如不同主播的直播流之类的不同业务内容。在具体实现上,可以通过多个管理节点的互相配合来进行第二业务节点的选择。一种情况下,业务节点向管理节点请求业务内容,如果该管理节点上注册的其他业务节点中有相应的业务内容,则从保存有业务内容的业务节点中选出第二业务节点即可。如果该管理节点上注册的其他业务节点中也没有相应的业务内容,则根据业务请求中的业务内容标识在网络拓扑中查找出保存有业务内容标识的管理节点,这也就意味着,该查找出的管理节点上至少注册有一个保存有业务内容的业务节点,然后通知该查找出的管理节点从保存有业务内容的业务节点中选出第二业务节点。Among them, the service identifier is used to identify the service type, and the service content identifier is used to distinguish different service contents such as live streams of different anchors. In specific implementation, the selection of the second service node can be carried out through the cooperation of multiple management nodes. In one case, the service node requests service content from the management node. If there is corresponding service content in other service nodes registered on the management node, the second service node can be selected from the service nodes storing the service content. If there is no corresponding service content in other service nodes registered on the management node, the management node storing the service content identifier is found in the network topology according to the service content identifier in the service request. This means that at least one service node storing the service content is registered on the found management node, and then the found management node is notified to select the second service node from the service nodes storing the service content.
本发明的一个实施例中,上述装置中,网络拓扑单元210,适于接收在本管理节点注册的业务节点上报的业务内容标识;根据业务内容标识确定目标管理节点,将本管理节点中保存有业务内容标识作为配置信息告知目标管理节点。In one embodiment of the present invention, in the above-mentioned device, the network topology unit 210 is suitable for receiving the service content identifier reported by the service node registered in the current management node; determining the target management node according to the service content identifier, and informing the target management node of the service content identifier stored in the current management node as configuration information.
参照上述内容可以确定在业务节点刚收到业务内容时,管理节点是如何通过业务节点上报的内容进行管理的。具体来说,可以由本管理节点注册的业务节点上报业务内容标识,然后通过哈希运算等方式,计算得到一个目标管理节点,然后告知目标管理节点,本管理节点中保存有业务内容标识。By referring to the above content, it can be determined how the management node manages the content reported by the business node when the business node just receives the business content. Specifically, the business node registered by the management node can report the business content identifier, and then calculate a target management node through hash operation and other methods, and then inform the target management node that the business content identifier is stored in the management node.
在一个具体例子中,管理节点1上的业务节点2有一路直播流36012345678(业务内容标识),则通过对其进行哈希运算确定了管理节点3是目标管理节点,将管理节点1上保存有36012345678作为配置信息告知管理节点3。In a specific example, business node 2 on management node 1 has a live stream 36012345678 (business content identifier), and management node 3 is determined to be the target management node by performing a hash operation on it, and management node 3 is informed that 36012345678 is saved on management node 1 as configuration information.
本发明的一个实施例中,上述装置中,网络拓扑单元210,适于根据业务请求中的业务内容标识确定待询问的管理节点,向待询问的管理节点询问出保存有业务内容标识的管理节点。In one embodiment of the present invention, in the above device, the network topology unit 210 is adapted to determine the management node to be queried according to the service content identifier in the service request, and query the management node to be queried for the management node storing the service content identifier.
结合上例,当管理节点4上的业务节点5向其请求直播流36012345678时,由于管理节点4上的业务节点都没有这一路直播流,则根据哈希运算,同样可以确定管理节点3是目标管理节点,则向管理节点3询问得到直播流36012345678的业务内容标识保存在管理节点1上,则管理节点4向管理节点1请求该路直播流,就能够使得管理节点1分配一个业务节点如业务节点2,将直播流推送给业务节点5。上述过程描述了一个推拉流的过程,在本发明的一个实施例中,上述装置中,业务内容为流媒体。而其他业务内容的传输可以参照实施,在此不再一一介绍了。Combined with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678, since none of the service nodes on the management node 4 has this live stream, then according to the hash operation, it can also be determined that the management node 3 is the target management node, and the service content identifier of the live stream 36012345678 is stored on the management node 1 after being inquired from the management node 3. Then the management node 4 requests the live stream from the management node 1, so that the management node 1 can allocate a service node such as service node 2 to push the live stream to the service node 5. The above process describes a process of pushing and pulling streams. In one embodiment of the present invention, in the above device, the service content is streaming media. The transmission of other service contents can be implemented with reference, and will not be introduced one by one here.
考虑管理节点的增加和减少的情况,其中减少的情况可以是宕机并没有其他可用管理节点补充,或者根据业务需求主动缩减管理节点数量。则执行流程上与前面类似,要重新计算保存有业务内容标识的管理节点,例如进行流迁移;业务节点上的流量进行调度,等等。Consider the increase and decrease of management nodes. The decrease can be due to downtime and no other available management nodes, or the number of management nodes can be reduced according to business needs. The execution process is similar to the previous one. The management nodes with business content identifiers need to be recalculated, such as flow migration, traffic scheduling on business nodes, etc.
各管理节点和业务节点形成的节点网络,如果考虑容灾,为了避免管理节点宕机影响使用,可以为每个管理节点配置一个备用节点,形成了主从架构,但是存在单点问题,为此本发明的实施例还提供了一种解决方法。The node network formed by each management node and business node, if disaster recovery is considered, in order to avoid the impact of management node failure on usage, a backup node can be configured for each management node, forming a master-slave architecture, but there is a single point problem. For this reason, an embodiment of the present invention also provides a solution.
在本发明的一个实施例中,上述装置还包括:接收单元,适于接收业务节点发送的管理节点确认请求。其中,管理节点可以管理在其上注册的业务节点的机器状态、存储的数据、业务信息等。例如,在直播场景下,管理节点可以管理在其上注册的各节点的直播流信息。In one embodiment of the present invention, the above-mentioned device further includes: a receiving unit, adapted to receive a management node confirmation request sent by a service node. The management node can manage the machine status, stored data, service information, etc. of the service nodes registered thereon. For example, in a live broadcast scenario, the management node can manage the live broadcast stream information of each node registered thereon.
在一个具体的实施例中,管理节点有多个,管理节点的确认并不等同于管理节点的注册,而是先一步确定要在哪个管理节点上进行注册,这样就基本上可以得到一个可靠的管理节点。In a specific embodiment, there are multiple management nodes, and the confirmation of the management node is not equivalent to the registration of the management node, but it is first determined on which management node to register, so that a reliable management node can be basically obtained.
管理节点确认单元,适于根据管理节点确认请求,向业务节点返回与指定管理节点对应的管理节点信息,以使业务节点在指定管理节点上进行注册。The management node confirmation unit is adapted to return the management node information corresponding to the designated management node to the service node according to the management node confirmation request, so that the service node is registered on the designated management node.
具体确认可靠管理节点的实现方式很多,例如维护一个可靠管理节点的表,实时根据各管理节点的状态进行更新,再从中依据空闲状态等参数确定一台具体的管理节点作为指定管理节点等等。业务节点在指定管理节点上注册后就可以上报相应信息实现管理了。There are many ways to confirm reliable management nodes, such as maintaining a table of reliable management nodes, updating in real time according to the status of each management node, and then determining a specific management node as the designated management node based on parameters such as idle status, etc. After the business node is registered on the designated management node, it can report the corresponding information to achieve management.
可见,上述装置在接收业务节点发送的管理节点确认请求后,根据管理节点确认请求,向业务节点返回与指定管理节点对应的管理节点信息,以使业务节点在指定管理节点上进行注册。其中,管理节点可以管理在其上注册的业务节点的机器状态、存储的数据、业务信息;而注册过程又分为两步,先确认业务节点需要在哪个管理节点上注册,再由业务节点注册到相应的管理节点上,这样即使注册的管理节点宕机,也可以再重新通过第一步过程确认得到一个新的可用管理节点进行注册,实现了业务节点的妥善管理,并且不必需为每个管理节点都配备一个从节点,在资源的利用率上得到了提升。It can be seen that after receiving the management node confirmation request sent by the business node, the above device returns the management node information corresponding to the designated management node to the business node according to the management node confirmation request, so that the business node can be registered on the designated management node. Among them, the management node can manage the machine status, stored data, and business information of the business nodes registered on it; and the registration process is divided into two steps, first confirming which management node the business node needs to register on, and then the business node registers on the corresponding management node. In this way, even if the registered management node is down, it can be re-confirmed through the first step to obtain a new available management node for registration, which realizes the proper management of the business node, and it is not necessary to equip each management node with a slave node, which improves the utilization of resources.
在本发明的一个实施例中,上述装置中,管理节点确认请求是业务节点在初次上线时发送的;和/或,管理节点确认请求是业务节点在与已注册的管理节点断开连接时。In one embodiment of the present invention, in the above device, the management node confirmation request is sent by the service node when it first comes online; and/or, the management node confirmation request is sent by the service node when it disconnects from a registered management node.
在一个具体的实施例中,业务节点在初次上线时可以根据预先的配置信息确定向哪个管理节点发送管理节点确认请求。其中为了容灾考虑可以按优先级配置为各个业务节点两个或更多个管理节点。例如业务节点1默认向管理节点2发送管理节点确认请求,如果未能成功通信则向管理节点3发送管理节点确认请求。如果能够获得与指定管理节点对应的管理节点信息,就进行注册流程,例如在管理节点4上进行注册。当与管理节点4的连接断开时,就重新向管理节点2或管理节点3(流程与前文类似)发送管理节点确认请求,例如得到新的指定管理节点为管理节点5,则在管理节点5上进行注册。In a specific embodiment, when a business node first goes online, it can determine to which management node to send a management node confirmation request based on pre-configuration information. For disaster recovery considerations, two or more management nodes can be configured for each business node according to priority. For example, business node 1 sends a management node confirmation request to management node 2 by default, and if communication fails, it sends a management node confirmation request to management node 3. If the management node information corresponding to the designated management node can be obtained, the registration process is performed, such as registering on management node 4. When the connection with management node 4 is disconnected, a management node confirmation request is resent to management node 2 or management node 3 (the process is similar to the previous text). For example, if the new designated management node is management node 5, registration is performed on management node 5.
这里如果管理节点4恢复正常,则管理节点5可以通过与业务节点1断开连接,使其重新进行注册,从而注册到管理节点4上。类似地各管理节点还需要进行业务节点的迁移。Here, if the management node 4 recovers to normal, the management node 5 can be disconnected from the service node 1 to re-register, thereby registering with the management node 4. Similarly, each management node also needs to migrate the service node.
在本发明的一个实施例中,上述装置中,该装置还包括:管理节点网络单元,适于与若干个管理节点建立连接,形成管理节点网络;管理节点确认单元,适于根据管理节点网络确定一个管理节点作为指定管理节点。In one embodiment of the present invention, in the above-mentioned device, the device also includes: a management node network unit, suitable for establishing a connection with several management nodes to form a management node network; a management node confirmation unit, suitable for determining a management node as a designated management node based on the management node network.
具体地,管理节点网络中的各管理节点可以与管理节点网络中的其他管理节点进行连接,例如构成一致性哈希环。Specifically, each management node in the management node network may be connected to other management nodes in the management node network, for example, to form a consistent hash ring.
在本发明的一个实施例中,上述装置中,管理节点请求中包括管理节点标签;管理节点确认单元,适于判断管理节点标签对应的管理节点是否可用,是则将管理节点标签对应的管理节点作为指定管理节点。In one embodiment of the present invention, in the above-mentioned device, the management node request includes a management node label; the management node confirmation unit is suitable for determining whether the management node corresponding to the management node label is available, and if so, the management node corresponding to the management node label is used as the designated management node.
其中,当管理节点宕机时可以从管理节点网络中排除,即判断理节点标签对应的管理节点是否可用可以简化为判断理节点标签对应的管理节点是否在管理节点网络中。具体地,各业务节点可以被配置有若干个管理节点,例如网络传输更优、效率更高的管理节点,如果这些管理节点可用,则优先选择这样的管理节点,因此可以事先保存为管理节点标签。Among them, when the management node is down, it can be excluded from the management node network, that is, judging whether the management node corresponding to the management node label is available can be simplified to judging whether the management node corresponding to the management node label is in the management node network. Specifically, each service node can be configured with several management nodes, such as management nodes with better network transmission and higher efficiency. If these management nodes are available, such management nodes are preferred, so they can be saved as management node labels in advance.
在本发明的一个实施例中,上述装置中,管理节点确认单元,适于若管理节点标签对应的管理节点不可用,则选取一个与业务节点处于同一集群的管理节点作为指定管理节点。In one embodiment of the present invention, in the above device, the management node confirmation unit is adapted to select a management node in the same cluster as the service node as the designated management node if the management node corresponding to the management node label is unavailable.
这里是考虑了管理节点标签对应的管理节点不可用,即不能够在其上进行注册的情况,为了保证效率(例如数据传输效率),选取一个与业务节点处于同一集群的管理节点作为指定管理节点,使得管理节点在管理业务节点的状态产生的延时相对更小。Here, the situation that the management node corresponding to the management node label is unavailable, that is, registration cannot be performed on it, is considered. In order to ensure efficiency (such as data transmission efficiency), a management node in the same cluster as the business node is selected as the designated management node, so that the delay caused by the management node in managing the state of the business node is relatively smaller.
在本发明的一个实施例中,上述装置中,管理节点确认单元,适于若不存在与业务节点处于同一集群的管理节点,则根据管理节点网络中的管理节点数据进行哈希计算,根据计算结果确定指定管理节点。例如前文所述的各管理节点构成一致性哈希环的情况下,就可以根据各管理节点的机器序列号等唯一标识通过哈希计算确定指定管理节点。In one embodiment of the present invention, in the above-mentioned device, the management node confirmation unit is adapted to perform hash calculation based on the management node data in the management node network if there is no management node in the same cluster as the service node, and determine the designated management node based on the calculation result. For example, in the case where the management nodes described above form a consistent hash ring, the designated management node can be determined by hash calculation based on the unique identifier such as the machine serial number of each management node.
在本发明的一个实施例中,上述装置中,管理节点确认单元,适于将业务节点原注册的管理节点的备份管理节点作为指定管理节点。In one embodiment of the present invention, in the above-mentioned device, the management node confirmation unit is adapted to use the backup management node of the management node originally registered by the service node as the designated management node.
这种情况下则是将单点主从与管理节点网络进行了结合,能够进一步更快速地在管理节点宕机时上线新的管理节点。In this case, the single-point master-slave is combined with the management node network, which can further and more quickly launch a new management node when the management node goes down.
在本发明的一个实施例中,上述装置中,管理节点网络单元,适于根据预先配置的管理节点地址,与各管理节点分别建立连接;以及适于记录连接的各管理节点的状态。In one embodiment of the present invention, in the above-mentioned device, the management node network unit is adapted to establish connections with each management node respectively according to a pre-configured management node address; and is adapted to record the status of each connected management node.
管理节点可以通过状态机的方式记录其他管理节点的状态,例如在线、下线、宕机等等。The management node can record the status of other management nodes through the state machine, such as online, offline, downtime, etc.
在本发明的一个实施例中,上述装置中,管理节点网络单元,适于与连接的各管理节点互相发送心跳信息,根据各管理节点的发送的心跳信息确定各管理节点的状态。具体地,在本发明的一个实施例中,上述装置中,心跳信息中包含本管理节点中记录的其他管理节点的状态信息;管理节点网络单元,适于当本管理节点中记录的一个管理节点处于第一状态时,若一个周期内接收到的记录该管理节点处于第一状态的状态信息的数量或比例达到相应的预设值,则通知管理节点网络中的其他管理节点执行与切换第二状态对应的操作,当操作完成后,记录该管理节点处于第二状态。In one embodiment of the present invention, in the above-mentioned device, the management node network unit is suitable for sending heartbeat information to each connected management node, and determining the status of each management node based on the heartbeat information sent by each management node. Specifically, in one embodiment of the present invention, in the above-mentioned device, the heartbeat information includes the status information of other management nodes recorded in the present management node; the management node network unit is suitable for notifying other management nodes in the management node network to perform an operation corresponding to switching to the second state when a management node recorded in the present management node is in the first state, if the number or proportion of status information recorded that the management node is in the first state received within a cycle reaches a corresponding preset value, and when the operation is completed, record that the management node is in the second state.
当管理节点启动后就根据配置的其他的管理节点的地址,与各管理节点建立连接,互相发送心跳信息。When the management node is started, it establishes connections with other management nodes according to the configured addresses of other management nodes and sends heartbeat information to each other.
在一个具体的实施例中,管理节点1在启动后(即上线)向管理节点2、管理节点3、管理节点4发送了连接请求,管理节点2、管理节点3、管理节点4在收到连接请求时将管理节点1记录为初始状态,当通过连接接收到心跳信息后则将管理节点1记录为在线状态。在互相发送心跳时也携带有自己记录的管理节点1的状态信息,这样管理节点2就会接收到管理节点1、管理节点3和管理节点4发送的管理节点1的状态信息,当其中记录管理节点1为在线状态的状态信息的数量或者比例达到了预设值,则通知管理节点1、管理节点3和管理节点4上线了一台新的管理节点即管理节点1,然后可以执行迁移,例如断开与一部分业务节点的连接,使其注册到管理节点1上。迁移时可以先使用旧环,再创建新环。迁移完成后依然询问其他的管理节点,如果认为迁移完成的管理节点的数量或者比例达到预设值,则将管理节点1的状态置为可用,继续通过心跳进行通知。迁移完成后旧环删除,通过新环提供服务。In a specific embodiment, after the management node 1 is started (i.e., online), it sends a connection request to the management node 2, the management node 3, and the management node 4. When the management node 2, the management node 3, and the management node 4 receive the connection request, the management node 1 is recorded as the initial state, and the management node 1 is recorded as the online state after the heartbeat information is received through the connection. When sending heartbeats to each other, the state information of the management node 1 recorded by itself is also carried, so that the management node 2 will receive the state information of the management node 1 sent by the management node 1, the management node 3, and the management node 4. When the number or proportion of the state information recording the online state of the management node 1 reaches a preset value, the management node 1, the management node 3, and the management node 4 are notified that a new management node, i.e., the management node 1, is online, and then migration can be performed, for example, disconnecting from a part of the service nodes so that they are registered with the management node 1. When migrating, the old ring can be used first, and then a new ring can be created. After the migration is completed, other management nodes are still asked. If it is considered that the number or proportion of the management nodes that have completed the migration reaches the preset value, the state of the management node 1 is set to available, and the notification through the heartbeat continues. After the migration is complete, the old ring is deleted and services are provided through the new ring.
在本发明的一个实施例中,上述装置中,当第一状态为在线状态时,第二状态为可用状态;当第一状态为离线状态时,第二状态为宕机状态;管理节点网络单元,还适于对业务节点进行迁移。In one embodiment of the present invention, in the above-mentioned device, when the first state is an online state, the second state is an available state; when the first state is an offline state, the second state is a downtime state; the management node network unit is also suitable for migrating service nodes.
与前文给出的例子相似,当一个管理节点认为另外一个状态原本为可用的管理节点心跳超时时,记录该心跳超时的管理节点下线,并进一步通过与其他管理节点的心跳信息确定该心跳超时的管理节点的状态,如果一个周期内接收到的记录该心跳超时的管理节点处于离线的状态信息的数量或比例达到相应的预设值,则通知其他管理节点,该心跳超时的管理节点宕机,进行业务节点迁移。Similar to the example given above, when a management node believes that the heartbeat of another management node that was originally available has timed out, it records that the management node with the timed out heartbeat is offline, and further determines the status of the management node with the timed out heartbeat through heartbeat information with other management nodes. If the number or proportion of status information recorded as the offline management node with the timed out heartbeat received within a cycle reaches the corresponding preset value, the other management nodes are notified that the management node with the timed out heartbeat is down, and the business node migration is performed.
在本发明的一个实施例中,上述装置中,接收单元,还适于接收在本管理节点注册的业务节点上报的业务节点信息;业务节点信息包括:业务节点的状态信息和/或业务信息。In one embodiment of the present invention, in the above device, the receiving unit is further adapted to receive service node information reported by the service node registered with the management node; the service node information includes: status information and/or service information of the service node.
其中,业务节点的状态信息可以包括机器上的硬件资源消耗等信息,业务信息可以根据实际的业务需求来确定,如直播场景下可以是直播流的相关信息等。Among them, the status information of the business node may include information such as hardware resource consumption on the machine, and the business information can be determined according to actual business needs, such as related information of the live broadcast stream in a live broadcast scenario.
图3示出了根据本发明一个实施例的一种节点网络的结构示意图。如图3所示,节点网络300包括若干个业务节点320和若干个管理节点310,管理节点中部署有如上述中任一项的业务网络的实现装置200。Fig. 3 shows a schematic diagram of a node network structure according to an embodiment of the present invention. As shown in Fig. 3, the node network 300 includes a plurality of service nodes 320 and a plurality of management nodes 310, and the management nodes are deployed with a service network implementation device 200 as described above.
综上所述,本发明的技术方案,通过构建业务网络,预先配置与各业务对应的网络拓扑并保存,在接收到第一业务节点发送的业务请求后,先根据业务请求所属的业务查找出对应的网络拓扑,再根据查找出的网络拓扑和业务请求确定第二业务节点,通知第二业务节点向第一业务节点发送业务内容。该技术方案可以应用于管理节点中,有益效果在于通过预先进行网络拓扑的配置,可以避免业务节点间互相询问,而是通过网络拓扑快速查找到保存有业务内容的目标业务节点,快速进行业务内容的传递,在流媒体服务等对等待时间有着强需求的业务场景下有着效果良好的应用。In summary, the technical solution of the present invention, by constructing a service network, pre-configuring and saving the network topology corresponding to each service, after receiving the service request sent by the first service node, first find out the corresponding network topology according to the service to which the service request belongs, and then determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node. This technical solution can be applied to management nodes, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content, which has a good effect in service scenarios such as streaming media services that have strong requirements for waiting time.
各业务节点仍然可以划分集群,但是集群的界限不再明显,可以用于通过标签区分,方便更新升级、AB测试等等。通过上述实施例可以看出,集群间可以互相进行推拉流等业务内容的传输,在具体调度时上下行一路直播流等可以基本保证在一个集群,当然集群数量增减、切换流量等场景下也可能上下行不在一个集群。Each service node can still be divided into clusters, but the boundaries of the clusters are no longer obvious, and can be distinguished by labels to facilitate updates, upgrades, AB testing, etc. It can be seen from the above embodiments that clusters can transmit service content such as push and pull streams to each other. In specific scheduling, the uplink and downlink live streams can basically be guaranteed to be in one cluster. Of course, in scenarios such as the increase or decrease of the number of clusters and switching of traffic, the uplink and downlink may not be in one cluster.
需要说明的是:It should be noted that:
在此提供的算法和显示不与任何特定计算机、虚拟装置或者其它设备固有相关。各种通用装置也可以与基于在此的示教一起使用。根据上面的描述,构造这类装置所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. Various general-purpose devices can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of device. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for the purpose of disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and/or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的业务网络的实现装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the implementation device of the service network according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
例如,图4示出了根据本发明一个实施例的电子设备的结构示意图。该电子设备包括处理器410和被安排成存储计算机可执行指令(计算机可读程序代码)的存储器420。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有存储用于执行上述方法中的任何方法步骤的计算机可读程序代码431的存储空间430。例如,用于存储计算机可读程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个计算机可读程序代码431。计算机可读程序代码431可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图5所述的计算机可读存储介质。图5示出了根据本发明一个实施例的一种计算机可读存储介质的结构示意图。该计算机可读存储介质500存储有用于执行根据本发明的方法步骤的计算机可读程序代码431,可以被电子设备400的处理器410读取,当计算机可读程序代码431由电子设备400运行时,导致该电子设备400执行上面所描述的方法中的各个步骤,具体来说,该计算机可读存储介质存储的计算机可读程序代码431可以执行上述任一实施例中示出的方法。计算机可读程序代码431可以以适当形式进行压缩。For example, FIG. 4 shows a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. The electronic device includes a processor 410 and a memory 420 arranged to store computer executable instructions (computer readable program code). The memory 420 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 420 has a storage space 430 for storing a computer readable program code 431 for executing any method step in the above method. For example, the storage space 430 for storing computer readable program code may include various computer readable program codes 431 for implementing various steps in the above method respectively. The computer readable program code 431 may be read from or written into one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card or a floppy disk. Such a computer program product is typically a computer readable storage medium as shown in FIG. 5. FIG. 5 shows a schematic diagram of the structure of a computer readable storage medium according to an embodiment of the present invention. The computer-readable storage medium 500 stores a computer-readable program code 431 for executing the method steps according to the present invention, which can be read by the processor 410 of the electronic device 400. When the computer-readable program code 431 is executed by the electronic device 400, the electronic device 400 executes the various steps in the method described above. Specifically, the computer-readable program code 431 stored in the computer-readable storage medium can execute the method shown in any of the above embodiments. The computer-readable program code 431 can be compressed in an appropriate form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
本发明的实施例公开了A1、一种业务网络的实现方法,包括:The embodiment of the present invention discloses A1, a method for implementing a service network, comprising:
预先配置与各业务对应的网络拓扑并保存;Pre-configure and save the network topology corresponding to each business;
接收第一业务节点发送的业务请求,根据所述业务请求所属的业务查找出对应的网络拓扑;Receiving a service request sent by the first service node, and finding a corresponding network topology according to the service to which the service request belongs;
根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。A second service node is determined according to the found network topology and the service request, and the second service node is notified to send service content to the first service node.
A2、如A1所述的方法,其中,所述根据所述业务请求所属的业务查找出对应的网络拓扑包括:A2. The method as described in A1, wherein the step of finding out a corresponding network topology according to the service to which the service request belongs comprises:
根据所述业务请求中的业务标识查找出对应的网络拓扑。The corresponding network topology is found according to the service identifier in the service request.
A3、如A1所述的方法,其中,所述根据查找出的网络拓扑和所述业务请求确定第二业务节点包括:A3. The method as described in A1, wherein determining the second service node according to the found network topology and the service request comprises:
根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点;至少有一个保存有所述业务内容的业务节点注册在查找出的管理节点上;According to the service content identifier in the service request, a management node storing the service content identifier is searched in the network topology; at least one service node storing the service content is registered on the searched management node;
通知所述管理节点从保存有所述业务内容的业务节点中选出第二业务节点。The management node is notified to select a second service node from the service nodes storing the service content.
A4、如A3所述的方法,其中,所述预先配置与各业务对应的网络拓扑并保存包括:A4. The method as described in A3, wherein the pre-configuring and saving the network topology corresponding to each service comprises:
接收在本管理节点注册的业务节点上报的业务内容标识;Receive the service content identifier reported by the service node registered at the management node;
根据所述业务内容标识确定目标管理节点,将本管理节点中保存有所述业务内容标识作为配置信息告知目标管理节点。The target management node is determined according to the service content identifier, and the service content identifier stored in the current management node is notified as configuration information to the target management node.
A5、如A4所述的方法,其中,所述根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点包括:A5. The method as described in A4, wherein searching for a management node storing the service content identifier in the network topology according to the service content identifier in the service request comprises:
根据所述业务请求中的业务内容标识确定待询问的管理节点,向所述待询问的管理节点询问出保存有所述业务内容标识的管理节点。The management node to be queried is determined according to the service content identifier in the service request, and the management node to be queried is queried for the management node storing the service content identifier.
A6、如A1-A5中任一项所述的方法,其中,所述业务内容为流媒体。A6. A method as described in any one of A1-A5, wherein the service content is streaming media.
本发明的实施例还公开了B7、一种业务网络的实现装置,包括:The embodiment of the present invention further discloses B7, a device for implementing a service network, comprising:
网络拓扑单元,适于预先配置与各业务对应的网络拓扑并保存;以及适于接收第一业务节点发送的业务请求,根据所述业务请求所属的业务查找出对应的网络拓扑;A network topology unit, adapted to pre-configure and save network topologies corresponding to each service; and adapted to receive a service request sent by a first service node, and find out a corresponding network topology according to the service to which the service request belongs;
业务节点单元,适于根据查找出的网络拓扑和所述业务请求确定第二业务节点,通知第二业务节点向所述第一业务节点发送业务内容。The service node unit is adapted to determine a second service node according to the found network topology and the service request, and notify the second service node to send service content to the first service node.
B8、如B7所述的装置,其中,B8. The device as described in B7, wherein:
所述网络拓扑单元,适于根据所述业务请求中的业务标识查找出对应的网络拓扑。The network topology unit is adapted to find out the corresponding network topology according to the service identifier in the service request.
B9、如B7所述的装置,其中,B9. The device as described in B7, wherein:
所述业务节点单元,适于根据所述业务请求中的业务内容标识在所述网络拓扑中查找出保存有所述业务内容标识的管理节点;至少有一个保存有所述业务内容的业务节点注册在查找出的管理节点上;通知所述管理节点从保存有所述业务内容的业务节点中选出第二业务节点。The service node unit is adapted to search for a management node storing the service content identifier in the network topology according to the service content identifier in the service request; register at least one service node storing the service content on the searched management node; and notify the management node to select a second service node from the service nodes storing the service content.
B10、如B9所述的装置,其中,B10. The device as described in B9, wherein:
所述网络拓扑单元,适于接收在本管理节点注册的业务节点上报的业务内容标识;根据所述业务内容标识确定目标管理节点,将本管理节点中保存有所述业务内容标识作为配置信息告知目标管理节点。The network topology unit is adapted to receive a service content identifier reported by a service node registered in the management node; determine a target management node according to the service content identifier, and inform the target management node that the service content identifier is stored in the management node as configuration information.
B11、如B10所述的装置,其中,B11. The device as described in B10, wherein:
所述网络拓扑单元,适于根据所述业务请求中的业务内容标识确定待询问的管理节点,向所述待询问的管理节点询问出保存有所述业务内容标识的管理节点。The network topology unit is adapted to determine the management node to be queried according to the service content identifier in the service request, and to query the management node to be queried for the management node storing the service content identifier.
B12、如B7-B11中任一项所述的装置,其中,所述业务内容为流媒体。B12. A device as described in any one of B7-B11, wherein the service content is streaming media.
本发明的实施例还公开了C13、一种电子设备,其中,该电子设备包括:处理器;以及被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行如A1-A6中任一项所述的方法。An embodiment of the present invention also discloses C13, an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to execute a method as described in any one of A1-A6.
本发明的实施例还公开了D14、一种计算机可读存储介质,其中,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被处理器执行时,实现如A1-A6中任一项所述的方法。An embodiment of the present invention further discloses D14, a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, implement the method as described in any one of A1-A6.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910146407.8A CN111628879B (en) | 2019-02-27 | 2019-02-27 | Service network realization method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910146407.8A CN111628879B (en) | 2019-02-27 | 2019-02-27 | Service network realization method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111628879A CN111628879A (en) | 2020-09-04 |
CN111628879B true CN111628879B (en) | 2024-10-29 |
Family
ID=72260470
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910146407.8A Active CN111628879B (en) | 2019-02-27 | 2019-02-27 | Service network realization method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111628879B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109218363A (en) * | 2017-07-03 | 2019-01-15 | 中国移动通信有限公司研究院 | Content distribution method, network node and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101227313B (en) * | 2007-01-19 | 2010-07-28 | 华为技术有限公司 | Business path regulation method and communication system as well as route computing unit |
CN101472166B (en) * | 2007-12-26 | 2011-11-16 | 华为技术有限公司 | Method for caching and enquiring content as well as point-to-point medium transmission system |
CN102638483B (en) * | 2011-02-15 | 2016-01-27 | 中国移动通信集团公司 | A kind of defining method of content distribution nodes, equipment and system |
CN103179433B (en) * | 2011-12-26 | 2017-02-08 | 中国移动通信集团上海有限公司 | System, method and service node for providing video contents |
CN102523237A (en) * | 2011-12-31 | 2012-06-27 | 北京佳讯飞鸿电气股份有限公司 | Method for sharing load of SIP registrar in IP dispatching system |
CN103491129B (en) * | 2013-07-05 | 2017-07-14 | 华为技术有限公司 | A kind of service node collocation method, pool of service nodes Register and system |
-
2019
- 2019-02-27 CN CN201910146407.8A patent/CN111628879B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109218363A (en) * | 2017-07-03 | 2019-01-15 | 中国移动通信有限公司研究院 | Content distribution method, network node and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111628879A (en) | 2020-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106911524B (en) | HA implementation method and device | |
US8539077B2 (en) | Load distribution apparatus, load distribution method, and storage medium | |
US20200326876A1 (en) | Object Migration Method, Device, and System | |
CN106888233B (en) | Data updating system and method | |
EP3817290B1 (en) | Member change method for distributed system, and distributed system | |
CN108848170B (en) | Fog cluster management system and method based on nagios monitoring | |
JP2014515237A (en) | Virtual network migration method, related apparatus, and system | |
WO2017185961A1 (en) | Method and apparatus for processing service discovery | |
CN110391940A (en) | Response method, device, system, equipment and the storage medium of address of service | |
CN107666493B (en) | Database configuration method and equipment thereof | |
US11223522B1 (en) | Context-based intelligent re-initiation of microservices | |
JP5255035B2 (en) | Failover system, storage processing apparatus, and failover control method | |
WO2016082078A1 (en) | Path management system, device and method | |
US11909840B2 (en) | Resource subscription method, device, and storage medium | |
CN111131445B (en) | DHCP cluster scheduling method and DHCP cluster system | |
US10037253B2 (en) | Fault handling methods in a home service system, and associated household appliances and servers | |
CN107612753B (en) | Wireless information processing method and device and wireless access equipment | |
CN103262470B (en) | FCoE network linking management method, equipment and system | |
CN111628879B (en) | Service network realization method and device | |
JP2023531145A (en) | Service request handling | |
JP2017167675A (en) | Information processing system, information processing method, and server | |
CN113037797B (en) | Data processing method and device | |
CN111629013B (en) | Service node management method, device and node network | |
CN106341252A (en) | Resource management method and device and control terminal | |
US11599387B2 (en) | Re-initiation of microservices utilizing context information provided via service calls |
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 |