A method and device for implementing a business network
By pre-configuring the network topology and business content identification, the business content in the streaming media service can be quickly found and delivered, which solves the problem of low content delivery efficiency between business nodes in the streaming media service and achieves fast delivery and efficient business content delivery.
Patent Information
- Application Number
- CN201910146407.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-27
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2039-02-27
AI Technical Summary
In scenarios such as streaming media services, users are distributed over a wide area and the service provider needs to provide streaming media content through different clusters. There is a lack of effective content scheduling mechanism between business nodes, resulting in low content delivery efficiency.
By pre-configuring and saving the network topology corresponding to each service, after receiving the service request, the corresponding network topology is found according to the service to which the request belongs, and the target service node that stores the service content is determined, and the node is notified to send the content to the requesting node. .
It realizes the rapid delivery of business content, avoids mutual inquiries between business nodes, significantly improves the waiting time of streaming media services, and improves the efficiency of business content delivery.
Smart Images

Figure CN111628879B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer networks, and in particular to a method and device for implementing a service network. Background Art
[0002] In scenarios such as streaming services, users are often distributed in a wide area, and the service provider needs to use different clusters to provide users with the streaming content they need to watch. Each service node in the cluster may not be able to store the streaming content required by the user. Therefore, after receiving the user's viewing request, if the service node does not have the corresponding streaming content, it needs to obtain it from other service nodes. How to effectively schedule the service content is a problem that needs to be solved. Summary of the invention
[0003] In view of the above problems, the present invention is proposed to provide a method and device for implementing a service network that overcomes the above problems or at least partially solves the above problems.
[0004] According to one aspect of the present invention, a method for implementing a service network is provided, comprising:
[0005] Pre-configure and save the network topology corresponding to each business;
[0006] Receiving a service request sent by the first service node, and finding a corresponding network topology according to the service to which the service request belongs;
[0007] 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.
[0008] Optionally, searching for a corresponding network topology according to the service to which the service request belongs includes: searching for a corresponding network topology according to a service identifier in the service request.
[0009] Optionally, determining the second service node according to the found network topology and the service request includes:
[0010] According to the service content identifier in the service request, a management node storing the service content identifier is searched in the network topology; at least one service node storing the service content is registered on the searched management node;
[0011] The management node is notified to select a second service node from the service nodes storing the service content.
[0012] Optionally, the pre-configuring and saving the network topology corresponding to each service includes:
[0013] Receive the service content identifier reported by the service node registered at the management node;
[0014] The target management node is determined according to the service content identifier, and the service content identifier stored in the current management node is notified as configuration information to the target management node.
[0015] Optionally, searching for a management node storing the service content identifier in the network topology according to the service content identifier in the service request includes:
[0016] The management node to be queried is determined according to the service content identifier in the service request, and the management node to be queried is queried for the management node storing the service content identifier.
[0017] Optionally, the service content is streaming media.
[0018] According to another aspect of the present invention, a service network implementation device is provided, comprising:
[0019] A network topology unit, adapted to pre-configure and save network topologies corresponding to each service; and adapted to receive a service request sent by a first service node, and find out a corresponding network topology according to the service to which the service request belongs;
[0020] The service node unit is adapted to determine a second service node according to the found network topology and the service request, and notify the second service node to send service content to the first service node.
[0021] Optionally, the network topology unit is adapted to search for a corresponding network topology according to a service identifier in the service request.
[0022] Optionally, the service node unit is adapted to search for a management node storing the service content identifier in the network topology according to the service content identifier in the service request; at least one service node storing the service content is registered on the searched management node; and the management node is notified to select a second service node from the service nodes storing the service content.
[0023] Optionally, the network topology unit is adapted to receive a service content identifier reported by a service node registered with the current management node; determine a target management node according to the service content identifier, and inform the target management node that the service content identifier is stored in the current management node as configuration information.
[0024] Optionally, the network topology unit is adapted to determine the management node to be queried according to the service content identifier in the service request, and query the management node to be queried for the management node storing the service content identifier.
[0025] Optionally, the service content is streaming media.
[0026] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the above methods.
[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the one or more programs implement any of the methods described above.
[0028] As can be seen from the above, the technical solution of the present invention, by constructing a service network, pre-configuring and saving the network topology corresponding to each service, after receiving the service request sent by the first service node, first find out the corresponding network topology according to the service to which the service request belongs, and then determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node. This technical solution can be applied to management nodes, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content, which has a good effect in business scenarios such as streaming media services that have strong requirements for waiting time.
[0029] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0031] Figure 1 A schematic diagram of a process for implementing a service network according to an embodiment of the present invention is shown;
[0032] Figure 2 A schematic diagram showing the structure of a device for implementing a service network according to an embodiment of the present invention is shown;
[0033] Figure 3 A schematic diagram of the structure of a node network according to an embodiment of the present invention is shown;
[0034] Figure 4 A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown;
[0035] Figure 5 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0036] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0037] Figure 1 FIG. 1 is a flow chart showing a method for implementing a service network according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0038] Step S110: pre-configure and save the network topology corresponding to each service.
[0039] The method can be applied to a management node that manages each service node, wherein a service node can implement a single service or multiple services, and a management node can manage service nodes related to a single service or multiple services.
[0040] Step S120: receiving a service request sent by the first service node, and finding out a corresponding network topology according to the service to which the service request belongs.
[0041] For example, when a user wants to watch a live broadcast, the user sends a viewing request to the first service node. If the first service node does not have the corresponding live broadcast stream of the host, the first node can send a service request to the management node above, that is, request the live broadcast stream of the corresponding host. The management node first determines the network topology of the live broadcast service (that is, the network topology composed of the service nodes that implement the live broadcast).
[0042] Step S130: determine the second service node according to the found network topology and service request, and notify the second service node to send service content to the first service node.
[0043] For example, if it is determined through the found network topology and service request that the live stream of the corresponding anchor is stored on the second service node, the second service node is notified to send the live stream to the first service node.
[0044] visible, Figure 1The method shown, by constructing a service network, pre-configuring and saving the network topology corresponding to each service, after receiving the service request sent by the first service node, first find out the corresponding network topology according to the service to which the service request belongs, then determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node. This technical solution can be applied to the management node, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content. It has a good application effect in service scenarios with strong requirements for waiting time, such as streaming media services.
[0045] In one embodiment of the present invention, in the above method, finding out the corresponding network topology according to the service to which the service request belongs includes: finding out the corresponding network topology according to the service identifier in the service request.
[0046] For example, different service identifiers are allocated to services such as live broadcast and playback, and the corresponding service identifiers are carried in the sent service requests so that the management node can find the corresponding network topology according to the service identifiers.
[0047] In one embodiment of the present invention, in the above method, determining the second service node based on the found network topology and service request includes: finding a management node storing a service content identifier in the network topology based on the service content identifier in the service request; registering at least one service node storing the service content on the found management node; and notifying the management node to select a second service node from the service nodes storing the service content.
[0048] Among them, the service identifier is used to identify the service type, and the service content identifier is used to distinguish different service contents such as live streams of different anchors. In specific implementation, the selection of the second service node can be carried out through the cooperation of multiple management nodes. In one case, the service node requests service content from the management node. If there is corresponding service content in other service nodes registered on the management node, the second service node can be selected from the service nodes storing the service content. If there is no corresponding service content in other service nodes registered on the management node, the management node storing the service content identifier is found in the network topology according to the service content identifier in the service request. This means that at least one service node storing the service content is registered on the found management node, and then the found management node is notified to select the second service node from the service nodes storing the service content.
[0049] In one embodiment of the present invention, in the above method, pre-configuring and saving the network topology corresponding to each service includes: receiving the service content identifier reported by the service node registered in the current management node; determining the target management node according to the service content identifier, and informing the target management node of the service content identifier saved in the current management node as configuration information.
[0050] By referring to the above content, it can be determined how the management node manages the content reported by the business node when the business node just receives the business content. Specifically, the business node registered by the management node can report the business content identifier, and then calculate a target management node through hash operation and other methods, and then inform the target management node that the business content identifier is stored in the management node.
[0051] In a specific example, business node 2 on management node 1 has a live stream 36012345678 (business content identifier), and management node 3 is determined to be the target management node by performing a hash operation on it, and management node 3 is informed that 36012345678 is saved on management node 1 as configuration information.
[0052] In one embodiment of the present invention, in the above method, searching for a management node storing a business content identifier in the network topology according to the business content identifier in the business request includes: determining a management node to be queried according to the business content identifier in the business request, and inquiring the management node to be queried for the management node storing the business content identifier.
[0053] Combined with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678, since none of the service nodes on the management node 4 has this live stream, then according to the hash operation, it can also be determined that the management node 3 is the target management node, and the service content identifier of the live stream 36012345678 is stored on the management node 1 after being inquired from the management node 3. Then the management node 4 requests the live stream from the management node 1, so that the management node 1 can allocate a service node such as service node 2 to push the live stream to the service node 5. The above process describes a process of pushing and pulling streams. In one embodiment of the present invention, in the above method, the service content is streaming media. The transmission of other service contents can be implemented with reference, and will not be introduced one by one here.
[0054] Consider the increase and decrease of management nodes. The decrease can be due to downtime and no other available management nodes, or the number of management nodes can be reduced according to business needs. The execution process is similar to the previous one. The management nodes with business content identifiers need to be recalculated, such as flow migration, traffic scheduling on business nodes, etc.
[0055] The node network formed by each management node and business node, if disaster recovery is considered, in order to avoid the impact of management node failure on usage, a backup node can be configured for each management node, forming a master-slave architecture, but there is a single point problem. For this reason, an embodiment of the present invention also provides a method for business node management, which can also be applied to management nodes.
[0056] Specifically, a management node confirmation request sent by a business node is first received. The management node can manage the machine status, stored data, business information, etc. of the business nodes registered on it. For example, in a live broadcast scenario, the management node can manage the live broadcast stream information of each node registered on it. In a specific embodiment, there are multiple management nodes, and the confirmation of the management node is not equivalent to the registration of the management node, but it is determined in advance which management node to register on, so that a reliable management node can basically be obtained.
[0057] Secondly, according to the management node confirmation request, the management node information corresponding to the designated management node is returned to the business node, so that the business node can be registered on the designated management node. There are many ways to confirm reliable management nodes, such as maintaining a table of reliable management nodes, updating it in real time according to the status of each management node, and then determining a specific management node as the designated management node based on parameters such as idle status, etc. After the business node is registered on the designated management node, it can report the corresponding information to achieve management.
[0058] It can be seen that the above method, after receiving the management node confirmation request sent by the business node, returns the management node information corresponding to the designated management node to the business node according to the management node confirmation request, so that the business node is registered on the designated management node. Among them, the management node can manage the machine status, stored data, and business information of the business nodes registered on it; and the registration process is divided into two steps, first confirming which management node the business node needs to register on, and then the business node registers to the corresponding management node. In this way, even if the registered management node is down, it can be re-confirmed through the first step to obtain a new available management node for registration, which realizes the proper management of the business node, and it is not necessary to equip each management node with a slave node, which improves the utilization of resources.
[0059] In one embodiment of the present invention, in the above method, the management node confirmation request is sent by the service node when it first comes online; and / or, the management node confirmation request is sent by the service node when it disconnects from a registered management node.
[0060] In a specific embodiment, when a business node first goes online, it can determine to which management node to send a management node confirmation request based on pre-configuration information. For disaster recovery considerations, two or more management nodes can be configured for each business node according to priority. For example, business node 1 sends a management node confirmation request to management node 2 by default, and if communication fails, it sends a management node confirmation request to management node 3. If the management node information corresponding to the designated management node can be obtained, the registration process is performed, such as registering on management node 4. When the connection with management node 4 is disconnected, a management node confirmation request is resent to management node 2 or management node 3 (the process is similar to the previous text). For example, if the new designated management node is management node 5, registration is performed on management node 5.
[0061] Here, if the management node 4 recovers to normal, the management node 5 can be disconnected from the service node 1 to re-register, thereby registering with the management node 4. Similarly, each management node also needs to migrate the service node.
[0062] In one embodiment of the present invention, in the above method, the method also includes: establishing connections with several management nodes to form a management node network; returning management node information corresponding to the designated management node to the business node includes: determining a management node as the designated management node based on the management node network.
[0063] Specifically, each management node in the management node network may be connected to other management nodes in the management node network, for example, to form a consistent hash ring.
[0064] In one embodiment of the present invention, in the above method, the management node request includes a management node label; determining a management node as a designated management node based on the management node network includes: judging whether the management node corresponding to the management node label is available, and if so, using the management node corresponding to the management node label as the designated management node.
[0065] Among them, when the management node is down, it can be excluded from the management node network, that is, judging whether the management node corresponding to the management node label is available can be simplified to judging whether the management node corresponding to the management node label is in the management node network. Specifically, each service node can be configured with several management nodes, such as management nodes with better network transmission and higher efficiency. If these management nodes are available, such management nodes are preferred, so they can be saved as management node labels in advance.
[0066] In one embodiment of the present invention, in the above method, determining a management node as the designated management node based on the management node network also includes: if the management node corresponding to the management node label is unavailable, selecting a management node in the same cluster as the business node as the designated management node.
[0067] Here, the situation that the management node corresponding to the management node label is unavailable, that is, registration cannot be performed on it, is considered. In order to ensure efficiency (such as data transmission efficiency), a management node in the same cluster as the business node is selected as the designated management node, so that the delay caused by the management node in managing the state of the business node is relatively smaller.
[0068] In one embodiment of the present invention, in the above method, determining a management node as a designated management node based on the management node network further includes: if there is no management node in the same cluster as the service node, performing a hash calculation based on the management node data in the management node network, and determining the designated management node based on the calculation result. For example, in the case where the management nodes described above form a consistent hash ring, the designated management node can be determined by hash calculation based on the unique identifier such as the machine serial number of each management node.
[0069] In one embodiment of the present invention, in the above method, determining a management node as the designated management node according to the management node network includes: using a backup management node of the management node originally registered by the service node as the designated management node.
[0070] In this case, the single-point master-slave is combined with the management node network, which can further and more quickly launch a new management node when the management node goes down.
[0071] In one embodiment of the present invention, in the above method, establishing connections with several management nodes to form a management node network includes: establishing connections with each management node respectively according to a pre-configured management node address; and recording the status of each connected management node.
[0072] The management node can record the status of other management nodes through the state machine, such as online, offline, downtime, etc.
[0073] In one embodiment of the present invention, in the above method, recording the status of each connected management node includes: sending heartbeat information to each other with each connected management node, and determining the status of each management node based on the heartbeat information sent by each management node. Specifically, in one embodiment of the present invention, in the above method, the heartbeat information includes the status information of other management nodes recorded in the present management node; determining the status of each management node based on the heartbeat information sent by each management node includes: when a management node recorded in the present management node is in a first state, if the number or proportion of status information recorded that the management node is in the first state received within a cycle reaches a corresponding preset value, then notifying other management nodes in the management node network to perform an operation corresponding to switching to the second state, and when the operation is completed, recording that the management node is in the second state.
[0074] When the management node is started, it establishes connections with other management nodes according to the configured addresses of other management nodes and sends heartbeat information to each other.
[0075] In a specific embodiment, after the management node 1 is started (i.e., online), it sends a connection request to the management node 2, the management node 3, and the management node 4. When the management node 2, the management node 3, and the management node 4 receive the connection request, the management node 1 is recorded as the initial state, and the management node 1 is recorded as the online state after the heartbeat information is received through the connection. When sending heartbeats to each other, the state information of the management node 1 recorded by itself is also carried, so that the management node 2 will receive the state information of the management node 1 sent by the management node 1, the management node 3, and the management node 4. When the number or proportion of the state information recording the online state of the management node 1 reaches a preset value, the management node 1, the management node 3, and the management node 4 are notified that a new management node, i.e., the management node 1, is online, and then migration can be performed, for example, disconnecting from a part of the service nodes so that they are registered with the management node 1. When migrating, the old ring can be used first, and then a new ring can be created. After the migration is completed, other management nodes are still asked. If it is considered that the number or proportion of the management nodes that have completed the migration reaches the preset value, the state of the management node 1 is set to available, and the notification through the heartbeat continues. After the migration is complete, the old ring is deleted and services are provided through the new ring.
[0076] In one embodiment of the present invention, in the above method, when the first state is an online state, the second state is an available state; when the first state is an offline state, the second state is a downtime state; executing an operation corresponding to switching the second state includes: migrating the business node.
[0077] Similar to the example given above, when a management node believes that the heartbeat of another management node that was originally available has timed out, it records that the management node with the timed out heartbeat is offline, and further determines the status of the management node with the timed out heartbeat through heartbeat information with other management nodes. If the number or proportion of status information recorded as the offline management node with the timed out heartbeat received within a cycle reaches the corresponding preset value, the other management nodes are notified that the management node with the timed out heartbeat is down, and the business node migration is performed.
[0078] In one embodiment of the present invention, in the above method, the method further includes: receiving service node information reported by a service node registered at the management node; the service node information includes: status information and / or service information of the service node.
[0079] Among them, the status information of the business node may include information such as hardware resource consumption on the machine, and the business information can be determined according to actual business needs, such as related information of the live broadcast stream in a live broadcast scenario.
[0080] Figure 2 FIG. 2 shows a schematic diagram of a structure of a device for implementing a service network according to an embodiment of the present invention. Figure 2 As shown, the service network implementation device 200 includes:
[0081] The network topology unit 210 is adapted to pre-configure and save the network topology corresponding to each service; and is adapted to receive a service request sent by the first service node, and find out the corresponding network topology according to the service to which the service request belongs.
[0082] The device can be applied to a management node that manages each service node, wherein a service node can implement a single service or multiple services, and a management node can manage service nodes related to a single service or multiple services. For example, when a user watches a live broadcast, a viewing demand is sent to the first service node. If there is no live broadcast stream of the corresponding anchor on the first service node, the first node can send a service request to the upper management node, that is, request the live broadcast stream of the corresponding anchor. The management node first determines the network topology of the live broadcast service (that is, the network topology composed of the service nodes that implement the live broadcast).
[0083] The service node unit 220 is adapted to determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node.
[0084] For example, if it is determined through the found network topology and service request that the live stream of the corresponding anchor is stored on the second service node, the second service node is notified to send the live stream to the first service node.
[0085] visible, Figure 2 The device shown, by constructing a service network, pre-configures and saves the network topology corresponding to each service, and after receiving the service request sent by the first service node, first finds the corresponding network topology according to the service to which the service request belongs, and then determines the second service node according to the found network topology and the service request, and notifies the second service node to send the service content to the first service node. This technical solution can be applied to management nodes, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content. It has a good application effect in service scenarios with strong requirements for waiting time, such as streaming media services.
[0086] In one embodiment of the present invention, in the above-mentioned device, the network topology unit 210 is adapted to find out the corresponding network topology according to the service identifier in the service request.
[0087] For example, different service identifiers are allocated to services such as live broadcast and playback, and the corresponding service identifiers are carried in the sent service requests so that the management node can find the corresponding network topology according to the service identifiers.
[0088] In one embodiment of the present invention, in the above-mentioned device, the service node unit 220 is suitable for finding a management node storing a service content identifier in the network topology according to the service content identifier in the service request; at least one service node storing the service content is registered on the found management node; and the management node is notified to select a second service node from the service nodes storing the service content.
[0089] Among them, the service identifier is used to identify the service type, and the service content identifier is used to distinguish different service contents such as live streams of different anchors. In specific implementation, the selection of the second service node can be carried out through the cooperation of multiple management nodes. In one case, the service node requests service content from the management node. If there is corresponding service content in other service nodes registered on the management node, the second service node can be selected from the service nodes storing the service content. If there is no corresponding service content in other service nodes registered on the management node, the management node storing the service content identifier is found in the network topology according to the service content identifier in the service request. This means that at least one service node storing the service content is registered on the found management node, and then the found management node is notified to select the second service node from the service nodes storing the service content.
[0090] In one embodiment of the present invention, in the above-mentioned device, the network topology unit 210 is suitable for receiving the service content identifier reported by the service node registered in the current management node; determining the target management node according to the service content identifier, and informing the target management node of the service content identifier stored in the current management node as configuration information.
[0091] By referring to the above content, it can be determined how the management node manages the content reported by the business node when the business node just receives the business content. Specifically, the business node registered by the management node can report the business content identifier, and then calculate a target management node through hash operation and other methods, and then inform the target management node that the business content identifier is stored in the management node.
[0092] In a specific example, business node 2 on management node 1 has a live stream 36012345678 (business content identifier), and management node 3 is determined to be the target management node by performing a hash operation on it, and management node 3 is informed that 36012345678 is saved on management node 1 as configuration information.
[0093] In one embodiment of the present invention, in the above device, the network topology unit 210 is adapted to determine the management node to be queried according to the service content identifier in the service request, and query the management node to be queried for the management node storing the service content identifier.
[0094] Combined with the above example, when the service node 5 on the management node 4 requests the live stream 36012345678, since none of the service nodes on the management node 4 has this live stream, then according to the hash operation, it can also be determined that the management node 3 is the target management node, and the service content identifier of the live stream 36012345678 is stored on the management node 1 after being inquired from the management node 3. Then the management node 4 requests the live stream from the management node 1, so that the management node 1 can allocate a service node such as service node 2 to push the live stream to the service node 5. The above process describes a process of pushing and pulling streams. In one embodiment of the present invention, in the above device, the service content is streaming media. The transmission of other service contents can be implemented with reference, and will not be introduced one by one here.
[0095] Consider the increase and decrease of management nodes. The decrease can be due to downtime and no other available management nodes, or the number of management nodes can be reduced according to business needs. The execution process is similar to the previous one. The management nodes with business content identifiers need to be recalculated, such as flow migration, traffic scheduling on business nodes, etc.
[0096] The node network formed by each management node and business node, if disaster recovery is considered, in order to avoid the impact of management node failure on usage, a backup node can be configured for each management node, forming a master-slave architecture, but there is a single point problem. For this reason, an embodiment of the present invention also provides a solution.
[0097] In one embodiment of the present invention, the above-mentioned device further includes: a receiving unit, adapted to receive a management node confirmation request sent by a service node. The management node can manage the machine status, stored data, service information, etc. of the service nodes registered thereon. For example, in a live broadcast scenario, the management node can manage the live broadcast stream information of each node registered thereon.
[0098] In a specific embodiment, there are multiple management nodes, and the confirmation of the management node is not equivalent to the registration of the management node, but it is first determined on which management node to register, so that a reliable management node can be basically obtained.
[0099] The management node confirmation unit is adapted to return the management node information corresponding to the designated management node to the service node according to the management node confirmation request, so that the service node is registered on the designated management node.
[0100] There are many ways to confirm reliable management nodes, such as maintaining a table of reliable management nodes, updating in real time according to the status of each management node, and then determining a specific management node as the designated management node based on parameters such as idle status, etc. After the business node is registered on the designated management node, it can report the corresponding information to achieve management.
[0101] It can be seen that after receiving the management node confirmation request sent by the business node, the above device returns the management node information corresponding to the designated management node to the business node according to the management node confirmation request, so that the business node can be registered on the designated management node. Among them, the management node can manage the machine status, stored data, and business information of the business nodes registered on it; and the registration process is divided into two steps, first confirming which management node the business node needs to register on, and then the business node registers on the corresponding management node. In this way, even if the registered management node is down, it can be re-confirmed through the first step to obtain a new available management node for registration, which realizes the proper management of the business node, and it is not necessary to equip each management node with a slave node, which improves the utilization of resources.
[0102] In one embodiment of the present invention, in the above device, the management node confirmation request is sent by the service node when it first comes online; and / or, the management node confirmation request is sent by the service node when it disconnects from a registered management node.
[0103] In a specific embodiment, when a business node first goes online, it can determine to which management node to send a management node confirmation request based on pre-configuration information. For disaster recovery considerations, two or more management nodes can be configured for each business node according to priority. For example, business node 1 sends a management node confirmation request to management node 2 by default, and if communication fails, it sends a management node confirmation request to management node 3. If the management node information corresponding to the designated management node can be obtained, the registration process is performed, such as registering on management node 4. When the connection with management node 4 is disconnected, a management node confirmation request is resent to management node 2 or management node 3 (the process is similar to the previous text). For example, if the new designated management node is management node 5, registration is performed on management node 5.
[0104] Here, if the management node 4 recovers to normal, the management node 5 can be disconnected from the service node 1 to re-register, thereby registering with the management node 4. Similarly, each management node also needs to migrate the service node.
[0105] In one embodiment of the present invention, in the above-mentioned device, the device also includes: a management node network unit, suitable for establishing a connection with several management nodes to form a management node network; a management node confirmation unit, suitable for determining a management node as a designated management node based on the management node network.
[0106] Specifically, each management node in the management node network may be connected to other management nodes in the management node network, for example, to form a consistent hash ring.
[0107] In one embodiment of the present invention, in the above-mentioned device, the management node request includes a management node label; the management node confirmation unit is suitable for determining whether the management node corresponding to the management node label is available, and if so, the management node corresponding to the management node label is used as the designated management node.
[0108] Among them, when the management node is down, it can be excluded from the management node network, that is, judging whether the management node corresponding to the management node label is available can be simplified to judging whether the management node corresponding to the management node label is in the management node network. Specifically, each service node can be configured with several management nodes, such as management nodes with better network transmission and higher efficiency. If these management nodes are available, such management nodes are preferred, so they can be saved as management node labels in advance.
[0109] In one embodiment of the present invention, in the above device, the management node confirmation unit is adapted to select a management node in the same cluster as the service node as the designated management node if the management node corresponding to the management node label is unavailable.
[0110] Here, the situation that the management node corresponding to the management node label is unavailable, that is, registration cannot be performed on it, is considered. In order to ensure efficiency (such as data transmission efficiency), a management node in the same cluster as the business node is selected as the designated management node, so that the delay caused by the management node in managing the state of the business node is relatively smaller.
[0111] In one embodiment of the present invention, in the above-mentioned device, the management node confirmation unit is adapted to perform hash calculation based on the management node data in the management node network if there is no management node in the same cluster as the service node, and determine the designated management node based on the calculation result. For example, in the case where the management nodes described above form a consistent hash ring, the designated management node can be determined by hash calculation based on the unique identifier such as the machine serial number of each management node.
[0112] In one embodiment of the present invention, in the above-mentioned device, the management node confirmation unit is adapted to use the backup management node of the management node originally registered by the service node as the designated management node.
[0113] In this case, the single-point master-slave is combined with the management node network, which can further and more quickly launch a new management node when the management node goes down.
[0114] In one embodiment of the present invention, in the above-mentioned device, the management node network unit is adapted to establish connections with each management node respectively according to a pre-configured management node address; and is adapted to record the status of each connected management node.
[0115] The management node can record the status of other management nodes through the state machine, such as online, offline, downtime, etc.
[0116] In one embodiment of the present invention, in the above-mentioned device, the management node network unit is suitable for sending heartbeat information to each connected management node, and determining the status of each management node based on the heartbeat information sent by each management node. Specifically, in one embodiment of the present invention, in the above-mentioned device, the heartbeat information includes the status information of other management nodes recorded in the present management node; the management node network unit is suitable for notifying other management nodes in the management node network to perform an operation corresponding to switching to the second state when a management node recorded in the present management node is in the first state, if the number or proportion of status information recorded that the management node is in the first state received within a cycle reaches a corresponding preset value, and when the operation is completed, record that the management node is in the second state.
[0117] When the management node is started, it establishes connections with other management nodes according to the configured addresses of other management nodes and sends heartbeat information to each other.
[0118] In a specific embodiment, after the management node 1 is started (i.e., online), it sends a connection request to the management node 2, the management node 3, and the management node 4. When the management node 2, the management node 3, and the management node 4 receive the connection request, the management node 1 is recorded as the initial state, and the management node 1 is recorded as the online state after the heartbeat information is received through the connection. When sending heartbeats to each other, the state information of the management node 1 recorded by itself is also carried, so that the management node 2 will receive the state information of the management node 1 sent by the management node 1, the management node 3, and the management node 4. When the number or proportion of the state information recording the online state of the management node 1 reaches a preset value, the management node 1, the management node 3, and the management node 4 are notified that a new management node, i.e., the management node 1, is online, and then migration can be performed, for example, disconnecting from a part of the service nodes so that they are registered with the management node 1. When migrating, the old ring can be used first, and then a new ring can be created. After the migration is completed, other management nodes are still asked. If it is considered that the number or proportion of the management nodes that have completed the migration reaches the preset value, the state of the management node 1 is set to available, and the notification through the heartbeat continues. After the migration is complete, the old ring is deleted and services are provided through the new ring.
[0119] In one embodiment of the present invention, in the above-mentioned device, when the first state is an online state, the second state is an available state; when the first state is an offline state, the second state is a downtime state; the management node network unit is also suitable for migrating service nodes.
[0120] Similar to the example given above, when a management node believes that the heartbeat of another management node that was originally available has timed out, it records that the management node with the timed out heartbeat is offline, and further determines the status of the management node with the timed out heartbeat through heartbeat information with other management nodes. If the number or proportion of status information recorded as the offline management node with the timed out heartbeat received within a cycle reaches the corresponding preset value, the other management nodes are notified that the management node with the timed out heartbeat is down, and the business node migration is performed.
[0121] In one embodiment of the present invention, in the above device, the receiving unit is further adapted to receive service node information reported by the service node registered with the management node; the service node information includes: status information and / or service information of the service node.
[0122] Among them, the status information of the business node may include information such as hardware resource consumption on the machine, and the business information can be determined according to actual business needs, such as related information of the live broadcast stream in a live broadcast scenario.
[0123] Figure 3 FIG. 2 shows a schematic diagram of a node network structure according to an embodiment of the present invention. Figure 3 As shown, the node network 300 includes a plurality of service nodes 320 and a plurality of management nodes 310, and the management nodes are deployed with a service network implementation device 200 as described above.
[0124] In summary, the technical solution of the present invention, by constructing a service network, pre-configuring and saving the network topology corresponding to each service, after receiving the service request sent by the first service node, first find out the corresponding network topology according to the service to which the service request belongs, and then determine the second service node according to the found network topology and the service request, and notify the second service node to send the service content to the first service node. This technical solution can be applied to management nodes, and the beneficial effect is that by configuring the network topology in advance, it is possible to avoid mutual inquiries between service nodes, and instead quickly find the target service node that stores the service content through the network topology, and quickly deliver the service content, which has a good effect in service scenarios such as streaming media services that have strong requirements for waiting time.
[0125] Each service node can still be divided into clusters, but the boundaries of the clusters are no longer obvious, and can be distinguished by labels to facilitate updates, upgrades, AB testing, etc. It can be seen from the above embodiments that clusters can transmit service content such as push and pull streams to each other. In specific scheduling, the uplink and downlink live streams can basically be guaranteed to be in one cluster. Of course, in scenarios such as the increase or decrease of the number of clusters and switching of traffic, the uplink and downlink may not be in one cluster.
[0126] It should be noted that:
[0127] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. Various general-purpose devices can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of device. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for the purpose of disclosing the best mode of the present invention.
[0128] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0129] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0130] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0131] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0132] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the implementation device of the service network according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0133] For example, Figure 4A schematic diagram of the structure of an electronic device according to an embodiment of the present invention is shown. The electronic device includes a processor 410 and a memory 420 arranged to store computer executable instructions (computer readable program code). The memory 420 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. The memory 420 has a storage space 430 for storing a computer readable program code 431 for executing any method step in the above method. For example, the storage space 430 for storing computer readable program code may include individual computer readable program codes 431 for implementing various steps in the above method respectively. The computer readable program code 431 can be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card or a floppy disk. Such a computer program product is typically, for example Figure 5 The computer-readable storage medium. Figure 5 A schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention is shown. The computer-readable storage medium 500 stores a computer-readable program code 431 for executing the method steps according to the present invention, which can be read by the processor 410 of the electronic device 400. When the computer-readable program code 431 is executed by the electronic device 400, the electronic device 400 executes the various steps in the method described above. Specifically, the computer-readable program code 431 stored in the computer-readable storage medium can execute the method shown in any of the above embodiments. The computer-readable program code 431 can be compressed in an appropriate form.
[0134] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0135] The embodiment of the present invention discloses A1, a method for implementing a service network, comprising:
[0136] Pre-configure and save the network topology corresponding to each business;
[0137] Receiving a service request sent by the first service node, and finding a corresponding network topology according to the service to which the service request belongs;
[0138] 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.
[0139] A2. The method as described in A1, wherein the step of finding out a corresponding network topology according to the service to which the service request belongs comprises:
[0140] The corresponding network topology is found according to the service identifier in the service request.
[0141] A3. The method as described in A1, wherein determining the second service node according to the found network topology and the service request comprises:
[0142] According to the service content identifier in the service request, a management node storing the service content identifier is searched in the network topology; at least one service node storing the service content is registered on the searched management node;
[0143] The management node is notified to select a second service node from the service nodes storing the service content.
[0144] A4. The method as described in A3, wherein the pre-configuring and saving the network topology corresponding to each service comprises:
[0145] Receive the service content identifier reported by the service node registered at the management node;
[0146] The target management node is determined according to the service content identifier, and the service content identifier stored in the current management node is notified as configuration information to the target management node.
[0147] A5. The method as described in A4, wherein searching for a management node storing the service content identifier in the network topology according to the service content identifier in the service request comprises:
[0148] The management node to be queried is determined according to the service content identifier in the service request, and the management node to be queried is queried for the management node storing the service content identifier.
[0149] A6. A method as described in any one of A1-A5, wherein the service content is streaming media.
[0150] The embodiment of the present invention further discloses B7, a device for implementing a service network, comprising:
[0151] A network topology unit, adapted to pre-configure and save network topologies corresponding to each service; and adapted to receive a service request sent by a first service node, and find out a corresponding network topology according to the service to which the service request belongs;
[0152] The service node unit is adapted to determine a second service node according to the found network topology and the service request, and notify the second service node to send service content to the first service node.
[0153] B8. The device as described in B7, wherein:
[0154] The network topology unit is adapted to find out the corresponding network topology according to the service identifier in the service request.
[0155] B9. The device as described in B7, wherein:
[0156] The service node unit is adapted to search for a management node storing the service content identifier in the network topology according to the service content identifier in the service request; register at least one service node storing the service content on the searched management node; and notify the management node to select a second service node from the service nodes storing the service content.
[0157] B10. The device as described in B9, wherein:
[0158] The network topology unit is adapted to receive a service content identifier reported by a service node registered in the management node; determine a target management node according to the service content identifier, and inform the target management node that the service content identifier is stored in the management node as configuration information.
[0159] B11. The device as described in B10, wherein:
[0160] The network topology unit is adapted to determine the management node to be queried according to the service content identifier in the service request, and to query the management node to be queried for the management node storing the service content identifier.
[0161] B12. A device as described in any one of B7-B11, wherein the service content is streaming media.
[0162] An embodiment of the present invention also discloses C13, an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to execute a method as described in any one of A1-A6.
[0163] An embodiment of the present invention further discloses D14, a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, implement the method as described in any one of A1-A6.
Claims
1. A method for implementing a business network, comprising: Pre-configure and save the network topology corresponding to each business; Receiving a service request sent by the first service node, and finding a corresponding network topology according to the service to which the service request belongs; 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; Determining the second service node according to the found network topology and the service request includes: According to the service content identifier in the service request, a management node storing the service content identifier is searched in the network topology by a preset operation method; 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 storing the service content; The pre-configuring and saving the network topology corresponding to each service includes: Receive the service content identifier reported by the service node registered at the management node; The target management node is determined according to the service content identifier by the preset operation mode, and the service content identifier stored in the current management node is notified to the target management node as configuration information.
2. The method of claim 1, wherein: The finding out the corresponding network topology according to the service to which the service request belongs includes: The corresponding network topology is found according to the service identifier in the service request.
3. The method of claim 1, wherein: The step of searching the network topology for a management node storing the service content identifier according to the service content identifier in the service request includes: The management node to be queried is determined according to the service content identifier in the service request, and the management node to be queried is queried for the management node storing the service content identifier.
4. The method according to any one of claims 1 to 3, wherein: The service content is streaming media.
5. A device for implementing a business network, comprising: A network topology unit, adapted to pre-configure and save network topologies corresponding to various services; and adapted to receive a service request sent by the first service node, and find out a corresponding network topology according to the 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 adapted to search for a management node storing the service content identifier in the network topology through a preset calculation method according to the service content identifier in the service request; At least one service node storing the service content is registered on the found management node; the management node is notified to select a second service node from the service nodes storing the service content; The network topology unit is adapted to receive a service content identifier reported by a service node registered in the management node; determine a target management node according to the service content identifier through the preset operation method, and inform the target management node that the service content identifier is stored in the management node as configuration information.
6. The device according to claim 5, wherein: The network topology unit is adapted to find out the corresponding network topology according to the service identifier in the service request.
7. The device according to claim 5, wherein: The network topology unit is adapted to determine the management node to be queried according to the service content identifier in the service request, and to query the management node to be queried for the management node storing the service content identifier.
8. The device according to any one of claims 5 to 7, wherein: The service content is streaming media.
9. An electronic device, wherein: The electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor is caused to perform the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, wherein: The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Business path regulation method and communication system as well as route computing unit
CN101227313A
Method for sharing load of SIP registrar in IP dispatching system
CN102523237A
Method, device and system for determining content distribution nodes
CN102638483A
System, method and service node for providing video contents
CN103179433A
Service node configuration method and service node pool logger and system
CN103491129A
