CN111628879A - Method and device for realizing service network - Google Patents

Method and device for realizing service network Download PDF

Info

Publication number
CN111628879A
CN111628879A CN201910146407.8A CN201910146407A CN111628879A CN 111628879 A CN111628879 A CN 111628879A CN 201910146407 A CN201910146407 A CN 201910146407A CN 111628879 A CN111628879 A CN 111628879A
Authority
CN
China
Prior art keywords
service
node
management node
management
network topology
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
Application number
CN201910146407.8A
Other languages
Chinese (zh)
Inventor
董文新
郭文艳
张博亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201910146407.8A priority Critical patent/CN111628879A/en
Publication of CN111628879A publication Critical patent/CN111628879A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Abstract

The invention discloses a method and a device for realizing a service network. The method comprises the following steps: pre-configuring and storing network topologies corresponding to various services; receiving a service request sent by a first service node, and finding out a corresponding network topology according to a service to which the service request belongs; and determining a second service node according to the found network topology and the service request, and informing the second service node of sending service content to the first service node. The technical scheme can be applied to the management node, and has the advantages that mutual inquiry among the service nodes can be avoided by configuring the network topology in advance, the target service node with the service content is quickly searched through the network topology, the service content is quickly transmitted, and the method is effectively applied in a service scene with strong demand on waiting time, such as streaming media service.

Description

Method and device for realizing service network
Technical Field
The invention relates to the field of computer networks, in particular to a method and a device for realizing a service network.
Background
In a scenario of streaming media service, users are often distributed in a wide region, and a server needs to provide streaming media content to be viewed to the users through different clusters. Each service node in the cluster may not necessarily store the streaming media content required by the user, so after receiving the viewing request of the user, if the service node does not have the corresponding streaming media content, the service node needs to obtain the streaming media content from other service nodes, and how to perform effective scheduling of the service content is a problem to be solved.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method and apparatus for implementing a service network that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method for implementing a service network, including:
pre-configuring and storing network topologies corresponding to various services;
receiving a service request sent by a first service node, and finding out a corresponding network topology according to a service to which the service request belongs;
and determining a second service node according to the found network topology and the service request, and informing the second service node of sending service content to the first service node.
Optionally, the finding out the corresponding network topology according to the service to which the service request belongs includes: and finding out the corresponding network topology according to the service identifier in the service request.
Optionally, the determining a second service node according to the found network topology and the service request includes:
searching out a management node stored with the service content identification in the network topology according to the service content identification in the service request; at least one service node storing the service content is registered on the searched management node;
and informing the management node to select a second service node from the service nodes stored with the service content.
Optionally, the pre-configuring and storing the network topology corresponding to each service includes:
receiving a service content identifier reported by a service node registered in the management node;
and determining a target management node according to the service content identification, and informing the target management node of the service content identification stored in the management node as configuration information.
Optionally, the searching for the management node storing the service content identifier in the network topology according to the service content identifier in the service request includes:
and determining a management node to be inquired according to the service content identifier in the service request, and inquiring the management node to be inquired, wherein the management node is stored with the service content identifier.
Optionally, the service content is streaming media.
According to another aspect of the present invention, there is provided a service network implementing apparatus, including:
the network topology unit is suitable for pre-configuring and storing network topologies corresponding to various services; the network topology searching method comprises the steps of receiving a service request sent by a first service node, and searching a corresponding network topology according to a service to which the service request belongs;
and the service node unit is suitable for determining a second service node according to the found network topology and the service request and informing the second service node of sending service content to the first service node.
Optionally, the network topology unit is adapted to find out a corresponding network topology according to the service identifier in the service request.
Optionally, the service node unit is adapted to find 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 informing the management node to select a second service node from the service nodes stored with the service content.
Optionally, the network topology unit is adapted to receive a service content identifier reported by a service node registered in the management node; and determining a target management node according to the service content identification, and informing the target management node of the service content identification stored in the management node as configuration information.
Optionally, the network topology unit is adapted to determine a 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 in which the service content identifier is stored.
Optionally, the service content is streaming media.
In accordance with still another aspect of the present invention, there is provided an electronic apparatus including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method as any one of the above.
According to a further aspect of the invention, there is provided a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement a method as any one of the above.
It can be seen from the above that, in the technical solution of the present invention, a service network is constructed, network topologies corresponding to respective services are configured in advance and stored, after a service request sent by a first service node is received, the corresponding network topology is found according to a 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. The technical scheme can be applied to the management node, and has the advantages that mutual inquiry among the service nodes can be avoided by configuring the network topology in advance, the target service node with the service content is quickly searched through the network topology, the service content is quickly transmitted, and the method is effectively applied in a service scene with strong demand on waiting time, such as streaming media service.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flow diagram of a method for implementing a service network according to an embodiment of the invention;
fig. 2 is a schematic structural diagram of an implementation apparatus of a service network according to an embodiment of the present invention;
FIG. 3 illustrates a schematic diagram of a network of nodes, according to an embodiment of the present invention;
FIG. 4 shows a schematic structural diagram of an electronic device according to one embodiment of the invention;
fig. 5 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flow chart illustrating a method for implementing a service network according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S110, pre-configuring and storing a network topology corresponding to each service.
The method can be applied to a management node for managing each service node, wherein the service node can realize single service or multiple services, and one management node can manage service nodes related to the single service or multiple services.
Step S120, receiving a service request sent by the first service node, and finding a corresponding network topology according to a service to which the service request belongs.
For example, if the user watches live broadcast, the viewing requirement is sent to the first service node, and if there is no live broadcast stream of the corresponding anchor on the first service node, the first node may send a service request to the above management node, that is, request the live broadcast stream of the corresponding anchor. The management node firstly determines the network topology of the live broadcast service (i.e. the network topology formed by the service nodes realizing the live broadcast).
Step S130, determining a second service node according to the found network topology and the service request, and informing the second service node to send service content to the first service node.
For example, if it is determined that the live stream of the corresponding anchor is stored in the second service node through the found network topology and the service request, the second service node is notified to send the live stream to the first service node.
It can be seen that, in the method shown in fig. 1, by constructing a service network, pre-configuring and storing network topologies corresponding to respective services, after receiving a service request sent by a first service node, first finding a corresponding network topology according to a service to which the service request belongs, then 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. The technical scheme can be applied to the management node, and has the advantages that mutual inquiry among the service nodes can be avoided by configuring the network topology in advance, the target service node with the service content is quickly searched through the network topology, the service content is quickly transmitted, and the method is effectively applied in a service scene with strong demand on waiting time, such as streaming media service.
In an embodiment of the present invention, in the method, finding out the corresponding network topology according to the service to which the service request belongs includes: and 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 sent service request carries a corresponding service identifier, so that the management node finds out a corresponding network topology according to the service identifier.
In an embodiment of the present invention, in the method, determining the second service node according to the searched network topology and the service request includes: searching out a management node stored with the service content identification in the network topology according to the service content identification in the service request; at least one service node with stored service content is registered on the searched management node; and informing the management node to select a second service node from the service nodes stored with the service contents.
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 anchor. In a specific implementation, the selection of the second service node may be performed by interworking of a plurality of management nodes. In one case, the service node requests the management node for the service content, and if there is a corresponding service content in other service nodes registered on the management node, the second service node is selected from the service nodes having the service content stored therein. If there is no corresponding service content in other service nodes registered on the management node, the management node stored with the service content identifier is searched in the network topology according to the service content identifier in the service request, which means that at least one service node stored with the service content is registered on the searched management node, and then the searched management node is notified to select a second service node from the service nodes stored with the service content.
In an embodiment of the present invention, in the method, pre-configuring and storing a network topology corresponding to each service includes: receiving a service content identifier reported by a service node registered in the management node; and determining a target management node according to the service content identification, and informing the target management node of the configuration information of the service content identification stored in the management node.
With reference to the above contents, it can be determined how the management node manages through the contents reported by the service node when the service node just receives the service contents. Specifically, the service node registered in the management node may report the service content identifier, and then calculate to obtain a target management node by means of hash operation and the like, and then notify the target management node, where the service content identifier is stored in the management node.
In a specific example, if the service node 2 on the management node 1 has a live stream 36012345678 (service content identifier), the hash operation is performed on the live stream 36012345678 to determine that the management node 3 is the target management node, and 36012345678 stored on the management node 1 is notified to the management node 3 as configuration information.
In an embodiment of the present invention, in the method, finding the management node storing the service content identifier in the network topology according to the service content identifier in the service request includes: and determining a management node to be inquired according to the service content identifier in the service request, and inquiring the management node to be inquired to obtain the management node stored with the service content identifier.
In combination with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678 from it, since the service nodes on the management node 4 do not have the live stream, it can also be determined that the management node 3 is the target management node according to the hash operation, and then the management node 3 is queried to obtain the service content identifier of the live stream 36012345678 and store the service content identifier on the management node 1, and then the management node 4 requests the management node 1 for the live stream, so that the management node 1 can allocate a service node such as the service node 2, and push the live stream to the service node 5. The above process describes a push-pull streaming process, and in one embodiment of the present invention, the service content is streaming media. And the transmission of other service contents can refer to implementation, and are not described one by one here.
Consider the case of an increase and decrease in management nodes, where the decrease may be a downtime without the addition of other available management nodes, or an active reduction in the number of management nodes based on traffic demand. The execution flow is similar to the previous one, and the management node stored with the service content identifier needs to be recalculated, for example, flow migration is performed; traffic on the service node is scheduled, etc.
If disaster tolerance is considered, and in order to avoid the use influence caused by the downtime of the management nodes, a node network formed by each management node and the service nodes can be configured with a standby node for each management node, so that a master-slave architecture is formed.
Specifically, a management node acknowledgement request sent by the service node is received first. Wherein the management node may manage machine states, stored data, traffic information, etc. of the service nodes registered thereon. For example, in a live scenario, the management node may manage live stream information for each node registered thereon. In a specific embodiment, there are a plurality of management nodes, and the validation of a management node is not equivalent to the registration of a management node, but a step is first performed to determine which management node to register on, so that a reliable management node is basically obtained.
And secondly, returning management node information corresponding to the specified management node to the service node according to the management node confirmation request so that the service node is registered on the specified management node. The implementation manners of specifically confirming the reliable management node are many, for example, a table of the reliable management node is maintained, updating is performed in real time according to the state of each management node, and a specific management node is determined as an appointed management node according to parameters such as an idle state and the like. After the service node is registered on the designated management node, the service node can report corresponding information to realize management.
In this way, after receiving the management node confirmation request sent by the service node, the method returns 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. The management node can manage the machine state, stored data and service information of the service node registered on the management node; the registration process is divided into two steps, firstly, the management node on which the service node needs to be registered is confirmed, and then the service node is registered on the corresponding management node, so that even if the registered management node goes down, a new available management node can be confirmed again through the first step process to be registered, the proper management of the service node is realized, a slave node does not need to be equipped for each management node, and the utilization rate of resources is improved.
In an embodiment of the present invention, in the method, the management node confirms that the request is sent when the service node is on line for the first time; and/or the management node confirms that the request is that the service node is disconnected from the registered management node.
In a specific embodiment, when the service node is on-line for the first time, the service node may determine to which management node to send the management node confirmation request according to the preset configuration information. Wherein two or more management nodes can be configured per service node in priority for disaster tolerance. For example, the service node 1 sends a management node confirmation request to the management node 2 by default and to the management node 3 if the communication is not successful. If the management node information corresponding to the specified management node can be obtained, a registration process is performed, for example, registration is performed on the management node 4. When the connection with the management node 4 is disconnected, the management node confirmation request is sent to the management node 2 or the management node 3 again (the process is similar to the above), for example, a new designated management node is obtained as the management node 5, and then the registration is performed on the management node 5.
Here, if the management node 4 is recovered to normal, the management node 5 may register with the management node 4 by disconnecting from the service node 1 and causing it to re-register. Similarly, each management node also needs to perform migration of the service node.
In an embodiment of the present invention, in the above method, the method further includes: establishing connection with a plurality of management nodes to form a management node network; the step of returning the management node information corresponding to the designated management node to the service node comprises the following steps: and determining a management node as a designated management node according to the management node network.
In particular, each management node in the management node network may be connected with other management nodes in the management node network, for example, to form a consistent hash ring.
In an embodiment of the present invention, in the method, the management node request includes a management node tag; determining a management node as a designated management node based on the management node network comprises: and judging whether the management node corresponding to the management node label is available, if so, taking the management node corresponding to the management node label as the designated management node.
When the management node is down, the management node can be excluded from the management node network, that is, whether the management node corresponding to the physical node label is available can be simply judged to determine whether the management node corresponding to the physical node label is in the management node network. In particular, each service node may be configured with several management nodes, for example, management nodes with better network transmission and higher efficiency, and if these management nodes are available, such management nodes are preferentially selected and thus may be saved as management node labels in advance.
In an embodiment of the present invention, the determining a management node as the designated management node according to the management node network further includes: and if the management node corresponding to the management node label is unavailable, selecting a management node in the same cluster with the service node as the designated management node.
In order to ensure efficiency (e.g., data transmission efficiency), a management node in the same cluster as the service node is selected as a designated management node, so that delay generated by the management node in a state of managing the service node is relatively smaller.
In an embodiment of the present invention, the determining a management node as the designated management node according to the management node network further includes: and if the management node in the same cluster with the service node does not exist, performing hash calculation according to the management node data in the management node network, and determining the designated management node according to the calculation result. For example, when the management nodes form a consistent hash ring as described above, the designated management node can be determined by hash calculation based on a unique identifier such as a machine serial number of each management node.
In an embodiment of the present invention, the determining a management node as the designated management node according to the management node network includes: and taking the backup management node of the management node originally registered by the service node as a designated management node.
In this case, the single-point master-slave is combined with the management node network, so that new management nodes can be brought on line more quickly when the management nodes are down.
In an embodiment of the present invention, the establishing a connection with a plurality of management nodes to form a management node network includes: respectively establishing connection with each management node according to a pre-configured management node address; and recording the state of each management node connected.
The management node may record the statuses of other management nodes, such as online, offline, down, and the like, by means of a state machine.
In an embodiment of the present invention, in the method, the recording the state of each connected management node includes: and mutually sending heartbeat information with each connected management node, and determining the state of each management node according to the heartbeat information sent by each management node. Specifically, in an embodiment of the present invention, in the method, the heartbeat information includes state information of other management nodes recorded in the management node; determining the state of each management node according to the heartbeat information sent by each management node comprises the following steps: when one management node recorded in the management node is in the first state, if the quantity or the proportion of the state information which is received in a period and records that the management node is in the first state reaches a corresponding preset value, other management nodes in the management node network are informed to execute the operation corresponding to the second state switching, and after the operation is completed, the management node is recorded to be in the second state.
After the management node is started, the management node establishes connection with each management node according to the configured addresses of other management nodes, and mutually sends heartbeat information.
In a specific embodiment, after being started (i.e., online), the management node 1 sends a connection request to the management node 2, the management node 3, and the management node 4, and the management node 2, the management node 3, and the management node 4 record the management node 1 as an initial state when receiving the connection request, and record the management node 1 as an online state when receiving heartbeat information through connection. The heartbeat is sent to each other and also carries the status information of the management node 1 recorded by the management node 2, so that the management node 2 receives the status information of the management node 1 sent by the management node 1, the management node 3 and the management node 4, when the quantity or the proportion of the status information recorded that the management node 1 is in an online state reaches a preset value, the management node 1, the management node 3 and the management node 4 are notified that a new management node, namely the management node 1, is online, and then migration can be performed, for example, the connection with a part of service nodes is disconnected, so that the new management node is registered on the management node 1. The old ring may be used before the new ring is created during migration. And after the migration is finished, inquiring other management nodes, if the number or the proportion of the management nodes after the migration is finished is considered to reach a preset value, setting the state of the management node 1 as available, and continuously notifying through heartbeat. And deleting the old ring after the migration is completed, and providing service through the new ring.
In an embodiment of the present invention, in the 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; performing an operation corresponding to switching the second state includes: and migrating the service node.
Similar to the examples given above, when one management node considers that another state is originally an available management node heartbeat timeout, the management node that has timed out the heartbeat is recorded offline, the state of the management node that has timed out the heartbeat is further determined by the heartbeat information of other management nodes, and if the number or the proportion of the state information, which is received in one period and records that the management node that has timed out the heartbeat is offline, reaches a corresponding preset value, the other management nodes are notified, the management node that has timed out the heartbeat goes down, and service node migration is performed.
In an embodiment of the present invention, in the above method, the method further includes: receiving service node information reported by service nodes registered in the management node; the service node information includes: status information and/or traffic information of the traffic node.
The state information of the service node may include information such as hardware resource consumption on the machine, and the service information may be determined according to actual service requirements, for example, the service information may be related information of a live stream in a live scene.
Fig. 2 is a schematic structural diagram of an implementation apparatus of a service network according to an embodiment of the present invention. As shown in fig. 2, the apparatus 200 for implementing a service network includes:
a network topology unit 210 adapted to pre-configure and store a network topology corresponding to each service; and the network topology searching method is suitable for receiving the service request sent by the first service node and searching the corresponding network topology according to the service to which the service request belongs.
The device can be applied to a management node for managing each service node, wherein the service node can realize single service or multiple services, and one management node can manage service nodes related to the single service or multiple services. For example, if the user watches live broadcast, the viewing requirement is sent to the first service node, and if there is no live broadcast stream of the corresponding anchor on the first service node, the first node may send a service request to the above management node, that is, request the live broadcast stream of the corresponding anchor. The management node firstly determines the network topology of the live broadcast service (i.e. the network topology formed by the service nodes realizing the live broadcast).
The service node unit 220 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 the service content to the first service node.
For example, if it is determined that the live stream of the corresponding anchor is stored in the second service node through the found network topology and the service request, the second service node is notified to send the live stream to the first service node.
It can be seen that, in the apparatus shown in fig. 2, by constructing a service network, a network topology corresponding to each service is configured in advance and stored, after receiving a service request sent by a first service node, a corresponding network topology is found according to a 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. The technical scheme can be applied to the management node, and has the advantages that mutual inquiry among the service nodes can be avoided by configuring the network topology in advance, the target service node with the service content is quickly searched through the network topology, the service content is quickly transmitted, and the method is effectively applied in a service scene with strong demand on waiting time, such as streaming media service.
In an embodiment of the present invention, in the above apparatus, the network topology unit 210 is adapted to find out a 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 sent service request carries a corresponding service identifier, so that the management node finds out a corresponding network topology according to the service identifier.
In an embodiment of the present invention, in the above apparatus, the service node unit 220 is adapted to find out, according to the service content identifier in the service request, a management node in which the service content identifier is stored in the network topology; at least one service node with stored service content is registered on the searched management node; and informing the management node to select a second service node from the service nodes stored with the service contents.
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 anchor. In a specific implementation, the selection of the second service node may be performed by interworking of a plurality of management nodes. In one case, the service node requests the management node for the service content, and if there is a corresponding service content in other service nodes registered on the management node, the second service node is selected from the service nodes having the service content stored therein. If there is no corresponding service content in other service nodes registered on the management node, the management node stored with the service content identifier is searched in the network topology according to the service content identifier in the service request, which means that at least one service node stored with the service content is registered on the searched management node, and then the searched management node is notified to select a second service node from the service nodes stored with the service content.
In an embodiment of the present invention, in the above apparatus, the network topology unit 210 is adapted to receive a service content identifier reported by a service node registered in the management node; and determining a target management node according to the service content identification, and informing the target management node of the configuration information of the service content identification stored in the management node.
With reference to the above contents, it can be determined how the management node manages through the contents reported by the service node when the service node just receives the service contents. Specifically, the service node registered in the management node may report the service content identifier, and then calculate to obtain a target management node by means of hash operation and the like, and then notify the target management node, where the service content identifier is stored in the management node.
In a specific example, if the service node 2 on the management node 1 has a live stream 36012345678 (service content identifier), the hash operation is performed on the live stream 36012345678 to determine that the management node 3 is the target management node, and 36012345678 stored on the management node 1 is notified to the management node 3 as configuration information.
In an embodiment of the present invention, in the above apparatus, the network topology unit 210 is adapted to determine a 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.
In combination with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678 from it, since the service nodes on the management node 4 do not have the live stream, it can also be determined that the management node 3 is the target management node according to the hash operation, and then the management node 3 is queried to obtain the service content identifier of the live stream 36012345678 and store the service content identifier on the management node 1, and then the management node 4 requests the management node 1 for the live stream, so that the management node 1 can allocate a service node such as the service node 2, and push the live stream to the service node 5. The above process describes a push-pull streaming process, and in one embodiment of the present invention, the service content in the above apparatus is streaming media. And the transmission of other service contents can refer to implementation, and are not described one by one here.
Consider the case of an increase and decrease in management nodes, where the decrease may be a downtime without the addition of other available management nodes, or an active reduction in the number of management nodes based on traffic demand. The execution flow is similar to the previous one, and the management node stored with the service content identifier needs to be recalculated, for example, flow migration is performed; traffic on the service node is scheduled, etc.
If disaster recovery is considered and the use is not affected by the downtime of the management nodes, a standby node can be configured for each management node to form a master-slave architecture, but a single-point problem exists.
In an embodiment of the present invention, the apparatus further includes: and the receiving unit is suitable for receiving the management node confirmation request sent by the service node. Wherein the management node may manage machine states, stored data, traffic information, etc. of the service nodes registered thereon. For example, in a live scenario, the management node may manage live stream information for each node registered thereon.
In a specific embodiment, there are a plurality of management nodes, and the validation of a management node is not equivalent to the registration of a management node, but a step is first performed to determine which management node to register on, so that a reliable management node is basically obtained.
And the management node confirmation unit is suitable for returning the management node information corresponding to the specified management node to the service node according to the management node confirmation request so as to register the service node on the specified management node.
The implementation manners of specifically confirming the reliable management node are many, for example, a table of the reliable management node is maintained, updating is performed in real time according to the state of each management node, and a specific management node is determined as an appointed management node according to parameters such as an idle state and the like. After the service node is registered on the designated management node, the service node can report corresponding information to realize management.
Therefore, after receiving the management node confirmation request sent by the service node, the device returns the management node information corresponding to the specified management node to the service node according to the management node confirmation request, so that the service node is registered on the specified management node. The management node can manage the machine state, stored data and service information of the service node registered on the management node; the registration process is divided into two steps, firstly, the management node on which the service node needs to be registered is confirmed, and then the service node is registered on the corresponding management node, so that even if the registered management node goes down, a new available management node can be confirmed again through the first step process to be registered, the proper management of the service node is realized, a slave node does not need to be equipped for each management node, and the utilization rate of resources is improved.
In an embodiment of the present invention, in the above apparatus, the management node confirms that the request is sent by the service node when the service node is initially online; and/or the management node confirms that the request is that the service node is disconnected from the registered management node.
In a specific embodiment, when the service node is on-line for the first time, the service node may determine to which management node to send the management node confirmation request according to the preset configuration information. Wherein two or more management nodes can be configured per service node in priority for disaster tolerance. For example, the service node 1 sends a management node confirmation request to the management node 2 by default and to the management node 3 if the communication is not successful. If the management node information corresponding to the specified management node can be obtained, a registration process is performed, for example, registration is performed on the management node 4. When the connection with the management node 4 is disconnected, the management node confirmation request is sent to the management node 2 or the management node 3 again (the process is similar to the above), for example, a new designated management node is obtained as the management node 5, and then the registration is performed on the management node 5.
Here, if the management node 4 is recovered to normal, the management node 5 may register with the management node 4 by disconnecting from the service node 1 and causing it to re-register. Similarly, each management node also needs to perform migration of the service node.
In an embodiment of the present invention, in the above apparatus, the apparatus further includes: the management node network unit is suitable for establishing connection with a plurality of management nodes to form a management node network; and the management node confirming unit is suitable for confirming one management node as the designated management node according to the management node network.
In particular, each management node in the management node network may be connected with other management nodes in the management node network, for example, to form a consistent hash ring.
In an embodiment of the present invention, in the apparatus, the management node request includes a management node tag; and the management node confirming unit is suitable for judging whether the management node corresponding to the management node label is available or not, and if so, taking the management node corresponding to the management node label as the designated management node.
When the management node is down, the management node can be excluded from the management node network, that is, whether the management node corresponding to the physical node label is available can be simply judged to determine whether the management node corresponding to the physical node label is in the management node network. In particular, each service node may be configured with several management nodes, for example, management nodes with better network transmission and higher efficiency, and if these management nodes are available, such management nodes are preferentially selected and thus may be saved as management node labels in advance.
In an embodiment of the present invention, in the apparatus, 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.
In order to ensure efficiency (e.g., data transmission efficiency), a management node in the same cluster as the service node is selected as a designated management node, so that delay generated by the management node in a state of managing the service node is relatively smaller.
In an embodiment of the present invention, in the above apparatus, the management node confirming unit is adapted to perform hash calculation according to 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 according to a calculation result. For example, when the management nodes form a consistent hash ring as described above, the designated management node can be determined by hash calculation based on a unique identifier such as a machine serial number of each management node.
In an embodiment of the present invention, in the above apparatus, the management node confirmation unit is adapted to use a backup management node of a 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, so that new management nodes can be brought on line more quickly when the management nodes are down.
In an embodiment of the present invention, in the above apparatus, the management node network unit is adapted to establish connections with the management nodes respectively according to preconfigured management node addresses; and adapted to record the status of each management node connected.
The management node may record the statuses of other management nodes, such as online, offline, down, and the like, by means of a state machine.
In an embodiment of the present invention, in the above apparatus, the management node network unit is adapted to send heartbeat information to each other with each of the management nodes connected, and determine the status of each of the management nodes according to the heartbeat information sent by each of the management nodes. Specifically, in an embodiment of the present invention, in the apparatus, the heartbeat information includes state information of other management nodes recorded in the management node; the management node network unit is suitable for informing other management nodes in the management node network to execute the operation corresponding to the second state switching if the quantity or the proportion of the received state information which records that the management node is in the first state reaches a corresponding preset value when one management node recorded in the management node is in the first state, and recording that the management node is in the second state after the operation is completed.
After the management node is started, the management node establishes connection with each management node according to the configured addresses of other management nodes, and mutually sends heartbeat information.
In a specific embodiment, after being started (i.e., online), the management node 1 sends a connection request to the management node 2, the management node 3, and the management node 4, and the management node 2, the management node 3, and the management node 4 record the management node 1 as an initial state when receiving the connection request, and record the management node 1 as an online state when receiving heartbeat information through connection. The heartbeat is sent to each other and also carries the status information of the management node 1 recorded by the management node 2, so that the management node 2 receives the status information of the management node 1 sent by the management node 1, the management node 3 and the management node 4, when the quantity or the proportion of the status information recorded that the management node 1 is in an online state reaches a preset value, the management node 1, the management node 3 and the management node 4 are notified that a new management node, namely the management node 1, is online, and then migration can be performed, for example, the connection with a part of service nodes is disconnected, so that the new management node is registered on the management node 1. The old ring may be used before the new ring is created during migration. And after the migration is finished, inquiring other management nodes, if the number or the proportion of the management nodes after the migration is finished is considered to reach a preset value, setting the state of the management node 1 as available, and continuously notifying through heartbeat. And deleting the old ring after the migration is completed, and providing service through the new ring.
In an embodiment of the present invention, in the above apparatus, 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; and the management node network unit is also suitable for migrating the service node.
Similar to the examples given above, when one management node considers that another state is originally an available management node heartbeat timeout, the management node that has timed out the heartbeat is recorded offline, the state of the management node that has timed out the heartbeat is further determined by the heartbeat information of other management nodes, and if the number or the proportion of the state information, which is received in one period and records that the management node that has timed out the heartbeat is offline, reaches a corresponding preset value, the other management nodes are notified, the management node that has timed out the heartbeat goes down, and service node migration is performed.
In an embodiment of the present invention, in the above apparatus, the receiving unit is further adapted to receive service node information reported by a service node registered in the management node; the service node information includes: status information and/or traffic information of the traffic node.
The state information of the service node may include information such as hardware resource consumption on the machine, and the service information may be determined according to actual service requirements, for example, the service information may be related information of a live stream in a live scene.
Fig. 3 shows a schematic structural diagram of a node network according to an embodiment of the present invention. As shown in fig. 3, the node network 300 comprises a number of service nodes 320 and a number of management nodes 310 in which the implementing apparatus 200 of the service network as described in any one of the above is deployed.
In summary, in the technical solution of the present invention, a service network is constructed, network topologies corresponding to services are configured in advance and stored, after a service request sent by a first service node is received, the corresponding network topology is found according to a 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. The technical scheme can be applied to the management node, and has the advantages that mutual inquiry among the service nodes can be avoided by configuring the network topology in advance, the target service node with the service content is quickly searched through the network topology, the service content is quickly transmitted, and the method is effectively applied in a service scene with strong demand on waiting time, such as streaming media service.
Each service node can still divide the cluster, but the boundary of the cluster is not obvious any more, and the cluster can be used for distinguishing through a label, so that updating and upgrading, AB testing and the like are facilitated. It can be seen from the above embodiments that service contents such as push-pull streams and the like can be mutually transmitted among clusters, and when specifically scheduling, one path of direct broadcast stream of uplink and downlink can be basically guaranteed to be in one cluster, and certainly, the uplink and downlink may not be in one cluster under the scenes of increasing and decreasing the number of clusters, switching flow and the like.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate 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 an implementation of a services network according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media 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 in any other form.
For example, fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device comprises 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 storing computer readable program code 431 for performing any of the method steps described above. For example, the storage space 430 for storing the computer readable program code may include respective computer readable program codes 431 for respectively implementing various steps in the above method. The computer readable program code 431 can be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is typically a computer readable storage medium such as described in fig. 5. Fig. 5 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention. The computer readable storage medium 500 has stored thereon a computer readable program code 431 for performing the steps of the method according to the invention, which is readable by the processor 410 of the electronic device 400, the computer readable program code 431, when executed by the electronic device 400, causing the electronic device 400 to perform the steps of the method described above, in particular the computer readable program code 431 stored thereon, is capable of performing the method shown in any of the embodiments described above. The computer readable program code 431 may be compressed in a suitable form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The embodiment of the invention discloses A1, a method for realizing a service network, which comprises the following steps:
pre-configuring and storing network topologies corresponding to various services;
receiving a service request sent by a first service node, and finding out a corresponding network topology according to a service to which the service request belongs;
and determining a second service node according to the found network topology and the service request, and informing the second service node of sending service content to the first service node.
A2, the method as in a1, wherein the finding out the corresponding network topology according to the service to which the service request belongs comprises:
and finding out the corresponding network topology according to the service identifier in the service request.
A3, the method as in a1, wherein the determining a second service node based on the found network topology and the service request comprises:
searching out a management node stored with the service content identification in the network topology according to the service content identification in the service request; at least one service node storing the service content is registered on the searched management node;
and informing the management node to select a second service node from the service nodes stored with the service content.
A4, the method as in A3, wherein the pre-configuring and maintaining the network topology corresponding to each service comprises:
receiving a service content identifier reported by a service node registered in the management node;
and determining a target management node according to the service content identification, and informing the target management node of the service content identification stored in the management node as configuration information.
A5, the method as in a4, wherein the finding the management node storing the service content identifier in the network topology according to the service content identifier in the service request includes:
and determining a management node to be inquired according to the service content identifier in the service request, and inquiring the management node to be inquired, wherein the management node is stored with the service content identifier.
A6, the method according to any A1-A5, wherein the service content is streaming media.
The embodiment of the invention also discloses B7, a device for realizing the service network, which comprises:
the network topology unit is suitable for pre-configuring and storing network topologies corresponding to various services; the network topology searching method comprises the steps of receiving a service request sent by a first service node, and searching a corresponding network topology according to a service to which the service request belongs;
and the service node unit is suitable for determining a second service node according to the found network topology and the service request and informing the second service node of sending service content to the first service node.
B8, the device of B7, wherein,
and the network topology unit is suitable for finding out the corresponding network topology according to the service identifier in the service request.
B9, the device of B7, wherein,
the service node unit is suitable for searching the management node stored with the service content identification in the network topology according to the service content identification in the service request; at least one service node storing the service content is registered on the searched management node; and informing the management node to select a second service node from the service nodes stored with the service content.
B10, the device of B9, wherein,
the network topology unit is suitable for receiving the service content identification reported by the service node registered in the management node; and determining a target management node according to the service content identification, and informing the target management node of the service content identification stored in the management node as configuration information.
B11, the device of B10, wherein,
the network topology unit is adapted to determine a management node to be queried according to the service content identifier in the service request, and query the management node to be queried with the service content identifier stored therein.
B12, the apparatus according to any one of B7-B11, wherein the service content is streaming media.
The embodiment of the invention also discloses C13 and electronic equipment, wherein the electronic equipment comprises: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any one of a1-a 6.
Embodiments of the invention also disclose D14, a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method as any one of a1-a 6.

Claims (10)

1. A method for implementing a service network includes:
pre-configuring and storing network topologies corresponding to various services;
receiving a service request sent by a first service node, and finding out a corresponding network topology according to a service to which the service request belongs;
and determining a second service node according to the found network topology and the service request, and informing the second service node of sending service content to the first service node.
2. The method of claim 1, wherein the finding the corresponding network topology according to the service to which the service request belongs comprises:
and finding out the corresponding network topology according to the service identifier in the service request.
3. The method of claim 1, wherein said determining a second service node based on the found network topology and the service request comprises:
searching out a management node stored with the service content identification in the network topology according to the service content identification in the service request; at least one service node storing the service content is registered on the searched management node;
and informing the management node to select a second service node from the service nodes stored with the service content.
4. The method of claim 3, wherein the pre-configuring and preserving a network topology corresponding to each service comprises:
receiving a service content identifier reported by a service node registered in the management node;
and determining a target management node according to the service content identification, and informing the target management node of the service content identification stored in the management node as configuration information.
5. The method of claim 4, wherein the finding out the management node storing the service content identifier in the network topology according to the service content identifier in the service request comprises:
and determining a management node to be inquired according to the service content identifier in the service request, and inquiring the management node to be inquired, wherein the management node is stored with the service content identifier.
6. The method according to any of claims 1-5, wherein the service content is streaming media.
7. An apparatus for implementing a service network, comprising:
the network topology unit is suitable for pre-configuring and storing network topologies corresponding to various services; the network topology searching method comprises the steps of receiving a service request sent by a first service node, and searching a corresponding network topology according to a service to which the service request belongs;
and the service node unit is suitable for determining a second service node according to the found network topology and the service request and informing the second service node of sending service content to the first service node.
8. The apparatus of claim 7, wherein,
and the network topology unit is suitable for finding out the corresponding network topology according to the service identifier in the service request.
9. An electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform the method of any one of claims 1-6.
10. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-6.
CN201910146407.8A 2019-02-27 2019-02-27 Method and device for realizing service network Pending CN111628879A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910146407.8A CN111628879A (en) 2019-02-27 2019-02-27 Method and device for realizing service network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910146407.8A CN111628879A (en) 2019-02-27 2019-02-27 Method and device for realizing service network

Publications (1)

Publication Number Publication Date
CN111628879A true CN111628879A (en) 2020-09-04

Family

ID=72260470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910146407.8A Pending CN111628879A (en) 2019-02-27 2019-02-27 Method and device for realizing service network

Country Status (1)

Country Link
CN (1) CN111628879A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009079948A1 (en) * 2007-12-26 2009-07-02 Huawei Technologies Co., Ltd. A content buffering, querying method and point-to-point media transmitting system
CN102523237A (en) * 2011-12-31 2012-06-27 北京佳讯飞鸿电气股份有限公司 Method for sharing load of SIP registrar in IP dispatching system
CN102638483A (en) * 2011-02-15 2012-08-15 中国移动通信集团公司 Method, device and system for determining content distribution nodes
CN103179433A (en) * 2011-12-26 2013-06-26 中国移动通信集团上海有限公司 System, method and service node for providing video contents
CN103491129A (en) * 2013-07-05 2014-01-01 华为技术有限公司 Service node configuration method and service node pool logger and system
CN109218363A (en) * 2017-07-03 2019-01-15 中国移动通信有限公司研究院 Content distribution method, network node and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009079948A1 (en) * 2007-12-26 2009-07-02 Huawei Technologies Co., Ltd. A content buffering, querying method and point-to-point media transmitting system
CN102638483A (en) * 2011-02-15 2012-08-15 中国移动通信集团公司 Method, device and system for determining content distribution nodes
CN103179433A (en) * 2011-12-26 2013-06-26 中国移动通信集团上海有限公司 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
CN103491129A (en) * 2013-07-05 2014-01-01 华为技术有限公司 Service node configuration method and service node pool logger and system
CN109218363A (en) * 2017-07-03 2019-01-15 中国移动通信有限公司研究院 Content distribution method, network node and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JIE DAI ET AL.: "Collaborative hierarchical caching with dynamic request routing for massive content distribution", IEEE *
覃国旗: "大规模流媒体分发系统的研究及仿真", 《中国优秀硕士学位论文全文数据库》 *

Similar Documents

Publication Publication Date Title
CN111371627B (en) Method for setting multiple IPs (Internet protocol) in Kubernetes through Pod
CN107105050B (en) Storage and downloading method and system for service objects
CN103795602A (en) Network strategy configuration method and device of virtual network
WO2017116930A1 (en) System and method for acquiring, processing, and updating global information
JP5255035B2 (en) Failover system, storage processing apparatus, and failover control method
CN104618312A (en) Remote registration method, device and system for M2M (Machine-to-Machine) application
US20160344582A1 (en) Call home cluster
CN110196843B (en) File distribution method based on container cluster and container cluster
CN110391940A (en) Response method, device, system, equipment and the storage medium of address of service
CN109120746A (en) Method for network address translation, device and address-translating device
CN103546315A (en) System, method and equipment for backing up DHCP (dynamic host configuration protocol) server
CN111355600A (en) Method and device for determining main node
CN114401250A (en) Address allocation method and device
CN111131445A (en) DHCP cluster scheduling method and DHCP cluster system
CN114745358A (en) IP address management method, system and controller in load balancing service
CN107612753B (en) Wireless information processing method and device and wireless access equipment
CN113810216A (en) Cluster fault switching method and device and electronic equipment
CN111917870A (en) Request processing method, system, device, electronic equipment and storage medium
JP2023544573A (en) Application context relocation method and application context relocation device
CN111885103A (en) Resource processing method, server, electronic device, and storage medium
CN111628879A (en) Method and device for realizing service network
CN110798358A (en) Distributed service identification method and device, computer readable medium and electronic equipment
US20230188625A1 (en) Service request handling
CN107431634A (en) A kind of method, apparatus and system of the interface established between VNFM
CN102130786B (en) Method and device for updating characteristics of single board

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