[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111628879B - Service network realization method and device - Google Patents

Service network realization method and device Download PDF

Info

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
management node
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
Application number
CN201910146407.8A
Other languages
Chinese (zh)
Other versions
CN111628879A (en
Inventor
董文新
郭文艳
张博亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN111628879B/en
Publication of CN111628879A publication Critical patent/CN111628879A/en
Application granted granted Critical
Publication of CN111628879B publication Critical patent/CN111628879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

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

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 topology corresponding to each service; 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 searched 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 nodes, and has the advantages that the mutual inquiry among service nodes can be avoided by carrying out the configuration of the network topology in advance, the target service node which stores the service content can be quickly searched through the network topology, the service content can be quickly transferred, and the method has good effect in service scenes with strong requirements on the waiting time of streaming media service.

Description

Service network realization method and device
Technical Field
The present invention relates to the field of computer networks, and in particular, to a method and apparatus for implementing a service network.
Background
In the scenes of streaming media service and the like, users often are distributed in a wide region, and a server side needs to provide streaming media content to be watched for the users through different clusters. Each service node in the cluster is not necessarily capable of storing the streaming media content required by the user, so that 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 acquire the streaming media content from other service nodes, and how to effectively schedule the service content is a problem to be solved.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a method and apparatus for implementing a service network that overcomes or at least partially solves the above problems.
According to one aspect of the present invention, there is provided a method for implementing a service network, including:
pre-configuring and storing network topology corresponding to each service;
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 searched network topology and the service request, and notifying the second service node to send service content to the first service node.
Optionally, the searching for the corresponding network topology according to the service to which the service request belongs includes: and searching out the corresponding network topology according to the service identifier in the service request.
Optionally, the determining the second service node according to the found network topology and the service request includes:
searching a management node which stores 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 notifying the management node to select a second service node from the service nodes storing the service contents.
Optionally, the pre-configuring and saving the network topology corresponding to each service includes:
Receiving service content identifiers reported by service nodes registered in the management node;
And determining a target management node according to the service content identifier, and informing the target management node that the service content identifier is 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 queried according to the service content identifier in the service request, and querying the management node to be queried for the management node which stores 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 implementation apparatus, including:
The network topology unit is suitable for pre-configuring and storing network topologies corresponding to the services; the method comprises the steps of 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 the service node unit is suitable for determining a second service node according to the searched network topology and the service request and notifying the second service node to send 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 out 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 notifying the management node to select a second service node from the service nodes storing the service contents.
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 identifier, and informing the target management node that the service content identifier is 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 to be queried, where the management node is stored with the service content identifier.
Optionally, the service content is streaming media.
According to 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 described in any of the above.
According to a further aspect of the present invention there is provided a computer readable storage medium storing one or more programs which when executed by a processor implement a method as described in any of the above.
As can be seen from the foregoing, according to the technical solution of the present invention, by constructing a service network, pre-configuring and storing network topologies corresponding to each service, after receiving a service request sent by a first service node, searching for a corresponding network topology according to a service to which the service request belongs, determining a second service node according to the searched network topology and the service request, and notifying the second service node to send service contents to the first service node. The technical scheme can be applied to the management nodes, and has the advantages that the mutual inquiry among service nodes can be avoided by carrying out the configuration of the network topology in advance, the target service node which stores the service content can be quickly searched through the network topology, the service content can be quickly transferred, and the method has good effect in service scenes with strong requirements on the waiting time of streaming media service.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
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 designate like parts throughout the figures. In the drawings:
FIG. 1 is a flow diagram illustrating a method of implementing a business network according to one 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 node network, according to one embodiment of the invention;
FIG. 4 shows a schematic structural diagram of an electronic device according to one embodiment of the invention;
fig. 5 illustrates a schematic structure 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 shows a flow diagram of a method for implementing a service network according to an embodiment of the invention. As shown in fig. 1, the method includes:
step S110, pre-configuring and storing network topology corresponding to each service.
The method can be applied to the management nodes for managing each service node, wherein the service node can realize a single service, can realize a plurality of services, and one management node can manage the service node related to the single service and can also manage the service nodes related to the plurality of services.
Step S120, receiving the service request sent by the first service node, and finding out the corresponding network topology according to the service to which the service request belongs.
For example, if the user watches live broadcast, the first service node sends a viewing requirement, and if the first service node does not have a live broadcast stream of the corresponding anchor, the first node may 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 service (i.e. the network topology formed by the service nodes implementing live service).
Step S130, determining a second service node according to the searched network topology and the service request, and notifying the second service node to send service content to the first service node.
For example, if the second service node is determined to store the live stream of the corresponding anchor through the searched network topology and 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, the network topology corresponding to each service is preconfigured and stored, after a service request sent by a first service node is received, the corresponding network topology is first found according to the service to which the service request belongs, then 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 nodes, and has the advantages that the mutual inquiry among service nodes can be avoided by carrying out the configuration of the network topology in advance, the target service node which stores the service content can be quickly searched through the network topology, the service content can be quickly transferred, and the method has good effect in service scenes with strong requirements on the waiting time of streaming media service.
In one embodiment of the present invention, in the above method, searching the corresponding network topology according to the service to which the service request belongs includes: and searching out the corresponding network topology according to the service identification in the service request.
For example, different service identifiers are allocated to services such as live broadcast and playback, and corresponding service identifiers are carried in the sent service request, so that the management node searches 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 according to the found network topology and the service request includes: searching a management node which stores the service content identifier in the network topology according to the service content identifier in the service request; at least one service node storing service content is registered on the searched management node; the notification management node selects a second service node from the service nodes storing the service contents.
Wherein the service identity is used for identifying the service type and the service content identity is used for distinguishing different service contents, such as live streams of different hosts. In a specific implementation, the selection of the second service node may be performed by interworking of a plurality of management nodes. In this case, the service node requests the service content from the management node, and if there is a corresponding service content in the other service nodes registered on the management node, the second service node is selected from the service nodes stored with the service content. If no corresponding service content exists in other service nodes registered on the management node, the management node which stores 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 which stores the service content is registered on the searched management node, and then the searched management node is informed to select a second service node from the service nodes which store the service content.
In one embodiment of the present invention, in the method, pre-configuring and storing network topologies corresponding to each service includes: receiving service content identifiers reported by service nodes registered in the management node; and determining a target management node according to the service content identifier, and informing the target management node of the service content identifier stored in the management node as configuration information.
By referring to the above, it can be determined how the management node manages the service content by the content reported by the service node immediately after the service node receives the service content. Specifically, the service node registered by the present management node reports the service content identifier, then calculates to obtain a target management node by means of hash operation and the like, and then informs the target management node that the service content identifier is stored in the present management node.
In a specific example, the service node 2 on the management node 1 has a live broadcast stream 36012345678 (service content identifier), and then it is determined that the management node 3 is a target management node by performing a hash operation on the live broadcast stream 36012345678, and 36012345678 stored on the management node 1 is used as configuration information to inform the management node 3.
In one embodiment of the present invention, in the above method, searching for a management node storing a service content identifier in a network topology according to the service content identifier in the service request includes: and determining the management node to be queried according to the service content identification in the service request, and querying the management node to be queried for the management node which stores the service content identification.
In combination with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678 to it, since the service node on the management node 4 does not have the live stream, it can be determined that the management node 3 is the target management node according to the hash operation, the service content identifier of the live stream 36012345678 is queried to the management node 3 and stored on the management node 1, and the management node 4 requests the live stream to the management node 1, 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 procedure describes a push-pull procedure, and in one embodiment of the present invention, in the above method, the service content is streaming media. And the transmission of other service contents can be referred to and will not be described herein.
Consider the case of an increase and decrease in management nodes, where the decrease may be downtime without other available management node supplements, or actively curtailing the number of management nodes according to business needs. The execution flow is similar to the previous one, and the management node storing the service content identifier is recalculated, for example, stream migration is performed; traffic on the service node is scheduled, etc.
If disaster tolerance is considered, a standby node can be configured for each management node to avoid the influence of downtime of the management node, so that a master-slave architecture is formed, but a single point problem exists.
Specifically, a management node acknowledgement request sent by a service node is received first. Wherein the management node may manage machine states, stored data, service information, etc. of the service nodes registered thereon. For example, in a live scenario, a 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 confirmation of the management node is not equivalent to the registration of the management node, but a first determination is made on which management node to register, so that a reliable management node can be basically obtained.
And secondly, according to the management node confirmation request, returning management node information corresponding to the designated management node to the service node so as to enable the service node to register on the designated management node. The specific confirmation may be implemented by a plurality of management nodes, for example, maintaining a table of the reliable management nodes, updating in real time according to the states of the management nodes, determining a specific management node as a designated management node according to parameters such as an idle state, and the like. The service node can report the corresponding information to realize management after registering on the appointed management node.
Therefore, after receiving the management node confirmation request sent by the service node, the method returns 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. Wherein, the management node can manage the machine state, the stored data and the service information of the service node registered on the management node; the registration process is divided into two steps, firstly, the service node is confirmed to be registered on which management node, and then the service node is registered on the corresponding management node, so that even if the registered management node is down, a new available management node can be obtained for registration again through the first step of process confirmation, the proper management of the service node is realized, and each management node is not required to be provided with a slave node, thereby improving the utilization rate of resources.
In one embodiment of the present invention, in the above method, the management node confirms that the request is sent by the service node when the service node is first on-line; and/or the management node confirms that the request is when the service node is disconnected from the registered management node.
In a specific embodiment, the service node may determine, according to the pre-configuration information, to which management node to send the management node acknowledgement request when the service node is first on-line. Wherein two or more management nodes for each service node may be configured with priority for disaster recovery. For example, the service node 1 transmits a management node acknowledgement request to the management node 2 by default, and transmits a management node acknowledgement request to the management node 3 if communication is not successful. If management node information corresponding to the specified management node can be obtained, a registration flow is performed, for example, registration is performed on the management node 4. When the connection with the management node 4 is disconnected, a management node confirmation request is sent again to the management node 2 or the management node 3 (the flow is similar to the above), for example, a new designated management node is obtained as the management node 5, and registration is performed on the management node 5.
Here, if the management node 4 is restored to normal, the management node 5 may be registered on the management node 4 by disconnecting from the service node 1 and re-registering it. Similarly each management node also needs to perform migration of the service node.
In an embodiment of the present invention, in the method, the method further includes: establishing connection with a plurality of management nodes to form a management node network; returning management node information corresponding to the designated management node to the service node includes: a management node is determined as a designated management node based on the network of management nodes.
In particular, each management node in the network of management nodes may be connected to other management nodes in the network of management nodes, e.g. forming a consistent hash ring.
In an embodiment of the present invention, in the above method, the management node request includes a management node tag; determining a management node as a designated management node based on the network of management nodes includes: judging whether the management node corresponding to the management node label is available or not, if so, taking the management node corresponding to the management node label as the appointed management node.
When the management node is down, the management node can be removed from the management node network, that is, judging whether the management node corresponding to the management node label is available or not can be simplified to judging whether the management node corresponding to the management node label is in the management node network or not. 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 above method, determining a management node as a designated management node according to the management node network further includes: and if the management node corresponding to the management node label is not available, selecting one management node which is in the same cluster with the service node as the designated management node.
In this case, considering that the management node corresponding to the management node label is unavailable, that is, cannot register on the management node, in order to ensure efficiency (for example, 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 the state of managing the service node is relatively smaller.
In an embodiment of the present invention, in the above method, determining a management node as a designated management node according to the management node network further includes: if the management node which is in the same cluster with the service node does not exist, hash calculation is carried out according to the management node data in the management node network, and the designated management node is determined according to the calculation result. For example, in the case where the management nodes form a consistent hash ring as described above, the designated management node may 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 a 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 the appointed management node.
In this case, the single-point master-slave and the management node network are combined, so that a new management node can be further and more quickly brought on line when the management node is down.
In one embodiment of the present invention, in the above method, establishing a connection with a plurality of management nodes, forming a management node network includes: according to the preset management node address, respectively establishing connection with each management node; the status of each connected management node is recorded.
The management node may record the status of other management nodes, such as online, offline, down, etc., by means of a state machine.
In one embodiment of the present invention, in the above method, recording the status of each connected management node includes: and sending heartbeat information to each connected management node, and determining the state of each management node according to the sent heartbeat information of each management node. Specifically, in one embodiment of the present invention, in the above method, the heartbeat information includes status 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: when one management node recorded in the management node is in a first state, if the quantity or proportion of the state information recorded in the first state of the management node received in one period reaches a corresponding preset value, other management nodes in the management node network are informed to execute the operation corresponding to the switching of a second state, and after the operation is completed, the management node is recorded to be in the second state.
When the management node is started, connection is established with each management node according to the address of other configured management nodes, and heartbeat information is mutually sent.
In a specific embodiment, the management node 1 sends a connection request to the management node 2, the management node 3 and the management node 4 after starting (i.e. online), 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 the connection. When the heartbeat is sent to each other, the state information of the management node 1 recorded by the management node 2 is carried, so that the management node 2 receives 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 the proportion of the state information in which the management node 1 is in an on-line state reaches a preset value, the management node 1, the management node 3 and the management node 4 are informed of being on-line with a new management node, namely the management node 1, and then migration can be executed, for example, the connection with a part of service nodes is disconnected, so that the service nodes are registered on the management node 1. The old ring can be used first and then the new ring can be created during migration. After the migration is completed, other management nodes are still inquired, and if the number or the proportion of the management nodes with the migration completed reach a preset value, the state of the management node 1 is set to be available, and notification is continued through heartbeat. After the migration is completed, the old ring is deleted, and the service is provided through the new ring.
In an embodiment of the present invention, in the method, when the first state is an on-line state, the second state is an available state; when the first state is an offline state, the second state is a downtime state; performing operations corresponding to switching the second state includes: and migrating the service node.
Similar to the example given above, when one management node considers that another state is originally available management node with the time-out of the heartbeat, the management node recording the time-out of the heartbeat is disconnected, and further determines the state of the management node with the time-out of the heartbeat through the heartbeat information of the other management nodes, if the number or the proportion of the state information, which is received in a period and records that the management node with the time-out of the heartbeat is offline, reaches a corresponding preset value, other management nodes are notified, and the management node with the time-out of the heartbeat is down, so that service node migration is performed.
In an embodiment of the present invention, in the method, the method further includes: receiving service node information reported by a service node registered in the management node; the service node information includes: status information of the service node and/or service information.
The state information of the service node may include information such as hardware resource consumption on a machine, and the service information may be determined according to an actual service requirement, for example, related information of a live stream in a live scene.
Fig. 2 shows 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 service network implementation apparatus 200 includes:
A network topology unit 210 adapted to pre-configure and store a network topology corresponding to each service; and the network topology searching module 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 the management nodes for managing each service node, wherein the service node can realize a single service, can realize a plurality of services, and one management node can manage the service node related to the single service and can also manage the service nodes related to the plurality of services. For example, if the user watches live broadcast, the first service node sends a viewing requirement, and if the first service node does not have a live broadcast stream of the corresponding anchor, the first node may 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 service (i.e. the network topology formed by the service nodes implementing live service).
The service node unit 220 is adapted to determine a second service node according to the network topology and the service request, and inform the second service node to send the service content to the first service node.
For example, if the second service node is determined to store the live stream of the corresponding anchor through the searched network topology and 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 device shown in fig. 2, by constructing a service network, the network topology corresponding to each service is preconfigured and stored, after a service request sent by a first service node is received, the corresponding network topology is first found according to the service to which the service request belongs, then 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 nodes, and has the advantages that the mutual inquiry among service nodes can be avoided by carrying out the configuration of the network topology in advance, the target service node which stores the service content can be quickly searched through the network topology, the service content can be quickly transferred, and the method has good effect in service scenes with strong requirements on the waiting time of streaming media service.
In an embodiment of the present invention, in the foregoing apparatus, the network topology unit 210 is adapted to find a corresponding network topology according to a service identifier in the service request.
For example, different service identifiers are allocated to services such as live broadcast and playback, and corresponding service identifiers are carried in the sent service request, so that the management node searches the corresponding network topology according to the service identifiers.
In an embodiment of the present invention, in the foregoing apparatus, the service node unit 220 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 service content is registered on the searched management node; the notification management node selects a second service node from the service nodes storing the service contents.
Wherein the service identity is used for identifying the service type and the service content identity is used for distinguishing different service contents, such as live streams of different hosts. In a specific implementation, the selection of the second service node may be performed by interworking of a plurality of management nodes. In this case, the service node requests the service content from the management node, and if there is a corresponding service content in the other service nodes registered on the management node, the second service node is selected from the service nodes stored with the service content. If no corresponding service content exists in other service nodes registered on the management node, the management node which stores 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 which stores the service content is registered on the searched management node, and then the searched management node is informed to select a second service node from the service nodes which store the service content.
In one embodiment of the present invention, in the above device, the network topology unit 210 is adapted to receive a service content identifier reported by a service node registered in the present management node; and determining a target management node according to the service content identifier, and informing the target management node of the service content identifier stored in the management node as configuration information.
By referring to the above, it can be determined how the management node manages the service content by the content reported by the service node immediately after the service node receives the service content. Specifically, the service node registered by the present management node reports the service content identifier, then calculates to obtain a target management node by means of hash operation and the like, and then informs the target management node that the service content identifier is stored in the present management node.
In a specific example, the service node 2 on the management node 1 has a live broadcast stream 36012345678 (service content identifier), and then it is determined that the management node 3 is a target management node by performing a hash operation on the live broadcast stream 36012345678, and 36012345678 stored on the management node 1 is used as configuration information to inform the management node 3.
In an embodiment of the present invention, in the foregoing 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 to it, since the service node on the management node 4 does not have the live stream, it can be determined that the management node 3 is the target management node according to the hash operation, the service content identifier of the live stream 36012345678 is queried to the management node 3 and stored on the management node 1, and the management node 4 requests the live stream to the management node 1, 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 procedure describes a push-pull procedure, and in one embodiment of the present invention, in the above device, the service content is streaming media. And the transmission of other service contents can be referred to and will not be described herein.
Consider the case of an increase and decrease in management nodes, where the decrease may be downtime without other available management node supplements, or actively curtailing the number of management nodes according to business needs. The execution flow is similar to the previous one, and the management node storing the service content identifier is recalculated, for example, stream migration is performed; traffic on the service node is scheduled, etc.
If disaster tolerance is considered, a standby node can be configured for each management node to avoid the influence of downtime of the management node, so that a master-slave architecture is formed, but a single point problem exists.
In one embodiment of the present invention, the apparatus further comprises: 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, service information, etc. of the service nodes registered thereon. For example, in a live scenario, a 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 confirmation of the management node is not equivalent to the registration of the management node, but a first determination is made on which management node to register, so that a reliable management node can be basically obtained.
And the management node confirmation unit is suitable for returning the management node information corresponding to the designated management node to the service node according to the management node confirmation request so as to enable the service node to register on the designated management node.
The specific confirmation may be implemented by a plurality of management nodes, for example, maintaining a table of the reliable management nodes, updating in real time according to the states of the management nodes, determining a specific management node as a designated management node according to parameters such as an idle state, and the like. The service node can report the corresponding information to realize management after registering on the appointed management node.
After receiving the management node confirmation request sent by the service node, the device returns 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. Wherein, the management node can manage the machine state, the stored data and the service information of the service node registered on the management node; the registration process is divided into two steps, firstly, the service node is confirmed to be registered on which management node, and then the service node is registered on the corresponding management node, so that even if the registered management node is down, a new available management node can be obtained for registration again through the first step of process confirmation, the proper management of the service node is realized, and each management node is not required to be provided with a slave node, thereby improving the utilization rate of resources.
In one embodiment of the present invention, in the above apparatus, the management node acknowledges that the request is sent by the service node when it is first on-line; and/or the management node confirms that the request is when the service node is disconnected from the registered management node.
In a specific embodiment, the service node may determine, according to the pre-configuration information, to which management node to send the management node acknowledgement request when the service node is first on-line. Wherein two or more management nodes for each service node may be configured with priority for disaster recovery. For example, the service node 1 transmits a management node acknowledgement request to the management node 2 by default, and transmits a management node acknowledgement request to the management node 3 if communication is not successful. If management node information corresponding to the specified management node can be obtained, a registration flow is performed, for example, registration is performed on the management node 4. When the connection with the management node 4 is disconnected, a management node confirmation request is sent again to the management node 2 or the management node 3 (the flow is similar to the above), for example, a new designated management node is obtained as the management node 5, and registration is performed on the management node 5.
Here, if the management node 4 is restored to normal, the management node 5 may be registered on the management node 4 by disconnecting from the service node 1 and re-registering it. Similarly each management node also needs to perform migration of the service node.
In an embodiment of the present invention, in the foregoing 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 confirmation unit is suitable for determining one management node as a designated management node according to the management node network.
In particular, each management node in the network of management nodes may be connected to other management nodes in the network of management nodes, e.g. forming a consistent hash ring.
In one embodiment of the present invention, in the above apparatus, the management node request includes a management node tag; and the management node confirmation 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 appointed management node.
When the management node is down, the management node can be removed from the management node network, that is, judging whether the management node corresponding to the management node label is available or not can be simplified to judging whether the management node corresponding to the management node label is in the management node network or not. 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 foregoing apparatus, the management node confirmation unit is adapted to select, as the designated management node, a management node that is in the same cluster as the service node if the management node corresponding to the management node label is unavailable.
In this case, considering that the management node corresponding to the management node label is unavailable, that is, cannot register on the management node, in order to ensure efficiency (for example, 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 the state of managing the service node is relatively smaller.
In an embodiment of the present invention, in the foregoing apparatus, the management node confirmation unit is adapted to perform hash computation 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 the computation result. For example, in the case where the management nodes form a consistent hash ring as described above, the designated management node may be determined by hash calculation based on the unique identifier such as the 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 to which the service node is originally registered as the designated management node.
In this case, the single-point master-slave and the management node network are combined, so that a new management node can be further and more quickly brought on line when the management node is down.
In one embodiment of the present invention, in the above apparatus, the management node network unit is adapted to establish a connection with each management node according to a pre-configured management node address; and adapted to record the status of each management node connected.
The management node may record the status of other management nodes, such as online, offline, down, etc., by means of a state machine.
In one embodiment of the present invention, in the above apparatus, the management node network unit is adapted to send heartbeat information to each of the connected management nodes, and determine a state of each of the management nodes according to the sent heartbeat information of each of the management nodes. Specifically, in one embodiment of the present invention, in the above apparatus, the heartbeat information includes status information of other management nodes recorded in the present management node; and the management node network unit is suitable for notifying other management nodes in the management node network to execute the operation corresponding to the switching of the second state if the quantity or proportion of the state information recorded in the first state of the management node received in one period 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.
When the management node is started, connection is established with each management node according to the address of other configured management nodes, and heartbeat information is mutually sent.
In a specific embodiment, the management node 1 sends a connection request to the management node 2, the management node 3 and the management node 4 after starting (i.e. online), 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 the connection. When the heartbeat is sent to each other, the state information of the management node 1 recorded by the management node 2 is carried, so that the management node 2 receives 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 the proportion of the state information in which the management node 1 is in an on-line state reaches a preset value, the management node 1, the management node 3 and the management node 4 are informed of being on-line with a new management node, namely the management node 1, and then migration can be executed, for example, the connection with a part of service nodes is disconnected, so that the service nodes are registered on the management node 1. The old ring can be used first and then the new ring can be created during migration. After the migration is completed, other management nodes are still inquired, and if the number or the proportion of the management nodes with the migration completed reach a preset value, the state of the management node 1 is set to be available, and notification is continued through heartbeat. After the migration is completed, the old ring is deleted, and the service is provided through the new ring.
In one embodiment of the present invention, in the apparatus, when the first state is an on-line 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 nodes.
Similar to the example given above, when one management node considers that another state is originally available management node with the time-out of the heartbeat, the management node recording the time-out of the heartbeat is disconnected, and further determines the state of the management node with the time-out of the heartbeat through the heartbeat information of the other management nodes, if the number or the proportion of the state information, which is received in a period and records that the management node with the time-out of the heartbeat is offline, reaches a corresponding preset value, other management nodes are notified, and the management node with the time-out of the heartbeat is down, so that 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 present management node; the service node information includes: status information of the service node and/or service information.
The state information of the service node may include information such as hardware resource consumption on a machine, and the service information may be determined according to an actual service requirement, for example, 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 invention. As shown in fig. 3, the node network 300 includes a plurality of service nodes 320 and a plurality of management nodes 310, in which the implementation apparatus 200 of the service network as any one of the above is deployed.
In summary, according to the technical scheme of the invention, by constructing a service network, pre-configuring and storing network topologies corresponding to each service, after receiving a service request sent by a first service node, searching the corresponding network topology according to the service to which the service request belongs, determining a second service node according to the searched network topology and the service request, and notifying the second service node to send service contents to the first service node. The technical scheme can be applied to the management nodes, and has the advantages that the mutual inquiry among service nodes can be avoided by carrying out the configuration of the network topology in advance, the target service node which stores the service content can be quickly searched through the network topology, the service content can be quickly transferred, and the method has good effect in service scenes with strong requirements on the waiting time of streaming media service.
The service nodes can still divide the clusters, but the boundaries of the clusters are not obvious any more, and the service nodes can be used for distinguishing through labels, so that updating and upgrading, AB testing and the like are facilitated. According to the embodiment, the clusters can mutually transmit business contents such as push-pull flow and the like, and uplink and downlink direct broadcast flow and the like can be basically ensured to be in one cluster during specific scheduling, and of course, the clusters can not be in one cluster in the scenes such as increasing or decreasing the number of the clusters, switching the 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 also be used with the teachings herein. The required structure for the construction of such devices is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood 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 construed as reflecting the intention that: i.e., the claimed invention 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 apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. 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. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units 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 but not others included in other embodiments, 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 can be used in any combination.
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 some or all of the functions of some or all of the components in an implementation of a service network according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
For example, fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present 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 memory space 430 for storing computer readable program code may include individual computer readable program code 431 for implementing the various steps in the above methods, respectively. The computer readable program code 431 may 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 as described for example in fig. 5. Fig. 5 illustrates a schematic structure of a computer-readable storage medium according to an embodiment of the present invention. The computer readable storage medium 500 stores computer readable program code 431 for performing the steps of the method according to the present invention, which may be read by the processor 410 of the electronic device 400, which computer readable program code 431, when executed by the electronic device 400, causes the electronic device 400 to perform the steps of the method described above, in particular, the computer readable program code 431 stored by the computer readable storage medium may perform 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 use of the words first, second, third, etc. do not denote any order. 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 topology corresponding to each service;
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 searched network topology and the service request, and notifying the second service node to send service content to the first service node.
A2, the method of A1, wherein the searching the corresponding network topology according to the service to which the service request belongs comprises:
and searching out the corresponding network topology according to the service identifier in the service request.
A3, the method of A1, wherein the determining a second service node according to the searched network topology and the service request comprises:
searching a management node which stores 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 notifying the management node to select a second service node from the service nodes storing the service contents.
A4, the method of A3, wherein the pre-configuring and storing the network topology corresponding to each service includes:
Receiving service content identifiers reported by service nodes registered in the management node;
And determining a target management node according to the service content identifier, and informing the target management node that the service content identifier is stored in the management node as configuration information.
A5, the method of A4, wherein the searching 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 queried according to the service content identifier in the service request, and querying the management node to be queried for the management node which stores the service content identifier.
The method of any one of A1-A5, wherein the service content is streaming media.
The embodiment of the invention also discloses a B7 and a device for realizing the service network, which comprises the following steps:
The network topology unit is suitable for pre-configuring and storing network topologies corresponding to the services; the method comprises the steps of 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 the service node unit is suitable for determining a second service node according to the searched network topology and the service request and notifying the second service node to send service content to the first service node.
B8, the device of B7, wherein,
The network topology unit is suitable for searching out the corresponding network topology according to the service identification in the service request.
B9, the device of B7, wherein,
The service node unit is suitable for searching a management node which stores 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 notifying the management node to select a second service node from the service nodes storing the service contents.
B10, the device of B9, wherein,
The network topology unit is suitable for receiving service content identifiers reported by service nodes registered in the management node; and determining a target management node according to the service content identifier, and informing the target management node that the service content identifier is stored in the management node as configuration information.
B11, the device of B10, wherein,
The network topology unit is suitable for determining the management node to be queried according to the service content identification in the service request, and querying the management node to be queried for the management node which stores the service content identification.
B12, the apparatus of 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 of A1-A6.
Embodiments of the invention also disclose D14, a computer readable storage medium storing one or more programs which, when executed by a processor, implement the method of any of A1-A6.

Claims (10)

1. A method for implementing a service network, comprising:
pre-configuring and storing network topology corresponding to each service;
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;
Determining a second service node according to the searched network topology and the service request, and notifying the second service node to send service content to the first service node;
The determining the second service node according to the searched network topology and the service request comprises:
searching a management node storing the service content identifier in the network topology in a preset operation mode 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;
Notifying the management node to select a second service node from the service nodes stored with the service content;
the pre-configuring the network topology corresponding to each service and storing the network topology comprises the following steps:
Receiving service content identifiers reported by service nodes registered in the management node;
And determining a target management node according to the service content identifier in the preset operation mode, and informing the target management node of the service content identifier stored in the management node as configuration information.
2. The method of claim 1, wherein the searching for the corresponding network topology according to the service to which the service request belongs comprises:
and searching out the corresponding network topology according to the service identifier in the service request.
3. The method of claim 1, wherein the locating the management node in the network topology that stores the service content identification based on the service content identification in the service request comprises:
And determining a management node to be queried according to the service content identifier in the service request, and querying the management node to be queried for the management node which stores the service content identifier.
4. A method according to any of claims 1-3, wherein the traffic content is streaming media.
5. An implementation apparatus of a service network, comprising:
The network topology unit is suitable for pre-configuring and storing network topologies corresponding to the services; the method comprises the steps of 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;
a service node unit 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;
The service node unit is suitable for searching a management node which stores the service content identifier in the network topology in a preset operation mode 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; notifying the management node to select a second service node from the service nodes stored with the service content;
The network topology unit is suitable for receiving service content identifiers reported by service nodes registered in the management node; and determining a target management node according to the service content identifier in the preset operation mode, and informing the target management node of the service content identifier stored in the management node as configuration information.
6. The apparatus of claim 5, wherein,
The network topology unit is suitable for searching out the corresponding network topology according to the service identification in the service request.
7. The apparatus of claim 5, wherein,
The network topology unit is suitable for determining the management node to be queried according to the service content identification in the service request, and querying the management node to be queried for the management node which stores the service content identification.
8. The apparatus of any of claims 5-7, wherein the traffic content is streaming media.
9. An electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the method of any of claims 1-4.
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-4.
CN201910146407.8A 2019-02-27 2019-02-27 Service network realization method and device Active CN111628879B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (1)

* Cited by examiner, † Cited by third party
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
CN111371627B (en) Method for setting multiple IPs (Internet protocol) in Kubernetes through Pod
US20080005321A1 (en) Monitoring and Managing Distributed Devices
EP3398043B1 (en) System and method for acquiring, processing, and updating global information
CN108924244B (en) Distributed system and flow distribution method and device for same
CN106933548B (en) Global information obtaining, processing and updating method, device and system
CN107656695B (en) Data storage and deletion method and device and distributed storage system
CN106933550B (en) Global information obtaining, processing and updating method, device and system
US20160344582A1 (en) Call home cluster
CN107645386B (en) Method and device for acquiring data resources
CN110196843B (en) File distribution method based on container cluster and container cluster
CN111131445B (en) DHCP cluster scheduling method and DHCP cluster system
CN107015767B (en) NAS device, distributed processing system and method
WO2022067830A1 (en) Application context migration method and device
CN111628879B (en) Service network realization method and device
CN107547605B (en) message reading and writing method based on node queue and node equipment
US20180013860A1 (en) Method and apparatus for determining to-be-uploaded nsd
CN111885103A (en) Resource processing method, server, electronic device, and storage medium
CN112398913B (en) Service scheduling method and system
CN117014492A (en) Cloud desktop dynamic migration method, device, equipment and storage medium
CN106375132B (en) Cloud server system and management method thereof
CN111629013B (en) Service node management method, device and node network
CN113965538A (en) Equipment state message processing method, device and storage medium
CN107332679B (en) Centerless information synchronization method and device
CN116991333B (en) Distributed data storage method, device, electronic equipment and storage medium
CN105554524A (en) Method and system for broadcasting program

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