WO2018076765A1 - Content distribution method and device for cloud computing system, computing node and system - Google Patents

Content distribution method and device for cloud computing system, computing node and system Download PDF

Info

Publication number
WO2018076765A1
WO2018076765A1 PCT/CN2017/091276 CN2017091276W WO2018076765A1 WO 2018076765 A1 WO2018076765 A1 WO 2018076765A1 CN 2017091276 W CN2017091276 W CN 2017091276W WO 2018076765 A1 WO2018076765 A1 WO 2018076765A1
Authority
WO
WIPO (PCT)
Prior art keywords
content
distribution
node
content distribution
distributed
Prior art date
Application number
PCT/CN2017/091276
Other languages
French (fr)
Chinese (zh)
Inventor
刘成华
肖腾飞
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018076765A1 publication Critical patent/WO2018076765A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/124Shortest path evaluation using a combination of metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Definitions

  • the present invention relates to communications technologies, and in particular, to a content distribution method and apparatus, a computing node, and a system of a cloud computing system.
  • Cloud computing originated from large Internet companies, which refers to the delivery and use of IT infrastructure. Through the network, the required resources such as hardware, platform, software, etc. are obtained in an on-demand and scalable manner.
  • Virtualization technology is the main supporting technology in the field of cloud computing.
  • a cloud computing center includes multiple physical servers. Each physical server can be divided into multiple virtual machines, each with independent computing and processing capabilities.
  • the number of physical servers in a cloud computing system can reach 100,000 units.
  • the number of virtual machines in a cloud computing system is even larger, generally reaching hundreds of thousands or millions. In this case, How to make a large number of virtual machines download to the distributed content quickly is an important issue that the cloud computing system needs to solve when distributing content.
  • P2P peer-to-peer
  • the BitTorrent (BT) distribution technology is a typical P2P distribution technology.
  • the BT system includes a central index server and a plurality of nodes.
  • the central index server receives and counts information such as the IP address and port number of all downloaders.
  • the download terminal can establish a connection with the node in the node list, and download data from the node that establishes the connection.
  • the download terminal can periodically connect to the central index server to inform the central index server of the content that it has downloaded. That is, in the BT system, each node can establish a connection with a plurality of other nodes, and download data from other connected nodes, and requires the node to occupy as much bandwidth as possible when downloading data, so as to improve downloading. speed.
  • the embodiments of the present invention provide a content distribution method and device, a computing node, and a system for a cloud computing system, which are used to solve the problem that the system traffic in the prior art in the content distribution of the cloud computing system is unpredictable.
  • a first aspect of the embodiments of the present invention provides a content distribution method of a cloud computing system, which is described in the perspective of a distribution controller, and the method includes:
  • a content distribution instruction is included, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, and the distribution target node list includes an identifier of the at least one distribution target node.
  • a content distribution path is generated according to a state traffic of each node in the physical networking topology cloud computing system of the cloud computing system and a distribution target node list, wherein the content distribution path is performed by the first node and at least one distribution target node A unidirectional chain distribution path is formed, and the head node is a node in the cloud computing system having a complete content to be distributed.
  • the content distribution message is sent to the at least one distribution target node, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node acquires and distributes according to the content distribution path and the identifier of the content to be distributed.
  • Content to be distributed is sent to the at least one distribution target node, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node acquires and distributes according to the content distribution path and the identifier of the content to be distributed.
  • the content distribution path is generated according to the physical networking topology of the cloud computing system, the state traffic of each node in the cloud computing system, and the distribution target node list, and the content distribution is performed according to the content distribution path.
  • the content distribution path is generated according to the physical networking topology information of the cloud computing system and the state traffic of each node in the cloud computing system, so that it is ensured that there is no disordered cross-connection between the distribution target nodes in the content distribution path. And ensuring that the actual traffic of each distribution target node in the content distribution path is within a controllable range.
  • the content distribution path is a unidirectional chain path, that is, the number of nodes connected to each node in the content distribution path is controlled by the distribution controller, so that the balance of the inbound and outbound bandwidth of each distribution target node can be achieved. Therefore, the method can ensure that the selected content distribution path is an optimal content distribution path.
  • the method can generate a content distribution path according to the physical networking topology information of the cloud computing system and the state traffic of each node in the cloud computing system each time the content distribution instruction is received, thereby ensuring that the content is performed each time.
  • the content distribution paths generated at the time of distribution are the optimal distribution paths. Further, based on the above-described optimal content distribution path, the flow control in the content distribution process can be fully realized.
  • the content distribution message further includes a specified distribution rate of the at least one distribution target node, which is determined according to the state traffic of the at least one distribution target node when the content distribution path is generated.
  • the method further includes:
  • two distribution target nodes that are located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • the node with the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path.
  • the content distribution path can be generated by the following methods:
  • two distribution target nodes that are located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • Generating a plurality of content distribution paths wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
  • it also includes:
  • the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
  • the first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
  • it also includes:
  • the first way to determine the faulty node in the content distribution path is:
  • the first distribution target node determines that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
  • the second way of determining the faulty node in the content distribution path is as follows:
  • Determining a faulty node in the content distribution path according to the status traffic reported by the at least one distribution target node and the distribution log.
  • the third way to determine the faulty node in the content distribution path is:
  • the second distribution target node determines that the downstream node of the second distribution target node is one of the content distribution paths, wherein the second distribution target node is the Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  • the above method further includes:
  • the above method further includes:
  • the method also includes:
  • the distribution progress, the distribution log, the distribution result, and the status traffic are transmitted to the terminal.
  • the HTTPS port when receiving the distribution progress, the distribution log, the distribution result, and the status traffic periodically reported by the distribution target node, the HTTPS port is used to receive the distribution progress and the distribution log periodically reported by the distribution target node. , distribution results, and status traffic.
  • a content distribution message is sent to the distribution target node using an HTTPS port when the content distribution message is sent to the distribution target node.
  • a second aspect of the embodiments of the present invention provides a content distribution method of a cloud computing system, where the method is described in the perspective of a computing node, and the method includes:
  • a content distribution message is received, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is determined by the distribution controller according to a physical networking topology of the cloud computing system, and a status of each node in the cloud computing system.
  • the traffic is generated by the distribution target node list, and the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, and the first node is a node in the cloud computing system that has the complete content to be distributed.
  • the metadata of the content to be distributed is obtained from the head node, and the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed.
  • the content distribution processing is performed based on the content distribution path and the metadata of the content to be distributed.
  • the content distribution message further includes a specified distribution rate of the distribution target node; correspondingly, when the content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed, the content distribution path may be And the metadata of the content to be distributed, and the content distribution processing is performed at a specified distribution rate.
  • the method further includes:
  • the following may be specifically performed by:
  • the block is saved, and the block is sent to a downstream node in the content distribution path according to the specified distribution rate.
  • the specific one when the block is sent to the downstream node in the content distribution path according to the specified distribution rate, the specific one may be:
  • a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  • it also includes:
  • the digital signature is checked according to the digital signature, and the result of the digital signature check is reported to the distribution controller.
  • it also includes:
  • the distribution progress, distribution log, distribution result, and status traffic are reported to the distribution controller.
  • the distribution progress, the distribution log, the distribution result, and the status traffic are reported to the distribution controller
  • the distribution progress, the distribution log, and the distribution log may be reported to the distribution controller by using an HTTPS protocol. Distribute results and status traffic.
  • a third aspect of the embodiments of the present invention provides a content distribution method, which is described in the home of a content repository, and the method includes:
  • Metadata of the content to be distributed is generated according to the identifier of the content to be distributed.
  • the method when the metadata of the content to be distributed is generated according to the identifier of the content to be distributed, the method may be specifically performed by the following method:
  • the partial number, the size of each part, the block size, the block index, the digital signature, and the block hash value of each block are written into the metadata of the content to be distributed.
  • a fourth aspect of the present invention provides a content distribution apparatus, including:
  • a receiving module configured to receive a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
  • a processing module configured to generate a content distribution path according to a physical networking topology of the cloud computing system, a state traffic of each node in the cloud computing system, and the distribution target node list, where the content distribution path is a first node and a a unidirectional chain distribution path formed by at least one distribution target node, where the first node is a node having a complete content to be distributed in the cloud computing system;
  • a sending module configured to send a content distribution message to the at least one distribution target node, where the content distribution message includes the content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node is configured according to the The content distribution path and the identifier of the content to be distributed acquire and distribute the content to be distributed.
  • the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is based on the at least one distribution target node when the content distribution path is generated The status of the traffic is determined.
  • the receiving module is further configured to receive a ready state reported by the at least one distribution target node
  • the sending module is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
  • the receiving module is further configured to receive a ready state reported by the at least one distribution target node
  • the sending module is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
  • processing module is further configured to:
  • two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • Generating a plurality of content distribution paths wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
  • processing module is further configured to:
  • the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
  • the first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
  • processing module is further configured to:
  • the processing module further includes:
  • a fourth determining unit configured to determine, when the response message for the content distribution message sent by the first distribution target node is not received, the first distribution target node is a faulty node in the content distribution path, where The first distribution target node is a distribution target node of any one of the content distribution paths.
  • the processing module further includes:
  • a fifth determining unit configured to determine a faulty node in the content distribution path according to the state traffic reported by the at least one distribution target node and the distribution log.
  • the processing module further includes:
  • a sixth determining unit configured to: when receiving the distribution failure message sent by the second distribution target node, determine that the downstream node of the second distribution target node is a fault node in the content distribution path, where the The second distribution target node is any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  • processing module is further configured to:
  • the receiving module is further configured to receive a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node;
  • the sending module is further configured to send the distribution progress, the distribution log, the distribution result, and the status traffic to the terminal.
  • a fifth aspect of the embodiments of the present invention provides a content distribution apparatus, including:
  • a receiving module configured to receive a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and the cloud computing a state traffic of each node in the system and a distribution target node list, where the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is in the system a complete node of the content to be distributed;
  • a processing module configured to acquire, according to the identifier of the content to be distributed, metadata of the content to be distributed from a first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a content of the content to be distributed Block hash value;
  • the processing module is further configured to perform content distribution processing according to the content distribution path and the metadata of the content to be distributed.
  • the content distribution message further includes a specified distribution rate of the distribution target node
  • the processing module is specifically configured to perform content distribution processing according to the specified distribution rate according to the content distribution path and the metadata of the content to be distributed.
  • it also includes:
  • a sending module configured to report a ready state to the distribution controller
  • the receiving module is further configured to receive a content receiving and forwarding indication sent by the distribution controller.
  • the processing module includes:
  • a receiving unit configured to receive a block sent by an upstream node
  • a checking unit configured to perform hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain a verification result
  • a sending unit configured to save the block when the verification result is a verification success, and send the block to a downstream node in the content distribution path according to the specified distribution rate.
  • the sending unit is specifically configured to:
  • a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  • the processing module is further configured to: when receiving all the blocks corresponding to the content to be distributed, perform digital signature check on the to-be-distributed content according to the digital signature, and digitally sign the The result of the check is reported to the distribution controller.
  • the processing module is further configured to obtain a distribution progress, a distribution log, a distribution result, and a status flow;
  • the sending module is further configured to report the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
  • a sixth aspect of the embodiments of the present invention provides a content distribution apparatus, including:
  • a receiving module configured to receive a creation metadata indication, where the creation metadata indication includes an identifier of the content to be distributed;
  • a processing module configured to generate metadata of the content to be distributed according to the identifier of the content to be distributed.
  • the processing module includes:
  • a dividing unit configured to perform partial division and block division on the to-be-distributed content after determining that the content to be distributed exists according to the content identifier to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
  • the processing unit is configured to perform digital signature processing on the content to be distributed, and obtain a digital signature.
  • a check unit is configured to perform hash check on each of the divided blocks to obtain a block hash value of each block.
  • a write unit for writing a partial number, a partial size, a block size, a block index, a digital signature, and a block hash value of each block into the metadata of the content to be distributed.
  • a seventh aspect of the embodiments of the present invention provides a distribution controller, including:
  • the memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
  • the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
  • a content distribution path According to a physical networking topology of the cloud computing system, a state traffic of each node in the cloud computing system, and the distribution target node list, wherein the content distribution path is a first node and the at least one distribution target a unidirectional chain distribution path formed by the node, where the head node is a node having a complete content to be distributed in the cloud computing system;
  • An eighth aspect of the embodiments of the present invention provides a computing node, including:
  • the memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
  • the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and each node in the cloud computing system
  • the status flow is generated by the distribution target node list, and the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is a complete system in the cloud computing system.
  • the metadata of the content to be distributed from the first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed;
  • Content distribution processing is performed based on the content distribution path and metadata of the content to be distributed.
  • a ninth aspect of the embodiments of the present invention provides a content repository, including:
  • the memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
  • the creation metadata indication includes an identifier of the content to be distributed
  • a tenth aspect of the present invention provides a content distribution system including the foregoing distribution controller, a computing node, and a content repository.
  • the distribution target node dynamically establishes a connection with other nodes in the process of downloading.
  • one distribution target node may establish a large number of The connection may cause a sudden burst of traffic, so the background technology cannot achieve effective flow control.
  • downloading a file block it is not downloaded or uploaded in order. Before downloading, first write the file with the same file capacity on the hard disk, and then randomly write the data by filling method. Each download needs to perform check calculation for all blocks. The read and write operations are performed simultaneously during the download and upload process, and the hard disk resources are occupied. Therefore, the efficiency of content distribution cannot be guaranteed.
  • the topology construction in the background art requires the support of the index server, and the order in which the nodes join the system has an extremely important influence on the formation of the topology.
  • the download and upload can be started, and if the node is downloaded, the exit may occur.
  • the number of "nodes" is zero, which causes some nodes to slow down and even download all the file blocks. Therefore, the background technology cannot guarantee the integrity of the distributed content.
  • the solution provided by the embodiment of the present invention can implement flow control in the content distribution process compared to the prior art.
  • FIG. 1 is a system architecture diagram of a content distribution method according to an embodiment of the present invention.
  • Embodiment 1 of a content distribution method according to an embodiment of the present invention
  • 3 is an example of a central physical server of a cloud computing system
  • Figure 5 is a schematic diagram of a single chain path
  • FIG. 6 is a schematic diagram of parallel distribution of multiple content distribution paths
  • FIG. 7 is a schematic diagram of a content distribution path bifurcation
  • FIG. 8 is a schematic diagram of deleting a faulty node from a content distribution path
  • FIG. 9 is a schematic diagram of rejoining a recovery node to a content distribution path
  • Figure 10 is a schematic diagram of content distribution to multiple subnets
  • FIG. 11 is a schematic flowchart of generating metadata according to Embodiment 2 of the present invention.
  • 12 is a schematic diagram of hierarchical division of content to be distributed
  • Figure 13 is a diagram showing an example of metadata of content to be distributed
  • FIG. 14 is a schematic diagram of a content receiving and forwarding process according to Embodiment 3 of a content distribution method according to an embodiment of the present disclosure
  • FIG. 15 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 16 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 17 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 18 is a block diagram of a fourth embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 19 is a block diagram showing a structure of a fifth embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 20 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 21 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • Figure 22 is a block diagram showing the structure of a third embodiment of a content distribution apparatus according to an embodiment of the present invention.
  • FIG. 23 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 24 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure.
  • FIG. 25 is a physical block diagram of Embodiment 1 of a distribution controller according to an embodiment of the present disclosure.
  • FIG. 26 is a physical block diagram of Embodiment 1 of a computing node according to an embodiment of the present disclosure
  • FIG. 27 is a physical block diagram of Embodiment 1 of a content repository according to an embodiment of the present invention.
  • the system involved in the embodiments of the present invention is a system consisting of a group of mutually independent computing nodes interconnected by a high-speed network, and the same content information needs to be shared or distributed between the computing nodes.
  • the deployment form of the system may be distributed deployment and centralized deployment.
  • the system can be a cloud computing system.
  • Each virtual machine in the cloud computing system can be regarded as a computing node in the system, and the same content information needs to be shared or distributed between the virtual machines.
  • system according to the embodiment of the present invention is not limited to a specific system, and any system in which the internal computing node needs to share or distribute the same content information may use the embodiment provided by the embodiment of the present invention. method.
  • computation node is collectively referred to as “node” in the embodiment of the present invention.
  • the physical network topology of the system refers to the location and connection relationship between physical devices in the physical network corresponding to the system.
  • the adjacent nodes refer to two nodes that are adjacent in the content distribution path, and the node 1, the node 2, and the node 3 in FIG. 1 are taken as an example, and the distribution path 1 in FIG. Node 1, Node 2, and Node 3, wherein Node 2 receives the distribution content from Node 1, that is, Node 2 and Node 1 are adjacent in the distribution path 1, and therefore, Node 1 and Node 2 are adjacent nodes.
  • node 3 and node 2 are also adjacent nodes.
  • node 1 is its upstream node and node 3 is its downstream node, ie, for a particular node 2, it receives the distribution content from the upstream node and sends the distribution to the unloading node.
  • Traffic refers to the amount of distributed data that the node uplinks (transmits) or downlinks (receives), that is, the amount of data sent or received by the node over a period of time.
  • a node with a low current traffic rate refers to a node that transmits and receives less data during the current statistical time period.
  • Bandwidth refers to the transmission speed allowed by the maximum data of the node within a specified time.
  • the flow control is achieved by limiting the bandwidth occupied by the node distribution process, the number of uplink and downlink connections of the node, and performing differentiated forwarding and packet loss control. of.
  • FIG. 1 is a system architecture diagram of a content distribution method according to an embodiment of the present invention. As shown in FIG. 1, the system includes a distribution controller, a content warehouse, and a plurality of nodes.
  • the distribution controller creates a content distribution path according to the information of the status, the traffic, the physical location, and the like of the plurality of nodes, and controls the plurality of nodes.
  • the distribution controller and the content distribution device may be the same.
  • the content repository is used to store the content to be distributed, and the content to be distributed is sent to the head node in the distribution path.
  • Each content distribution path is a unidirectional chain distribution path, and the first node in each distribution path is a node including the complete distribution content, and the first node starts to distribute the content to the nodes in the distribution path in order.
  • the distribution controller when a user needs to distribute the content to a distribution target node in the cloud computing system, receives a content distribution indication sent by the terminal that needs to distribute the content, where the content distribution indication includes the content to be distributed. And identifying a distribution target node list, wherein the distribution target node list includes an identifier of at least one distribution target node; at this time, the distribution controller determines which nodes the content needs to be distributed to.
  • the distribution controller generates a content distribution path according to the physical networking topology of the cloud computing system, the state traffic of each node, and the distribution target node list; and then sends a content distribution message including the content distribution path and the identifier of the content to be distributed to each distribution target. node.
  • Each node receives the content distribution path, establishes a content link channel with the upstream and downstream nodes according to the content distribution path, and starts content distribution.
  • FIG. 2 A specific content distribution process of an embodiment of the present invention is shown in FIG. 2.
  • FIG. 2 is an interaction flowchart of a content distribution method according to Embodiment 1 of the present invention.
  • the interaction process may utilize the system architecture of FIG. 1 and the network element therein to implement content distribution of the cloud computing system, as shown in FIG. 2 .
  • the method includes:
  • the user issues content to the content warehouse through the terminal.
  • the user can publish the new distributable content to the content repository through the terminal.
  • the terminal can directly publish the content to the content repository by using an Application Programming Interface (API) provided by the content repository.
  • API Application Programming Interface
  • the content is saved in the content repository.
  • the content repository stores the distributed content, and the content repository can generate a content identifier for the content, the content identifier uniquely identifies the content, and returns the content identifier to the terminal. Subsequent when the terminal or distribution controller needs to obtain content from the content repository, it needs to distinguish by the content identifier.
  • the user sends a content distribution indication to the distribution controller through the terminal.
  • the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, and the distribution target node list includes an identifier of the at least one distribution target node.
  • the content distribution indication is sent to the distribution controller through the terminal, and the content distribution indication indicates the identification and distribution of the content to be distributed. List of target nodes.
  • the identifier of the content to be distributed is used to indicate which content in the content warehouse is specifically distributed by the distribution controller, and the identifier of the content to be distributed is the identifier allocated by the content warehouse in the step S201.
  • the distribution target node list includes an identifier of at least one distribution target node, and the distribution target node refers to that the user wants to distribute the content to the destination node, and the nodes that need to be distributed to different contents may not be the same, and therefore, the user passes Each time the terminal sends a content distribution indication to the distribution controller, it needs to specify the target node to which the content is specifically sent.
  • the number of the distribution target nodes may be one or multiple, and the present invention does not limit the number thereof.
  • the identity of each distribution target node can be represented by the name, number, or IP address of the node, and the like.
  • steps S201 and S202 may be discontinuous in time, and the user may first publish the content to the content repository, and then select an appropriate time to send the content distribution indication to the distribution controller.
  • the terminal may first send an inquiry request to the content repository according to the identifier of the content to be distributed, and the content warehouse may determine whether the content corresponding to the identifier exists after receiving the query request, if If yes, the terminal returns a query success message to the terminal, and the terminal may continue to send the content distribution indication to the distribution controller. If not, the terminal may return a failure message to the terminal, and the terminal may only prompt the user for the content corresponding to the identifier, and prompt the user to re-confirm the content. Identify, without continuing to send a content distribution indication to the distribution controller.
  • the distribution controller generates a content distribution path according to the content distribution instruction.
  • the distribution controller After receiving the content distribution indication sent by the terminal, the distribution controller generates a content distribution path according to the physical networking topology, the status traffic of each node in the system, and the distribution target node list carried in the content distribution indication.
  • the physical networking topology indicates the current networking connection relationship between system nodes.
  • the status traffic of each node in the system indicates the status traffic status of each node.
  • the node status traffic can be the specific current traffic load situation, or the node. Whether the current traffic exceeds the threshold.
  • Each time the distribution controller receives the content distribution instruction it combines these two actual situations to select a content distribution path that can save the distribution time and save system traffic, thereby ensuring efficient content distribution and realizing flow control.
  • the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, and the first node in the content distribution path is the first node, and the node with complete content to be distributed in the system can be the first node.
  • the content distribution path generated by the distribution controller includes a first node and at least one distribution target node, and the connection relationship between the nodes is unidirectional chain, for example, for a node in the content distribution path.
  • A it can only receive data from one Node B, and can only send the received data to one node C, and can no longer send data to Node B, nor can it receive data from Node C.
  • content distribution can be used in the distribution process, that is, a complete distribution of content to be distributed is divided into multiple blocks, multiple pieces are distributed one by one, and finally combined into one complete content.
  • some nodes in the system may have all the blocks corresponding to the content to be distributed, that is, the complete content to be distributed, and these nodes can be the first nodes in the content distribution path.
  • Some nodes may have a part of the blocks, and these nodes cannot be the first node in the content distribution path.
  • the distribution controller generates a content distribution path based on the physical networking topology and the state traffic of each node in the system.
  • a chained path that is, the number of nodes to which each node in the content distribution path is connected can be controlled by a distribution controller. Specifically, it may be in the form of a single chain path, a plurality of concurrent chain paths, etc., and different types of chain paths may be used in different scenarios, which will be described in detail later in the embodiments of the present invention.
  • the distribution controller sends a creation metadata indication to the content warehouse.
  • the creation metadata indication includes an identifier of the content to be distributed.
  • the distribution controller may send a creation metadata indication to the content repository, the creation metadata indicating metadata for instructing the content repository to establish the content to be distributed, the content to be distributed
  • the metadata is the metadata formed after the content to be distributed and the security check is performed. In the content forwarding process, it is necessary to perform security according to the metadata and will be described in detail later.
  • the first node Since the first node has complete content to be distributed, that is, the first node has used metadata in the content forwarding process, metadata of the content to be distributed is also required in the first node.
  • the content repository generates metadata of the content to be distributed according to the creation metadata indication sent by the distribution controller.
  • the content repository determines the to-be-distributed content saved in the content repository according to the identifier of the content to be distributed carried therein, and generates metadata of the content to be distributed. Before generating the metadata of the content to be distributed, the content repository first determines whether the metadata of the content to be distributed has been generated, and if it has been generated, the generation operation is no longer performed, but the existing metadata can be directly used.
  • the metadata of the content to be distributed includes a digital signature of the content to be distributed, a block index, a block hash value, and the like, and a method of specifically generating metadata of the content to be distributed will be explained in detail in the introduction of FIG. 11 below.
  • the distribution controller sends a content distribution message to all distribution target nodes in the content distribution path.
  • each content distribution path may include multiple distribution target nodes, and distribute The controller can send a content distribution message to all of the distribution target nodes in the content distribution path.
  • the content distribution message sent by the distribution controller includes the content distribution path and the identifier of the content to be distributed, and after the distribution controller distributes the content distribution path to each distribution target node, the distribution target node may The content distribution path determines from which node the content is received and to which node the content is sent.
  • each distribution target node is also capable of receiving an identifier of the content to be distributed, and the distribution target node can determine which content should be specifically received or transmitted according to the identifier.
  • the distribution controller can pre-open the HTTPS port on it, and the HTTPS port is used for secure transmission of instructions.
  • the distribution controller can use the HTTPS port to send a content distribution message to the distribution destination node to improve the security of content distribution.
  • the distribution target node establishes a content connection channel.
  • a connection channel can be established with the other distribution target nodes according to the content distribution path.
  • the distribution target node can determine which nodes to connect with based on the content distribution path. For example, if there is a chain such as node A->node B->node C in the content distribution path, it means that when the distribution controller requests content distribution, the content is forwarded from node A to node B, and then forwarded by node B. To node C, for node B, a connection channel should be established with node A and node C.
  • Each distribution target node can open a TCP port in advance, and the TCP port can be used for secure transmission of content to be distributed.
  • each distribution target node and its neighbor nodes can establish a connection channel through a TCP port.
  • the distribution target node sends a request message for acquiring metadata of the content to be distributed to the head node.
  • each distribution target node can be from the content
  • the metadata of the content to be distributed is obtained in the first node in the distribution path.
  • the first node in the content distribution path is a node having the complete distribution content
  • the metadata of the content to be distributed is also stored in the first node, and the metadata is obtained before the first node obtains the complete distribution content.
  • the content warehouse can be used as the first node.
  • FIG. 1 also takes the content warehouse as the first node as an example.
  • the head node in a content distribution path is not limited to the content warehouse, and may be other nodes that have the complete distribution content and the metadata of the content to be distributed.
  • the first node sends, to each distribution target node, a response message of the request message for acquiring metadata of the content to be distributed, where the response message includes metadata of the content to be distributed.
  • the distribution target node reports the ready state to the distribution controller.
  • each distribution target node may report a ready status message to the distribution controller to notify the distribution control.
  • the device is ready to begin content distribution.
  • Each distribution target node can send a ready-to-use body to the distribution controller through a different port, for example: an HTTPS port.
  • the distribution controller sends a content receiving and forwarding indication to each distribution target node.
  • the content receiving and forwarding indication may be sent to each distribution target node, and each distribution target node may start to perform only after receiving the indication. Content reception and forwarding.
  • the distribution controller needs to receive the ready status information of each of the distribution target nodes before sending the content receiving and forwarding indication to each distribution target node.
  • the distribution controller sends a content receiving and forwarding indication to the distribution target node through the HTTPS port.
  • each distribution target node receives the content to be distributed from the receiving channel according to the content connection channel established as described above, and forwards the content to be distributed through the forwarding channel.
  • the content distribution and forwarding are performed between the distribution target nodes through the TCP port.
  • Each distribution target node acquires a distribution progress, a distribution log, a distribution result, and a status flow.
  • each of the distribution target nodes can monitor the current receiving and forwarding progress in real time during the process of receiving and forwarding the content, and can also obtain the log information generated during the content receiving and forwarding process, and can also receive and forward, that is, the distribution is completed.
  • the current state traffic of the distribution target node can be monitored in real time, wherein the state traffic can indicate the current state of the distribution target node and the current traffic, for example, Currently, it is in the normal state of connection or fault state, and the current value of the received and forwarded traffic.
  • the foregoing receiving and forwarding progress may refer to receiving the number of content blocks that the distribution target node has received, or the proportion of the content blocks that have been received occupying all the content blocks that need to be received, and the like.
  • Each distribution target node reports the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
  • each distribution target node can periodically report the distribution progress, the distribution log, the distribution result, and the status traffic, and the distribution controller can save the information, analyze the information, and perform the corresponding operation according to the analysis result.
  • the distribution controller analyzes the state traffic of each node. If the state traffic of a node exceeds a certain threshold, the distribution controller can perform corresponding flow control; for example, the distribution controller can perform the distribution result. Analysis, if the distribution result is a failure, you need to re-distribute with the corresponding strategy.
  • the distribution controller can also send the above distribution progress, distribution log, distribution result, and status traffic to the terminal.
  • the terminal may query the foregoing information through an API provided by the distribution controller, so as to timely understand the content distribution and feed back the situation to the user.
  • the distribution target node reports the progress, log, distribution result, and status traffic to the distribution controller through the HTTPS port.
  • the distribution controller also receives the progress of the distribution report, the log, the distribution result, and the status traffic through the HTTPS port.
  • the TCP connection can be disconnected between the distribution target nodes, the distribution target node reports the distribution to the distribution controller using the HTTPS port, and the distribution controller also receives the distribution target node report through the HTTPS port. Distribution completion information.
  • Table 2 provides an introduction to the ports that are open in the distribution controller, content store, and distribution target nodes and their functions.
  • the distribution controller when content distribution is performed, the distribution controller generates a content distribution path according to the physical networking topology, the state traffic of each node in the system, and the distribution target node list, and further performs content distribution according to the content distribution path.
  • the content distribution path is generated according to the physical networking topology information and the state traffic of each node in the system, so that it is possible to ensure that there is no disordered cross-connection between the distribution target nodes in the content distribution path, and that the content distribution path is ensured.
  • the actual traffic of each distribution target node in the control range is within the controllable range.
  • the content distribution path is a unidirectional chain path, that is, the number of nodes connected to each node in the content distribution path is controlled by the distribution controller, so that the balance of the inbound and outbound bandwidth of each distribution target node can be achieved.
  • the distribution controller can generate the content distribution path according to the physical networking topology information and the state traffic of each node in the system each time the content distribution instruction is received, thereby ensuring that the content is performed each time.
  • the content distribution paths generated at the time of distribution are the optimal distribution paths. Further, based on the above-described optimal content distribution path, the flow control in the content distribution process can be fully realized.
  • the content distribution path is generated by the distribution controller according to the distribution task situation, the content receiving node does not need to be dynamically added, the scheduling of the distribution controller is simple, and the content receiving node does not need to continuously query the available path during the distribution process. Therefore, it is also possible to ensure the efficiency of content distribution.
  • the distribution path is a unidirectional chain path combined with the actual physical topology networking structure, and the nodes are completely peer-to-peer, and the required file block information is not required to be queried.
  • the current node After the current node receives the distributed content, the current node can Forwarded to the next node immediately, and there is a fixed head node, so the integrity of the content distribution can also be guaranteed.
  • the distribution controller may also specify a maximum distribution rate of each node in the content distribution path when generating the content distribution path.
  • the distribution controller determines the maximum distribution rate of each node according to the current state traffic of each node in the content distribution path, that is, the rate at which each node receives data, and if the current traffic of a node is low, The maximum distribution rate of the node is set to be larger. If the current traffic of a node has reached a certain threshold, the maximum distribution rate of the node needs to be set smaller.
  • the distribution controller may carry the above maximum distribution rate in the content distribution message and send it to each node.
  • the node constrains content distribution according to the maximum distribution rate when content distribution is performed.
  • the first specific implementation method is a specific implementation method
  • the distribution controller uses two distribution target nodes located on the same physical host in the physical networking as adjacent nodes in the content distribution path according to the physical networking topology and the distribution target node list.
  • FIG. 3 is an example of a central physical server of a cloud computing system
  • FIG. 4 is an example of internal connection of a central physical server of a cloud computing system.
  • the central physical server may be A blade server is used, and the components of the blade server are as shown in Table 1:
  • Chassis 2 Compute node 3
  • Fan module 4 Pass-through module / switch module (switch) 5
  • Management module 6 Power module
  • the blade server in FIG. 3 has 16 computing nodes, that is, 16 physical hosts, each of which is configured with a 64-core CPU and 256 GB of memory, and each physical host can Virtually out 16-32 virtual machines.
  • the NIC bandwidth of the physical host is determined, for example, 10 Gbps, and the bandwidth of the switching module in the entire chassis is also determined, for example, 10 Gbps.
  • the bandwidth that can be equally distributed to each virtual machine is very limited.
  • the distribution server may use two distribution target nodes located on the same physical host in the physical networking as neighboring nodes in the content distribution path according to the physical networking topology when generating the content distribution path.
  • the distribution target node received by the distribution server includes: node A, node B, node C, and node D, wherein node A and node B are in the same physical host 21, and node C and node D are in the same physical Within the host 22, the distribution controller can use the node B and the node A as neighboring nodes in the content distribution path, and the node D and the node C as the content distribution path. Adjacent nodes.
  • the content receiving and forwarding between the node A and the node B are both in the physical host 21, and the network card bandwidth of the physical host 21 is not occupied.
  • the content receiving and forwarding between the node C and the node D are in the physical host.
  • the NIC bandwidth of the physical host 22 is not occupied. In this way, it is possible to generate a content distribution path that is ordered, has no intersection, and neighboring nodes are all located in the same physical host, thereby realizing flow control and high efficiency in content distribution.
  • two distribution target nodes located in the same chassis in the physical network are used as adjacent nodes in the content distribution path.
  • each distribution target node when there are no nodes located in the same physical host in the distribution target node received by the distribution controller, that is, each distribution target node does not satisfy the condition of being located on the same physical host.
  • the distribution controller can then use two nodes located in the same chassis as neighbors in the content distribution path. In this way, the data interaction between the two nodes can be limited to the same chassis as much as possible, that is, the bandwidth of the chassis is not occupied as much as possible, thereby further ensuring the flow control and high efficiency in content distribution.
  • a node having a complete content to be distributed in the system is determined; according to the state traffic of each node in the system, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path.
  • the head node needs to have complete distribution content and metadata for the content to be distributed.
  • the first node can obtain the above-mentioned complete distribution content and metadata of the content to be distributed by the following method:
  • the content warehouse can be based on The complete distribution of content generates metadata for the content to be distributed.
  • the first node in the content distribution path generated by the distribution controller is the content repository. After the distribution controller sends the content distribution path to each distribution destination node, each distribution destination node can be obtained from the content repository.
  • the first node is the content
  • the warehouse after receiving the notification, the first node forwards the content to its downstream node according to the connection relationship in the content distribution path.
  • the distribution target node has the complete distribution content.
  • each distribution target node in the content distribution path can report the content information that has been successfully received and saved to the distribution controller in the process of receiving and forwarding the content, and the distribution controller can determine which nodes have been completed according to the information. Distribute content.
  • the distribution target node may report to the distribution controller a quantity of the content block that has been received, an identifier of each content block, a success indication of receiving, and the like according to the information, and the distribution controller determines, according to the information, whether the distribution target node is Already have a complete distribution.
  • the distribution controller When there are multiple nodes in the system with the complete distribution content, when the distribution controller generates the content distribution path for the complete distribution content, the node with the lowest current traffic consumption can be selected as the content distribution path in the current content distribution process.
  • the first node When there are multiple nodes in the system with the complete distribution content, when the distribution controller generates the content distribution path for the complete distribution content, the node with the lowest current traffic consumption can be selected as the content distribution path in the current content distribution process. The first node.
  • the distribution speed of the content to be distributed can be ensured, thereby further improving the efficiency of content distribution.
  • the generated content distribution path is multiple, wherein the number of generated content distribution paths is less than or equal to the number of nodes having complete content to be distributed,
  • the first node in each content distribution path is one of the nodes having the complete content to be distributed.
  • the content distribution path generated by the distribution controller is a single chain path
  • FIG. 5 is a single A schematic diagram of a chain path, as shown in FIG. 5, each node in a single chain path has only one upstream node and one downstream node, that is, the node can only receive data from the upstream node, and can only send data to the downstream node, thereby It can fully control the inbound and outbound bandwidth of each node, avoiding congestion caused by too many connections of a single node, or excessive consumption of CPU and memory, and affecting applications running on the node.
  • the arrows in Figure 5 indicate the flow of data.
  • a single chained path ensures traffic control, efficiency, and integrity in content distribution. However, if the number of distribution target nodes is large, using a single chain path may result in a slower distribution due to the link being too long.
  • the nodes satisfy the condition as the first node, and the distribution controller can generate multiple content distribution paths according to the nodes.
  • the first node in each content distribution path is one of these nodes with complete content to be distributed.
  • the content distribution paths generated by the distribution controller are independent of each other, so parallel distribution between content distribution paths can be achieved.
  • the distribution controller can set the nodes located in the same physical host or the same chassis in the same content distribution path, thereby improving content distribution efficiency and saving traffic consumption.
  • the distribution controller sets a plurality of distribution target nodes in two content distribution paths by the above method, and the first in each content distribution path.
  • the node is determined by the distribution controller according to information such as the number of content blocks that have been received reported by each distribution target node, the identifier of each content block, the success indication of receiving, and the like.
  • the method for parallel distribution of multiple content distribution paths in the embodiment can effectively reduce the influence of the delay of the last node distribution on the link due to the long link length, and can reduce the complexity caused by the length of the control chain path. degree.
  • the fork node splits the content distribution path into a first content distribution path and a second content distribution path.
  • the first content distribution path and the second content distribution path are the same as the first node, and the first content distribution path and the second content distribution path are demarcated by the foregoing bifurcation node.
  • the distribution controller determines the node with the lowest current traffic consumption according to the state traffic reported by the node, and uses the distribution target node with the lowest current traffic consumption as the fork node.
  • the distribution controller presets the preset number of nodes according to the physical networking topology and the node size of the system, for example, setting the number of nodes to 200.
  • the distribution controller may Generating a single chained distribution path, using this single chained distribution path for content distribution ensures the efficiency of content distribution. If the number of the distribution target nodes is greater than the number of the preset nodes, if the single-chain distribution path is used again, the delay of the last node in the path is too large. Therefore, in this embodiment, the method may be firstly performed according to the foregoing method.
  • FIG. 7 is a schematic diagram of the content distribution path bifurcation. As shown in FIG. 7, the first node after the first node is used as a fork node, and two parallel distribution paths are formed from the node, thereby reducing distribution. The length of the path ensures the speed and efficiency of content distribution.
  • This embodiment relates to a method of processing a faulty node in an existing content distribution path.
  • the distribution controller When the distribution target node on the content distribution link performs content distribution, data may not be normally received or forwarded for some reason, in which case the distribution controller first determines the faulty node in the content distribution path.
  • the method for the distribution controller to determine the faulty node in the content distribution path includes the following three types:
  • the distribution controller After the distribution controller sends the content distribution message to the first distribution target node, if the response message for the content distribution message sent by the first distribution target node is not received, determining that the first distribution target node is in the content distribution path A faulty node, wherein the first distribution target node is a distribution target node of any one of the content distribution paths.
  • the specific process of the distribution controller transmitting the content distribution message to the first distribution target node is as described in the foregoing step S206. If the distribution target node is operating normally, after the content distribution message sent by the distribution controller is received, the distribution target node distributes to the distribution node. Control returns a response message. If the distribution controller does not receive the response message, the distribution controller can determine the distribution target node failure.
  • the distribution target node can report its status traffic and distribution logs to the distribution controller according to a certain period, and the distribution controller receives the status traffic and distributes the log, and then judges if the status of the target node is distributed. If the traffic has exceeded the maximum threshold, or there is a record of the distribution exception in the distribution log, the distribution controller can determine that the distribution target node is down.
  • the distribution controller receives the distribution failure message sent by the second distribution target node, determining that the downstream node of the second distribution target node is a faulty node in the content distribution path, wherein the second distribution target node is a content distribution path. Any one of the distribution target nodes except the last distribution target node.
  • the distribution target node may record the content block that has been distributed in the process of content distribution, and if there is a case where the content block distribution fails, the distribution target node sends a distribution failure message to the distribution controller. After receiving the message, the distribution controller may determine that the downstream node of the distribution target node cannot receive the distribution content normally, and determine the downstream node of the distribution target node as the fault node.
  • the distribution controller may delete the faulty node from the original content distribution path and use the downstream node of the faulty node as the downstream node of the upstream node of the faulty node.
  • the distribution controller separately sends a path update indication to the upstream node and the downstream node of the faulty node to indicate that the upstream node of the faulty node updates its saved content distribution path, that is, updates its downstream node to the downstream node of the faulty node.
  • the downstream node of the faulty node updates its saved content distribution path, that is, updates its upstream node to the upstream node of the faulty node.
  • FIG. 8 is a schematic diagram of deleting a faulty node from a content distribution path.
  • the second node in the content distribution path is a faulty node, and the faulty node is deleted from the content distribution path, and the faulty node is before and The nodes that follow are connected.
  • This embodiment relates to a processing method after a failed node is recovered.
  • the faulty node After the faulty node is deleted from the content distribution path, the faulty node can continue to periodically report its state traffic to the distribution controller. When the distribution controller knows that the faulty node's state has returned to the normal state, it joins again. In the content distribution path.
  • the distribution controller acquires the recovery node in the content distribution path by acquiring the state traffic.
  • the number of the recovery nodes may be one or multiple, and the recovery node is a node deleted from the content distribution path due to the failure.
  • the distribution controller may add the recovery node to the content distribution path to cause the recovery node to obtain the distribution content from the upstream node of the recovery node, wherein the recovery node requests the slave node from the upstream node. Get the distribution.
  • FIG. 9 is a schematic diagram of rejoining the recovery node to the content distribution path, and the dotted line in FIG.
  • the upstream node of node A is connected with the downstream node
  • the upstream node of node B is connected with the downstream node.
  • the content distribution path does not return to the original state. It is only allowed that node A obtains the distributed content from its upstream node by means of an active request, and only allows the node B to obtain the distributed content from its upstream node by means of an active request.
  • the upstream node at this time is not necessarily the upstream node of the restoration node in the original content distribution path, but the node that is closest to the recovery node in the physical topology and is in the current content distribution path.
  • FIG. 10 is a schematic diagram of content distribution to multiple subnets.
  • the distribution controller may divide the content distribution path into subnets based on the first node. Multiple sub-paths, no isolation between multiple sub-paths. This effectively controls the bandwidth usage of each subnet and avoids traffic interaction between subnets.
  • the sub-path can be split according to the method described in the foregoing embodiment to ensure the speed and efficiency of content distribution.
  • the present embodiment relates to a specific method for generating metadata of the content to be distributed in the content repository of step 105 in FIG. 2 described above.
  • the content to be distributed stored in the content repository is determined according to the identifier of the content to be distributed carried therein, and the content to be distributed is generated. Metadata.
  • the content repository Before generating the metadata of the content to be distributed, the content repository first determines whether the metadata of the content to be distributed has been generated, and if it has been generated, the generation operation is no longer performed, but the existing metadata can be directly used.
  • the content repository may determine whether the content to be distributed exists according to the identifier of the content to be distributed in the created metadata indication. If not, the content warehouse may return a prompt to the terminal that the content to be distributed does not exist. The terminal is caused to re-check the identity of the content to be distributed that is sent, or to re-publish the content to be distributed to the content repository.
  • the identifier of the content to be distributed is allocated by the content warehouse, and is different from the identifier corresponding to other content to be distributed in the entire system.
  • the content repository confirms that the content to be distributed exists and the metadata of the content to be distributed does not yet exist, it is necessary to generate metadata of the content to be distributed.
  • the metadata of the content to be distributed can be obtained from the content repository.
  • FIG. 11 is a schematic diagram of a process for generating metadata according to Embodiment 2 of the present invention.
  • a method for generating metadata of a content to be distributed by a content warehouse is:
  • S1101 Perform partial division and block division on the content to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
  • the size of the content to be distributed is generally large. For example, a general multimedia file that needs to be distributed can reach more than 1G. If the entire content to be distributed is sent directly in the content distribution process, once the data transmission has a problem, it needs to be heavy. Newly sent the entire file to be distributed, resulting in inefficient content distribution. Therefore, in this embodiment, the content to be distributed is hierarchically divided into blocks. In the content distribution process, the minimum unit of data transmission is blocking, and even if there is a problem in transmission, only the corresponding segment needs to be redistributed. Can greatly improve the efficiency of content distribution.
  • the content warehouse can divide the content to be distributed into two layers.
  • the first layer divides the entire file to be distributed into a plurality of parts, and the second layer divides each part into a plurality of blocks.
  • FIG. 12 is a schematic diagram of hierarchical division of content to be distributed. As shown in FIG. 12, the content repository may divide the content to be distributed into multiple equal-sized parts, and then divide each part into blocks of equal size, and the block is content distribution.
  • the minimum transmission unit may be used to be distributed into two layers. The first layer divides the entire file to be distributed into a plurality of parts, and the second layer divides each part into a plurality of blocks.
  • FIG. 12 is a schematic diagram of hierarchical division of content to be distributed. As shown in FIG. 12, the content repository may divide the content to be distributed into multiple equal-sized parts, and then divide each part into blocks of equal size, and the block is content distribution.
  • the minimum transmission unit may be used to be distributed into two layers.
  • the user can pre-configure the size of the part and the size of the block in the content repository.
  • the partial partitioning and block partitioning are performed according to the pre-configured partial size and block size. It should be noted that, according to requirements, the content warehouse can also divide the content to be distributed into more layers, wherein the lowest layer is the smallest unit of data transmission.
  • the partial quantity and the block number are calculated according to the total size, partial size, and block size of the content to be distributed, and the total size of the content to be distributed may be specifically divided by Partially sized to get a partial quantity, then divide the partial size by the block size to get the number of blocks.
  • each block can also be assigned a unique index, that is, a block index, for identifying each block when subsequent content distribution.
  • the content warehouse can get the partial quantity, partial size, block size and block index.
  • the index value may be determined according to the number of the portion of the block corresponding to the block and the order of the block in the portion. For example, suppose a block M, the part corresponding to the block M is the first part of the content to be distributed, that is, the corresponding part number is 1, and the block is the first block in the part 1, that is, the block If the number is 1, the index value of the block can be set to P1B1, where "P" refers to the part and "B" refers to the block.
  • the content corresponding to the block can be immediately indexed according to the block index. Therefore, the allocation of the block index according to the number can facilitate reading and writing of the distributed content by offset. Can improve the efficiency of reading and writing of distributed content.
  • S1102 Perform digital signature processing on the content to be distributed, and obtain a digital signature.
  • the content warehouse can use a specific algorithm, such as (Pretty Good Privacy, PGP for short) to digitally sign the distributed content, obtain a digital signature, and use the same algorithm pair after the distribution target node obtains the complete content to be distributed.
  • PGP Peripheral Good Privacy
  • S1103 Perform hash check on each block that is divided, and obtain a block hash value of each block.
  • the content repository can also hash each block that is partitioned. Since the block is the smallest unit of data transmission, the content warehouse performs a hash check on each block in advance and writes it into the metadata of the content to be distributed. After the distribution target node receives a content block, it can It is determined whether the received block has not been tampered by comparing the hash check results to ensure the security of each block.
  • hashing a block you can use the Secure Hash Algorithm (SHA1) algorithm.
  • SHA1 Secure Hash Algorithm
  • S1104 Write a partial number, a partial size, a block size, a block index, a digital signature, and a block hash value of each block into the metadata of the content to be distributed.
  • the content repository can write it into the metadata of the distributed content.
  • the first part of the metadata of the content to be distributed includes the name of the content to be distributed and the digital signature
  • the second part includes the part count and the partial size.
  • the third part includes each block index and block hash value (blockhash) of each block.
  • the block hash value of each block is after each block index, so After the target node reads the block index, it can directly read the block hash value corresponding to the block without querying again, thereby improving the reading efficiency of the metadata.
  • the embodiment relates to the specific method for distributing the target node for content distribution in step S213 in FIG. 2.
  • the distribution target node after the distribution target node receives the content distribution message, performing the operation of establishing a connection, acquiring metadata of the content to be distributed, reporting the ready state, and then distributing according to the metadata and the content.
  • the path performs content distribution processing, that is, content reception and forwarding.
  • FIG. 14 is a schematic diagram of a content receiving and forwarding process according to Embodiment 3 of a content distribution method according to an embodiment of the present invention. As shown in FIG. 14, the process of distributing a target node for content distribution is:
  • S1402 Perform a hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain the verification result.
  • the block is saved, and the block is sent to the downstream node in the content distribution path according to the specified distribution rate.
  • the distribution rate refers to the rate of reception, because the number of ingress and egress nodes is fixed, so the forwarding rate is also controlled.
  • the distribution target node performs hash check on the received block to obtain a check value, and then reads the block hash value from the metadata according to the block index of the received block, if the distribution target node calculates If the check value is consistent with the block hash value in the metadata, the received block is considered to be the correct block and can be forwarded to the next distribution target node.
  • the content to be distributed is in the block as the minimum transmission unit, and therefore, each time the distribution target node receives a block, the above-described steps S1401 - S1403 are performed.
  • the block can be verified by using a hash check, and if the verification is successful, it is forwarded to the next distribution target node, thereby ensuring the forwarded block. safety.
  • the content can be directly forwarded to the downstream node, and therefore, the above steps S1401-S1403 need not be performed.
  • the distribution target node may determine whether the transmission is successful. If the transmission is not successful, the retransmission is performed. If the number of retransmission failures reaches a preset number, the The distribution controller sends a distribution failure message to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  • the distribution target node further needs to perform the following operations:
  • the distribution target node determines whether all the blocks corresponding to the content to be distributed are received, and if so, the distribution target node performs a digital signature check on the content to be distributed according to the digital signature in the metadata of the content to be distributed, and reports the result of the digital signature check to the distribution. Controller.
  • the digital signature check is used to check the entire content to be distributed, and therefore, after the distribution target node confirms that the blocks of the content to be distributed have all been received, the corresponding algorithm can be used to receive the entire
  • the content is digitally checked. If the digital signature result is consistent with the metadata of the content to be distributed, the check passes, otherwise the check fails.
  • the distribution target node reports the digital signature result to the distribution controller, and the distribution controller performs retransmission and the like according to the digital signature result.
  • the distribution target may determine whether all blocks of the content to be distributed have been received according to the saved metadata of the content to be distributed. Specifically, each block index of the content to be distributed is recorded in the metadata, and the distribution control determines whether the block index of all the received content blocks completely corresponds to the block index in the metadata, and if yes, determines that the to-be-score has been received. Send all blocks of content.
  • the following embodiments relate to the scenario in which the present invention is applied to a cloud computing system in which a plurality of tenants exist.
  • the cloud computing system For a cloud computing system, where there are multiple tenants, the cloud computing system requires that the resources of multiple tenants are isolated from each other. Therefore, when the embodiment of the present invention is applied to a cloud computing system, it needs to be based on the characteristics of the tenant. Content distribution.
  • a tenant is a customer who uses a system or computer computing resource, but in multi-tenant technology, a tenant contains all data that can be identified as a specified user in the system, including account and statistics (accounting data) ), the various data built by the user in the system, and the customized application environment of the user itself are all in the scope of the tenant, and the tenant uses the application system developed or built by the supplier or For computing resources, etc., the application system designed by the vendor will accommodate more than one user in the same environment. In order to make the environment capabilities of multiple users the same application and computing environment, the application and computing environment It must be specially designed, in addition to allowing the system platform to allow multiple copies of the same application to run at the same time.
  • the content distribution indication may be carried in addition to the identifier of the to-be-distributed content and the distribution target node.
  • Tenant information After receiving the content distribution instruction, the distribution controller may integrate the unified user management system of the third party to authenticate the tenant and query the resource list accessible by the tenant. Further, when the distribution controller constructs the content distribution path, the node in the content distribution path is a distribution target node accessible by the tenant, and the node in the content distribution path cannot be a distribution target node inaccessible to the tenant. Different tenants build different content distribution paths, and different content distribution paths cannot access each other during the distribution process, thereby effectively achieving multi-tenancy isolation.
  • FIG. 15 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in Figure 15, the apparatus includes:
  • the receiving module 1501 is configured to receive a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node.
  • the processing module 1502 is configured to generate a content distribution path according to the physical networking topology, the status traffic of each node in the system, and the distribution target node list, where the content distribution path is a single page formed by the first node and the at least one distribution target node.
  • the chained distribution path, the first node is the node in the system with complete content to be distributed.
  • the sending module 1503 is configured to send a content distribution message to the at least one distribution target node, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node obtains according to the content distribution path and the identifier of the content to be distributed. And distribute the content to be distributed.
  • the device is used to implement the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is determined according to the state traffic of the at least one distribution target node when the content distribution path is generated.
  • the receiving module 1501 is further configured to receive a ready state reported by the one distribution target node.
  • the sending module 1503 is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
  • FIG 16 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention.
  • the processing module includes:
  • the first determining unit 15021 is configured to use two distribution target nodes that are located on the same physical host or the same chassis in the physical networking as the neighboring nodes in the content distribution path according to the physical networking topology and the distribution target node list.
  • the second determining unit 15022 is configured to determine a node in the system that has complete content to be distributed.
  • the third determining unit 15023 is configured to use, as the first node in the content distribution path, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed according to the state traffic of each node in the system.
  • processing module 1502 is further configured to:
  • two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • processing module 1502 is further configured to:
  • the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content distribution path and the second content distribution path according to the fork node;
  • the first content distribution path and the second content distribution path are the same as the first node, the first content distribution path and the second content distribution path are demarcated by the fork node, and the fork node is the node with the lowest current traffic consumption in the content distribution path. .
  • processing module 1502 is further configured to:
  • the faulty node is deleted from the content distribution path, and the downstream node of the faulty node is regarded as the downstream node of the upstream node of the faulty node.
  • FIG. 17 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 17, the processing module 1502 further includes:
  • the fourth determining unit 15024 is configured to: when the response message for the content distribution message sent by the first distribution target node is not received, determine that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
  • FIG. 18 is a block diagram of a fourth embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 18, the processing module 1502 further includes:
  • the fifth determining unit 15025 is configured to determine a faulty node in the content distribution path according to the state traffic reported by the at least one distribution target node and the distribution log.
  • FIG. 19 is a block diagram of a fifth embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 19, the processing module 1502 further includes:
  • the sixth determining unit 15026 is configured to: when receiving the distribution failure message sent by the second distribution target node, determine that the downstream node of the second distribution target node is a faulty node in the content distribution path, where the second distribution target node is Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  • processing module 1502 is further configured to:
  • the recovery node is added to the content distribution path such that the recovery node acquires the distribution content from the upstream node of the recovery node, wherein the recovery node acquires the distribution content from the upstream node of the recovery node by the active request mode.
  • the receiving module 1501 is further configured to receive a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node.
  • the sending module 1503 is further configured to send a distribution progress, a distribution log, a distribution result, and the status traffic to the terminal.
  • FIG. 20 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 20, the apparatus includes:
  • the receiving module 2001 is configured to receive a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, where the content distribution path is configured by the distribution controller according to a physical networking topology, status traffic of each node in the system, and
  • the distribution target node list is generated by a unidirectional chain distribution path composed of a first node and at least one distribution target node, and the first node is a node having complete content to be distributed in the system.
  • the processing module 2002 is configured to obtain metadata of the content to be distributed from the first node according to the identifier of the content to be distributed, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed.
  • the processing module 2002 is further configured to perform content distribution processing according to the content distribution path and the metadata of the content to be distributed.
  • the content distribution message further includes a specified distribution rate of the distribution target node.
  • the processing module 2002 is specifically configured to perform content distribution processing according to the specified distribution rate according to the content distribution path and the metadata of the content to be distributed.
  • FIG 21 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in Figure 21, the apparatus further includes:
  • the sending module 2003 is configured to report the ready state to the distribution controller.
  • the receiving module 2001 is further configured to receive a content receiving and forwarding indication sent by the distribution controller.
  • FIG. 22 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 22, the processing module 2002 includes:
  • the receiving unit 20021 is configured to receive a block sent by the upstream node.
  • the checking unit 20022 is configured to perform hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain the verification result.
  • the sending unit 20023 is configured to save the block when the verification result is that the verification is successful, and send the block to the downstream node in the content distribution path according to the specified distribution rate.
  • the sending unit 20023 is specifically configured to:
  • a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  • the processing module 2002 is further configured to perform a digital signature check on the content to be distributed according to the digital signature when receiving all the blocks corresponding to the content to be distributed, and report the result of the digital signature check to the distribution controller.
  • the processing module 2002 is further configured to obtain a distribution progress, a distribution log, a distribution result, and a status flow.
  • the sending module 2003 is further configured to report the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
  • FIG. 23 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 23, the apparatus includes:
  • the receiving module 2301 is configured to receive a creation metadata indication, where the creation metadata indication includes an identifier of the content to be distributed;
  • the processing module 2302 is configured to generate metadata of the content to be distributed according to the identifier of the content to be distributed.
  • FIG. 24 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention.
  • the processing module 2302 includes:
  • the dividing unit 23021 is configured to perform partial division and block division on the to-be-distributed content after determining that the content to be distributed exists according to the content identifier to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
  • the processing unit 23022 is configured to perform digital signature processing on the content to be distributed to obtain a digital signature.
  • the checking unit 23023 is configured to perform hash check on each of the divided blocks to obtain a block hash value of each block.
  • the writing unit 23024 is configured to write the partial quantity, the partial size, the block size, the block index, the digital signature, and the block hash value of each block into the metadata of the content to be distributed.
  • FIG. 25 is a physical block diagram of Embodiment 1 of a distribution controller according to an embodiment of the present invention. As shown in FIG. 25, the distribution controller includes:
  • the memory 2501 is used to store program instructions, and the processor 2502 is used to call program instructions in the memory 2501 to perform the following methods:
  • the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
  • the content distribution path is a one-way composed of a first node and the at least one distribution target node a chain distribution path, the head node being a node in the system having the complete content to be distributed;
  • the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is determined according to state traffic of the at least one distribution target node when the content distribution path is generated.
  • processor 2502 is further configured to:
  • processor 2502 is further configured to:
  • two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • the node having the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path according to the state traffic of each node in the system.
  • processor 2502 is further configured to:
  • two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
  • Generating a plurality of content distribution paths wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
  • processor 2502 is further configured to:
  • the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
  • the first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
  • processor 2502 is further configured to:
  • processor 2502 is further configured to:
  • the first distribution target node determines that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
  • processor 2502 is further configured to:
  • Determining a faulty node in the content distribution path according to the status traffic reported by the at least one distribution target node and the distribution log.
  • processor 2502 is further configured to:
  • the second distribution target node determines that the downstream node of the second distribution target node is one of the content distribution paths, wherein the second distribution target node is the Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  • processor 2502 is further configured to:
  • processor 2502 is further configured to:
  • the distribution progress, the distribution log, the distribution result, and the status traffic are transmitted to the terminal.
  • FIG. 26 is a physical block diagram of Embodiment 1 of a computing node according to an embodiment of the present invention. As shown in FIG. 26, the computing node includes:
  • the memory 2601 is configured to store program instructions, and the processor 2602 is configured to call program instructions in the memory 2601 to perform the following methods:
  • the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is distributed by the distribution controller according to a physical networking topology, status traffic of each node in the system, and a distribution target node
  • the content distribution path is a unidirectional chain distribution path formed by the head node and the at least one distribution target node, where the head node is a node having a complete content to be distributed in the system;
  • the metadata of the content to be distributed from the first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed;
  • the content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed.
  • the content distribution message further includes a specified distribution rate of the distribution target node; the processor 2602 is further configured to:
  • the content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed according to the specified distribution rate.
  • processor 2602 is further configured to:
  • processor 2602 is further configured to:
  • the block is saved, and the block is sent to a downstream node in the content distribution path according to the specified distribution rate.
  • processor 2602 is further configured to:
  • a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  • processor 2602 is further configured to:
  • the digital signature is checked according to the digital signature, and the result of the digital signature check is reported to the distribution controller.
  • processor 2602 is further configured to:
  • the distribution progress, distribution log, distribution result, and status traffic are reported to the distribution controller.
  • FIG. 27 is a physical block diagram of Embodiment 1 of a content repository according to an embodiment of the present invention. As shown in FIG. 27, the content repository includes:
  • the memory 2701 is used to store program instructions, and the processor 2702 is used to call program instructions in the memory 2701 to perform the following methods:
  • the creation metadata indication includes an identifier of the content to be distributed
  • processor 2702 is further configured to:
  • an embodiment of the present invention further provides a content distribution system, including the foregoing distribution controller, the foregoing computing node, and the content repository.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Provided are a content distribution method and device for a cloud computing system, a computing node and a system. The method comprises: receiving a content distribution instruction, the content distribution instruction comprising an identifier of content to be distributed and a distribution target node list, and the distribution target node list comprising an identifier of at least one distribution target node; according to physical networking topology, the state traffic of each node in the system and the distribution target node list, generating a content distribution path, the content distribution path being a one-way chain distribution path composed of a head node and at least one distribution target node; and sending a content distribution message to the at least one distribution target node. This method can ensure that the number of nodes connected to each node in the content distribution path is controlled by a distribution controller; therefore, the balance of the access bandwidth of each distribution target node can be realized. Moreover, it can also be ensured that the content distribution path generated each time content is distributed is the optimal distribution path.

Description

云计算系统的内容分发方法及装置、计算节点及系统Content distribution method and device, computing node and system of cloud computing system
本申请要求于2016年10月31日提交中国专利局、申请号为201610931630.X,发明名称为“云计算系统的内容分发方法及装置、计算节点及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610931630.X filed on October 31, 2016, entitled "Content Distribution Method and Apparatus, Computing Node and System of Cloud Computing System", The entire contents are incorporated herein by reference.
技术领域Technical field
本发明涉及通信技术,尤其涉及一种云计算系统的内容分发方法及装置、计算节点及系统。The present invention relates to communications technologies, and in particular, to a content distribution method and apparatus, a computing node, and a system of a cloud computing system.
背景技术Background technique
云计算起源于大型互联网企业,是指IT基础设施的交付和使用模式,通过网络以按需、易扩展的方式获得所需的资源,例如硬件、平台、软件等。虚拟化技术是云计算领域的主要支撑技术,一个云计算中心中包括多个物理服务器,每个物理服务器可以被划分为多个虚拟机,每个虚拟机具有独立的计算和处理能力。在云计算系统中,可能存在将相同的内容分发给众多虚拟机的场景。例如,为众多的虚拟机分发同一个操作系统补丁。一般情况下,一个云计算系统中的物理服务器的数量都能够达到十万台,相应地,云计算系统中的虚拟机数量更加庞大,一般可以达到数十万或者数百万,在此情况下,如何使得数量庞大的虚拟机快速地下载到分发的内容,是云计算系统在内容分发时需要解决的重要问题。Cloud computing originated from large Internet companies, which refers to the delivery and use of IT infrastructure. Through the network, the required resources such as hardware, platform, software, etc. are obtained in an on-demand and scalable manner. Virtualization technology is the main supporting technology in the field of cloud computing. A cloud computing center includes multiple physical servers. Each physical server can be divided into multiple virtual machines, each with independent computing and processing capabilities. In a cloud computing system, there may be scenarios where the same content is distributed to a large number of virtual machines. For example, distribute the same operating system patch for many virtual machines. In general, the number of physical servers in a cloud computing system can reach 100,000 units. Correspondingly, the number of virtual machines in a cloud computing system is even larger, generally reaching hundreds of thousands or millions. In this case, How to make a large number of virtual machines download to the distributed content quickly is an important issue that the cloud computing system needs to solve when distributing content.
现有技术中,采用点对点(Peer to Peer,简称P2P)技术来提高下载速度,P2P是一种没有集中控制的分布式系统,系统中的每个节点既是客户机也是服务器。比特(BitTorrent,简称BT)分发技术是典型的P2P分发技术,具体地,BT系统中包括一个中心索引服务器以及多个节点,中心索引服务器接收并统计所有下载者的IP地址和端口号等信息,并且向每个下载终端发送一份节点列表,下载终端可以与这个节点列表中的节点建立连接,并从建立连接的节点处下载数据。下载终端可以周期性地连接中心索引服务器,向中心索引服务器告知自己所下载的内容。即,在BT系统中,每个节点都可以与多个其他节点建立连接,并从所连接的其他节点处下载数据,并且,要求节点在下载数据时占用尽可能多的带宽,以提高下载的速度。In the prior art, peer-to-peer (P2P) technology is used to improve download speed. P2P is a distributed system without centralized control. Each node in the system is both a client and a server. The BitTorrent (BT) distribution technology is a typical P2P distribution technology. Specifically, the BT system includes a central index server and a plurality of nodes. The central index server receives and counts information such as the IP address and port number of all downloaders. And sending a list of nodes to each download terminal, the download terminal can establish a connection with the node in the node list, and download data from the node that establishes the connection. The download terminal can periodically connect to the central index server to inform the central index server of the content that it has downloaded. That is, in the BT system, each node can establish a connection with a plurality of other nodes, and download data from other connected nodes, and requires the node to occupy as much bandwidth as possible when downloading data, so as to improve downloading. speed.
但是,现有技术存在系统流量不可预知的问题,因此,不能满足云计算系统对于系统流量控制的要求。However, the prior art has an unpredictable problem of system traffic, and therefore cannot meet the requirements of the cloud computing system for system flow control.
发明内容Summary of the invention
本发明实施例提供一种云计算系统的内容分发方法及装置、计算节点及系统,用于解决现有技术中云计算系统的内容分发时所存在的系统流量不可预知的问题。The embodiments of the present invention provide a content distribution method and device, a computing node, and a system for a cloud computing system, which are used to solve the problem that the system traffic in the prior art in the content distribution of the cloud computing system is unpredictable.
本发明实施例第一方面提供一种云计算系统的内容分发方法,该方法以分发控制器的角度进行描述,该方法包括:A first aspect of the embodiments of the present invention provides a content distribution method of a cloud computing system, which is described in the perspective of a distribution controller, and the method includes:
首先,接收内容分发指示,该内容分发指示中包括待分发内容的标识以及分发目标节点列表,该分发目标节点列表中包括至少一个分发目标节点的标识。First, a content distribution instruction is included, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, and the distribution target node list includes an identifier of the at least one distribution target node.
其次,根据云计算系统的物理组网拓扑云计算系统中各节点的状态流量以及分发目标节点列表,生成内容分发路径,其中,该内容分发路径为由首节点和至少一个分发目标节点所 构成的单向链式分发路径,该首节点为云计算系统中具有完整的待分发内容的节点。Secondly, a content distribution path is generated according to a state traffic of each node in the physical networking topology cloud computing system of the cloud computing system and a distribution target node list, wherein the content distribution path is performed by the first node and at least one distribution target node A unidirectional chain distribution path is formed, and the head node is a node in the cloud computing system having a complete content to be distributed.
进而,向上述至少一个分发目标节点发送内容分发消息,该内容分发消息中包括内容分发路径以及待分发内容的标识,以使至少一个分发目标节点根据内容分发路径以及待分发内容的标识获取并分发待分发内容。Further, the content distribution message is sent to the at least one distribution target node, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node acquires and distributes according to the content distribution path and the identifier of the content to be distributed. Content to be distributed.
使用该方法在进行内容分发时,根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表来生成内容分发路径,进而按照该内容分发路径来进行内容分发。首先,该内容分发路径根据云计算系统的物理组网拓扑信息以及云计算系统中各节点的状态流量来生成,因此能够保证该内容分发路径中的分发目标节点之间不存在无序交叉连接,以及保证该内容分发路径中的各分发目标节点的实际流量在可控范围内。其次,该内容分发路径为单向链式路径,即,该内容分发路径中每个节点连接的节点数量由分发控制器来控制,因此,能够实现各分发目标节点的出入带宽的平衡。因此,使用本方法能够保证所选的内容分发路径为最优内容分发路径。另外,该方法在每次接收到内容分发指示时,都可以根据云计算系统的物理组网拓扑信息以及云计算系统中各节点的状态流量来生成内容分发路径,因此,能够保证每次进行内容分发时所生成的内容分发路径都是最优分发路径。进而,基于上述最优的内容分发路径,就可以完全实现对于内容分发过程中的流量控制。When the content distribution is performed, the content distribution path is generated according to the physical networking topology of the cloud computing system, the state traffic of each node in the cloud computing system, and the distribution target node list, and the content distribution is performed according to the content distribution path. First, the content distribution path is generated according to the physical networking topology information of the cloud computing system and the state traffic of each node in the cloud computing system, so that it is ensured that there is no disordered cross-connection between the distribution target nodes in the content distribution path. And ensuring that the actual traffic of each distribution target node in the content distribution path is within a controllable range. Secondly, the content distribution path is a unidirectional chain path, that is, the number of nodes connected to each node in the content distribution path is controlled by the distribution controller, so that the balance of the inbound and outbound bandwidth of each distribution target node can be achieved. Therefore, the method can ensure that the selected content distribution path is an optimal content distribution path. In addition, the method can generate a content distribution path according to the physical networking topology information of the cloud computing system and the state traffic of each node in the cloud computing system each time the content distribution instruction is received, thereby ensuring that the content is performed each time. The content distribution paths generated at the time of distribution are the optimal distribution paths. Further, based on the above-described optimal content distribution path, the flow control in the content distribution process can be fully realized.
在一种可能的设计中,上述内容分发消息中还包括至少一个分发目标节点的指定分发速率,该指定分发速率是在生成内容分发路径时根据至少一个分发目标节点的状态流量确定的。In a possible design, the content distribution message further includes a specified distribution rate of the at least one distribution target node, which is determined according to the state traffic of the at least one distribution target node when the content distribution path is generated.
在一种可能的设计中,该方法还包括:In one possible design, the method further includes:
接收至少一个分发目标节点上报的准备就绪状态,并根据该准备就绪状态,向至少一个分发目标节点发送内容接收与转发指示。Receiving a ready state reported by the at least one distribution target node, and transmitting a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
在一种可能的设计中,在生成内容分发路径时,可以通过以下方式来生成:In one possible design, when generating a content distribution path, it can be generated in the following ways:
根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为内容分发路径中的相邻节点;According to the physical networking topology and the distribution target node list, two distribution target nodes that are located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定云计算系统中具有完整的待分发内容的节点;Determining a node in the cloud computing system that has a complete content to be distributed;
根据云计算系统中各节点的状态流量,将具有完整的待分发内容的节点中当前流量耗费最低的节点作为内容分发路径中的首节点。According to the state traffic of each node in the cloud computing system, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path.
在一种可能的设计中,当云计算系统中存在多个具有完整的待分发内容的节点时,可以通过以下方法来生成内容分发路径:In a possible design, when there are multiple nodes in the cloud computing system with complete content to be distributed, the content distribution path can be generated by the following methods:
根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为内容分发路径中的相邻节点;According to the physical networking topology and the distribution target node list, two distribution target nodes that are located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定云计算系统中具有完整的待分发内容的多个节点;Determining a plurality of nodes in the cloud computing system that have complete content to be distributed;
生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于所述具有完整的所述待分发内容的节点的个数,每条所述内容分发路径中的首节点为所述具有完整的所述待分发内容的节点中的其中一个节点。Generating a plurality of content distribution paths, wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
在一种可能的设计中,还包括:In one possible design, it also includes:
设置所述内容分发路径中的预设节点数量;Setting a preset number of nodes in the content distribution path;
若所述内容分发路径中的节点数量大于所述预设节点数量,则从所述内容分发路径中选择分叉节点,并根据所述分叉节点将所述内容分发路径拆分为第一内容分发路径以及第二内容分发路径; If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
其中,所述第一内容分发路径和所述第二内容分发路径的首节点相同,所述第一内容分发路径和所述第二内容分发路径以所述分叉节点为分界,所述分叉节点为所述内容分发路径中当前流量耗费最低的节点。The first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
在一种可能的设计中,还包括:In one possible design, it also includes:
确定所述内容分发路径中的故障节点;Determining a faulty node in the content distribution path;
将所述故障节点从所述内容分发路径中删除,并将所述故障节点的下游节点作为所述故障节点上游节点的下游节点。And deleting the faulty node from the content distribution path, and using a downstream node of the faulty node as a downstream node of the upstream node of the faulty node.
在一种可能的设计中,上述确定内容分发路径中的故障节点的第一种方式为:In one possible design, the first way to determine the faulty node in the content distribution path is:
若未接收到第一分发目标节点发送的对于所述内容分发消息的响应消息,则确定所述第一分发目标节点为所述内容分发路径中的一个故障节点,其中,所述第一分发目标节点为所述内容分发路径中的任意一个分发目标节点。If the response message to the content distribution message sent by the first distribution target node is not received, determining that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
在一种可能的设计中,上述确定内容分发路径中的故障节点的第二种方式为:In a possible design, the second way of determining the faulty node in the content distribution path is as follows:
根据所述至少一个分发目标节点所上报的状态流量以及分发日志,确定所述内容分发路径中的故障节点。Determining a faulty node in the content distribution path according to the status traffic reported by the at least one distribution target node and the distribution log.
在一种可能的设计中,上述确定内容分发路径中的故障节点的第三种方式为:In one possible design, the third way to determine the faulty node in the content distribution path is:
若接收到第二分发目标节点发送的分发失败消息,则确定所述第二分发目标节点的下游节点为所述内容分发路径中的一个故障节点,其中,所述第二分发目标节点为所述内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。If the distribution failure message sent by the second distribution target node is received, determining that the downstream node of the second distribution target node is one of the content distribution paths, wherein the second distribution target node is the Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
在一种可能的设计中,上述方法还包括:In a possible design, the above method further includes:
获取所述内容分发路径中的恢复节点,所述恢复节点为由于故障从所述内容分发路径中删除的节点;Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
将所述恢复节点增加到所述内容分发路径中,以使所述恢复节点从所述恢复节点的上游节点获取分发内容,其中,所述恢复节点通过主动请求方式从所述恢复节点的上游节点获取分发内容。Adding the recovery node to the content distribution path, so that the recovery node acquires distribution content from an upstream node of the recovery node, wherein the recovery node is from an upstream node of the recovery node by an active request mode Get the distribution.
在一种可能的设计中,上述方法还包括:In a possible design, the above method further includes:
方法还包括:The method also includes:
接收所述至少一个分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量;Receiving a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node;
向终端发送所述分发进度、所述分发日志、所述分发结果以及所述状态流量。The distribution progress, the distribution log, the distribution result, and the status traffic are transmitted to the terminal.
在一种可能的设计中,在接收所述分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量时,使用HTTPS端口接收所述分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量。In a possible design, when receiving the distribution progress, the distribution log, the distribution result, and the status traffic periodically reported by the distribution target node, the HTTPS port is used to receive the distribution progress and the distribution log periodically reported by the distribution target node. , distribution results, and status traffic.
在一种可能的设计中,在向所述分发目标节点发送内容分发消息时,使用HTTPS端口向所述分发目标节点发送内容分发消息。In one possible design, a content distribution message is sent to the distribution target node using an HTTPS port when the content distribution message is sent to the distribution target node.
本发明实施例第二方面提供一种云计算系统的内容分发方法,该方法站在计算节点的角度进行描述,该方法包括:A second aspect of the embodiments of the present invention provides a content distribution method of a cloud computing system, where the method is described in the perspective of a computing node, and the method includes:
首先,接收内容分发消息,该内容分发消息中包括内容分发路径以及待分发内容的标识,其中,内容分发路径由分发控制器根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表所生成,内容分发路径为由首节点和至少一个分发目标节点所构成的单向链式分发路径,首节点为云计算系统中具有完整的所述待分发内容的节点。 First, a content distribution message is received, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is determined by the distribution controller according to a physical networking topology of the cloud computing system, and a status of each node in the cloud computing system. The traffic is generated by the distribution target node list, and the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, and the first node is a node in the cloud computing system that has the complete content to be distributed.
其次,根据待分发内容的标识,从首节点中获取待分发内容的元数据,待分发内容的元数据中包括待分发内容的数字签名、块索引以及块哈希值。Secondly, according to the identifier of the content to be distributed, the metadata of the content to be distributed is obtained from the head node, and the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed.
进而,根据内容分发路径以及待分发内容的元数据,进行内容分发处理。Further, the content distribution processing is performed based on the content distribution path and the metadata of the content to be distributed.
在一种可能的设计中,上述内容分发消息中还包括分发目标节点的指定分发速率;相应地,在根据内容分发路径以及待分发内容的元数据,进行内容分发处理时,可以根据内容分发路径以及待分发内容的元数据,按照指定分发速率进行内容分发处理。In a possible design, the content distribution message further includes a specified distribution rate of the distribution target node; correspondingly, when the content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed, the content distribution path may be And the metadata of the content to be distributed, and the content distribution processing is performed at a specified distribution rate.
在一种可能的设计中,该方法还包括:In one possible design, the method further includes:
向分发控制器上报准备就绪状态;Reporting the ready status to the distribution controller;
接收分发控制器发送的内容接收与转发指示。Receiving a content receiving and forwarding indication sent by the distribution controller.
在一种可能的设计中,在根据所述待内容分发路径以及所述待分发内容的元数据,进行内容分发处理时,具体可以通过下述方法来进行:In a possible design, when the content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed, the following may be specifically performed by:
接收上游节点发送的块;Receiving a block sent by an upstream node;
根据所述待分发内容的元数据中的块索引以及块哈希值,对所述块进行哈希校验,获取校验结果;And performing a hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and acquiring a verification result;
若所述校验结果为校验成功,则保存所述块,并按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点。If the verification result is that the verification is successful, the block is saved, and the block is sent to a downstream node in the content distribution path according to the specified distribution rate.
在一种可能的设计中,在按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点时,具体可以为:In a possible design, when the block is sent to the downstream node in the content distribution path according to the specified distribution rate, the specific one may be:
若发送失败,则进行重新发送;If the transmission fails, resend it;
若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使所述分发控制器根据所述下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
在一种可能的设计中,还包括:In one possible design, it also includes:
若接收到所述待分发内容对应的所有块,则根据所述数字签名对所述待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。If all the blocks corresponding to the content to be distributed are received, the digital signature is checked according to the digital signature, and the result of the digital signature check is reported to the distribution controller.
在一种可能的设计中,还包括:In one possible design, it also includes:
获取分发进度、分发日志、分发结果以及状态流量;Obtain distribution progress, distribution logs, distribution results, and status traffic;
向所述分发控制器上报所述分发进度、分发日志、分发结果以及状态流量。The distribution progress, distribution log, distribution result, and status traffic are reported to the distribution controller.
在一种可能的设计中,在向所述分发控制器上报所述分发进度、分发日志、分发结果以及状态流量时,可以使用HTTPS协议向所述分发控制器上报所述分发进度、分发日志、分发结果以及状态流量。In a possible design, when the distribution progress, the distribution log, the distribution result, and the status traffic are reported to the distribution controller, the distribution progress, the distribution log, and the distribution log may be reported to the distribution controller by using an HTTPS protocol. Distribute results and status traffic.
本发明实施例第三方面提供一种内容分发方法,该方法站在内容仓库的家角度进行描述,该方法包括:A third aspect of the embodiments of the present invention provides a content distribution method, which is described in the home of a content repository, and the method includes:
接收创建元数据指示,该创建元数据指示中包括待分发内容的标识;Receiving a creation metadata indication, where the creation metadata indication includes an identifier of the content to be distributed;
根据待分发内容的标识,生成待分发内容的元数据。Metadata of the content to be distributed is generated according to the identifier of the content to be distributed.
在一种可能的设计中,在根据所述待分发内容的标识,生成所述待分发内容的元数据时,具体可以通过下述方法来执行:In a possible design, when the metadata of the content to be distributed is generated according to the identifier of the content to be distributed, the method may be specifically performed by the following method:
根据所述待分发内容标识,判断所述待分发内容是否存在,若是,则:Determining whether the content to be distributed exists according to the content identifier to be distributed, and if yes,
对所述待分发内容进行部分划分以及块划分,获取部分数量、部分大小、块大小以及块索引;以及,Performing partial division and block division on the to-be-distributed content, acquiring part number, partial size, block size, and block index; and,
对所述待分发内容进行数字签名处理,获取数字签名;以及, Digitally signing the content to be distributed to obtain a digital signature; and,
对划分的每个块进行哈希校验,获取每个块的块哈希值;Hashing each block of the partition to obtain a block hash value of each block;
将所述部分数量、每部分大小、块大小、块索引、数字签名以及每个块的块哈希值写入所述待分发内容的元数据中。The partial number, the size of each part, the block size, the block index, the digital signature, and the block hash value of each block are written into the metadata of the content to be distributed.
本发明第四方面提供一种内容分发装置,包括:A fourth aspect of the present invention provides a content distribution apparatus, including:
接收模块,用于接收内容分发指示,所述内容分发指示中包括待分发内容的标识以及分发目标节点列表,所述分发目标节点列表中包括至少一个分发目标节点的标识;a receiving module, configured to receive a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
处理模块,用于根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及所述分发目标节点列表,生成内容分发路径,其中,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为云计算系统中具有完整的所述待分发内容的节点;a processing module, configured to generate a content distribution path according to a physical networking topology of the cloud computing system, a state traffic of each node in the cloud computing system, and the distribution target node list, where the content distribution path is a first node and a a unidirectional chain distribution path formed by at least one distribution target node, where the first node is a node having a complete content to be distributed in the cloud computing system;
发送模块,用于向所述至少一个分发目标节点发送内容分发消息,所述内容分发消息中包括所述内容分发路径以及所述待分发内容的标识,以使所述至少一个分发目标节点根据所述内容分发路径以及所述待分发内容的标识获取并分发所述待分发内容。a sending module, configured to send a content distribution message to the at least one distribution target node, where the content distribution message includes the content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node is configured according to the The content distribution path and the identifier of the content to be distributed acquire and distribute the content to be distributed.
在一种可能的设计中,所述内容分发消息中还包括所述至少一个分发目标节点的指定分发速率,所述指定分发速率是在生成所述内容分发路径时根据所述至少一个分发目标节点的状态流量确定的。In a possible design, the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is based on the at least one distribution target node when the content distribution path is generated The status of the traffic is determined.
在一种可能的设计中,所述接收模块,还用于接收所述至少一个分发目标节点上报的准备就绪状态;In a possible design, the receiving module is further configured to receive a ready state reported by the at least one distribution target node;
所述发送模块,还用于根据所述准备就绪状态,向所述至少一个分发目标节点发送内容接收与转发指示。The sending module is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
在一种可能的设计中,所述接收模块,还用于接收所述至少一个分发目标节点上报的准备就绪状态;In a possible design, the receiving module is further configured to receive a ready state reported by the at least one distribution target node;
所述发送模块,还用于根据所述准备就绪状态,向所述至少一个分发目标节点发送内容接收与转发指示。The sending module is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
在一种可能的设计中,所述处理模块还用于:In one possible design, the processing module is further configured to:
根据物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;以及,According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定系统中具有完整的所述待分发内容的多个节点;以及,Determining a plurality of nodes in the system having the complete content to be distributed; and,
生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于所述具有完整的所述待分发内容的节点的个数,每条所述内容分发路径中的首节点为所述具有完整的所述待分发内容的节点中的其中一个节点。Generating a plurality of content distribution paths, wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
在一种可能的设计中,所述处理模块还用于:In one possible design, the processing module is further configured to:
设置所述内容分发路径中的预设节点数量;以及,Setting a preset number of nodes in the content distribution path; and,
若所述内容分发路径中的节点数量大于所述预设节点数量,则从所述内容分发路径中选择分叉节点,并根据所述分叉节点将所述内容分发路径拆分为第一内容分发路径以及第二内容分发路径;If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
其中,所述第一内容分发路径和所述第二内容分发路径的首节点相同,所述第一内容分发路径和所述第二内容分发路径以所述分叉节点为分界,所述分叉节点为所述内容分发路径中当前流量耗费最低的节点。The first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
在一种可能的设计中,所述处理模块还用于: In one possible design, the processing module is further configured to:
确定所述内容分发路径中的故障节点;以及,Determining a faulty node in the content distribution path; and,
将所述故障节点从所述内容分发路径中删除,并将所述故障节点的下游节点作为所述故障节点上游节点的下游节点。And deleting the faulty node from the content distribution path, and using a downstream node of the faulty node as a downstream node of the upstream node of the faulty node.
在一种可能的设计中,所述处理模块还包括:In a possible design, the processing module further includes:
第四确定单元,用于在未接收到第一分发目标节点发送的对于所述内容分发消息的响应消息时,确定所述第一分发目标节点为所述内容分发路径中的一个故障节点,其中,所述第一分发目标节点为所述内容分发路径中的任意一个分发目标节点。a fourth determining unit, configured to determine, when the response message for the content distribution message sent by the first distribution target node is not received, the first distribution target node is a faulty node in the content distribution path, where The first distribution target node is a distribution target node of any one of the content distribution paths.
在一种可能的设计中,所述处理模块还包括:In a possible design, the processing module further includes:
第五确定单元,用于根据所述至少一个分发目标节点所上报的状态流量以及分发日志,确定所述内容分发路径中的故障节点。And a fifth determining unit, configured to determine a faulty node in the content distribution path according to the state traffic reported by the at least one distribution target node and the distribution log.
在一种可能的设计中,所述处理模块还包括:In a possible design, the processing module further includes:
第六确定单元,用于在接收到第二分发目标节点发送的分发失败消息时,确定所述第二分发目标节点的下游节点为所述内容分发路径中的一个故障节点,其中,所述第二分发目标节点为所述内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。a sixth determining unit, configured to: when receiving the distribution failure message sent by the second distribution target node, determine that the downstream node of the second distribution target node is a fault node in the content distribution path, where the The second distribution target node is any one of the distribution target nodes except the last distribution destination node in the content distribution path.
在一种可能的设计中,所述处理模块还用于:In one possible design, the processing module is further configured to:
获取所述内容分发路径中的恢复节点,所述恢复节点为由于故障从所述内容分发路径中删除的节点;以及,Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
将所述恢复节点增加到所述内容分发路径中,以使所述恢复节点从所述恢复节点的上游节点获取分发内容,其中,所述恢复节点通过主动请求方式从所述恢复节点的上游节点获取分发内容。Adding the recovery node to the content distribution path, so that the recovery node acquires distribution content from an upstream node of the recovery node, wherein the recovery node is from an upstream node of the recovery node by an active request mode Get the distribution.
在一种可能的设计中,所述接收模块,还用于接收所述至少一个分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量;In a possible design, the receiving module is further configured to receive a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node;
所述发送模块,还用于向终端发送所述分发进度、所述分发日志、所述分发结果以及所述状态流量。The sending module is further configured to send the distribution progress, the distribution log, the distribution result, and the status traffic to the terminal.
本发明实施例第五方面提供一种内容分发装置,包括:A fifth aspect of the embodiments of the present invention provides a content distribution apparatus, including:
接收模块,用于接收内容分发消息,所述内容分发消息中包括内容分发路径以及待分发内容的标识,其中,所述内容分发路径由分发控制器根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表所生成,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为系统中具有完整的所述待分发内容的节点;a receiving module, configured to receive a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and the cloud computing a state traffic of each node in the system and a distribution target node list, where the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is in the system a complete node of the content to be distributed;
处理模块,用于根据所述待分发内容的标识,从首节点中获取所述待分发内容的元数据,所述待分发内容的元数据中包括所述待分发内容的数字签名、块索引以及块哈希值;a processing module, configured to acquire, according to the identifier of the content to be distributed, metadata of the content to be distributed from a first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a content of the content to be distributed Block hash value;
所述处理模块,还用于根据所述内容分发路径以及所述待分发内容的元数据,进行内容分发处理。The processing module is further configured to perform content distribution processing according to the content distribution path and the metadata of the content to be distributed.
在一种可能的设计中,所述内容分发消息中还包括分发目标节点的指定分发速率;In a possible design, the content distribution message further includes a specified distribution rate of the distribution target node;
所述处理模块,具体用于根据所述内容分发路径以及所述待分发内容的元数据,按照所述指定分发速率进行内容分发处理。The processing module is specifically configured to perform content distribution processing according to the specified distribution rate according to the content distribution path and the metadata of the content to be distributed.
在一种可能的设计中,还包括:In one possible design, it also includes:
发送模块,用于向分发控制器上报准备就绪状态;a sending module, configured to report a ready state to the distribution controller;
所述接收模块,还用于接收所述分发控制器发送的内容接收与转发指示。 The receiving module is further configured to receive a content receiving and forwarding indication sent by the distribution controller.
在一种可能的设计中,所述处理模块包括:In one possible design, the processing module includes:
接收单元,用于接收上游节点发送的块;a receiving unit, configured to receive a block sent by an upstream node;
校验单元,用于根据所述待分发内容的元数据中的块索引以及块哈希值,对所述块进行哈希校验,获取校验结果;a checking unit, configured to perform hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain a verification result;
发送单元,用于在所述校验结果为校验成功时,保存所述块,并按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点。And a sending unit, configured to save the block when the verification result is a verification success, and send the block to a downstream node in the content distribution path according to the specified distribution rate.
在一种可能的设计中,所述发送单元具体用于:In a possible design, the sending unit is specifically configured to:
若发送失败,则进行重新发送;以及,If the transmission fails, resend; and,
若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使所述分发控制器根据所述下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
在一种可能的设计中,所述处理模块,还用于在接收到所述待分发内容对应的所有块时,根据所述数字签名对所述待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。In a possible design, the processing module is further configured to: when receiving all the blocks corresponding to the content to be distributed, perform digital signature check on the to-be-distributed content according to the digital signature, and digitally sign the The result of the check is reported to the distribution controller.
在一种可能的设计中,所述处理模块,还用于获取分发进度、分发日志、分发结果以及状态流量;In a possible design, the processing module is further configured to obtain a distribution progress, a distribution log, a distribution result, and a status flow;
所述发送模块,还用于向所述分发控制器上报所述分发进度、分发日志、分发结果以及状态流量。The sending module is further configured to report the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
本发明实施例第六方面提供一种内容分发装置,包括:A sixth aspect of the embodiments of the present invention provides a content distribution apparatus, including:
接收模块,用于接收创建元数据指示,所述创建元数据指示中包括待分发内容的标识;a receiving module, configured to receive a creation metadata indication, where the creation metadata indication includes an identifier of the content to be distributed;
处理模块,用于根据所述待分发内容的标识,生成所述待分发内容的元数据。And a processing module, configured to generate metadata of the content to be distributed according to the identifier of the content to be distributed.
在一种可能的设计中,处理模块包括:In one possible design, the processing module includes:
划分单元,用于在根据所述待分发内容标识,判断所述待分发内容存在之后,对所述待分发内容进行部分划分以及块划分,获取部分数量、部分大小、块大小以及块索引。a dividing unit, configured to perform partial division and block division on the to-be-distributed content after determining that the content to be distributed exists according to the content identifier to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
处理单元,用于对待分发内容进行数字签名处理,获取数字签名。The processing unit is configured to perform digital signature processing on the content to be distributed, and obtain a digital signature.
校验单元,用于对划分的每个块进行哈希校验,获取每个块的块哈希值。A check unit is configured to perform hash check on each of the divided blocks to obtain a block hash value of each block.
写入单元,用于将部分数量、每部分大小、块大小、块索引、数字签名以及每个块的块哈希值写入待分发内容的元数据中。A write unit for writing a partial number, a partial size, a block size, a block index, a digital signature, and a block hash value of each block into the metadata of the content to be distributed.
本发明实施例第七方面提供一种分发控制器,包括:A seventh aspect of the embodiments of the present invention provides a distribution controller, including:
存储器和处理器。Memory and processor.
存储器用于存储程序指令,处理器用于调用存储器中的程序指令,执行下述方法:The memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
接收内容分发指示,所述内容分发指示中包括待分发内容的标识以及分发目标节点列表,所述分发目标节点列表中包括至少一个分发目标节点的标识;Receiving a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及所述分发目标节点列表,生成内容分发路径,其中,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为云计算系统中具有完整的所述待分发内容的节点;Generating a content distribution path according to a physical networking topology of the cloud computing system, a state traffic of each node in the cloud computing system, and the distribution target node list, wherein the content distribution path is a first node and the at least one distribution target a unidirectional chain distribution path formed by the node, where the head node is a node having a complete content to be distributed in the cloud computing system;
向所述至少一个分发目标节点发送内容分发消息,所述内容分发消息中包括所述内容分发路径以及所述待分发内容的标识,以使所述至少一个分发目标节点根据所述内容分发路径以及所述待分发内容的标识获取并分发所述待分发内容。And transmitting, to the at least one distribution target node, a content distribution message, where the content distribution message includes the content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node according to the content distribution path and The identifier of the content to be distributed acquires and distributes the content to be distributed.
本发明实施例第八方面提供一种计算节点,包括: An eighth aspect of the embodiments of the present invention provides a computing node, including:
存储器和处理器。Memory and processor.
存储器用于存储程序指令,处理器用于调用存储器中的程序指令,执行下述方法:The memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
接收内容分发消息,所述内容分发消息中包括内容分发路径以及待分发内容的标识,其中,所述内容分发路径由分发控制器根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表所生成,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为云计算系统中具有完整的所述待分发内容的节点;Receiving a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and each node in the cloud computing system The status flow is generated by the distribution target node list, and the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is a complete system in the cloud computing system. a node that describes the content to be distributed;
根据所述待分发内容的标识,从首节点中获取所述待分发内容的元数据,所述待分发内容的元数据中包括所述待分发内容的数字签名、块索引以及块哈希值;Obtaining, according to the identifier of the content to be distributed, the metadata of the content to be distributed from the first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed;
根据所述内容分发路径以及待分发内容的元数据,进行内容分发处理。Content distribution processing is performed based on the content distribution path and metadata of the content to be distributed.
本发明实施例第九方面提供一种内容仓库,包括:A ninth aspect of the embodiments of the present invention provides a content repository, including:
存储器和处理器。Memory and processor.
存储器用于存储程序指令,处理器用于调用存储器中的程序指令,执行下述方法:The memory is used to store program instructions, and the processor is used to call program instructions in the memory to perform the following methods:
接收创建元数据指示,所述创建元数据指示中包括待分发内容的标识;Receiving a creation metadata indication, wherein the creation metadata indication includes an identifier of the content to be distributed;
根据所述待分发内容的标识,生成所述待分发内容的元数据。Generating metadata of the content to be distributed according to the identifier of the content to be distributed.
本发明第十方面提供一种内容分发系统,包括前述的分发控制器、计算节点以及内容仓库。A tenth aspect of the present invention provides a content distribution system including the foregoing distribution controller, a computing node, and a content repository.
背景技术中,对于一次内容分发,并不存在确定的分发路径,而是由分发目标节点在下载的过程中动态地与其他节点建立连接,为了更有效的交换内容,一个分发目标节点可能建立众多的连接,可能导致流量的突然迸发,因此,背景技术无法实现有效的流量控制。其次,下载文件块时不是按照顺序下载或上传,下载前首先在硬盘写入要下载文件容量相同的文件,然后通过填充的方法随机写入数据,每次下载需要对所有块进行校验计算,下载与上传过程中同时进行读和写操作,对硬盘资源占用高。因此,不能保证内容分发的高效性。另外背景技术中拓扑构建需要索引服务器的支持,节点加入系统的次序对形成拓扑有着极其重要的影响,当有当节点加入才能启动下载与上传,如果存在节点下载完成就退出时,就可能出现“种子”节点数为零,这会导致部分节点下载速度放慢,甚至无法完整下载所有文件块,因此,背景技术也无法保证分发内容的完整性。In the background art, for a content distribution, there is no determined distribution path, but the distribution target node dynamically establishes a connection with other nodes in the process of downloading. In order to exchange content more effectively, one distribution target node may establish a large number of The connection may cause a sudden burst of traffic, so the background technology cannot achieve effective flow control. Secondly, when downloading a file block, it is not downloaded or uploaded in order. Before downloading, first write the file with the same file capacity on the hard disk, and then randomly write the data by filling method. Each download needs to perform check calculation for all blocks. The read and write operations are performed simultaneously during the download and upload process, and the hard disk resources are occupied. Therefore, the efficiency of content distribution cannot be guaranteed. In addition, the topology construction in the background art requires the support of the index server, and the order in which the nodes join the system has an extremely important influence on the formation of the topology. When there is a node to join, the download and upload can be started, and if the node is downloaded, the exit may occur. The number of "nodes" is zero, which causes some nodes to slow down and even download all the file blocks. Therefore, the background technology cannot guarantee the integrity of the distributed content.
本发明实施例所提供的方案,相比于现有技术,能够实现对于内容分发过程中的流量控制。The solution provided by the embodiment of the present invention can implement flow control in the content distribution process compared to the prior art.
附图说明DRAWINGS
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are Some of the embodiments of the invention may be obtained by those of ordinary skill in the art in view of the drawings without departing from the scope of the invention.
图1为本发明实施例提供的内容分发方法的系统架构图;1 is a system architecture diagram of a content distribution method according to an embodiment of the present invention;
图2为本发明实施例提供的内容分发方法实施例一的交互流程图;2 is an interaction flowchart of Embodiment 1 of a content distribution method according to an embodiment of the present invention;
图3为云计算系统的中心物理服务器的一个示例;3 is an example of a central physical server of a cloud computing system;
图4为云计算系统的中心物理服务器的内部连接示例;4 is an example of internal connection of a central physical server of a cloud computing system;
图5为单一链式路径的示意图; Figure 5 is a schematic diagram of a single chain path;
图6为多条内容分发路径并行分发的示意图;6 is a schematic diagram of parallel distribution of multiple content distribution paths;
图7为内容分发路径进行分叉的示意图;7 is a schematic diagram of a content distribution path bifurcation;
图8为从内容分发路径中删除故障节点的示意图;8 is a schematic diagram of deleting a faulty node from a content distribution path;
图9为将恢复节点重新加入内容分发路径的示意图;9 is a schematic diagram of rejoining a recovery node to a content distribution path;
图10为内容分发到多个子网的示意图;Figure 10 is a schematic diagram of content distribution to multiple subnets;
图11为本发明提供实施例二的生成元数据流程示意图;11 is a schematic flowchart of generating metadata according to Embodiment 2 of the present invention;
图12为待分发内容层次划分的示意图;12 is a schematic diagram of hierarchical division of content to be distributed;
图13为待分发内容的元数据的示例图;Figure 13 is a diagram showing an example of metadata of content to be distributed;
图14为本发明实施例提供的内容分发方法实施例三的内容接收与转发流程示意图;FIG. 14 is a schematic diagram of a content receiving and forwarding process according to Embodiment 3 of a content distribution method according to an embodiment of the present disclosure;
图15为本发明实施例提供的内容分发装置实施例一的模块结构图;FIG. 15 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图16为本发明实施例提供的内容分发装置实施例二的模块结构图;FIG. 16 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图17为本发明实施例提供的内容分发装置实施例三的模块结构图;FIG. 17 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图18为本发明实施例提供的内容分发装置实施例四的模块结构图;FIG. 18 is a block diagram of a fourth embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图19为本发明实施例提供的内容分发装置实施例五的模块结构图;FIG. 19 is a block diagram showing a structure of a fifth embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图20为本发明实施例提供的内容分发装置实施例一的模块结构图;FIG. 20 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图21为本发明实施例提供的内容分发装置实施例二的模块结构图;FIG. 21 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图22为本发明实施例提供的内容分发装置实施例三的模块结构图;Figure 22 is a block diagram showing the structure of a third embodiment of a content distribution apparatus according to an embodiment of the present invention;
图23为本发明实施例提供的内容分发装置实施例一的模块结构图;FIG. 23 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图24为本发明实施例提供的内容分发装置实施例二的模块结构图;FIG. 24 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present disclosure;
图25为本发明实施例提供的分发控制器实施例一的实体框图;FIG. 25 is a physical block diagram of Embodiment 1 of a distribution controller according to an embodiment of the present disclosure;
图26为本发明实施例提供的计算节点实施例一的实体框图;FIG. 26 is a physical block diagram of Embodiment 1 of a computing node according to an embodiment of the present disclosure;
图27为本发明实施例提供的内容仓库实施例一的实体框图。FIG. 27 is a physical block diagram of Embodiment 1 of a content repository according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. Some embodiments, rather than all of the embodiments, are invented. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
在具体描述本发明实施例之前,首先对本发明实施例所涉及到几个概念进行解释:Before describing the embodiments of the present invention in detail, first, several concepts involved in the embodiments of the present invention are explained:
1、系统、节点、物理组网拓扑1. System, node, and physical networking topology
本发明实施例所涉及的系统是由一群相互独立的,通过高速网络互联的计算节点所组成的系统,计算节点之间需要共享或分发相同的内容信息。系统在部署形态上可能是分布式部署与集中式部署。The system involved in the embodiments of the present invention is a system consisting of a group of mutually independent computing nodes interconnected by a high-speed network, and the same content information needs to be shared or distributed between the computing nodes. The deployment form of the system may be distributed deployment and centralized deployment.
举例来说,系统可以是云计算系统,云计算系统中的每个虚拟机可以看作是系统中的一个计算节点,虚拟机之间需要共享或者分发相同的内容信息。For example, the system can be a cloud computing system. Each virtual machine in the cloud computing system can be regarded as a computing node in the system, and the same content information needs to be shared or distributed between the virtual machines.
需要说明的是,本发明实施例所涉及的系统并不限于某个特定的系统,只要是其内部的计算节点需要共享或分发相同的内容信息的系统,都可以使用本发明实施例所提供的方法。It should be noted that the system according to the embodiment of the present invention is not limited to a specific system, and any system in which the internal computing node needs to share or distribute the same content information may use the embodiment provided by the embodiment of the present invention. method.
为描述方便,本发明实施例中统一将“计算节点”称为“节点”。For convenience of description, the “computation node” is collectively referred to as “node” in the embodiment of the present invention.
对于每个系统来说都对应一个物理组网,系统的物理组网拓扑是指系统所对应的物理组网中各物理设备之间的位置以及连接关系等。 For each system, it corresponds to a physical network. The physical network topology of the system refers to the location and connection relationship between physical devices in the physical network corresponding to the system.
2、相邻节点、上游节点、下游节点2. Adjacent nodes, upstream nodes, downstream nodes
在本发明实施例中,相邻节点是指在内容分发路径中位置相邻的两个节点,以图1中的节点1、节点2和节点3为例,图1中的分发路径1中包括节点1、节点2和节点3,其中,节点2是从节点1中接收分发内容,即节点2和节点1在分发路径1中的位置相邻,因此,节点1和节点2就是相邻节点,同时,节点3和节点2也是相邻节点。In the embodiment of the present invention, the adjacent nodes refer to two nodes that are adjacent in the content distribution path, and the node 1, the node 2, and the node 3 in FIG. 1 are taken as an example, and the distribution path 1 in FIG. Node 1, Node 2, and Node 3, wherein Node 2 receives the distribution content from Node 1, that is, Node 2 and Node 1 are adjacent in the distribution path 1, and therefore, Node 1 and Node 2 are adjacent nodes. At the same time, node 3 and node 2 are also adjacent nodes.
而对于特定的节点2,节点1是其上游节点,节点3是其下游节点,即,对于特定的节点2,其从上游节点上接收分发内容,并将分发内容发送给卸下游节点。For a particular node 2, node 1 is its upstream node and node 3 is its downstream node, ie, for a particular node 2, it receives the distribution content from the upstream node and sends the distribution to the unloading node.
3、流量及带宽3, traffic and bandwidth
流量是指节点上行(发送)或下行(接收)的分发数据量,即节点在一段时间内的发送或接收的数据量。当前流量低的节点是指当前统计时间段内的发送与接收的数据量少的节点。Traffic refers to the amount of distributed data that the node uplinks (transmits) or downlinks (receives), that is, the amount of data sent or received by the node over a period of time. A node with a low current traffic rate refers to a node that transmits and receives less data during the current statistical time period.
带宽指节点在规定时间内最大数据允许的传输速度,流量控制是通过限制节点分发过程中所占用带宽,节点的上下行的连接数,以及进行有区分的转发与丢包控制等技术手段来实现的。Bandwidth refers to the transmission speed allowed by the maximum data of the node within a specified time. The flow control is achieved by limiting the bandwidth occupied by the node distribution process, the number of uplink and downlink connections of the node, and performing differentiated forwarding and packet loss control. of.
图1为本发明实施例提供的内容分发方法的系统架构图,如图1所示,系统中包括分发控制器、内容仓库(content warehouse)以及多个节点。FIG. 1 is a system architecture diagram of a content distribution method according to an embodiment of the present invention. As shown in FIG. 1, the system includes a distribution controller, a content warehouse, and a plurality of nodes.
分发控制器根据多个节点的状态、流量、物理位置等信息创建内容分发路径,并对多个节点进行控制,本发明实施例中,分发控制器和内容分发装置可以是相同的。内容仓库用于存储待分发的内容,并将待分发的内容发送给分发路径中的首节点。每条内容分发路径都为单向链式分发路径,每条分发路径中的首节点为包括完整分发内容的节点,由首节点开始按照顺序向分发路径中的节点分发内容。本发明的实施例中当某个用户需要将内容分发到云计算系统中分发目标节点时,分发控制器接收到需要分发内容的终端发送的内容分发指示,该内容分发指示中包括待分发内容的标识以及分发目标节点列表,分发目标节点列表中包括至少一个分发目标节点的标识;此时分发控制器确定了该内容需要被分发到哪些节点。分发控制器根据云计算系统的物理组网拓扑、各节点的状态流量以及分发目标节点列表,生成内容分发路径;然后将包含内容分发路径和待分发内容的标识的内容分发消息发送给各个分发目标节点。各个节点接收到了该内容分发路径,根据该内容分发路径,建立与上下游节点的内容链接通道,并开始进行内容分发。本发明实施例的具体的内容分发过程如图2所示。The distribution controller creates a content distribution path according to the information of the status, the traffic, the physical location, and the like of the plurality of nodes, and controls the plurality of nodes. In the embodiment of the present invention, the distribution controller and the content distribution device may be the same. The content repository is used to store the content to be distributed, and the content to be distributed is sent to the head node in the distribution path. Each content distribution path is a unidirectional chain distribution path, and the first node in each distribution path is a node including the complete distribution content, and the first node starts to distribute the content to the nodes in the distribution path in order. In a embodiment of the present invention, when a user needs to distribute the content to a distribution target node in the cloud computing system, the distribution controller receives a content distribution indication sent by the terminal that needs to distribute the content, where the content distribution indication includes the content to be distributed. And identifying a distribution target node list, wherein the distribution target node list includes an identifier of at least one distribution target node; at this time, the distribution controller determines which nodes the content needs to be distributed to. The distribution controller generates a content distribution path according to the physical networking topology of the cloud computing system, the state traffic of each node, and the distribution target node list; and then sends a content distribution message including the content distribution path and the identifier of the content to be distributed to each distribution target. node. Each node receives the content distribution path, establishes a content link channel with the upstream and downstream nodes according to the content distribution path, and starts content distribution. A specific content distribution process of an embodiment of the present invention is shown in FIG. 2.
图2为本发明实施例提供的内容分发方法实施例一的交互流程图,该交互流程可以利用图1中系统架构和其中的网元,来实现云计算系统的内容分发的目的,如图2所示,该方法包括:FIG. 2 is an interaction flowchart of a content distribution method according to Embodiment 1 of the present invention. The interaction process may utilize the system architecture of FIG. 1 and the network element therein to implement content distribution of the cloud computing system, as shown in FIG. 2 . As shown, the method includes:
S201、用户通过终端向内容仓库发布内容。S201. The user issues content to the content warehouse through the terminal.
具体地,当存在新的可以分发的内容时,例如新生成操作系统补丁后,就可以由用户通过终端将这些新的可以分发的内容发布到内容仓库中去。终端可以直接使用内容仓库所提供的应用程序接口(Application Programming Interface,简称API)将内容发布到内容仓库中。当完成内容发布之后,这些内容就被保存在内容仓库中。Specifically, when there is new content that can be distributed, for example, after a new operating system patch is newly generated, the user can publish the new distributable content to the content repository through the terminal. The terminal can directly publish the content to the content repository by using an Application Programming Interface (API) provided by the content repository. When the content is published, the content is saved in the content repository.
内容仓库存储分发的内容,内容仓库可以为该内容生成内容标识,该内容标识唯一标识该内容,并将该内容标识返回给终端。后续当终端或分发控制器需要从内容仓库获取内容时,都需要通过该内容标识进行区分。The content repository stores the distributed content, and the content repository can generate a content identifier for the content, the content identifier uniquely identifies the content, and returns the content identifier to the terminal. Subsequent when the terminal or distribution controller needs to obtain content from the content repository, it needs to distinguish by the content identifier.
S202、用户通过终端向分发控制器发送内容分发指示。 S202. The user sends a content distribution indication to the distribution controller through the terminal.
其中,上述内容分发指示包括待分发内容的标识以及分发目标节点列表,该分发目标节点列表包括至少一个分发目标节点的标识。The content distribution indication includes an identifier of the content to be distributed and a distribution target node list, and the distribution target node list includes an identifier of the at least one distribution target node.
具体地,当用户希望将已经发布到内容仓库上的某个特定内容分发到特定的目标节点时,通过终端向分发控制器发送内容分发指示,这个内容分发指示中指示待分发内容的标识以及分发目标节点列表。Specifically, when the user wishes to distribute a certain content that has been posted to the content repository to a specific target node, the content distribution indication is sent to the distribution controller through the terminal, and the content distribution indication indicates the identification and distribution of the content to be distributed. List of target nodes.
其中,待分发内容的标识用来指示分发控制器具体分发内容仓库中的哪个内容,该待分发内容的标识即为步骤S201中内容仓库为该内容所分配的标识。The identifier of the content to be distributed is used to indicate which content in the content warehouse is specifically distributed by the distribution controller, and the identifier of the content to be distributed is the identifier allocated by the content warehouse in the step S201.
另外,分发目标节点列表中包括至少一个分发目标节点的标识,分发目标节点是指用户希望将内容分发到目的节点,对于不同的内容,其需要分发到的节点可能并不相同,因此,用户通过终端每次向分发控制器发送内容分发指示时,都需要指定这些内容具体要发送到的目标节点。其中,分发目标节点的数量可以是一个,也可以是多个,本发明对其数量不做限制。每个分发目标节点的标识可以通过节点的名称、编号或者IP地址等来表示。In addition, the distribution target node list includes an identifier of at least one distribution target node, and the distribution target node refers to that the user wants to distribute the content to the destination node, and the nodes that need to be distributed to different contents may not be the same, and therefore, the user passes Each time the terminal sends a content distribution indication to the distribution controller, it needs to specify the target node to which the content is specifically sent. The number of the distribution target nodes may be one or multiple, and the present invention does not limit the number thereof. The identity of each distribution target node can be represented by the name, number, or IP address of the node, and the like.
需要说明的是,上述步骤S201和S202在时间上可以不连续,用户可以先将内容发布到内容仓库,再选择合适的时间向分发控制器发送内容分发指示。It should be noted that the above steps S201 and S202 may be discontinuous in time, and the user may first publish the content to the content repository, and then select an appropriate time to send the content distribution indication to the distribution controller.
可选地,终端在向分发控制器发送内容分发指示之前,可以首先根据待分发内容的标识向内容仓库发送查询申请,内容仓库在接收到查询申请之后可以判断该标识对应的内容是否存在,如果存在,则向终端返回查询成功消息,终端可以继续向分发控制器发送内容分发指示;如果不存在,则向终端返回失败消息,终端仅可以提示用户该标识对应的内容存在,提醒用户重新确认内容标识,而不继续向分发控制器发送内容分发指示。Optionally, before sending the content distribution indication to the distribution controller, the terminal may first send an inquiry request to the content repository according to the identifier of the content to be distributed, and the content warehouse may determine whether the content corresponding to the identifier exists after receiving the query request, if If yes, the terminal returns a query success message to the terminal, and the terminal may continue to send the content distribution indication to the distribution controller. If not, the terminal may return a failure message to the terminal, and the terminal may only prompt the user for the content corresponding to the identifier, and prompt the user to re-confirm the content. Identify, without continuing to send a content distribution indication to the distribution controller.
S203、分发控制器根据内容分发指示生成内容分发路径。S203. The distribution controller generates a content distribution path according to the content distribution instruction.
当分发控制器接收到终端发送的内容分发指示后,根据物理组网拓扑、系统中各节点的状态流量以及内容分发指示中所携带的分发目标节点列表,生成内容分发路径。其中物理组网拓扑表示了系统节点之间中当前的组网连接关系,系统中各节点的状态流量表示了各个节点状态流量情况,比如:节点状态流量可以为具体当前的流量负荷情况,或者节点当前的流量是否超阈值的情况。分发控制器每次接收到内容分发指示后,都结合这两种实际情况来选择出一条最能节省分发时间和节省系统流量的内容分发路径,从而保证内容分发的高效以及实现流量控制。After receiving the content distribution indication sent by the terminal, the distribution controller generates a content distribution path according to the physical networking topology, the status traffic of each node in the system, and the distribution target node list carried in the content distribution indication. The physical networking topology indicates the current networking connection relationship between system nodes. The status traffic of each node in the system indicates the status traffic status of each node. For example, the node status traffic can be the specific current traffic load situation, or the node. Whether the current traffic exceeds the threshold. Each time the distribution controller receives the content distribution instruction, it combines these two actual situations to select a content distribution path that can save the distribution time and save system traffic, thereby ensuring efficient content distribution and realizing flow control.
内容分发路径是由首节点和上述至少一个分发目标节点所构成的单向链式分发路径,该内容分发路径中的第一个节点为首节点,系统中具有完整的待分发内容的节点可以作为首节点。The content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, and the first node in the content distribution path is the first node, and the node with complete content to be distributed in the system can be the first node.
具体地,分发控制器所生成的内容分发路径中包括了首节点和至少一个分发目标节点,这些节点之间的连接关系是单向链式的,举例来说,对于内容分发路径中的一个节点A,其只能从一个节点B上接收数据,并只能将接收到的数据发送一个节点C,而不能再向节点B发送数据,也不能从节点C接收数据。Specifically, the content distribution path generated by the distribution controller includes a first node and at least one distribution target node, and the connection relationship between the nodes is unidirectional chain, for example, for a node in the content distribution path. A, it can only receive data from one Node B, and can only send the received data to one node C, and can no longer send data to Node B, nor can it receive data from Node C.
另外,为提升内容分发的效率,内容在分发过程中可以使用分块分发,即将一个完整的待分发内容划分为多块,多块逐个进行分发,最后再组合为一个完整的内容。在内容分发过程中,系统中的有些节点就可能拥有待分发内容对应的所有块,即完整的待分发内容,这些节点就可以作为内容分发路径中的首节点。而有些节点可能拥有一部分块,这些节点就不能作为内容分发路径中的首节点。In addition, in order to improve the efficiency of content distribution, content distribution can be used in the distribution process, that is, a complete distribution of content to be distributed is divided into multiple blocks, multiple pieces are distributed one by one, and finally combined into one complete content. During the content distribution process, some nodes in the system may have all the blocks corresponding to the content to be distributed, that is, the complete content to be distributed, and these nodes can be the first nodes in the content distribution path. Some nodes may have a part of the blocks, and these nodes cannot be the first node in the content distribution path.
分发控制器根据物理组网拓扑、系统中各节点的状态流量所生成的内容分发路径为单向 链式路径,即,该内容分发路径中每个节点所连接的节点数量可以由分发控制器来控制。具体地,可以是单一链式路径、多条并发链式路径等形式,在不同的场景下,可以使用不同形式的链式路径,将会在本发明实施例的后续进行详细说明。The distribution controller generates a content distribution path based on the physical networking topology and the state traffic of each node in the system. A chained path, that is, the number of nodes to which each node in the content distribution path is connected can be controlled by a distribution controller. Specifically, it may be in the form of a single chain path, a plurality of concurrent chain paths, etc., and different types of chain paths may be used in different scenarios, which will be described in detail later in the embodiments of the present invention.
S204、分发控制器向内容仓库发送创建元数据指示。其中,该创建元数据指示中包括待分发内容的标识。S204. The distribution controller sends a creation metadata indication to the content warehouse. The creation metadata indication includes an identifier of the content to be distributed.
具体地,在分发控制器生成内容分发路径之后,分发控制器可以向内容仓库发送创建元数据指示,这个创建元数据指示用于指示内容仓库建立待分发内容的元数据(metadata),待分发内容的元数据是对待分发内容进行分块以及进行安全校验之后所形成的元数据,在内容转发过程中都需要根据元数据进行安全以及将在后续对其进行详细描述。Specifically, after the distribution controller generates the content distribution path, the distribution controller may send a creation metadata indication to the content repository, the creation metadata indicating metadata for instructing the content repository to establish the content to be distributed, the content to be distributed The metadata is the metadata formed after the content to be distributed and the security check is performed. In the content forwarding process, it is necessary to perform security according to the metadata and will be described in detail later.
由于首节点中具有完整的待分发内容,即首节点在进行内容转发过程中已经使用了元数据,因此,首节点中也需要具有待分发内容的元数据。Since the first node has complete content to be distributed, that is, the first node has used metadata in the content forwarding process, metadata of the content to be distributed is also required in the first node.
S205、内容仓库根据分发控制器所发送的创建元数据指示,生成待分发内容的元数据。S205. The content repository generates metadata of the content to be distributed according to the creation metadata indication sent by the distribution controller.
具体地,在内容仓库接收到内容分发指示后,根据其中所携带的待分发内容的标识来确定出内容仓库中所保存的待分发内容,并生成待分发内容的元数据。在生成待分发内容的元数据之前,内容仓库首先判断是否已经生成了待分发内容的元数据,如果已经生成,则不再执行生成操作,而是可以直接使用现有的元数据。Specifically, after receiving the content distribution instruction, the content repository determines the to-be-distributed content saved in the content repository according to the identifier of the content to be distributed carried therein, and generates metadata of the content to be distributed. Before generating the metadata of the content to be distributed, the content repository first determines whether the metadata of the content to be distributed has been generated, and if it has been generated, the generation operation is no longer performed, but the existing metadata can be directly used.
其中,待分发内容的元数据包括待分发内容的数字签名、块索引以及块哈希值等,具体生成待分发内容的元数据的方法将在下文图11的介绍中进行详细的解释说明。The metadata of the content to be distributed includes a digital signature of the content to be distributed, a block index, a block hash value, and the like, and a method of specifically generating metadata of the content to be distributed will be explained in detail in the introduction of FIG. 11 below.
S206、分发控制器向内容分发路径中的所有分发目标节点发送内容分发消息。S206. The distribution controller sends a content distribution message to all distribution target nodes in the content distribution path.
其中,图2仅示出了分发控制器向节点1和节点2这两个分发目标节点发送内容分发消息,但是在实际分发过程中,每条内容分发路径中可能包括多个分发目标节点,分发控制器可以向内容分发路径中的所有分发目标节点都发送内容分发消息。2, only the distribution controller sends a content distribution message to the two distribution target nodes, node 1 and node 2, but in the actual distribution process, each content distribution path may include multiple distribution target nodes, and distribute The controller can send a content distribution message to all of the distribution target nodes in the content distribution path.
具体地,分发控制器所发送的内容分发消息中包括了上述的内容分发路径以及上述待分发内容的标识,当分发控制器将内容分发路径分发到各分发目标节点后,分发目标节点就可以根据内容分发路径确定从哪个节点接收内容,以及向哪个节点发送内容。另外,各分发目标节点还能够接收到待分发内容的标识,分发目标节点根据标识可以确定具体应该接收或者发送哪些内容。Specifically, the content distribution message sent by the distribution controller includes the content distribution path and the identifier of the content to be distributed, and after the distribution controller distributes the content distribution path to each distribution target node, the distribution target node may The content distribution path determines from which node the content is received and to which node the content is sent. In addition, each distribution target node is also capable of receiving an identifier of the content to be distributed, and the distribution target node can determine which content should be specifically received or transmitted according to the identifier.
优选地,分发控制器可以预先开启其上的HTTPS端口,HTTPS端口用于指令的安全传输。分发控制器可以使用HTTPS端口向分发目标节点发送内容分发消息,以提升内容分发时的安全性。Preferably, the distribution controller can pre-open the HTTPS port on it, and the HTTPS port is used for secure transmission of instructions. The distribution controller can use the HTTPS port to send a content distribution message to the distribution destination node to improve the security of content distribution.
S207、分发目标节点建立内容连接通道。S207. The distribution target node establishes a content connection channel.
当各分发目标节点接收到分发控制器发送的内容分发路径之后,就可以根据内容分发路径与其他分发目标节点之间建立连接通道。具体地,分发目标节点根据内容分发路径就可以确定自己应该与哪些节点进行连接。举例来说,如果内容分发路径中存在节点A->节点B->节点C这样的链,则说明在分发控制器要求在内容分发时,内容从节点A转发到节点B,再由节点B转发到节点C,则对于节点B来说,就应该同节点A以及节点C建立连接通道。After each distribution target node receives the content distribution path sent by the distribution controller, a connection channel can be established with the other distribution target nodes according to the content distribution path. Specifically, the distribution target node can determine which nodes to connect with based on the content distribution path. For example, if there is a chain such as node A->node B->node C in the content distribution path, it means that when the distribution controller requests content distribution, the content is forwarded from node A to node B, and then forwarded by node B. To node C, for node B, a connection channel should be established with node A and node C.
各分发目标节点可以预先开启TCP端口,TCP端口可以用于待分发内容的安全传输。在具体建立连接通道时,各分发目标节点与其相邻节点可以通过TCP端口建立连接通道。Each distribution target node can open a TCP port in advance, and the TCP port can be used for secure transmission of content to be distributed. When a connection channel is specifically established, each distribution target node and its neighbor nodes can establish a connection channel through a TCP port.
S208、分发目标节点向首节点发送获取待分发内容的元数据的请求消息。S208. The distribution target node sends a request message for acquiring metadata of the content to be distributed to the head node.
在各分发目标节点之间的内容连接通道建立完成的基础上,各分发目标节点可以从内容 分发路径中的首节点中获取待分发内容的元数据。如前所述,内容分发路径中的首节点是具有完整分发内容的节点,除此之外,首节点中还保存有待分发内容的元数据,该元数据在首节点获取到完整分发内容之前就保存到首节点中。由于内容仓库中保存了完整分发内容以及待分发内容的元数据,因此,内容仓库可以作为首节点,图1也是以内容仓库作为首节点为例进行说明。但是,需要说明的是,一条内容分发路径中的首节点并不限于内容仓库,也可以是其他拥有完整分发内容以及待分发内容的元数据的节点。On the basis of the completion of the establishment of the content connection channel between the distribution target nodes, each distribution target node can be from the content The metadata of the content to be distributed is obtained in the first node in the distribution path. As described above, the first node in the content distribution path is a node having the complete distribution content, and in addition, the metadata of the content to be distributed is also stored in the first node, and the metadata is obtained before the first node obtains the complete distribution content. Save to the first node. Since the content repository stores the metadata of the complete distribution content and the content to be distributed, the content warehouse can be used as the first node. FIG. 1 also takes the content warehouse as the first node as an example. However, it should be noted that the head node in a content distribution path is not limited to the content warehouse, and may be other nodes that have the complete distribution content and the metadata of the content to be distributed.
S209、首节点向各分发目标节点发送获取待分发内容的元数据的请求消息的响应消息,该响应消息中包括待分发内容的元数据。S209. The first node sends, to each distribution target node, a response message of the request message for acquiring metadata of the content to be distributed, where the response message includes metadata of the content to be distributed.
S210、分发目标节点向分发控制器上报准备就绪状态。S210. The distribution target node reports the ready state to the distribution controller.
当各分发目标节点之间建立好了连接通道,并且已经从首节点获取到了待分发内容的元数据之后,各分发目标节点可以向分发控制器上报一条准备就绪的状态消息,用来通知分发控制器已经准备就绪,可以开始进行内容分发。各分发目标节点可以通过不同的端口向分发控制器发送准备就绪状体,例如:HTTPS端口。After the connection channel is established between the distribution target nodes, and the metadata of the content to be distributed has been acquired from the first node, each distribution target node may report a ready status message to the distribution controller to notify the distribution control. The device is ready to begin content distribution. Each distribution target node can send a ready-to-use body to the distribution controller through a different port, for example: an HTTPS port.
S211、分发控制器向各分发目标节点发送内容接收与转发指示。S211. The distribution controller sends a content receiving and forwarding indication to each distribution target node.
具体地,当分发控制器接收到各分发目标节点的准备就绪的状态消息后,就可以向各分发目标节点发送内容接收与转发指示,各分发目标节点只有在接收到该指示之后才可以开始进行内容接收与转发。Specifically, after the distribution controller receives the ready status message of each distribution target node, the content receiving and forwarding indication may be sent to each distribution target node, and each distribution target node may start to perform only after receiving the indication. Content reception and forwarding.
需要说明的是,对于一条内容分发路径,分发控制器需要接收到其中每个分发目标节点的准备就绪的状态信息之后才能够向各分发目标节点发送内容接收与转发指示。It should be noted that, for a content distribution path, the distribution controller needs to receive the ready status information of each of the distribution target nodes before sending the content receiving and forwarding indication to each distribution target node.
优选地,分发控制器通过HTTPS端口向分发目标节点发送内容接收与转发指示。Preferably, the distribution controller sends a content receiving and forwarding indication to the distribution target node through the HTTPS port.
S212、各分发目标节点之间执行内容接收与转发。S212. Perform content reception and forwarding between each distribution target node.
具体地,各分发目标节点按照前述所建立起来的内容连接通道,从与接收通道接收待分发内容,并通过转发通道将待分发内容转发出去。Specifically, each distribution target node receives the content to be distributed from the receiving channel according to the content connection channel established as described above, and forwards the content to be distributed through the forwarding channel.
分发目标节点进行内容接收与转发的具体过程将在下文图14的介绍中进行详细的解释说明。The specific process of distributing the target node for content reception and forwarding will be explained in detail in the introduction of FIG. 14 below.
优选地,分发目标节点之间通过TCP端口进行内容接收与转发。Preferably, the content distribution and forwarding are performed between the distribution target nodes through the TCP port.
S213、各分发目标节点获取分发进度、分发日志、分发结果以及状态流量。S213. Each distribution target node acquires a distribution progress, a distribution log, a distribution result, and a status flow.
具体地,各分发目标节点在在进行内容接收与转发的过程中,可以实时监控当前的接收转发进度,还可以获取内容接收转发过程中所生成的日志信息,还可以在接收转发,即分发完成后获取分发结果,例如成功接收了哪些块、内容转发是否成功等,还可以实时监控该分发目标节点当前的状态流量,其中,状态流量可以表示该分发目标节点的当前状态以及当前的流量,例如,当前处于连接正常状态或故障状态,当前的接收转发流量的具体值等。Specifically, each of the distribution target nodes can monitor the current receiving and forwarding progress in real time during the process of receiving and forwarding the content, and can also obtain the log information generated during the content receiving and forwarding process, and can also receive and forward, that is, the distribution is completed. After the distribution result is obtained, for example, which blocks are successfully received, whether the content forwarding is successful, or the like, the current state traffic of the distribution target node can be monitored in real time, wherein the state traffic can indicate the current state of the distribution target node and the current traffic, for example, Currently, it is in the normal state of connection or fault state, and the current value of the received and forwarded traffic.
其中,上述接收转发进度可以指接收分发目标节点已经接收的内容块的数量,或者已经接收的内容块占需要接收的所有内容块的比例等。The foregoing receiving and forwarding progress may refer to receiving the number of content blocks that the distribution target node has received, or the proportion of the content blocks that have been received occupying all the content blocks that need to be received, and the like.
S214、各分发目标节点将分发进度、分发日志、分发结果以及状态流量上报给分发控制器。S214. Each distribution target node reports the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
优选地,各分发目标节点可以周期性地上报分发进度、分发日志、分发结果以及状态流量,分发控制器可以保存这些信息,并且对这些信息进行分析,根据分析结果来执行对应的操作。例如,分发控制器对各节点的状态流量进行分析,如果某个节点的状态流量超出一定的阈值,则分发控制器可以进行对应的流量控制;又例如,分发控制器可以对分发结果进行 分析,如果分发结果为失败,则需要采用对应的策略重新进行分发等。Preferably, each distribution target node can periodically report the distribution progress, the distribution log, the distribution result, and the status traffic, and the distribution controller can save the information, analyze the information, and perform the corresponding operation according to the analysis result. For example, the distribution controller analyzes the state traffic of each node. If the state traffic of a node exceeds a certain threshold, the distribution controller can perform corresponding flow control; for example, the distribution controller can perform the distribution result. Analysis, if the distribution result is a failure, you need to re-distribute with the corresponding strategy.
除此之外,分发控制器还可以将上述分发进度、分发日志、分发结果以及状态流量发送给终端。具体地,终端可以通过分发控制器所提供的API来查询上述信息,以便及时了解内容分发的情况并将这些情况反馈给用户。In addition, the distribution controller can also send the above distribution progress, distribution log, distribution result, and status traffic to the terminal. Specifically, the terminal may query the foregoing information through an API provided by the distribution controller, so as to timely understand the content distribution and feed back the situation to the user.
优选地,分发目标节点通过HTTPS端口向分发控制器上报进度、日志、分发结果和状态流量。Preferably, the distribution target node reports the progress, log, distribution result, and status traffic to the distribution controller through the HTTPS port.
相应地,分发控制器也通过HTTPS端口接收分发上报的进度、日志、分发结果和状态流量。Accordingly, the distribution controller also receives the progress of the distribution report, the log, the distribution result, and the status traffic through the HTTPS port.
优选地,在此之后,当内容完成之后,各分发目标节点之间可以断开TCP连接,分发目标节点使用HTTPS端口向分发控制器上报分发完成,分发控制器也通过HTTPS端口接收分发目标节点上报的分发完成信息。Preferably, after the content is completed, the TCP connection can be disconnected between the distribution target nodes, the distribution target node reports the distribution to the distribution controller using the HTTPS port, and the distribution controller also receives the distribution target node report through the HTTPS port. Distribution completion information.
表2为分发控制器、内容仓库以及分发目标节点中所开启的端口及其功能的介绍。Table 2 provides an introduction to the ports that are open in the distribution controller, content store, and distribution target nodes and their functions.
表2Table 2
Figure PCTCN2017091276-appb-000001
Figure PCTCN2017091276-appb-000001
使用https安全端口来进行指令传输以及分发内容传输,能够保证内容分发过程中的安全性。使用tcp端口可以更加快速地传输内容,确保内容传输的效率.Using the https secure port for command transfer and distribution of content transfers ensures security during content distribution. Use the tcp port to transfer content more quickly, ensuring efficient content transfer.
本实施例中,在进行内容分发时,分发控制器根据物理组网拓扑、系统中各节点的状态流量以及分发目标节点列表来生成内容分发路径,进而按照该内容分发路径来进行内容分发。首先,该内容分发路径根据物理组网拓扑信息以及系统中各节点的状态流量来生成,因此能够保证该内容分发路径中的分发目标节点之间不存在无序交叉连接,以及保证该内容分发路径中的各分发目标节点的实际流量在可控范围内。其次,该内容分发路径为单向链式路径,即,该内容分发路径中每个节点连接的节点数量由分发控制器来控制,因此,能够实现各分发目标节点的出入带宽的平衡。综上,能够保证所选的内容分发路径为最优内容分发路径。另外,本实施例中,分发控制器在每次接收到内容分发指示时,都可以根据物理组网拓扑信息以及系统中各节点的状态流量来生成内容分发路径,因此,能够保证每次进行内容分发时所生成的内容分发路径都是最优分发路径。进而,基于上述最优的内容分发路径,就可以完全实现对于内容分发过程中的流量控制。 In this embodiment, when content distribution is performed, the distribution controller generates a content distribution path according to the physical networking topology, the state traffic of each node in the system, and the distribution target node list, and further performs content distribution according to the content distribution path. First, the content distribution path is generated according to the physical networking topology information and the state traffic of each node in the system, so that it is possible to ensure that there is no disordered cross-connection between the distribution target nodes in the content distribution path, and that the content distribution path is ensured. The actual traffic of each distribution target node in the control range is within the controllable range. Secondly, the content distribution path is a unidirectional chain path, that is, the number of nodes connected to each node in the content distribution path is controlled by the distribution controller, so that the balance of the inbound and outbound bandwidth of each distribution target node can be achieved. In summary, it is possible to ensure that the selected content distribution path is the optimal content distribution path. In addition, in this embodiment, the distribution controller can generate the content distribution path according to the physical networking topology information and the state traffic of each node in the system each time the content distribution instruction is received, thereby ensuring that the content is performed each time. The content distribution paths generated at the time of distribution are the optimal distribution paths. Further, based on the above-described optimal content distribution path, the flow control in the content distribution process can be fully realized.
进一步地,本实施例中,由分发控制器根据分发任务情况生成内容分发路径,内容接收节点无须动态加入,分发控制器的调度简单,内容接收节点无须在分发过程中不断地查询可用路径。因此,还能够保证内容分发的高效性。Further, in this embodiment, the content distribution path is generated by the distribution controller according to the distribution task situation, the content receiving node does not need to be dynamically added, the scheduling of the distribution controller is simple, and the content receiving node does not need to continuously query the available path during the distribution process. Therefore, it is also possible to ensure the efficiency of content distribution.
进一步地,本实施例中,分发路径是结合实际物理拓扑组网结构的单向链式路径,节点之间完全对等,不需查询所需文件块信息,当前节点接收到分发内容后,能立即转发给下一个节点,并且存在固定的首节点,因此,还能够保证内容分发的完整性。Further, in this embodiment, the distribution path is a unidirectional chain path combined with the actual physical topology networking structure, and the nodes are completely peer-to-peer, and the required file block information is not required to be queried. After the current node receives the distributed content, the current node can Forwarded to the next node immediately, and there is a fixed head node, so the integrity of the content distribution can also be guaranteed.
另一实施例中,上述步骤S203中分发控制器在生成内容分发路径时,还可以指定内容分发路径中每个节点的最大分发速率。In another embodiment, in the above step S203, the distribution controller may also specify a maximum distribution rate of each node in the content distribution path when generating the content distribution path.
具体地,分发控制器根据内容分发路径中每个节点当前的状态流量来确定每个节点的最大分发速率,即每个节点接收数据的速率,如果某个节点的当前流量较低,则可以将该节点的最大分发速率设置的大一些,如果某个节点的当前流量已经达到一定阈值,则需要将该节点的最大分发速率设置的小一些。Specifically, the distribution controller determines the maximum distribution rate of each node according to the current state traffic of each node in the content distribution path, that is, the rate at which each node receives data, and if the current traffic of a node is low, The maximum distribution rate of the node is set to be larger. If the current traffic of a node has reached a certain threshold, the maximum distribution rate of the node needs to be set smaller.
进而,分发控制器可以将上述最大分发速率携带在内容分发消息中发送给各节点。节点在进行内容分发时,根据该最大分发速率来约束内容分发。Further, the distribution controller may carry the above maximum distribution rate in the content distribution message and send it to each node. The node constrains content distribution according to the maximum distribution rate when content distribution is performed.
本实施例中,通过为内容分发路径中的每个节点设置最大分发速率,可以保证每个节点的分发流量都是可控的,从而进一步保证内容分发时的流量控制。In this embodiment, by setting a maximum distribution rate for each node in the content distribution path, it is ensured that the distribution traffic of each node is controllable, thereby further ensuring traffic control during content distribution.
以下详细介绍分发控制器生成内容分发路径的几种具体实施方法。The following is a detailed description of several specific implementation methods for the distribution controller to generate a content distribution path.
第一种具体实施方法:The first specific implementation method:
分发控制器根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一物理主机上的两个分发目标节点作为内容分发路径中的相邻节点。The distribution controller uses two distribution target nodes located on the same physical host in the physical networking as adjacent nodes in the content distribution path according to the physical networking topology and the distribution target node list.
以云计算系统为例,图3为云计算系统的中心物理服务器的一个示例,图4为云计算系统的中心物理服务器的内部连接示例,如图3和图4所示,该中心物理服务器可以采用刀片服务器,该刀片服务器的各部件如表1所示:Taking a cloud computing system as an example, FIG. 3 is an example of a central physical server of a cloud computing system, and FIG. 4 is an example of internal connection of a central physical server of a cloud computing system. As shown in FIG. 3 and FIG. 4, the central physical server may be A blade server is used, and the components of the blade server are as shown in Table 1:
表1Table 1
11 机箱 Chassis
22 计算节点,即物理主机Compute node
33 风扇模块Fan module
44 直通模块/交换模块(交换机)Pass-through module / switch module (switch)
55 管理模块Management module
66 电源模块Power module
结合图3、图4及表1,图3中的刀片服务器的机箱中有16个计算节点,即16个物理主机,每个物理主机的配置为64核CPU,256G内存,每个物理主机能够虚拟出16-32个虚拟机。物理主机的网卡带宽是确定的,例如为10Gbps,并且整个机箱中的交换模块的带宽也是确定的,例如10Gbps。当物理主机所对应的虚拟机个数较多时,能够平摊给每个虚拟机的出口带宽就非常有限。Referring to FIG. 3, FIG. 4 and Table 1, the blade server in FIG. 3 has 16 computing nodes, that is, 16 physical hosts, each of which is configured with a 64-core CPU and 256 GB of memory, and each physical host can Virtually out 16-32 virtual machines. The NIC bandwidth of the physical host is determined, for example, 10 Gbps, and the bandwidth of the switching module in the entire chassis is also determined, for example, 10 Gbps. When the number of virtual machines corresponding to a physical host is large, the bandwidth that can be equally distributed to each virtual machine is very limited.
而本实施例中,具体地,分发服务器在生成内容分发路径时,可以根据物理组网拓扑将在物理组网中位于同一物理主机上的两个分发目标节点作为内容分发路径中的相邻节点。举例来说,假设分发服务器所接收到的分发目标节点包括:节点A、节点B、节点C和节点D,其中,节点A和节点B在同一物理主机21内,节点C和节点D在同一物理主机22内,则分发控制器可以将节点B和节点A作为内容分发路径中的相邻节点,将节点D和节点C作为内容分发路径中 的相邻节点。这样,节点A和节点B之间的内容接收和转发都在物理主机21内,不会占用物理主机21的网卡带宽,同样地,节点C和节点D之间的内容接收和转发都在物理主机22内,不会占用物理主机22的网卡带宽。通过这种方式,能够生成有序、没有交叉并且相邻节点都位于同一物理主机内的内容分发路径,从而实现了内容分发时的流量控制以及高效性。In this embodiment, specifically, the distribution server may use two distribution target nodes located on the same physical host in the physical networking as neighboring nodes in the content distribution path according to the physical networking topology when generating the content distribution path. . For example, suppose that the distribution target node received by the distribution server includes: node A, node B, node C, and node D, wherein node A and node B are in the same physical host 21, and node C and node D are in the same physical Within the host 22, the distribution controller can use the node B and the node A as neighboring nodes in the content distribution path, and the node D and the node C as the content distribution path. Adjacent nodes. In this way, the content receiving and forwarding between the node A and the node B are both in the physical host 21, and the network card bandwidth of the physical host 21 is not occupied. Similarly, the content receiving and forwarding between the node C and the node D are in the physical host. Within 22, the NIC bandwidth of the physical host 22 is not occupied. In this way, it is possible to generate a content distribution path that is ordered, has no intersection, and neighboring nodes are all located in the same physical host, thereby realizing flow control and high efficiency in content distribution.
第二种具体实施方法:The second specific implementation method:
根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一机箱内的两个分发目标节点作为内容分发路径中的相邻节点。According to the physical networking topology and the distribution target node list, two distribution target nodes located in the same chassis in the physical network are used as adjacent nodes in the content distribution path.
具体地,继续参照图3、图4及表1,当分发控制器所接收到的分发目标节点中不存在位于同一物理主机的节点时,即各分发目标节点都不满足位于同一物理主机的条件时,分发控制器就可以将位于同一机箱内的两个节点作为内容分发路径中的相邻节点。通过这种方式,能够将两个节点之间的数据交互尽量限制在同一个机箱内,即尽量不占用机箱的带宽,从而进一步保证内容分发时的流量控制以及高效性。Specifically, referring to FIG. 3, FIG. 4 and Table 1, when there are no nodes located in the same physical host in the distribution target node received by the distribution controller, that is, each distribution target node does not satisfy the condition of being located on the same physical host. The distribution controller can then use two nodes located in the same chassis as neighbors in the content distribution path. In this way, the data interaction between the two nodes can be limited to the same chassis as much as possible, that is, the bandwidth of the chassis is not occupied as much as possible, thereby further ensuring the flow control and high efficiency in content distribution.
第三种具体实施方式:The third specific implementation method:
确定系统中具有完整的待分发内容的节点;根据系统中各节点的状态流量,将上述具有完整的待分发内容的节点中当前流量耗费最低的节点作为内容分发路径中的首节点。A node having a complete content to be distributed in the system is determined; according to the state traffic of each node in the system, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path.
如前所述,首节点需要具有完整的分发内容和待分发内容的元数据。首节点可以通过如下方法获得上述完整的分发内容和待分发内容的元数据:As mentioned earlier, the head node needs to have complete distribution content and metadata for the content to be distributed. The first node can obtain the above-mentioned complete distribution content and metadata of the content to be distributed by the following method:
在初始状态下,系统中所有的节点上都不具有完整的分发内容和待分发内容的元数据,而只有内容仓库中保存了完整的分发内容,当用户发起内容分发指示后,内容仓库可以根据完整的分发内容生成待分发内容的元数据。在此情况下,分发控制器所生成的内容分发路径中的首节点即为内容仓库,当分发控制器将内容分发路径发送给各分发目标节点后,各分发目标节点就可以从内容仓库中获取待分发内容的元数据,并且根据内容分发路径建立与其他节点的连接,并向分发控制器发送准备就绪状态,分发控制器接收了准备就绪状态,并向首节点发送通知(首节点即为内容仓库),首节点接收了通知后,按照内容分发路径中的连接关系向其下游节点转发内容。当某个分发目标节点接收到了所有待分发内容后,该分发目标节点就具有了完整分发内容。同时,内容分发路径中的各分发目标节点在接收和转发内容的过程中可以将自己已经成功接收并且保存的内容信息上报给分发控制器,分发控制器根据这些信息就可以确定哪些节点已经拥有完整分发内容。具体地,分发目标节点可以按照一定的周期向分发控制器上报自己已经接收到的内容块数量、每个内容块的标识、接收成功标识等信息,分发控制器根据这些信息来确定分发目标节点是否已经拥有完整分发内容。In the initial state, all the nodes in the system do not have the complete distribution content and the metadata of the content to be distributed, but only the content distribution stores the complete distribution content. When the user initiates the content distribution instruction, the content warehouse can be based on The complete distribution of content generates metadata for the content to be distributed. In this case, the first node in the content distribution path generated by the distribution controller is the content repository. After the distribution controller sends the content distribution path to each distribution destination node, each distribution destination node can be obtained from the content repository. Metadata of the content to be distributed, and establishing a connection with other nodes according to the content distribution path, and sending a ready state to the distribution controller, the distribution controller receives the ready state, and sends a notification to the head node (the first node is the content The warehouse, after receiving the notification, the first node forwards the content to its downstream node according to the connection relationship in the content distribution path. When a distribution target node receives all the content to be distributed, the distribution target node has the complete distribution content. At the same time, each distribution target node in the content distribution path can report the content information that has been successfully received and saved to the distribution controller in the process of receiving and forwarding the content, and the distribution controller can determine which nodes have been completed according to the information. Distribute content. Specifically, the distribution target node may report to the distribution controller a quantity of the content block that has been received, an identifier of each content block, a success indication of receiving, and the like according to the information, and the distribution controller determines, according to the information, whether the distribution target node is Already have a complete distribution.
当系统中存在多个具有完整分发内容的节点时,分发控制器在生成针对该完整分发内容的内容分发路径时,可以从中选择当前流量耗费最低的节点作为本次内容分发过程中的内容分发路径的首节点。When there are multiple nodes in the system with the complete distribution content, when the distribution controller generates the content distribution path for the complete distribution content, the node with the lowest current traffic consumption can be selected as the content distribution path in the current content distribution process. The first node.
本实施例中,通过选择当前流量耗费最低的节点作为首节点,可以保证待分发内容的分发速度,从而进一步提升内容分发的高效性。In this embodiment, by selecting the node with the lowest current traffic consumption as the first node, the distribution speed of the content to be distributed can be ensured, thereby further improving the efficiency of content distribution.
第四种具体实施方式:The fourth specific implementation method:
若存在多个具有完整的待分发内容的节点,则生成的内容分发路径为多条,其中,所生成的内容分发路径的条数小于或等于该具有完整的待分发内容的节点的个数,每条内容分发路径中的首节点为该具有完整的待分发内容的节点中的其中一个节点。If there are multiple nodes having complete content to be distributed, the generated content distribution path is multiple, wherein the number of generated content distribution paths is less than or equal to the number of nodes having complete content to be distributed, The first node in each content distribution path is one of the nodes having the complete content to be distributed.
具体地,默认情况下,分发控制器所生成的内容分发路径为单一链式路径,图5为单一 链式路径的示意图,如图5所示,单一链式路径中每个节点只具有一个上游节点与一个下游节点,即节点只能从上游节点接收数据,并且只能向下游节点发送数据,从而能够充分控制各个节点的出入带宽,避免单个节点的连接过多造成拥塞,或者CPU与内存的过分消耗,对节点上运行的应用产生影响。图5中的箭头表示数据流向。在分发目标节点的数量较少时,使用单一链式路径可以保证内容分发中的流量控制、高效性以及完整性。而如果分发目标节点的数量较多时,使用单一链式路径可能会由于链路过长而导致分发的速度较慢。Specifically, by default, the content distribution path generated by the distribution controller is a single chain path, and FIG. 5 is a single A schematic diagram of a chain path, as shown in FIG. 5, each node in a single chain path has only one upstream node and one downstream node, that is, the node can only receive data from the upstream node, and can only send data to the downstream node, thereby It can fully control the inbound and outbound bandwidth of each node, avoiding congestion caused by too many connections of a single node, or excessive consumption of CPU and memory, and affecting applications running on the node. The arrows in Figure 5 indicate the flow of data. With a small number of distribution target nodes, a single chained path ensures traffic control, efficiency, and integrity in content distribution. However, if the number of distribution target nodes is large, using a single chain path may result in a slower distribution due to the link being too long.
而本实施例中,当系统中存在多个具有完整的待分发内容的节点时,这些节点都满足作为首节点的条件,分发控制器就可以根据这些节点来生成多条内容分发路径,其中,每条内容分发路径中的首节点为这些具有完整的待分发内容的节点中的其中一个节点。分发控制器所生成的内容分发路径之间相互独立,因此可以做到内容分发路径之间的并行分发。In this embodiment, when there are multiple nodes in the system that have complete content to be distributed, the nodes satisfy the condition as the first node, and the distribution controller can generate multiple content distribution paths according to the nodes. The first node in each content distribution path is one of these nodes with complete content to be distributed. The content distribution paths generated by the distribution controller are independent of each other, so parallel distribution between content distribution paths can be achieved.
优选地,分发控制器可以将位于同一物理主机或同一机箱内的节点设置在同一条内容分发路径中,从而提升内容分发效率,节省流量耗费。Preferably, the distribution controller can set the nodes located in the same physical host or the same chassis in the same content distribution path, thereby improving content distribution efficiency and saving traffic consumption.
图6为多条内容分发路径并行分发的示意图,如图6所示,分发控制器通过上述方法将数量较多的分发目标节点设置在两条内容分发路径中,每条内容分发路径中的首节点由分发控制器根据各分发目标节点所上报的已经接收到的内容块数量、每个内容块的标识、接收成功标识等信息来确定。6 is a schematic diagram of parallel distribution of multiple content distribution paths. As shown in FIG. 6, the distribution controller sets a plurality of distribution target nodes in two content distribution paths by the above method, and the first in each content distribution path. The node is determined by the distribution controller according to information such as the number of content blocks that have been received reported by each distribution target node, the identifier of each content block, the success indication of receiving, and the like.
本实施例所述的多条内容分发路径并行分发的方法,能够有效减少由于单一链路过长对链路上最后节点分发时延的影响,并且能够减少由于控制链式路径长度所导致的复杂度。The method for parallel distribution of multiple content distribution paths in the embodiment can effectively reduce the influence of the delay of the last node distribution on the link due to the long link length, and can reduce the complexity caused by the length of the control chain path. degree.
第五种具体实施方式:The fifth specific implementation method:
设置内容分发路径中的预设节点个数;若内容分发路径中的节点数量大于预设节点数量,则从内容分发路径中选择当前流量耗费最低的分发目标节点作为分叉节点,并根据该分叉节点将内容分发路径拆分为第一内容分发路径以及第二内容分发路径。Set the number of preset nodes in the content distribution path; if the number of nodes in the content distribution path is greater than the preset number of nodes, select the distribution target node with the lowest current traffic consumption as the branch node from the content distribution path, and according to the score The fork node splits the content distribution path into a first content distribution path and a second content distribution path.
其中,第一内容分发路径和第二内容分发路径的首节点相同,第一内容分发路径和第二内容分发路径以上述分叉节点为分界。The first content distribution path and the second content distribution path are the same as the first node, and the first content distribution path and the second content distribution path are demarcated by the foregoing bifurcation node.
具体地,分发控制器根据节点所上报的状态流量来确定当前流量耗费最低的节点,并将当前流量耗费最低的分发目标节点作为分叉节点。Specifically, the distribution controller determines the node with the lowest current traffic consumption according to the state traffic reported by the node, and uses the distribution target node with the lowest current traffic consumption as the fork node.
具体地,分发控制器预先根据系统的物理组网拓扑以及节点规模设置预设节点数量,例如设置节点数量为200个,当分发目标节点数量小于或等于该预设节点数量时,分发控制器可以生成一个单一链式分发路径,使用该单一链式分发路径进行内容分发能够保证内容分发的效率。而如果分发目标节点数量大于该预设节点数量时,如果再使用单一链式分发路径,就会使得路径中最后节点的时延过大,因此,本实施例中,可以首先按照前述的方法先建立一条单一链式分发路径,然后,从该单一链式分发路径中选择一个当前流量耗费最低的节点作为分叉节点,在分叉节点之后,产生两条分发路径,即,从分叉节点之后,将原本的一条分发路径变为两条路径,因此,降低了分发路径的长度,并且实现并行的内容分发。而由于分叉节点的链出节点数为两个,因此,所需要耗费的流量相对较多,因此,选择当前流量耗费最低的节点作为分叉节点,可以保证分叉节点具有足够的流量用于内容分发。Specifically, the distribution controller presets the preset number of nodes according to the physical networking topology and the node size of the system, for example, setting the number of nodes to 200. When the number of distribution target nodes is less than or equal to the preset number of nodes, the distribution controller may Generating a single chained distribution path, using this single chained distribution path for content distribution ensures the efficiency of content distribution. If the number of the distribution target nodes is greater than the number of the preset nodes, if the single-chain distribution path is used again, the delay of the last node in the path is too large. Therefore, in this embodiment, the method may be firstly performed according to the foregoing method. Establishing a single chain distribution path, and then selecting a node with the lowest current traffic as the branch node from the single chain distribution path, and after the fork node, generating two distribution paths, that is, after the branch node , the original distribution path is changed into two paths, thus reducing the length of the distribution path and implementing parallel content distribution. Since the number of nodes of the forked node is two, the amount of traffic required is relatively large. Therefore, selecting the node with the lowest current traffic as the fork node can ensure that the fork node has sufficient traffic for the fork node. Content distribution.
图7为内容分发路径进行分叉的示意图,如图7所示,将首节点之后的第一个节点作为分叉节点,从该节点之后就形成了两条并行的分发路径,从而降低了分发路径的长度,保证了内容分发的速度和效率。FIG. 7 is a schematic diagram of the content distribution path bifurcation. As shown in FIG. 7, the first node after the first node is used as a fork node, and two parallel distribution paths are formed from the node, thereby reducing distribution. The length of the path ensures the speed and efficiency of content distribution.
需要说明的是,前述第四种具体实施方式中也可以首先判断分发目标节点是否大于预设 节点数量,如果大于则执行上述第四种具体实施方式。It should be noted that, in the foregoing fourth specific implementation manner, whether the distribution target node is greater than a preset may be first determined. The number of nodes, if greater than the above, implements the fourth embodiment described above.
第六种具体实施方式:The sixth specific implementation method:
该实施例涉及已有内容分发路径中存在故障节点的处理方法。This embodiment relates to a method of processing a faulty node in an existing content distribution path.
内容分发链路上的分发目标节点在进行内容分发时,可能由于某些原因无法正常接收或转发数据,在这种情况下,分发控制器首先确定内容分发路径中的故障节点。When the distribution target node on the content distribution link performs content distribution, data may not be normally received or forwarded for some reason, in which case the distribution controller first determines the faulty node in the content distribution path.
其中,分发控制器确定内容分发路径中的故障节点的方法包括以下三种:The method for the distribution controller to determine the faulty node in the content distribution path includes the following three types:
1、在分发控制器向第一分发目标节点发送内容分发消息之后,如果未接收到第一分发目标节点发送的对于内容分发消息的响应消息,则确定第一分发目标节点为内容分发路径中的一个故障节点,其中,该第一分发目标节点为内容分发路径中的任意一个分发目标节点。After the distribution controller sends the content distribution message to the first distribution target node, if the response message for the content distribution message sent by the first distribution target node is not received, determining that the first distribution target node is in the content distribution path A faulty node, wherein the first distribution target node is a distribution target node of any one of the content distribution paths.
分发控制器向第一分发目标节点发送内容分发消息的具体过程如前述步骤S206所述,如果分发目标节点运行正常,则在接收到分发控制器所发送的内容分发消息之后,分发目标节点向分发控制返回一个响应消息。如果分发控制器没有收到该响应消息,则分发控制器就可以确定分发目标节点故障。The specific process of the distribution controller transmitting the content distribution message to the first distribution target node is as described in the foregoing step S206. If the distribution target node is operating normally, after the content distribution message sent by the distribution controller is received, the distribution target node distributes to the distribution node. Control returns a response message. If the distribution controller does not receive the response message, the distribution controller can determine the distribution target node failure.
2、根据至少一个分发目标节点所上报的状态流量以及分发日志,确定内容分发路径中的故障节点。2. Determine the faulty node in the content distribution path according to the status traffic reported by the at least one distribution target node and the distribution log.
当分发目标节点开始进行内容分发之后,分发目标节点可以按照一定的周期向分发控制器上报其状态流量以及分发日志,分发控制器接收到状态流量以及分发日志后进行判断,如果分发目标节点的状态流量已经超过最大阈值,或者分发日志中存在分发异常的记录,则分发控制器就可以确定该分发目标节点故障。After the distribution target node starts content distribution, the distribution target node can report its status traffic and distribution logs to the distribution controller according to a certain period, and the distribution controller receives the status traffic and distributes the log, and then judges if the status of the target node is distributed. If the traffic has exceeded the maximum threshold, or there is a record of the distribution exception in the distribution log, the distribution controller can determine that the distribution target node is down.
3、如果分发控制器接收到第二分发目标节点发送的分发失败消息,则确定第二分发目标节点的下游节点为内容分发路径中的一个故障节点,其中,第二分发目标节点为内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。3. If the distribution controller receives the distribution failure message sent by the second distribution target node, determining that the downstream node of the second distribution target node is a faulty node in the content distribution path, wherein the second distribution target node is a content distribution path. Any one of the distribution target nodes except the last distribution target node.
分发目标节点在进行内容分发的过程中,可以对其分发过的内容块进行记录,如果存在内容块分发失败的情况,则分发目标节点向分发控制器发送分发失败消息。分发控制器接收到该消息之后,就可以确定该分发目标节点的下游节点无法正常接收分发内容,将该分发目标节点的下游节点确定为故障节点。The distribution target node may record the content block that has been distributed in the process of content distribution, and if there is a case where the content block distribution fails, the distribution target node sends a distribution failure message to the distribution controller. After receiving the message, the distribution controller may determine that the downstream node of the distribution target node cannot receive the distribution content normally, and determine the downstream node of the distribution target node as the fault node.
当分发控制器确定出内容分发路径中的故障节点之后,分发控制器可以将该故障节点从原有的内容分发路径中删除,并将故障节点的下游节点作为故障节点上游节点的下游节点。优选地,分发控制器分别向故障节点的上游节点和下游节点发送路径更新指示,以指示故障节点的上游节点将其所保存的内容分发路径进行更新,即将其下游节点更新为故障节点的下游节点,指示故障节点的下游节点将其所保存的内容分发路径进行更新,即将其上游节点更新为故障节点的上游节点。需要说明的是,上述更新完成后,故障节点的上游节点和下游节点之间需要建立新的连接通道,以保证后续内容的正常分发。After the distribution controller determines the faulty node in the content distribution path, the distribution controller may delete the faulty node from the original content distribution path and use the downstream node of the faulty node as the downstream node of the upstream node of the faulty node. Preferably, the distribution controller separately sends a path update indication to the upstream node and the downstream node of the faulty node to indicate that the upstream node of the faulty node updates its saved content distribution path, that is, updates its downstream node to the downstream node of the faulty node. Indicates that the downstream node of the faulty node updates its saved content distribution path, that is, updates its upstream node to the upstream node of the faulty node. It should be noted that after the above update is completed, a new connection channel needs to be established between the upstream node and the downstream node of the faulty node to ensure normal distribution of subsequent content.
图8为从内容分发路径中删除故障节点的示意图,如图8所示,内容分发路径中的第二个节点为故障节点,从该内容分发路径中删除该故障节点,将该故障节点之前以及之后的节点连接起来。8 is a schematic diagram of deleting a faulty node from a content distribution path. As shown in FIG. 8, the second node in the content distribution path is a faulty node, and the faulty node is deleted from the content distribution path, and the faulty node is before and The nodes that follow are connected.
第七种具体实施方式:The seventh specific embodiment:
该实施例涉及故障节点恢复之后的处理方法。This embodiment relates to a processing method after a failed node is recovered.
在故障节点被从内容分发路径中删除之后,故障节点还是可以继续周期性地向分发控制器上报其状态流量,当分发控制器获知故障节点的状态已经恢复到正常状态,则将其再加入 内容分发路径中。After the faulty node is deleted from the content distribution path, the faulty node can continue to periodically report its state traffic to the distribution controller. When the distribution controller knows that the faulty node's state has returned to the normal state, it joins again. In the content distribution path.
具体地,分发控制器通过获取状态流量来获取到内容分发路径中的恢复节点,恢复节点的数量可以是一个,也可以是多个,恢复节点为由于故障从内容分发路径中删除的节点。当分发控制器获取到恢复节点之后,分发控制器可以将恢复节点增加到内容分发路径中,以使恢复节点从恢复节点的上游节点获取分发内容,其中,恢复节点通过主动请求的方式从上游节点获取分发内容。具体地,图9为将恢复节点重新加入内容分发路径的示意图,图9中虚线表示节点A和节点B在正常状态时处于内容分发路径中,由于故障,节点A和节点B被从内容分发路径中删除,节点A的上游节点和下游节点连接,节点B的上游节点和下游节点连,当节点A和节点B的状态恢复到正常状态后,内容分发路径并不会恢复到原来的状态,而是仅允许节点A通过主动请求的方式从其上游节点获取分发内容,仅允许节点B通过主动请求的方式从其上游节点获取分发内容。需要说明的是,此时的上游节点并不一定是恢复节点在原有内容分发路径中的上游节点,而是在物理拓扑上与该恢复节点最近,并且处于当前内容分发路径中的节点。Specifically, the distribution controller acquires the recovery node in the content distribution path by acquiring the state traffic. The number of the recovery nodes may be one or multiple, and the recovery node is a node deleted from the content distribution path due to the failure. After the distribution controller acquires the recovery node, the distribution controller may add the recovery node to the content distribution path to cause the recovery node to obtain the distribution content from the upstream node of the recovery node, wherein the recovery node requests the slave node from the upstream node. Get the distribution. Specifically, FIG. 9 is a schematic diagram of rejoining the recovery node to the content distribution path, and the dotted line in FIG. 9 indicates that the node A and the node B are in the content distribution path in the normal state, and the node A and the node B are from the content distribution path due to the failure. In the middle deletion, the upstream node of node A is connected with the downstream node, and the upstream node of node B is connected with the downstream node. When the state of node A and node B returns to the normal state, the content distribution path does not return to the original state. It is only allowed that node A obtains the distributed content from its upstream node by means of an active request, and only allows the node B to obtain the distributed content from its upstream node by means of an active request. It should be noted that the upstream node at this time is not necessarily the upstream node of the restoration node in the original content distribution path, but the node that is closest to the recovery node in the physical topology and is in the current content distribution path.
第八种具体实施方式:The eighth specific embodiment:
对于某些系统,例如云计算系统,可能存在将同一分发内容分发到多个子网的情况。图10为内容分发到多个子网的示意图,如图10所示,在内容分发到多个子网的情况下,分发控制器可以以首节点为中心,将内容分发路径划分为以子网为分割的多条子路径,多条子路径之间隔离没有交互。这样能有效控制各子网的带宽占用,避免跨子网之间的流量交互。For some systems, such as cloud computing systems, there may be situations where the same distribution is distributed to multiple subnets. 10 is a schematic diagram of content distribution to multiple subnets. As shown in FIG. 10, in the case where content is distributed to multiple subnets, the distribution controller may divide the content distribution path into subnets based on the first node. Multiple sub-paths, no isolation between multiple sub-paths. This effectively controls the bandwidth usage of each subnet and avoids traffic interaction between subnets.
进一步地,如果一个子网内的子路径的长度过长,可以根据前述实施方式所述的方法对子路径进行拆分,以保证内容分发的速度和效率。Further, if the length of the sub-path within a subnet is too long, the sub-path can be split according to the method described in the foregoing embodiment to ensure the speed and efficiency of content distribution.
在上述实施例的基础上,本实施例涉及前述图2中步骤105的内容仓库生成待分发内容的元数据的具体方法。Based on the above embodiment, the present embodiment relates to a specific method for generating metadata of the content to be distributed in the content repository of step 105 in FIG. 2 described above.
如前述图2中步骤S205中所述,在内容仓库接收到创建元数据指示后,根据其中所携带的待分发内容的标识来确定出内容仓库中所保存的待分发内容,并生成待分发内容的元数据。在生成待分发内容的元数据之前,内容仓库首先判断是否已经生成了待分发内容的元数据,如果已经生成,则不再执行生成操作,而是可以直接使用现有的元数据。As described in step S205 in FIG. 2, after the content repository receives the creation metadata indication, the content to be distributed stored in the content repository is determined according to the identifier of the content to be distributed carried therein, and the content to be distributed is generated. Metadata. Before generating the metadata of the content to be distributed, the content repository first determines whether the metadata of the content to be distributed has been generated, and if it has been generated, the generation operation is no longer performed, but the existing metadata can be directly used.
同时,内容仓库也可以根据所接收到的创建元数据指示中的待分发内容的标识,判断待分发内容是否存在,如果不存在,则内容仓库可以向终端返回待分发内容不存在的提示,以使终端重新检查所发送的待分发内容的标识,或者重新向内容仓库发布待分发内容。At the same time, the content repository may determine whether the content to be distributed exists according to the identifier of the content to be distributed in the created metadata indication. If not, the content warehouse may return a prompt to the terminal that the content to be distributed does not exist. The terminal is caused to re-check the identity of the content to be distributed that is sent, or to re-publish the content to be distributed to the content repository.
其中,上述待分发内容的标识由内容仓库分配,并且区别于整个系统中的其他待分发内容所对应的标识。The identifier of the content to be distributed is allocated by the content warehouse, and is different from the identifier corresponding to other content to be distributed in the entire system.
如果内容仓库确认待分发内容存在,并且待分发内容的元数据还不存在,则需要生成待分发内容的元数据。在后续内容分发过程中,如果内容分发路径中的节点中没有保存该元数据,就可以从内容仓库来获取待分发内容的元数据。If the content repository confirms that the content to be distributed exists and the metadata of the content to be distributed does not yet exist, it is necessary to generate metadata of the content to be distributed. In the subsequent content distribution process, if the metadata is not saved in the nodes in the content distribution path, the metadata of the content to be distributed can be obtained from the content repository.
具体地,图11为本发明提供实施例二的生成元数据流程示意图,如图11所示,内容仓库生成待分发内容的元数据的方法为:Specifically, FIG. 11 is a schematic diagram of a process for generating metadata according to Embodiment 2 of the present invention. As shown in FIG. 11, a method for generating metadata of a content to be distributed by a content warehouse is:
S1101、对待分发内容进行部分划分以及块划分,获取部分数量、部分大小、块大小以及块索引。S1101: Perform partial division and block division on the content to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
待分发内容的大小一般较大,例如,一般的需要分发的多媒体文件都能达到1G以上。如果在内容分发过程中直接将整个待分发内容一次性发送,一旦数据传输出现问题,就需要重 新发送整个待分发文件,造成内容分发效率低下。因此,本实施例中,将待分发内容进行分层分块划分,在内容分发过程中,数据传输的最小单位是分块,即使传输出现问题,也只需要将对应的分块重新分发,因此可以极大地提高内容分发效率。The size of the content to be distributed is generally large. For example, a general multimedia file that needs to be distributed can reach more than 1G. If the entire content to be distributed is sent directly in the content distribution process, once the data transmission has a problem, it needs to be heavy. Newly sent the entire file to be distributed, resulting in inefficient content distribution. Therefore, in this embodiment, the content to be distributed is hierarchically divided into blocks. In the content distribution process, the minimum unit of data transmission is blocking, and even if there is a problem in transmission, only the corresponding segment needs to be redistributed. Can greatly improve the efficiency of content distribution.
内容仓库可以将待分发内容分成两层,第一层将整个待分发文件划分为多个部分,第二层再将每个部分划分为多个块。图12为待分发内容层次划分的示意图,如图12所示,内容仓库可以将待分发内容划分为大小相等的多个部分,再将每个部分划分为大小相等的块,块为内容分发时的最小传输单位。The content warehouse can divide the content to be distributed into two layers. The first layer divides the entire file to be distributed into a plurality of parts, and the second layer divides each part into a plurality of blocks. FIG. 12 is a schematic diagram of hierarchical division of content to be distributed. As shown in FIG. 12, the content repository may divide the content to be distributed into multiple equal-sized parts, and then divide each part into blocks of equal size, and the block is content distribution. The minimum transmission unit.
用户可以预先在内容仓库中配置部分的大小和块的大小,当内容仓库进行分层划分时,就按照预先配置的部分大小和块大小来进行部分划分和块划分。需要说明的是,根据需要,内容仓库还可以将待分发内容划分为更多层次,其中最下一层为数据传输的最小单位。The user can pre-configure the size of the part and the size of the block in the content repository. When the content warehouse is hierarchically divided, the partial partitioning and block partitioning are performed according to the pre-configured partial size and block size. It should be noted that, according to requirements, the content warehouse can also divide the content to be distributed into more layers, wherein the lowest layer is the smallest unit of data transmission.
本步骤中,当内容仓库进行部分划分和块划分时,根据待分发内容的总的大小、部分大小以及块大小,来计算出部分数量和块数量,具体可以将待分发内容的总大小除以部分大小来得到部分数量,再将部分大小除以块大小来得到块数量。并且,内容仓库在划分出块之后,还可以为每个块分配一个唯一的索引,即块索引,以用于后续内容分发时识别每个块。经过上过过程,内容仓库就可以获取到部分数量、部分大小、块大小以及块索引。In this step, when the content warehouse performs partial partitioning and block partitioning, the partial quantity and the block number are calculated according to the total size, partial size, and block size of the content to be distributed, and the total size of the content to be distributed may be specifically divided by Partially sized to get a partial quantity, then divide the partial size by the block size to get the number of blocks. Moreover, after the content warehouse divides the blocks, each block can also be assigned a unique index, that is, a block index, for identifying each block when subsequent content distribution. After the process, the content warehouse can get the partial quantity, partial size, block size and block index.
在为块分配块索引时,优选地,可以根据块所对应的部分的编号以及块在部分中的顺序来确定索引值。举例来说,假设某个块M,该块M所对应的部分为待分发内容中的第一个部分,即对应的部分编号为1,该块为部分1中的第一个块,即块的编号为1,则该块的索引值可以设置为P1B1,其中“P”指部分,“B”指块。When assigning a block index to a block, preferably, the index value may be determined according to the number of the portion of the block corresponding to the block and the order of the block in the portion. For example, suppose a block M, the part corresponding to the block M is the first part of the content to be distributed, that is, the corresponding part number is 1, and the block is the first block in the part 1, that is, the block If the number is 1, the index value of the block can be set to P1B1, where "P" refers to the part and "B" refers to the block.
由于部分大小和块大小都是固定的,因此,只要根据块索引就能立即索引到块对应的内容,因此,根据编号来分配块索引可以方便对分发内容按偏移量来读取与写入,可以提高分发的内容的读写效率。Since the partial size and the block size are fixed, the content corresponding to the block can be immediately indexed according to the block index. Therefore, the allocation of the block index according to the number can facilitate reading and writing of the distributed content by offset. Can improve the efficiency of reading and writing of distributed content.
S1102、对待分发内容进行数字签名处理,获取数字签名。S1102: Perform digital signature processing on the content to be distributed, and obtain a digital signature.
内容仓库可以使用特定的算法,例如(Pretty Good Privacy,简称PGP)对待分发内容进行数字签名处理,获取到数字签名,当分发目标节点获取到完整的待分发内容之后,也可以使用同样的算法对所接收到的内容进行签名检查,以确认待分发内容的安全。The content warehouse can use a specific algorithm, such as (Pretty Good Privacy, PGP for short) to digitally sign the distributed content, obtain a digital signature, and use the same algorithm pair after the distribution target node obtains the complete content to be distributed. The received content is checked for signature to confirm the security of the content to be distributed.
S1103、对划分的每个块进行哈希校验,获取每个块的块哈希值。S1103: Perform hash check on each block that is divided, and obtain a block hash value of each block.
除了对整个待分发内容进行数字签名处理,内容仓库还可以对所划分出的每个块进行哈希校验。由于块是数据传输的最小单位,因此,内容仓库事先对每个块进行哈希校验并将其写进待分发内容的元数据中,每当分发目标节点接收到一个内容块之后,就可以通过比较哈希校验结果来确定所接收到的块是否未被篡改,以保证每个块的安全。对块进行哈希校验时,可以使用安全哈希标准(Secure Hash Algorithm,简称SHA1)算法。In addition to digitally signing the entire content to be distributed, the content repository can also hash each block that is partitioned. Since the block is the smallest unit of data transmission, the content warehouse performs a hash check on each block in advance and writes it into the metadata of the content to be distributed. After the distribution target node receives a content block, it can It is determined whether the received block has not been tampered by comparing the hash check results to ensure the security of each block. When hashing a block, you can use the Secure Hash Algorithm (SHA1) algorithm.
S1104、将部分数量、部分大小、块大小、块索引、数字签名以及每个块的块哈希值写入所述待分发内容的元数据中。S1104: Write a partial number, a partial size, a block size, a block index, a digital signature, and a block hash value of each block into the metadata of the content to be distributed.
当经过前述步骤(S1101-1104)获取到部分数量、部分大小、块大小、块索引、数字签名以及每个块的块哈希值之后,内容仓库可以将其写入分发内容的元数据中。After the partial number, partial size, block size, block index, digital signature, and block hash value of each block are acquired through the foregoing steps (S1101-1104), the content repository can write it into the metadata of the distributed content.
图13为待分发内容的元数据的示例图,如图13所示,待分发内容的元数据中第一部分包括待分发内容的名称以及数字签名,第二部分包括部分数量(partcount)、部分大小(partsize)以及块大小(blocksize),第三部分包括每个块索引以及每个块的块哈希值(blockhash)。其中,在第三部分中,每个块的块哈希值都在每个块索引之后,这样,当分 发目标节点读取到块索引之后,就可以直接读取到块对应的块哈希值,而不需要再次进行查询,从而提高元数据的读取效率。13 is an exemplary diagram of metadata of content to be distributed. As shown in FIG. 13, the first part of the metadata of the content to be distributed includes the name of the content to be distributed and the digital signature, and the second part includes the part count and the partial size. (partsize) and block size (blocksize), the third part includes each block index and block hash value (blockhash) of each block. Among them, in the third part, the block hash value of each block is after each block index, so After the target node reads the block index, it can directly read the block hash value corresponding to the block without querying again, thereby improving the reading efficiency of the metadata.
在上述实施例的基础上,本实施例涉及前述图2中步骤S213分发目标节点进行内容分发的具体方法。Based on the foregoing embodiment, the embodiment relates to the specific method for distributing the target node for content distribution in step S213 in FIG. 2.
如前述实施例一中步骤S206-S213所述,当分发目标节点接收到内容分发消息后,执行建立连接、获取待分发内容的元数据、上报准备就绪状态的操作,之后根据元数据以及内容分发路径进行内容分发处理,即进行内容接收与转发。As described in steps S206-S213 in the foregoing first embodiment, after the distribution target node receives the content distribution message, performing the operation of establishing a connection, acquiring metadata of the content to be distributed, reporting the ready state, and then distributing according to the metadata and the content. The path performs content distribution processing, that is, content reception and forwarding.
图14为本发明实施例提供的内容分发方法实施例三的内容接收与转发流程示意图,如图14所示,分发目标节点进行内容分发的过程为:FIG. 14 is a schematic diagram of a content receiving and forwarding process according to Embodiment 3 of a content distribution method according to an embodiment of the present invention. As shown in FIG. 14, the process of distributing a target node for content distribution is:
S1401、接收上游节点发送的块。S1401. Receive a block sent by an upstream node.
S1402、根据待分发内容的元数据中的块索引以及块哈希值,对块进行哈希校验,获取校验结果。S1402: Perform a hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain the verification result.
S1403、若校验结果为校验成功,则保存块,并按照指定分发速率将块发送给内容分发路径中的下游节点。S1403. If the verification result is that the verification is successful, the block is saved, and the block is sent to the downstream node in the content distribution path according to the specified distribution rate.
分发速率指的是接收的速率,因为出入节点数是固定的,所以转发速率也得到控制。The distribution rate refers to the rate of reception, because the number of ingress and egress nodes is fixed, so the forwarding rate is also controlled.
具体地,分发目标节点对接收到的块进行哈希校验,得到一个校验值,再根据所接收到的块的块索引从元数据中读取到块哈希值,如果分发目标节点计算出的校验值和元数据中的块哈希值一致,则认为所接收的块为正确的块,可以将其转发到下一分发目标节点。Specifically, the distribution target node performs hash check on the received block to obtain a check value, and then reads the block hash value from the metadata according to the block index of the received block, if the distribution target node calculates If the check value is consistent with the block hash value in the metadata, the received block is considered to be the correct block and can be forwarded to the next distribution target node.
如前所述,待分发内容以块为最小传输单位,因此,每当分发目标节点接收到一个块,就执行上述步骤S1401-S1403。As described above, the content to be distributed is in the block as the minimum transmission unit, and therefore, each time the distribution target node receives a block, the above-described steps S1401 - S1403 are performed.
本实施例中,当分发目标节点接收到一个块后,就可以使用哈希校验对块进行校验,只要校验成功才将其转发至下一分发目标节点,从而保证所转发的块的安全性。In this embodiment, after the distribution target node receives a block, the block can be verified by using a hash check, and if the verification is successful, it is forwarded to the next distribution target node, thereby ensuring the forwarded block. safety.
需要说明的是,对于内容分发路径中的首节点,当接收到分发控制器发送的内容分发指示后,就可以直接将内容转发到下游节点,因此,不需要执行上述步骤S1401-S1403。It should be noted that, for the first node in the content distribution path, after receiving the content distribution indication sent by the distribution controller, the content can be directly forwarded to the downstream node, and therefore, the above steps S1401-S1403 need not be performed.
另一实施例中,上述步骤S1403中将块转发到下游节点时,分发目标节点可以判断发送是否成功,如果未发送成功,则进行重新发送,如果重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使分发控制器根据下游节点的状态重新建立内容分发路径。In another embodiment, when the block is forwarded to the downstream node in step S1403, the distribution target node may determine whether the transmission is successful. If the transmission is not successful, the retransmission is performed. If the number of retransmission failures reaches a preset number, the The distribution controller sends a distribution failure message to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
另一实施例中,在上述步骤S1403之后,分发目标节点还需要执行如下操作:In another embodiment, after the step S1403, the distribution target node further needs to perform the following operations:
分发目标节点判断是否接收到待分发内容对应的所有块,若是,则分发目标节点根据待分发内容的元数据中的数字签名对待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。The distribution target node determines whether all the blocks corresponding to the content to be distributed are received, and if so, the distribution target node performs a digital signature check on the content to be distributed according to the digital signature in the metadata of the content to be distributed, and reports the result of the digital signature check to the distribution. Controller.
具体地,如前所述,数字签名检查用于对整个待分发内容进行检查,因此,当分发目标节点确认待分发内容的块已经全部接收到了之后,就可以使用对应的算法对接收到的整个内容进行数字签名检查,如果数字签名结果与待分发内容的元数据中的一致,则说明检查通过,否则说明检查不通过。分发目标节点将数字签名结果上报给分发控制器,分发控制器根据数字签名结果执行重新发送等操作。Specifically, as described above, the digital signature check is used to check the entire content to be distributed, and therefore, after the distribution target node confirms that the blocks of the content to be distributed have all been received, the corresponding algorithm can be used to receive the entire The content is digitally checked. If the digital signature result is consistent with the metadata of the content to be distributed, the check passes, otherwise the check fails. The distribution target node reports the digital signature result to the distribution controller, and the distribution controller performs retransmission and the like according to the digital signature result.
其中,分发目标可以根据所保存的待分发内容的元数据来判断是否已经接收到了待分发内容的所有块。具体地,元数据中记录了待分发内容的每个块索引,分发控制判断所接收到的所有内容块的块索引是否与元数据中的块索引完全对应,若是,则确定已经接收到了待分 发内容的所有块。The distribution target may determine whether all blocks of the content to be distributed have been received according to the saved metadata of the content to be distributed. Specifically, each block index of the content to be distributed is recorded in the metadata, and the distribution control determines whether the block index of all the received content blocks completely corresponds to the block index in the metadata, and if yes, determines that the to-be-score has been received. Send all blocks of content.
下述实施例涉及本发明是实施例应用于存在多个租户的云计算系统时的场景。The following embodiments relate to the scenario in which the present invention is applied to a cloud computing system in which a plurality of tenants exist.
对于云计算系统,其中存在多个租户(multi tenants),云计算系统要求多个租户的资源相互隔离互不影响,因此,当将本发明实施例应用于云计算系统时,需要根据租户的特点进行内容分发。在多租户技术中,租户(tenant)是指使用系统或电脑运算资源的客户,但在多租户技术中,租户包含在系统中可识别为指定用户的一切数据,包括帐户与统计信息(accounting data),用户在系统中建置的各式数据,以及用户本身的客制化应用程序环境等,都属于租户的范围,而租户所使用的则是基于供应商所开发或建置的应用系统或运算资源等,供应商所设计的应用系统会容纳数个以上的用户在同一个环境下使用,为了要让多个用户的环境能力同一个应用程序与运算环境上使用,则应用程序与运算环境必须要特别设计,除了可以让系统平台可以允许同时让多份相同的应用程序运行外。For a cloud computing system, where there are multiple tenants, the cloud computing system requires that the resources of multiple tenants are isolated from each other. Therefore, when the embodiment of the present invention is applied to a cloud computing system, it needs to be based on the characteristics of the tenant. Content distribution. In multi-tenant technology, a tenant is a customer who uses a system or computer computing resource, but in multi-tenant technology, a tenant contains all data that can be identified as a specified user in the system, including account and statistics (accounting data) ), the various data built by the user in the system, and the customized application environment of the user itself are all in the scope of the tenant, and the tenant uses the application system developed or built by the supplier or For computing resources, etc., the application system designed by the vendor will accommodate more than one user in the same environment. In order to make the environment capabilities of multiple users the same application and computing environment, the application and computing environment It must be specially designed, in addition to allowing the system platform to allow multiple copies of the same application to run at the same time.
具体地,当用户或应用程序调用分发控制器所提供的API向分发控制器下发内容分发指示时,该内容分发指示中除了携带前述的待分发内容的标识以及分发目标节点外,还可以携带租户信息。当分发控制器接收到内容分发指示后,可以集成对接第三方的统一用户管理系统,对租户鉴权,并查询租户可访问的资源列表。进而,分发控制器在构建内容分发路径时,内容分发路径中的节点为租户可访问的分发目标节点,内容分发路径中的节点不能为租户不可访问的分发目标节点。不同的租户构建不同的内容分发路径,在分发过程中不同的内容分发路径之间不能互相访问,从而有效地实现了多租户的隔离。Specifically, when the user or the application invokes the API provided by the distribution controller to deliver the content distribution indication to the distribution controller, the content distribution indication may be carried in addition to the identifier of the to-be-distributed content and the distribution target node. Tenant information. After receiving the content distribution instruction, the distribution controller may integrate the unified user management system of the third party to authenticate the tenant and query the resource list accessible by the tenant. Further, when the distribution controller constructs the content distribution path, the node in the content distribution path is a distribution target node accessible by the tenant, and the node in the content distribution path cannot be a distribution target node inaccessible to the tenant. Different tenants build different content distribution paths, and different content distribution paths cannot access each other during the distribution process, thereby effectively achieving multi-tenancy isolation.
图15为本发明实施例提供的内容分发装置实施例一的模块结构图,如图15所示,该装置包括:Figure 15 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in Figure 15, the apparatus includes:
接收模块1501,用于接收内容分发指示,该内容分发指示中包括待分发内容的标识以及分发目标节点列表,该分发目标节点列表中包括至少一个分发目标节点的标识。The receiving module 1501 is configured to receive a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node.
处理模块1502,用于根据物理组网拓扑、系统中各节点的状态流量以及分发目标节点列表,生成内容分发路径,其中,该内容分发路径为由首节点和至少一个分发目标节点所构成的单向链式分发路径,首节点为系统中具有完整的待分发内容的节点。The processing module 1502 is configured to generate a content distribution path according to the physical networking topology, the status traffic of each node in the system, and the distribution target node list, where the content distribution path is a single page formed by the first node and the at least one distribution target node. The chained distribution path, the first node is the node in the system with complete content to be distributed.
发送模块1503,用于向至少一个分发目标节点发送内容分发消息,内容分发消息中包括内容分发路径以及待分发内容的标识,以使至少一个分发目标节点根据内容分发路径以及待分发内容的标识获取并分发待分发内容。The sending module 1503 is configured to send a content distribution message to the at least one distribution target node, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node obtains according to the content distribution path and the identifier of the content to be distributed. And distribute the content to be distributed.
该装置用于实现前述方法实施例,其实现原理和技术效果类似,此处不再赘述。The device is used to implement the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
另一实施例中,上述内容分发消息中还包括至少一个分发目标节点的指定分发速率,该指定分发速率是在生成内容分发路径时根据至少一个分发目标节点的状态流量确定的。In another embodiment, the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is determined according to the state traffic of the at least one distribution target node when the content distribution path is generated.
另一实施例中,接收模块1501,还用于接收所述一个分发目标节点上报的准备就绪状态。In another embodiment, the receiving module 1501 is further configured to receive a ready state reported by the one distribution target node.
发送模块1503,还用于根据准备就绪状态,向至少一个分发目标节点发送内容接收与转发指示。The sending module 1503 is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
图16为本发明实施例提供的内容分发装置实施例二的模块结构图,如图16所示,处理模块包括:Figure 16 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in Figure 16, the processing module includes:
第一确定单元15021,用于根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为内容分发路径中的相邻节点。The first determining unit 15021 is configured to use two distribution target nodes that are located on the same physical host or the same chassis in the physical networking as the neighboring nodes in the content distribution path according to the physical networking topology and the distribution target node list.
第二确定单元15022,用于确定系统中具有完整的待分发内容的节点。 The second determining unit 15022 is configured to determine a node in the system that has complete content to be distributed.
第三确定单元15023,用于根据系统中各节点的状态流量,将具有完整的待分发内容的节点中当前流量耗费最低的节点作为内容分发路径中的首节点。The third determining unit 15023 is configured to use, as the first node in the content distribution path, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed according to the state traffic of each node in the system.
另一实施例中,处理模块1502还用于:In another embodiment, the processing module 1502 is further configured to:
根据物理组网拓扑以及分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为内容分发路径中的相邻节点;以及,According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定系统中具有完整的待分发内容的多个节点;以及,Determining multiple nodes in the system with complete content to be distributed; and,
生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于具有完整的待分发内容的节点的个数,每条内容分发路径中的首节点为具有完整的待分发内容的节点中的其中一个节点。Generating a plurality of content distribution paths, wherein the number of generated content distribution paths is less than or equal to the number of nodes having complete content to be distributed, and the first node in each content distribution path is complete with content to be distributed One of the nodes in the node.
另一实施例中,处理模块1502还用于:In another embodiment, the processing module 1502 is further configured to:
设置内容分发路径中的预设节点数量;以及,Set the number of preset nodes in the content distribution path; and,
若内容分发路径中的节点数量大于预设节点数量,则从内容分发路径中选择分叉节点,并根据分叉节点将内容分发路径拆分为第一内容分发路径以及第二内容分发路径;If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content distribution path and the second content distribution path according to the fork node;
其中,第一内容分发路径和第二内容分发路径的首节点相同,第一内容分发路径和第二内容分发路径以分叉节点为分界,分叉节点为内容分发路径中当前流量耗费最低的节点。The first content distribution path and the second content distribution path are the same as the first node, the first content distribution path and the second content distribution path are demarcated by the fork node, and the fork node is the node with the lowest current traffic consumption in the content distribution path. .
另一实施例中,处理模块1502还用于:In another embodiment, the processing module 1502 is further configured to:
确定内容分发路径中的故障节点;以及,Determining the faulty node in the content distribution path; and,
将故障节点从内容分发路径中删除,并将故障节点的下游节点作为故障节点上游节点的下游节点。The faulty node is deleted from the content distribution path, and the downstream node of the faulty node is regarded as the downstream node of the upstream node of the faulty node.
图17为本发明实施例提供的内容分发装置实施例三的模块结构图,如图17所示,处理模块1502还包括:FIG. 17 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 17, the processing module 1502 further includes:
第四确定单元15024,用于在未接收到第一分发目标节点发送的对于内容分发消息的响应消息时,确定第一分发目标节点为内容分发路径中的一个故障节点,其中,第一分发目标节点为内容分发路径中的任意一个分发目标节点。The fourth determining unit 15024 is configured to: when the response message for the content distribution message sent by the first distribution target node is not received, determine that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
图18为本发明实施例提供的内容分发装置实施例四的模块结构图,如图18所示,处理模块1502还包括:FIG. 18 is a block diagram of a fourth embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 18, the processing module 1502 further includes:
第五确定单元15025,用于根据至少一个分发目标节点所上报的状态流量以及分发日志,确定内容分发路径中的故障节点。The fifth determining unit 15025 is configured to determine a faulty node in the content distribution path according to the state traffic reported by the at least one distribution target node and the distribution log.
图19为本发明实施例提供的内容分发装置实施例五的模块结构图,如图19所示,处理模块1502还包括:FIG. 19 is a block diagram of a fifth embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 19, the processing module 1502 further includes:
第六确定单元15026,用于在接收到第二分发目标节点发送的分发失败消息时,确定第二分发目标节点的下游节点为内容分发路径中的一个故障节点,其中,第二分发目标节点为内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。The sixth determining unit 15026 is configured to: when receiving the distribution failure message sent by the second distribution target node, determine that the downstream node of the second distribution target node is a faulty node in the content distribution path, where the second distribution target node is Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
另一实施例中,处理模块1502还用于:In another embodiment, the processing module 1502 is further configured to:
获取内容分发路径中的恢复节点,该恢复节点为由于故障从内容分发路径中删除的节点;以及,Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
将恢复节点增加到内容分发路径中,以使恢复节点从恢复节点的上游节点获取分发内容,其中,恢复节点通过主动请求方式从恢复节点的上游节点获取分发内容。The recovery node is added to the content distribution path such that the recovery node acquires the distribution content from the upstream node of the recovery node, wherein the recovery node acquires the distribution content from the upstream node of the recovery node by the active request mode.
另一实施例中,接收模块1501,还用于接收至少一个分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量。 In another embodiment, the receiving module 1501 is further configured to receive a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node.
发送模块1503,还用于向终端发送分发进度、分发日志、分发结果以及所述状态流量。The sending module 1503 is further configured to send a distribution progress, a distribution log, a distribution result, and the status traffic to the terminal.
图20为本发明实施例提供的内容分发装置实施例一的模块结构图,如图20所示,该装置包括:FIG. 20 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 20, the apparatus includes:
接收模块2001,用于接收内容分发消息,该内容分发消息中包括内容分发路径以及待分发内容的标识,其中,内容分发路径由分发控制器根据物理组网拓扑、系统中各节点的状态流量以及分发目标节点列表所生成,内容分发路径为由首节点和至少一个分发目标节点所构成的单向链式分发路径,首节点为系统中具有完整的待分发内容的节点。The receiving module 2001 is configured to receive a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, where the content distribution path is configured by the distribution controller according to a physical networking topology, status traffic of each node in the system, and The distribution target node list is generated by a unidirectional chain distribution path composed of a first node and at least one distribution target node, and the first node is a node having complete content to be distributed in the system.
处理模块2002,用于根据待分发内容的标识,从首节点中获取待分发内容的元数据,待分发内容的元数据中包括待分发内容的数字签名、块索引以及块哈希值。The processing module 2002 is configured to obtain metadata of the content to be distributed from the first node according to the identifier of the content to be distributed, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed.
处理模块2002,还用于根据内容分发路径以及待分发内容的元数据,进行内容分发处理。The processing module 2002 is further configured to perform content distribution processing according to the content distribution path and the metadata of the content to be distributed.
另一实施例中,内容分发消息中还包括分发目标节点的指定分发速率。In another embodiment, the content distribution message further includes a specified distribution rate of the distribution target node.
处理模块2002,具体用于根据内容分发路径以及待分发内容的元数据,按照指定分发速率进行内容分发处理。The processing module 2002 is specifically configured to perform content distribution processing according to the specified distribution rate according to the content distribution path and the metadata of the content to be distributed.
图21为本发明实施例提供的内容分发装置实施例二的模块结构图,如图21所示,该装置还包括:Figure 21 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in Figure 21, the apparatus further includes:
发送模块2003,用于向分发控制器上报准备就绪状态。The sending module 2003 is configured to report the ready state to the distribution controller.
接收模块2001,还用于接收分发控制器发送的内容接收与转发指示。The receiving module 2001 is further configured to receive a content receiving and forwarding indication sent by the distribution controller.
图22为本发明实施例提供的内容分发装置实施例三的模块结构图,如图22所示,处理模块2002包括:FIG. 22 is a block diagram of a third embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 22, the processing module 2002 includes:
接收单元20021,用于接收上游节点发送的块。The receiving unit 20021 is configured to receive a block sent by the upstream node.
校验单元20022,用于根据待分发内容的元数据中的块索引以及块哈希值,对块进行哈希校验,获取校验结果。The checking unit 20022 is configured to perform hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain the verification result.
发送单元20023,用于在校验结果为校验成功时,保存块,并按照指定分发速率将块发送给内容分发路径中的下游节点。The sending unit 20023 is configured to save the block when the verification result is that the verification is successful, and send the block to the downstream node in the content distribution path according to the specified distribution rate.
另一实施例中,发送单元20023具体用于:In another embodiment, the sending unit 20023 is specifically configured to:
若发送失败,则进行重新发送;以及,If the transmission fails, resend; and,
若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使分发控制器根据下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
另一实施例中,处理模块2002,还用于在接收到待分发内容对应的所有块时,根据数字签名对待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。In another embodiment, the processing module 2002 is further configured to perform a digital signature check on the content to be distributed according to the digital signature when receiving all the blocks corresponding to the content to be distributed, and report the result of the digital signature check to the distribution controller.
另一实施例中,处理模块2002,还用于获取分发进度、分发日志、分发结果以及状态流量。In another embodiment, the processing module 2002 is further configured to obtain a distribution progress, a distribution log, a distribution result, and a status flow.
发送模块2003,还用于向分发控制器上报分发进度、分发日志、分发结果以及状态流量。The sending module 2003 is further configured to report the distribution progress, the distribution log, the distribution result, and the status traffic to the distribution controller.
图23为本发明实施例提供的内容分发装置实施例一的模块结构图,如图23所示,该装置包括:FIG. 23 is a block diagram of a first embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 23, the apparatus includes:
接收模块2301,用于接收创建元数据指示,所述创建元数据指示中包括待分发内容的标识;The receiving module 2301 is configured to receive a creation metadata indication, where the creation metadata indication includes an identifier of the content to be distributed;
处理模块2302,用于根据所述待分发内容的标识,生成所述待分发内容的元数据。The processing module 2302 is configured to generate metadata of the content to be distributed according to the identifier of the content to be distributed.
图24为本发明实施例提供的内容分发装置实施例二的模块结构图,如图24所示,处理模块2302包括: FIG. 24 is a block diagram of a second embodiment of a content distribution apparatus according to an embodiment of the present invention. As shown in FIG. 24, the processing module 2302 includes:
划分单元23021,用于在根据所述待分发内容标识,判断所述待分发内容存在之后,对所述待分发内容进行部分划分以及块划分,获取部分数量、部分大小、块大小以及块索引。The dividing unit 23021 is configured to perform partial division and block division on the to-be-distributed content after determining that the content to be distributed exists according to the content identifier to be distributed, and obtain a partial quantity, a partial size, a block size, and a block index.
处理单元23022,用于对待分发内容进行数字签名处理,获取数字签名。The processing unit 23022 is configured to perform digital signature processing on the content to be distributed to obtain a digital signature.
校验单元23023,用于对划分的每个块进行哈希校验,获取每个块的块哈希值。The checking unit 23023 is configured to perform hash check on each of the divided blocks to obtain a block hash value of each block.
写入单元23024,用于将部分数量、每部分大小、块大小、块索引、数字签名以及每个块的块哈希值写入待分发内容的元数据中。The writing unit 23024 is configured to write the partial quantity, the partial size, the block size, the block index, the digital signature, and the block hash value of each block into the metadata of the content to be distributed.
图25为本发明实施例提供的分发控制器实施例一的实体框图,如图25所示,该分发控制器包括:FIG. 25 is a physical block diagram of Embodiment 1 of a distribution controller according to an embodiment of the present invention. As shown in FIG. 25, the distribution controller includes:
存储器2501和处理器2502。A memory 2501 and a processor 2502.
存储器2501用于存储程序指令,处理器2502用于调用存储器2501中的程序指令,执行下述方法:The memory 2501 is used to store program instructions, and the processor 2502 is used to call program instructions in the memory 2501 to perform the following methods:
接收内容分发指示,所述内容分发指示中包括待分发内容的标识以及分发目标节点列表,所述分发目标节点列表中包括至少一个分发目标节点的标识;Receiving a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
根据物理组网拓扑、系统中各节点的状态流量以及所述分发目标节点列表,生成内容分发路径,其中,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为系统中具有完整的所述待分发内容的节点;Generating a content distribution path according to a physical networking topology, a status traffic of each node in the system, and the distribution target node list, wherein the content distribution path is a one-way composed of a first node and the at least one distribution target node a chain distribution path, the head node being a node in the system having the complete content to be distributed;
向所述至少一个分发目标节点发送内容分发消息,所述内容分发消息中包括所述内容分发路径以及所述待分发内容的标识,以使所述至少一个分发目标节点根据所述内容分发路径以及所述待分发内容的标识获取并分发所述待分发内容。And transmitting, to the at least one distribution target node, a content distribution message, where the content distribution message includes the content distribution path and an identifier of the content to be distributed, so that the at least one distribution target node according to the content distribution path and The identifier of the content to be distributed acquires and distributes the content to be distributed.
进一步地,所述内容分发消息中还包括所述至少一个分发目标节点的指定分发速率,所述指定分发速率是在生成所述内容分发路径时根据所述至少一个分发目标节点的状态流量确定的。Further, the content distribution message further includes a specified distribution rate of the at least one distribution target node, where the specified distribution rate is determined according to state traffic of the at least one distribution target node when the content distribution path is generated. .
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
接收所述至少一个分发目标节点上报的准备就绪状态;Receiving a ready state reported by the at least one distribution target node;
根据所述准备就绪状态,向所述至少一个分发目标节点发送内容接收与转发指示。And transmitting, according to the ready state, a content receiving and forwarding indication to the at least one distribution target node.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
根据物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定系统中具有完整的所述待分发内容的节点;Determining a node in the system that has the complete content to be distributed;
根据系统中各节点的状态流量,将所述具有完整的所述待分发内容的节点中当前流量耗费最低的节点作为所述内容分发路径中的首节点。The node having the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path according to the state traffic of each node in the system.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
根据物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
确定系统中具有完整的所述待分发内容的多个节点;Determining a plurality of nodes in the system having the complete content to be distributed;
生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于所述具有完整的所述待分发内容的节点的个数,每条所述内容分发路径中的首节点为所述具有完整的所述待分发内容的节点中的其中一个节点。Generating a plurality of content distribution paths, wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
设置所述内容分发路径中的预设节点数量; Setting a preset number of nodes in the content distribution path;
若所述内容分发路径中的节点数量大于所述预设节点数量,则从所述内容分发路径中选择分叉节点,并根据所述分叉节点将所述内容分发路径拆分为第一内容分发路径以及第二内容分发路径;If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
其中,所述第一内容分发路径和所述第二内容分发路径的首节点相同,所述第一内容分发路径和所述第二内容分发路径以所述分叉节点为分界,所述分叉节点为所述内容分发路径中当前流量耗费最低的节点。The first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
确定所述内容分发路径中的故障节点;Determining a faulty node in the content distribution path;
将所述故障节点从所述内容分发路径中删除,并将所述故障节点的下游节点作为所述故障节点上游节点的下游节点。And deleting the faulty node from the content distribution path, and using a downstream node of the faulty node as a downstream node of the upstream node of the faulty node.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
若未接收到第一分发目标节点发送的对于所述内容分发消息的响应消息,则确定所述第一分发目标节点为所述内容分发路径中的一个故障节点,其中,所述第一分发目标节点为所述内容分发路径中的任意一个分发目标节点。If the response message to the content distribution message sent by the first distribution target node is not received, determining that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node for any of the content distribution paths.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
根据所述至少一个分发目标节点所上报的状态流量以及分发日志,确定所述内容分发路径中的故障节点。Determining a faulty node in the content distribution path according to the status traffic reported by the at least one distribution target node and the distribution log.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
若接收到第二分发目标节点发送的分发失败消息,则确定所述第二分发目标节点的下游节点为所述内容分发路径中的一个故障节点,其中,所述第二分发目标节点为所述内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。If the distribution failure message sent by the second distribution target node is received, determining that the downstream node of the second distribution target node is one of the content distribution paths, wherein the second distribution target node is the Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
获取所述内容分发路径中的恢复节点,所述恢复节点为由于故障从所述内容分发路径中删除的节点;Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
将所述恢复节点增加到所述内容分发路径中,以使所述恢复节点从所述恢复节点的上游节点获取分发内容,其中,所述恢复节点通过主动请求方式从所述恢复节点的上游节点获取分发内容。Adding the recovery node to the content distribution path, so that the recovery node acquires distribution content from an upstream node of the recovery node, wherein the recovery node is from an upstream node of the recovery node by an active request mode Get the distribution.
进一步地,处理器2502还用于:Further, the processor 2502 is further configured to:
接收所述至少一个分发目标节点周期性上报的分发进度、分发日志、分发结果以及状态流量;Receiving a distribution progress, a distribution log, a distribution result, and a status flow periodically reported by the at least one distribution target node;
向终端发送所述分发进度、所述分发日志、所述分发结果以及所述状态流量。The distribution progress, the distribution log, the distribution result, and the status traffic are transmitted to the terminal.
图26为本发明实施例提供的计算节点实施例一的实体框图,如图26所示,该计算节点包括:FIG. 26 is a physical block diagram of Embodiment 1 of a computing node according to an embodiment of the present invention. As shown in FIG. 26, the computing node includes:
存储器2601和处理器2602。 Memory 2601 and processor 2602.
存储器2601用于存储程序指令,处理器2602用于调用存储器2601中的程序指令,执行下述方法:The memory 2601 is configured to store program instructions, and the processor 2602 is configured to call program instructions in the memory 2601 to perform the following methods:
接收内容分发消息,所述内容分发消息中包括内容分发路径以及待分发内容的标识,其中,所述内容分发路径由分发控制器根据物理组网拓扑、系统中各节点的状态流量以及分发目标节点列表所生成,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为系统中具有完整的所述待分发内容的节点; Receiving a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is distributed by the distribution controller according to a physical networking topology, status traffic of each node in the system, and a distribution target node The content distribution path is a unidirectional chain distribution path formed by the head node and the at least one distribution target node, where the head node is a node having a complete content to be distributed in the system;
根据所述待分发内容的标识,从首节点中获取所述待分发内容的元数据,所述待分发内容的元数据中包括所述待分发内容的数字签名、块索引以及块哈希值;Obtaining, according to the identifier of the content to be distributed, the metadata of the content to be distributed from the first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed;
根据所述内容分发路径以及所述待分发内容的元数据,进行内容分发处理。The content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed.
进一步地,所述内容分发消息中还包括分发目标节点的指定分发速率;处理器2602还用于:Further, the content distribution message further includes a specified distribution rate of the distribution target node; the processor 2602 is further configured to:
根据所述内容分发路径以及所述待分发内容的元数据,按照所述指定分发速率进行内容分发处理。The content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed according to the specified distribution rate.
进一步地,处理器2602还用于:Further, the processor 2602 is further configured to:
向分发控制器上报准备就绪状态;Reporting the ready status to the distribution controller;
接收所述分发控制器发送的内容接收与转发指示。Receiving a content receiving and forwarding indication sent by the distribution controller.
进一步地,处理器2602还用于:Further, the processor 2602 is further configured to:
接收上游节点发送的块;Receiving a block sent by an upstream node;
根据所述待分发内容的元数据中的块索引以及块哈希值,对所述块进行哈希校验,获取校验结果;And performing a hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and acquiring a verification result;
若所述校验结果为校验成功,则保存所述块,并按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点。If the verification result is that the verification is successful, the block is saved, and the block is sent to a downstream node in the content distribution path according to the specified distribution rate.
进一步地,处理器2602还用于:Further, the processor 2602 is further configured to:
若发送失败,则进行重新发送;If the transmission fails, resend it;
若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使所述分发控制器根据所述下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
进一步地,处理器2602还用于:Further, the processor 2602 is further configured to:
若接收到所述待分发内容对应的所有块,则根据所述数字签名对所述待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。If all the blocks corresponding to the content to be distributed are received, the digital signature is checked according to the digital signature, and the result of the digital signature check is reported to the distribution controller.
进一步地,处理器2602还用于:Further, the processor 2602 is further configured to:
获取分发进度、分发日志、分发结果以及状态流量;Obtain distribution progress, distribution logs, distribution results, and status traffic;
向所述分发控制器上报所述分发进度、分发日志、分发结果以及状态流量。The distribution progress, distribution log, distribution result, and status traffic are reported to the distribution controller.
图27为本发明实施例提供的内容仓库实施例一的实体框图,如图27所示,该内容仓库包括:FIG. 27 is a physical block diagram of Embodiment 1 of a content repository according to an embodiment of the present invention. As shown in FIG. 27, the content repository includes:
存储器2701和处理器2702。A memory 2701 and a processor 2702.
存储器2701用于存储程序指令,处理器2702用于调用存储器2701中的程序指令,执行下述方法:The memory 2701 is used to store program instructions, and the processor 2702 is used to call program instructions in the memory 2701 to perform the following methods:
接收创建元数据指示,所述创建元数据指示中包括待分发内容的标识;Receiving a creation metadata indication, wherein the creation metadata indication includes an identifier of the content to be distributed;
根据所述待分发内容的标识,生成所述待分发内容的元数据。Generating metadata of the content to be distributed according to the identifier of the content to be distributed.
进一步地,处理器2702还用于:Further, the processor 2702 is further configured to:
根据所述待分发内容标识,判断所述待分发内容是否存在,若是,则:Determining whether the content to be distributed exists according to the content identifier to be distributed, and if yes,
对所述待分发内容进行部分划分以及块划分,获取部分数量、部分大小、块大小以及块索引;以及,Performing partial division and block division on the to-be-distributed content, acquiring part number, partial size, block size, and block index; and,
对所述待分发内容进行数字签名处理,获取数字签名;以及,Digitally signing the content to be distributed to obtain a digital signature; and,
对划分的每个块进行哈希校验,获取每个块的块哈希值;Hashing each block of the partition to obtain a block hash value of each block;
将所述部分数量、每部分大小、块大小、块索引、数字签名以及每个块的块哈希值写入 所述待分发内容的元数据中。Write the partial number, the size of each part, the block size, the block index, the digital signature, and the block hash value of each block In the metadata of the content to be distributed.
另外,本发明实施例还提供一种内容分发系统,其中包括上述分发控制器、上述计算节点以及上述内容仓库。In addition, an embodiment of the present invention further provides a content distribution system, including the foregoing distribution controller, the foregoing computing node, and the content repository.
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.

Claims (31)

  1. 一种云计算系统的内容分发方法,其特征在于,包括:A content distribution method for a cloud computing system, comprising:
    接收内容分发指示,所述内容分发指示中包括待分发内容的标识以及分发目标节点列表,所述分发目标节点列表中包括至少一个分发目标节点的标识;Receiving a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
    根据云计算系统的物理组网拓扑、各节点的状态流量以及所述分发目标节点列表,生成内容分发路径;Generating a content distribution path according to a physical networking topology of the cloud computing system, state traffic of each node, and the distribution target node list;
    向所述至少一个分发目标节点发送内容分发消息,所述内容分发消息中包括所述内容分发路径和所述待分发内容的标识。And transmitting, to the at least one distribution target node, a content distribution message, where the content distribution message includes the content distribution path and an identifier of the content to be distributed.
  2. 根据权利要求1所述的方法,其特征在于,所述内容分发消息中还包括所述至少一个分发目标节点的指定分发速率。The method according to claim 1, wherein said content distribution message further comprises a specified distribution rate of said at least one distribution target node.
  3. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    接收所述至少一个分发目标节点上报的准备就绪状态;Receiving a ready state reported by the at least one distribution target node;
    根据所述准备就绪状态,向所述至少一个分发目标节点发送内容接收与转发指示。And transmitting, according to the ready state, a content receiving and forwarding indication to the at least one distribution target node.
  4. 根据权利要求1所述的方法,其特征在于,所述根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及所述分发目标节点列表,生成内容分发路径,包括:The method according to claim 1, wherein the generating a content distribution path according to the physical networking topology of the cloud computing system, the state traffic of each node in the cloud computing system, and the distribution target node list comprises:
    根据云计算系统的物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;According to the physical networking topology of the cloud computing system and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
    确定云计算系统中具有完整的所述待分发内容的节点;Determining a node in the cloud computing system that has the complete content to be distributed;
    根据云计算系统中各节点的状态流量,将所述具有完整的所述待分发内容的节点中当前流量耗费最低的节点作为所述内容分发路径中的首节点。According to the state traffic of each node in the cloud computing system, the node with the lowest current traffic consumption among the nodes having the complete content to be distributed is used as the first node in the content distribution path.
  5. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    根据物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
    确定云计算系统中具有完整的所述待分发内容的多个节点;Determining a plurality of nodes in the cloud computing system having the complete content to be distributed;
    生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于所述具有完整的所述待分发内容的节点的个数。A plurality of content distribution paths are generated, wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed.
  6. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    设置所述内容分发路径中的预设节点数量;Setting a preset number of nodes in the content distribution path;
    若所述内容分发路径中的节点数量大于所述预设节点数量,则从所述内容分发路径中选择分叉节点,并根据所述分叉节点将所述内容分发路径拆分为第一内容分发路径以及第二内容分发路径;If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
    其中,所述第一内容分发路径和所述第二内容分发路径的首节点相同,所述第一内容分发路径和所述第二内容分发路径以所述分叉节点为分界,所述分叉节点为所述内容分发路径中当前流量耗费最低的节点。The first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
  7. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    确定所述内容分发路径中的故障节点;Determining a faulty node in the content distribution path;
    将所述故障节点从所述内容分发路径中删除,并将所述故障节点的下游节点作为所述故障节点上游节点的下游节点。And deleting the faulty node from the content distribution path, and using a downstream node of the faulty node as a downstream node of the upstream node of the faulty node.
  8. 根据权利要求7所述的方法,其特征在于,所述确定所述内容分发路径中的故障节点, 包括:The method according to claim 7, wherein said determining said faulty node in said content distribution path, include:
    若未接收到第一分发目标节点发送的对于所述内容分发消息的响应消息,则确定所述第一分发目标节点为所述内容分发路径中的一个故障节点,其中,所述第一分发目标节点为所述内容分发路径中的任意一个分发目标节点;If the response message to the content distribution message sent by the first distribution target node is not received, determining that the first distribution target node is a faulty node in the content distribution path, where the first distribution target The node distributes the target node to any one of the content distribution paths;
    根据所述至少一个分发目标节点所上报的状态流量以及分发日志,确定所述内容分发路径中的故障节点;或者Determining a faulty node in the content distribution path according to status traffic reported by the at least one distribution target node and a distribution log; or
    若接收到第二分发目标节点发送的分发失败消息,则确定所述第二分发目标节点的下游节点为所述内容分发路径中的一个故障节点,其中,所述第二分发目标节点为所述内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。If the distribution failure message sent by the second distribution target node is received, determining that the downstream node of the second distribution target node is one of the content distribution paths, wherein the second distribution target node is the Any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  9. 根据权利要求7所述的方法,其特征在于,还包括:The method of claim 7 further comprising:
    获取所述内容分发路径中的恢复节点,所述恢复节点为由于故障从所述内容分发路径中删除的节点;Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
    将所述恢复节点增加到所述内容分发路径中,以使所述恢复节点从所述恢复节点的上游节点获取分发内容,其中,所述恢复节点通过主动请求方式从所述恢复节点的上游节点获取分发内容。Adding the recovery node to the content distribution path, so that the recovery node acquires distribution content from an upstream node of the recovery node, wherein the recovery node is from an upstream node of the recovery node by an active request mode Get the distribution.
  10. 一种云计算系统的内容分发方法,其特征在于,包括:A content distribution method for a cloud computing system, comprising:
    接收内容分发消息,所述内容分发消息中包括内容分发路径以及待分发内容的标识,其中,所述内容分发路径由分发控制器根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表所生成,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为系统中具有完整的所述待分发内容的节点;Receiving a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and each node in the cloud computing system The status flow is generated by the distribution target node list, and the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is complete in the system. a node that distributes content;
    根据所述待分发内容的标识,从首节点中获取所述待分发内容的元数据,所述待分发内容的元数据中包括所述待分发内容的数字签名、块索引以及块哈希值;Obtaining, according to the identifier of the content to be distributed, the metadata of the content to be distributed from the first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a block hash value of the content to be distributed;
    根据所述内容分发路径以及所述待分发内容的元数据,进行内容分发处理。The content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed.
  11. 根据权利要求10所述的方法,其特征在于,所述内容分发消息中还包括分发目标节点的指定分发速率;The method according to claim 10, wherein the content distribution message further comprises a specified distribution rate of the distribution target node;
    所述根据所述内容分发路径以及所述待分发内容的元数据,进行内容分发处理具体包括:The content distribution processing according to the content distribution path and the metadata of the content to be distributed specifically includes:
    根据所述内容分发路径以及所述待分发内容的元数据,按照所述指定分发速率进行内容分发处理。The content distribution processing is performed according to the content distribution path and the metadata of the content to be distributed according to the specified distribution rate.
  12. 根据权利要求11所述的方法,其特征在于,还包括:The method of claim 11 further comprising:
    向分发控制器上报准备就绪状态;Reporting the ready status to the distribution controller;
    接收所述分发控制器发送的内容接收与转发指示。Receiving a content receiving and forwarding indication sent by the distribution controller.
  13. 根据权利要求10所述的方法,其特征在于,所述根据所述待内容分发路径以及所述待分发内容的元数据,进行内容分发处理,包括:The method according to claim 10, wherein the performing content distribution processing according to the to-be-content distribution path and the metadata of the content to be distributed includes:
    接收上游节点发送的块;Receiving a block sent by an upstream node;
    根据所述待分发内容的元数据中的块索引以及块哈希值,对所述块进行哈希校验,获取校验结果;And performing a hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and acquiring a verification result;
    若所述校验结果为校验成功,则保存所述块,并按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点。 If the verification result is that the verification is successful, the block is saved, and the block is sent to a downstream node in the content distribution path according to the specified distribution rate.
  14. 根据权利要求13所述的方法,其特征在于,所述按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点,包括:The method according to claim 13, wherein the sending the block to the downstream node in the content distribution path according to the specified distribution rate comprises:
    若发送失败,则进行重新发送;If the transmission fails, resend it;
    若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使所述分发控制器根据所述下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  15. 根据权利要求13或14所述的方法,其特征在于,还包括:The method according to claim 13 or 14, further comprising:
    若接收到所述待分发内容对应的所有块,则根据所述数字签名对所述待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。If all the blocks corresponding to the content to be distributed are received, the digital signature is checked according to the digital signature, and the result of the digital signature check is reported to the distribution controller.
  16. 一种内容分发装置,其特征在于,包括:A content distribution device, comprising:
    接收模块,用于接收内容分发指示,所述内容分发指示中包括待分发内容的标识以及分发目标节点列表,所述分发目标节点列表中包括至少一个分发目标节点的标识;a receiving module, configured to receive a content distribution indication, where the content distribution indication includes an identifier of the content to be distributed and a distribution target node list, where the distribution target node list includes an identifier of the at least one distribution target node;
    处理模块,用于根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及所述分发目标节点列表,生成内容分发路径;a processing module, configured to generate a content distribution path according to a physical networking topology of the cloud computing system, a state traffic of each node in the cloud computing system, and the distribution target node list;
    发送模块,用于向所述至少一个分发目标节点发送内容分发消息,所述内容分发消息中包括所述内容分发路径以及所述待分发内容的标识。And a sending module, configured to send a content distribution message to the at least one distribution target node, where the content distribution message includes the content distribution path and an identifier of the content to be distributed.
  17. 根据权利要求16所述的装置,其特征在于,所述内容分发消息中还包括所述至少一个分发目标节点的指定分发速率。The apparatus according to claim 16, wherein said content distribution message further comprises a specified distribution rate of said at least one distribution target node.
  18. 根据权利要求16所述的装置,其特征在于,The device of claim 16 wherein:
    所述接收模块,还用于接收所述至少一个分发目标节点上报的准备就绪状态;The receiving module is further configured to receive a ready state reported by the at least one distribution target node;
    所述发送模块,还用于根据所述准备就绪状态,向所述至少一个分发目标节点发送内容接收与转发指示。The sending module is further configured to send a content receiving and forwarding indication to the at least one distribution target node according to the ready state.
  19. 根据权利要求16所述的装置,其特征在于,所述处理模块包括:The device according to claim 16, wherein the processing module comprises:
    第一确定单元,用于根据云计算系统的物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;a first determining unit, configured to use, as the content distribution path, two distribution target nodes located on the same physical host or the same chassis in the physical networking according to the physical networking topology of the cloud computing system and the distribution target node list Adjacent nodes in ;
    第二确定单元,用于确定云计算系统中具有完整的所述待分发内容的节点;a second determining unit, configured to determine a node in the cloud computing system that has the complete content to be distributed;
    第三确定单元,用于根据云计算系统中各节点的状态流量,将所述具有完整的所述待分发内容的节点中当前流量耗费最低的节点作为所述内容分发路径中的首节点。And a third determining unit, configured to use, as the first node in the content distribution path, a node with the lowest current traffic consumption among the nodes having the complete content to be distributed according to the state traffic of each node in the cloud computing system.
  20. 根据权利要求16所述的装置,其特征在于,所述处理模块还用于:The device according to claim 16, wherein the processing module is further configured to:
    根据物理组网拓扑以及所述分发目标节点列表,将在物理组网中位于同一物理主机或者同一机箱上的两个分发目标节点作为所述内容分发路径中的相邻节点;以及,According to the physical networking topology and the distribution target node list, two distribution target nodes located on the same physical host or the same chassis in the physical networking are used as adjacent nodes in the content distribution path;
    确定系统中具有完整的所述待分发内容的多个节点;以及,Determining a plurality of nodes in the system having the complete content to be distributed; and,
    生成多条内容分发路径,其中,所生成的内容分发路径的条数小于或等于所述具有完整的所述待分发内容的节点的个数,每条所述内容分发路径中的首节点为所述具有完整的所述待分发内容的节点中的其中一个节点。Generating a plurality of content distribution paths, wherein the number of generated content distribution paths is less than or equal to the number of nodes having the complete content to be distributed, and the first node in each of the content distribution paths is One of the nodes having the complete content to be distributed.
  21. 根据权利要求16所述的装置,其特征在于,所述处理模块还用于:The device according to claim 16, wherein the processing module is further configured to:
    设置所述内容分发路径中的预设节点数量;以及,Setting a preset number of nodes in the content distribution path; and,
    若所述内容分发路径中的节点数量大于所述预设节点数量,则从所述内容分发路径中选择分叉节点,并根据所述分叉节点将所述内容分发路径拆分为第一内容分发路径以及第二内容分发路径; If the number of nodes in the content distribution path is greater than the preset number of nodes, selecting a fork node from the content distribution path, and splitting the content distribution path into the first content according to the fork node a distribution path and a second content distribution path;
    其中,所述第一内容分发路径和所述第二内容分发路径的首节点相同,所述第一内容分发路径和所述第二内容分发路径以所述分叉节点为分界,所述分叉节点为所述内容分发路径中当前流量耗费最低的节点。The first content distribution path and the first node of the second content distribution path are the same, and the first content distribution path and the second content distribution path are demarcated by the bifurcation node, and the bifurcation The node is the node with the lowest traffic consumption in the content distribution path.
  22. 根据权利要求16所述的装置,其特征在于,所述处理模块还用于:The device according to claim 16, wherein the processing module is further configured to:
    确定所述内容分发路径中的故障节点;以及,Determining a faulty node in the content distribution path; and,
    将所述故障节点从所述内容分发路径中删除,并将所述故障节点的下游节点作为所述故障节点上游节点的下游节点。And deleting the faulty node from the content distribution path, and using a downstream node of the faulty node as a downstream node of the upstream node of the faulty node.
  23. 根据权利要求22所述的装置,其特征在于,所述处理模块还包括:第四确定单元,用于在未接收到第一分发目标节点发送的对于所述内容分发消息的响应消息时,确定所述第一分发目标节点为所述内容分发路径中的一个故障节点,其中,所述第一分发目标节点为所述内容分发路径中的任意一个分发目标节点;The apparatus according to claim 22, wherein the processing module further comprises: a fourth determining unit, configured to determine, when the response message for the content distribution message sent by the first distribution target node is not received The first distribution target node is a faulty node in the content distribution path, wherein the first distribution target node is a distribution target node of any one of the content distribution paths;
    第五确定单元,用于根据所述至少一个分发目标节点所上报的状态流量以及分发日志,确定所述内容分发路径中的故障节点;和a fifth determining unit, configured to determine a faulty node in the content distribution path according to the state traffic reported by the at least one distribution target node and the distribution log; and
    第六确定单元,用于在接收到第二分发目标节点发送的分发失败消息时,确定所述第二分发目标节点的下游节点为所述内容分发路径中的一个故障节点,其中,所述第二分发目标节点为所述内容分发路径中除最后一个分发目标节点之外的任意一个分发目标节点。a sixth determining unit, configured to: when receiving the distribution failure message sent by the second distribution target node, determine that the downstream node of the second distribution target node is a fault node in the content distribution path, where the The second distribution target node is any one of the distribution target nodes except the last distribution destination node in the content distribution path.
  24. 根据权利要求22所述的装置,其特征在于,所述处理模块还用于:The device according to claim 22, wherein the processing module is further configured to:
    获取所述内容分发路径中的恢复节点,所述恢复节点为由于故障从所述内容分发路径中删除的节点;以及,Acquiring a recovery node in the content distribution path, the recovery node being a node deleted from the content distribution path due to a failure;
    将所述恢复节点增加到所述内容分发路径中,以使所述恢复节点从所述恢复节点的上游节点获取分发内容,其中,所述恢复节点通过主动请求方式从所述恢复节点的上游节点获取分发内容。Adding the recovery node to the content distribution path, so that the recovery node acquires distribution content from an upstream node of the recovery node, wherein the recovery node is from an upstream node of the recovery node by an active request mode Get the distribution.
  25. 一种计算节点,其特征在于,包括:A computing node, comprising:
    接收模块,用于接收内容分发消息,所述内容分发消息中包括内容分发路径以及待分发内容的标识,其中,所述内容分发路径由分发控制器根据云计算系统的物理组网拓扑、云计算系统中各节点的状态流量以及分发目标节点列表所生成,所述内容分发路径为由首节点和所述至少一个分发目标节点所构成的单向链式分发路径,所述首节点为系统中具有完整的所述待分发内容的节点;a receiving module, configured to receive a content distribution message, where the content distribution message includes a content distribution path and an identifier of the content to be distributed, wherein the content distribution path is configured by the distribution controller according to a physical networking topology of the cloud computing system, and the cloud computing a state traffic of each node in the system and a distribution target node list, where the content distribution path is a unidirectional chain distribution path formed by the first node and the at least one distribution target node, where the first node is in the system a complete node of the content to be distributed;
    处理模块,用于根据所述待分发内容的标识,从首节点中获取所述待分发内容的元数据,所述待分发内容的元数据中包括所述待分发内容的数字签名、块索引以及块哈希值;a processing module, configured to acquire, according to the identifier of the content to be distributed, metadata of the content to be distributed from a first node, where the metadata of the content to be distributed includes a digital signature, a block index, and a content of the content to be distributed Block hash value;
    所述处理模块,还用于根据所述内容分发路径以及所述待分发内容的元数据,进行内容分发处理。The processing module is further configured to perform content distribution processing according to the content distribution path and the metadata of the content to be distributed.
  26. 根据权利要求25所述的计算节点,其特征在于,所述内容分发消息中还包括分发目标节点的指定分发速率;The computing node according to claim 25, wherein the content distribution message further includes a specified distribution rate of the distribution target node;
    所述处理模块,具体用于根据所述内容分发路径以及所述待分发内容的元数据,按照所述指定分发速率进行内容分发处理。The processing module is specifically configured to perform content distribution processing according to the specified distribution rate according to the content distribution path and the metadata of the content to be distributed.
  27. 根据权利要求26所述的计算节点,其特征在于,还包括:The computing node of claim 26, further comprising:
    发送模块,用于向分发控制器上报准备就绪状态;a sending module, configured to report a ready state to the distribution controller;
    所述接收模块,还用于接收所述分发控制器发送的内容接收与转发指示。The receiving module is further configured to receive a content receiving and forwarding indication sent by the distribution controller.
  28. 根据权利要求25所述的计算节点,其特征在于,所述处理模块包括: The computing node of claim 25, wherein the processing module comprises:
    接收单元,用于接收上游节点发送的块;a receiving unit, configured to receive a block sent by an upstream node;
    校验单元,用于根据所述待分发内容的元数据中的块索引以及块哈希值,对所述块进行哈希校验,获取校验结果;a checking unit, configured to perform hash check on the block according to the block index and the block hash value in the metadata of the content to be distributed, and obtain a verification result;
    发送单元,用于在所述校验结果为校验成功时,保存所述块,并按照所述指定分发速率将所述块发送给所述内容分发路径中的下游节点。And a sending unit, configured to save the block when the verification result is a verification success, and send the block to a downstream node in the content distribution path according to the specified distribution rate.
  29. 根据权利要求28所述的计算节点,其特征在于,所述发送单元具体用于:The computing node according to claim 28, wherein the sending unit is specifically configured to:
    若发送失败,则进行重新发送;以及,If the transmission fails, resend; and,
    若重新发送失败的次数达到预设次数,则向分发控制器发送分发失败消息,以使所述分发控制器根据所述下游节点的状态重新建立内容分发路径。If the number of retransmission failures reaches a preset number of times, a distribution failure message is sent to the distribution controller to cause the distribution controller to re-establish the content distribution path according to the state of the downstream node.
  30. 根据权利要求28或29所述的计算节点,其特征在于,A computing node according to claim 28 or 29, characterized in that
    所述处理模块,还用于在接收到所述待分发内容对应的所有块时,根据所述数字签名对所述待分发内容进行数字签名检查,并将数字签名检查的结果上报给分发控制器。The processing module is further configured to: when receiving all the blocks corresponding to the content to be distributed, perform digital signature check on the to-be-distributed content according to the digital signature, and report the result of the digital signature check to the distribution controller .
  31. 一种内容分发系统,其特征在于,所述系统包括权利要求16-24任一所述的内容分发装置以及权利要求25-30任一所述的计算节点。 A content distribution system, comprising the content distribution device of any of claims 16-24 and the computing node of any of claims 25-30.
PCT/CN2017/091276 2016-10-31 2017-06-30 Content distribution method and device for cloud computing system, computing node and system WO2018076765A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610931630.XA CN108023812B (en) 2016-10-31 2016-10-31 Content distribution method and device of cloud computing system, computing node and system
CN201610931630.X 2016-10-31

Publications (1)

Publication Number Publication Date
WO2018076765A1 true WO2018076765A1 (en) 2018-05-03

Family

ID=62023016

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/091276 WO2018076765A1 (en) 2016-10-31 2017-06-30 Content distribution method and device for cloud computing system, computing node and system

Country Status (2)

Country Link
CN (1) CN108023812B (en)
WO (1) WO2018076765A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110831010A (en) * 2019-10-21 2020-02-21 上海鹄恩信息科技有限公司 Multichannel data sending and receiving method and device and data transmission system
CN111200479A (en) * 2018-11-19 2020-05-26 福建天泉教育科技有限公司 Transmission data verification method and storage medium
CN113630446A (en) * 2021-07-20 2021-11-09 湖北美和易思教育科技有限公司 File distribution method and system based on path diffusion and readable storage medium
CN115460195A (en) * 2022-09-21 2022-12-09 湖南智领通信科技有限公司 Method and device for distributing files in whole network suitable for ad hoc network

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109194542B (en) * 2018-08-22 2021-05-07 网宿科技股份有限公司 Method and device for counting internal consumption of live stream in CDN system
CN109376134B (en) * 2018-09-29 2022-04-01 深圳市网心科技有限公司 File distributed deployment method, device, system and storage medium
CN109800050B (en) * 2018-11-22 2021-11-23 海光信息技术股份有限公司 Memory management method, device, related equipment and system of virtual machine
CN109995866B (en) * 2019-04-03 2022-04-29 深圳市网心科技有限公司 Distributed file verification method and device, computer device and storage medium
CN112688980B (en) * 2019-10-18 2022-10-25 上海哔哩哔哩科技有限公司 Resource distribution method and device, and computer equipment
CN111277630B (en) 2020-01-13 2022-09-09 腾讯科技(深圳)有限公司 Routing control method and device, electronic equipment and storage medium
CN113836186B (en) * 2021-09-28 2023-10-10 北京环境特性研究所 Simulation data query method and device based on ES search engine
CN114884951A (en) * 2022-05-23 2022-08-09 西安明赋云计算有限公司 Content distribution method based on cloud computing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7373394B1 (en) * 2003-06-30 2008-05-13 Cisco Technology, Inc. Method and apparatus for multicast cloud with integrated multicast and unicast channel routing in a content distribution network
CN101997891A (en) * 2009-08-28 2011-03-30 华为技术有限公司 Method, device and system for allocating P2P media stream
CN101997924A (en) * 2010-11-22 2011-03-30 杨文军 Cloud storage file transfer protocol (CFTP)
US20160204916A1 (en) * 2015-01-08 2016-07-14 Ngoc-Dung DAO System and method for joint optimization of source selection and traffic engineering

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7373394B1 (en) * 2003-06-30 2008-05-13 Cisco Technology, Inc. Method and apparatus for multicast cloud with integrated multicast and unicast channel routing in a content distribution network
CN101997891A (en) * 2009-08-28 2011-03-30 华为技术有限公司 Method, device and system for allocating P2P media stream
CN101997924A (en) * 2010-11-22 2011-03-30 杨文军 Cloud storage file transfer protocol (CFTP)
US20160204916A1 (en) * 2015-01-08 2016-07-14 Ngoc-Dung DAO System and method for joint optimization of source selection and traffic engineering

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111200479A (en) * 2018-11-19 2020-05-26 福建天泉教育科技有限公司 Transmission data verification method and storage medium
CN111200479B (en) * 2018-11-19 2022-04-12 福建天泉教育科技有限公司 Transmission data verification method and storage medium
CN110831010A (en) * 2019-10-21 2020-02-21 上海鹄恩信息科技有限公司 Multichannel data sending and receiving method and device and data transmission system
CN110831010B (en) * 2019-10-21 2024-04-16 上海鹄恩信息科技有限公司 Multichannel data sending and receiving method and device and data transmission system
CN113630446A (en) * 2021-07-20 2021-11-09 湖北美和易思教育科技有限公司 File distribution method and system based on path diffusion and readable storage medium
CN115460195A (en) * 2022-09-21 2022-12-09 湖南智领通信科技有限公司 Method and device for distributing files in whole network suitable for ad hoc network

Also Published As

Publication number Publication date
CN108023812A (en) 2018-05-11
CN108023812B (en) 2021-06-08

Similar Documents

Publication Publication Date Title
WO2018076765A1 (en) Content distribution method and device for cloud computing system, computing node and system
US9385875B2 (en) Scalable transport with cluster-consensus rendezvous
US10185497B2 (en) Cluster federation and trust in a cloud environment
US9560093B2 (en) Higher efficiency storage replication using compression
US11316609B2 (en) Data transmitting method, data receiving method, and device
EP2104287B1 (en) A method for client node network topology construction and a system for stream media delivery
WO2012065426A1 (en) Load distribution method, apparatus and server in distributed cache system
US9621412B2 (en) Method for guaranteeing service continuity in a telecommunication network and system thereof
JP2020087443A (en) Dynamic content distribution protocol for enterprise environment
CN112087382B (en) Service routing method and device
CN113472646B (en) Data transmission method, node, network manager and system
WO2012075970A1 (en) Method, device and system for obtaining media content
JP2023547256A (en) Data download methods, devices, and computer equipment
CN109639502B (en) Return source control method and content distribution network
CN109120556B (en) A kind of method and system of cloud host access object storage server
CN112217735A (en) Information synchronization method and load balancing system
CN106909322B (en) Routing method and device for supporting storage disaster recovery in virtualization system
CN109413142A (en) A kind of iSCSI virtual protocol implementation method under Linux
US20200341968A1 (en) Differential Update of Local Cache from Central Database
EP3843342A1 (en) Communication method and related device
JP5464746B2 (en) Resource management apparatus, program and method for distributing and sharing database
KR20240050254A (en) Apparatus and method for transferring data in blockchain network
JP2010157225A (en) Message transmission/reception method of messaging network system
Rudish Design and Implementation of DPIPE, A P2P File Transfer Protocol for Large File Transfers in Datacenter Environments
Kassa Efficient cross-layer routing and congestion control architectures for distributed systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17864301

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17864301

Country of ref document: EP

Kind code of ref document: A1