Image distribution method, system and device

By distributing different shards of mirror files in peer-to-peer networks, the problem of low image file distribution efficiency in the prior art is solved, and more efficient image distribution and faster network bandwidth utilization are achieved.

CN115567547BActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210994948.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2025-04-25
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

In the prior art, the image file distribution efficiency is low, resulting in the need to deploy cloud game systems in multiple regions in cloud game application scenarios to meet the needs of low latency and high picture quality for users, and real-time update of game storage has become a problem.

Method used

By receiving query messages from the second peer node in a peer network, determining and sending different shards and hashes of the mirror file, and distributing them using multiple network channels, so that each second peer node interacts with other nodes to obtain the mirror file.

Benefits of technology

This method improves the efficiency of mirror distribution, reduces the transmission burden of the first peer node, improves the speed and efficiency of node downloads, improves the utilization rate of network bandwidth, and reduces the total time to distribute mirror files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115567547B_ABST
    Figure CN115567547B_ABST
Patent Text Reader

Abstract

The present application discloses a mirror distribution method, system and device. The method comprises: a first peer node receives N first query messages sent by N second peer nodes; the first peer node determines, based on the N first query messages, N different mirror slices included in the mirror file queried by sending the N first query messages to the N second peer nodes; the first peer node sends N mirror slices and N different hash values ​​corresponding to the N mirror slices to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the mirror file, the i-th network channel is a network channel for the first peer node and the i-th second peer node to transmit the i-th mirror slice and the hash value corresponding to the i-th mirror slice, N is a positive integer greater than or equal to 2, i=1,2,…,N. The method can improve the efficiency of mirror distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a mirror distribution method, system and device. Background Art

[0002] With the development of cloud technology, more and more application scenarios are based on cloud technology to achieve resource sharing within the network. For example, in the cloud game application scenario, it is necessary to provide users with a variety of games to play, and at the same time, it is necessary to meet the game needs of users in different regions. In order to meet the user's needs for low latency and high image quality, it is necessary to deploy cloud game systems in various places, including cloud game storage devices. Therefore, it is necessary to maintain game storage in multiple local areas at the same time, and the real-time update of game resources has become a problem.

[0003] In the traditional solution, Qcow2 images are mainly used to save game data. The above method mounts the game data into the cloud gaming system, and the Qcow2 images in each area are consistent. When sharing the game image file, the node storing the game image file first transfers the complete game image file to the child node of the node. After the child node obtains the complete game image file, the child node transfers the complete game image file to its child node until all communicating nodes in the network obtain the complete game image file, and then stops the process of sharing the game image file. In the above technology, there is a problem of low efficiency in image file distribution.

[0004] Therefore, there is an urgent need for an image distribution method, by which the efficiency of image distribution can be improved. Summary of the invention

[0005] The present application provides a method, system and device for image distribution, which can improve the efficiency of image distribution.

[0006] A first aspect of an embodiment of the present application provides an image distribution method, which is applied to a peer-to-peer network including a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application, N being a positive integer greater than or equal to 2, and comprising: the first peer node receives N first query messages sent by the N second peer nodes, and the N first query messages correspond one-to-one to the N second peer nodes; the first peer node determines, based on the N first query messages, N different image shards included in the image file queried by the N first query messages sent to the N second peer nodes; the first peer node sends the N image shards and N different hash values ​​corresponding to the N image shards to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the image file, wherein the i-th network channel is a network channel for the first peer node and the i-th second peer node to transmit the i-th image shard and the hash value corresponding to the i-th image shard, i=1,2,…,N.

[0007] A second aspect of an embodiment of the present application provides an image distribution method, which is applied to a peer-to-peer network including a control node and a first peer node managed by the control node and N second peer nodes, wherein the first peer node stores an image file associated with an application, and N is a positive integer greater than or equal to 2, comprising: the i-th second peer node determines the download order of N image fragments included in the image file according to a received download instruction sent by the control node, the download instruction is used to indicate the start of downloading the image file, the N second peer nodes all receive the download instruction, the N second peer nodes correspond to the N download orders one by one, and the N download orders are different, i=1,2,…,N; the i-th second peer node determines the download order of N image fragments included in the image file according to the i-th second peer node According to the i-th download order, determine to send a first query message to the first peer node, and send a second query message to other second peer nodes; the first query message is used to query the i-th mirror slice included in the mirror file, and the i-th mirror slice is the first mirror slice downloaded as indicated by the i-th download order; the second query message is used to query a mirror slice other than the i-th mirror slice included in the mirror file, and the mirror slice queried by the second query message is the j-th mirror slice downloaded as indicated by the i-th download order, j=2,3,…,N; the i-th second peer node sends the first query message to the first peer node, and sends the second query message to other second peer nodes, so as to obtain the mirror file.

[0008] The third aspect of the embodiment of the present application provides an image distribution device, which is applied to a peer-to-peer network including a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application, and N is a positive integer greater than or equal to 2, comprising: a transceiver unit, which is used to receive N first query messages sent by the N second peer nodes, and the N first query messages correspond one-to-one to the N second peer nodes; a processing unit, which is used to determine, based on the N first query messages, to send the N first query messages to the N second peer nodes The queried image file includes N different image slices; the transceiver unit is also used to send the N image slices and N different hash values ​​corresponding to the N image slices to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the image file, wherein the i-th network channel is the network channel for the first peer node and the i-th second peer node to transmit the i-th image slice and the hash value corresponding to the i-th image slice, i=1,2,…,N.

[0009] A fourth aspect of an embodiment of the present application provides an image distribution device, which is applied to a peer-to-peer network including a control node and a first peer node managed by the control node and N second peer nodes, wherein the first peer node stores an image file associated with an application, and N is a positive integer greater than or equal to 2, comprising: a processing unit, which is used to determine the download order of N image fragments included in the image file according to a download instruction received from the control node, the download instruction is used to indicate the start of downloading the image file, the N second peer nodes all receive the download instruction, the N second peer nodes correspond one-to-one to the N download orders, and the N download orders are different, i=1,2,…,N; the processing unit is also used to determine the download order of N image fragments included in the image file according to the i-th second peer node Corresponding to the i-th download order, determine to send a first query message to the first peer node, and send a second query message to other second peer nodes; the first query message is used to query the i-th mirror slice included in the mirror file, and the i-th mirror slice is the first mirror slice downloaded as indicated by the i-th download order; the second query message is used to query a mirror slice other than the i-th mirror slice included in the mirror file, and the mirror slice queried by the second query message is the j-th mirror slice downloaded as indicated by the i-th download order, j=2,3,…,N; a transceiver unit is used to send the first query message to the first peer node, and send the second query message to other second peer nodes, so as to obtain the mirror file.

[0010] The fifth aspect of the embodiment of the present application provides a mirror distribution device, which has the function of implementing the mirror distribution device described in the first aspect or any possible implementation of the first aspect, and the third aspect or any possible implementation of the third aspect. The function can be implemented based on hardware, or it can be implemented based on hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0011] In a possible implementation manner, the structure of the image distribution device includes a processor, and the processor is configured to support the image distribution device to execute corresponding functions in the above method.

[0012] The image distribution device may further include a memory, which is coupled to the processor and stores program instructions and data necessary for the image distribution device.

[0013] In another possible implementation, the image distribution device includes: a processor, a transmitter, a receiver, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the transmitter, the receiver, the random access memory, and the read-only memory through the bus. When the image distribution device needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system to guide the image distribution device into a normal operating state. After the image distribution device enters the normal operating state, the application program and the operating system are run in the random access memory, so that the processor executes the image distribution method in the first aspect or any possible implementation of the first aspect.

[0014] The sixth aspect of the embodiment of the present application provides a mirror distribution device, which has the function of implementing the mirror distribution device described in the second aspect or any possible implementation of the second aspect, and the fourth aspect or any possible implementation of the fourth aspect. The function can be implemented based on hardware, or it can be implemented based on hardware to execute corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0015] In a possible implementation manner, the structure of the image distribution device includes a processor, and the processor is configured to support the image distribution device to execute corresponding functions in the above method.

[0016] The image distribution device may further include a memory, which is coupled to the processor and stores program instructions and data necessary for the image distribution device.

[0017] In another possible implementation, the image distribution device includes: a processor, a transmitter, a receiver, a random access memory, a read-only memory, and a bus. The processor is respectively coupled to the transmitter, the receiver, the random access memory, and the read-only memory through the bus. When the image distribution device needs to be run, it is started by the basic input / output system solidified in the read-only memory or the bootloader boot system in the embedded system to guide the image distribution device into a normal operating state. After the image distribution device enters the normal operating state, the application program and the operating system are run in the random access memory, so that the processor executes the image distribution method in the second aspect or any possible implementation of the second aspect.

[0018] The seventh aspect of the embodiments of the present application further provides a computer-readable storage medium on which one or more computer instructions are stored, characterized in that the instructions are executed by a processor to implement the method described in any of the above technical solutions.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments disclosed in this application, nor are they intended to limit the scope of the disclosure of this application. Other features disclosed in this application will become easily understood through the following description.

[0020] The technical solution of the image distribution method provided in the embodiment of the present application is applied to a peer-to-peer network including a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application, N being a positive integer greater than or equal to 2, and comprising: the first peer node receives N first query messages sent by N second peer nodes, and the N first query messages correspond one-to-one to the N second peer nodes; the first peer node determines, based on the N first query messages, N different image shards included in the image file queried by the N first query messages sent to the N second peer nodes; the first peer node sends N image shards and N different hash values ​​corresponding to the N image shards to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the image file, wherein the i-th network channel is a network channel for the first peer node and the i-th second peer node to transmit the i-th image shard and the hash value corresponding to the i-th image shard, i=1,2,…,N. In the above-mentioned process of distributing the image file, the first peer node storing the image file associated with the application in the peer-to-peer network sends the N different image fragments included in the image file to the N second peer nodes in the peer-to-peer network that do not store the image file through N different network channels, and the N different network channels, the N second peer nodes and the N different image fragments correspond one to one. After that, the N second peer nodes in the peer-to-peer network that have N different image fragments interact to share the image fragments stored by each other. This method can reduce the transmission burden of the first peer node that has the complete image file and improve the efficiency of image distribution. When the N second peer nodes share the image fragments stored by each other, the second peer node that does not store the image file can distribute the image fragment to other second peer nodes in the network after receiving the image fragment without waiting to receive the complete image file, which can improve the network bandwidth utilization and reduce the total time consumed in distributing the image file in the network. At the same time, it is also conducive to improving the efficiency of image distribution. When distributing image files, image fragmentation is used as the minimum transmission granularity, which can also improve the flexibility of image distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0022] Figure 1 It is a schematic diagram of an application scenario applicable to the image distribution method provided in an embodiment of the present application.

[0023] Figure 2 It is a schematic diagram of the transmission process of a mirror distribution method provided by traditional technology.

[0024] Figure 3A It is a schematic diagram of a network architecture applicable to an embodiment of the present application.

[0025] Figure 3B It is a schematic diagram of another network architecture applicable to an embodiment of the present application.

[0026] Figure 4 It is a structural diagram of a control node 100 provided in an embodiment of the present application.

[0027] Figure 5 It is a structural diagram of a peer node 200 provided in an embodiment of the present application.

[0028] Figure 6 It is a schematic diagram of an image distribution method provided in an embodiment of the present application.

[0029] Figure 7 It is a schematic diagram of the relationship between the image file and the image layer provided in the embodiment of the present application.

[0030] Figure 8 It is a schematic diagram of the relationship between image layers and image shards provided in an embodiment of the present application.

[0031] Fig. 9A It is a schematic diagram of another image distribution method provided in an embodiment of the present application.

[0032] Fig. 9B It is a schematic diagram of another image distribution method provided in an embodiment of the present application.

[0033] Fig.10 It is a schematic diagram of a network bandwidth adjustment method provided in an embodiment of the present application.

[0034] Fig.11 It is a structural diagram of a mirror distribution device provided in an embodiment of the present application.

[0035] Fig.12 It is a structural diagram of a mirror distribution system provided in an embodiment of the present application.

[0036] Fig.13 It is a structural diagram of a mirror distribution device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described clearly and completely below in conjunction with the drawings in the embodiments of the present application. However, the present application can be implemented in many other ways different from the above description. Therefore, based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present application.

[0038] It should be noted that the terms "first", "second", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having" and their variants are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] To facilitate understanding, the technical terms that may be involved in the embodiments of the present application are first briefly introduced.

[0040] 1. Cloud technology

[0041] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0042] 2. Cloud gaming

[0043] Cloud gaming is a gaming method based on cloud computing. In the cloud gaming mode, all games are run on the server side, and the rendered game screen is compressed and transmitted to users through the network.

[0044] 3. Cloud Computer

[0045] Similar to cloud gaming, it is a gaming method based on cloud computing. The difference is that in this scenario, a completely open environment is provided to users, without restricting them to just playing games. Users can perform a series of operations such as video editing and machine learning through cloud computers.

[0046] 4. Peer-to-peer (P2P) network

[0047] Peer-to-peer network, also known as point-to-peer network or peer-to-peer computer network. Peer-to-peer network is a distributed application architecture that distributes tasks and workloads between peer nodes. It is a networking or network form formed by the peer computing model at the application layer. Specifically, in a peer-to-peer network, network participants share some of their hardware resources (for example, computing resources, storage resources, network connection resources, printer resources, etc.). These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediate entity. In other words, the participants in the peer-to-peer network are both providers of resources, services and content (servers), and acquirers of resources, services and content (clients).

[0048] 5. Mirror

[0049] An image is also called an image file. An image is a file storage format that can be considered a copy of the original file.

[0050] 6. Mirror layer

[0051] Images are usually stored in a layered structure, and the image structure corresponding to each layer is called an image layer.

[0052] 7. Mirror Sharding

[0053] Image sharding is a logical sharding for an image layer. That is, an image layer can be logically divided into multiple image shards. For example, if an image layer is 40 megabytes (MB), it can be logically divided into 10 image shards, and the size of each image shard is 4MB.

[0054] 8. Tree network

[0055] A tree network is a network topology in which all nodes are organized in a tree. The tree network includes root nodes and leaf nodes. In a tree network, data flows in one direction along the branches, that is, it can only flow from the root node to the leaf node, but not from the leaf node to the root node.

[0056] 9. Mesh Network

[0057] A mesh network is a network topology in which all nodes are interconnected irregularly without an absolute parent-child relationship, that is, node A can flow resources to node B, and node B can also flow resources to node A.

[0058] 10. File format of Qcow2 disk image file

[0059] Qcow2 is the file format for disk image files used by QEMU.

[0060] Below, in conjunction with the accompanying drawings, the application scenarios, network architecture, and image distribution methods applicable to the mirror distribution methods of the embodiments of the present application are described in detail. It is understood that, if there is no conflict between the embodiments provided in the present application, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step timing in the following method embodiments is only an example, not a strict limitation.

[0061] First, an application scenario of the image distribution method applicable to the embodiment of the present application is introduced with reference to the accompanying drawings.

[0062] Figure 1 Schematic diagram of an application scenario of the image distribution method provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes a network, multiple nodes i and multiple terminals i, i=1, 2, 3, 4. Among them, any two nodes among the multiple nodes i can communicate through the network to achieve data transmission, and the i-th node communicates with the i-th terminal to achieve data transmission. Optionally, the application scenario can also include a larger number of nodes (for example, 10, etc.), and the larger number of nodes communicate through the network to achieve data transmission. Optionally, any node i in the application scenario can also communicate with a larger number of terminals (for example, 2 or 3, etc.) to achieve data transmission. Among them, Figure 1 The network shown may be a wired network or a wireless network, which is not specifically limited in this application. Node i and terminal i may be connected via a wired manner or via a wireless manner (eg, Bluetooth or wireless communication technology (WIFI)), which is not specifically limited in this application.

[0063] Node i can be a server with storage capacity (for example, storing cloud game update image files) and computing capacity. Figure 1 In the application scenario shown, the application (for example, a game application) installed in terminal i can run in node i. That is, node i can perform the relevant calculation and processing operations for running the application. After node i runs the application, it will transmit the data generated by the application to terminal i, so that terminal i can obtain the data associated with the application. This method can effectively reduce the amount of calculation of terminal i. For example, in a cloud gaming scenario, the game application installed in terminal i can run on node i. After node i runs the game application, it can also render and compress the acquired application data. After that, node i can transmit the processed data to terminal i to meet the needs of terminal i. Node i can also send data to terminal i through the network. Figure 1Other nodes in the network send resources stored in node i (for example, image files generated by applications running in node i), or Figure 1 Other nodes in obtain resources stored in other nodes. Optionally, node i may have a memory and a processor. The processor of node i may be a central processing unit (CPU). Optionally, node i may also have one or more of a graphics processing unit (GPU), a neural network processing unit (NPU), or a field programmable gate array (FPGA), and the memory of node i may be a random access memory (RAM) or a solid-state drive (SSD) or other devices or memory instances with storage capabilities. A solid-state drive may also be referred to as a solid-state drive (SSD). The form of node i is not specifically limited. Node i may be hardware or software. When node i is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or it may be implemented as a single server. When node i is software, it may be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it may be implemented as a single software or software module. The embodiments of the present application do not specifically limit this.

[0064] Applications can be installed and run on terminal i, and the running results of the applications can be displayed. For example, a game application installed in terminal i can be run in node i. After node i runs the game application, it can render and compress the generated game data and send the processed data to terminal i. After receiving the data, terminal i can display the game data to the user through the display interface. There is no specific limitation on the form of terminal i. For example, terminal i can be, but is not limited to, a personal computer, a smart phone, a tablet computer, a desktop computer, or a wearable device (e.g., a smart watch).

[0065] Optionally, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including hypertext mark-up language (HTML), extensible markup language (XML), etc. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), and Internet protocol security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0066] It should be understood that the above Figure 1 The application scenarios shown are for illustration only and do not constitute any limitation on the application scenarios applicable to the mirror distribution method provided in the embodiments of the present application. Optionally, the above application scenarios may also include a greater number of nodes or terminals. Optionally, any node in the above application scenarios may also communicate with a greater number of terminals to achieve data transmission.

[0067] when Figure 1When the application scenario shown is a cloud game application scenario, multiple nodes in the cloud game application scenario can share a game update image file stored or generated by a node to achieve the purpose of sharing the game update image file. Exemplarily, node 1 stores a game update image file generated by running a game application, and node 1 communicates with node 2, node 3, and node 4, and transmits the game update image file stored in node 1 to node 2, node 3, and node 4 to achieve sharing of the game update image file. In practical applications, when the number of nodes that do not have resources in the network is large, node 1 with resources transmits the game update image file (for example, the game update image file includes 2 Qcow2 image files) to a large number of nodes that do not have resources, which not only increases the overhead of node 1 uploading files, but also causes node 1 to transmit the locally stored game update image file to node 2, node 3, and node 4 respectively. There is a high transmission delay. In some cases, in the process of transmitting the image file to node 2, node 3, and node 4 by node 1, there may be a phenomenon that the image file is attacked or tampered with, so that the image file received by node 2, node 3, and node 4 is incomplete.

[0068] In order to solve the problems existing in the above cloud game application scenarios, the traditional technology provides a method for distributing images. The traditional technology mainly uses Qcow2 images to save game data. This method mounts the game data to the cloud game system. The Qcow2 images stored in the nodes of each region are consistent, and the game images existing in the nodes of each region cannot be configured separately. Figure 2 FIG. 1 is a schematic diagram showing the transmission process of the mirror distribution method provided by the conventional technology. Figure 2 , Figure 2 The network architecture shown is a tree structure, which includes 7 nodes that can be Figure 1 The application scenario shown in FIG. 1 includes nodes. Figure 2 Node 1 in the example may be a node storing a cloud game update image file. Figure 2In the case of other nodes shown, node 1 will first transmit the image file and the hash value 1 corresponding to the image file to node 2 and node 3 respectively. After node 2 or node 3 receives the image file and hash value 1, it first performs a hash operation on the image file to obtain a hash value 2, and by comparing hash value 1 and hash value 2, it is determined that node 2 or node 3 has successfully received the image file. After that, node 2 or node 3 will send the image file and hash value 2 to their respective child nodes, and so on, until all nodes have received the image file, where the child nodes of node 2 are node 4 and node 5, and the child nodes of node 3 are node 6 and node 7. In this implementation, if a node finds that it has not received the complete image file, the node needs to send a request to the upstream node to retransmit the image file in order to regain the image file. Usually, the data volume of the image file is very large (for example, an image file of tens of gigabytes (Gigabyte, GB or G) to hundreds of GB). In the above implementation, it takes a long time (for example, usually tens of minutes) for the node to perform integrity check on the received image file, resulting in a high delay in the transmission of the image file. The above transmission of the image file is transmitted in a tree network. As the number of nodes in the network increases, the total transmission time of the image file will inevitably increase. When the image file is transmitted based on the tree network, it is executed in layers and serially. That is to say, the node of this layer must wait for the node of the upper layer to transmit the image file before the node of this layer can transmit the image file to its child node. In this way, there is a high transmission delay when the non-vertex node (node ​​other than node 1) in the tree network receives the image file. When a node (for example, node 2) in the above tree network fails during the transmission of the image file, it will also cause the failed child node to fail to successfully receive the image file.

[0069] Therefore, the embodiments of the present application provide a mirror distribution method, device and system to solve the above-mentioned problems.

[0070] Next, combine Figures 3A to 5 The following describes a network architecture to which the image distribution method provided in the embodiments of the present application is applicable.

[0071] Figure 3A Schematic diagram of a network architecture applicable to the embodiment of the present application. Figure 3A As shown, the network architecture includes a control node and multiple peer nodes. Figure 3AIn the example, the multiple peer nodes are respectively peer node 1, peer node 2 and peer node 3. Among them, any two nodes among all the nodes (i.e., the control node and multiple peer nodes) included in the network architecture can communicate with each other to realize data interaction. The network architecture can be understood as a P2P network architecture, and any two nodes in the architecture can communicate and interact with data based on the P2P network communication protocol. For example, the P2P network communication protocol can be a P2P network communication protocol based on TCP / UDP. Optionally, the network architecture can also include a larger number of peer nodes, which is not specifically limited in the present application. When the network architecture includes a larger number of peer nodes, any two nodes in the network architecture can communicate with each other to realize data interaction. Exemplarily, Figure 3B Another network architecture applicable to an embodiment of the present application is shown, the network architecture includes 5 peer nodes and 1 control node, and any two nodes included in the network architecture can communicate to achieve data transmission.

[0072] A control node is used to manage multiple peer nodes in the network architecture. Figure 4 FIG. 1 is a schematic diagram showing a structure of a control node 100 provided in an embodiment of the present application. It can be understood that the control node 100 can be Figure 3A The control node in the network architecture shown is Figure 3A The control node in Figure 4 The control node 100 in has the same or similar functions. Figure 4 The control node 100 includes the following functional modules: service registration and discovery 210, network topology center 220, network service (web server), and dynamic control center 240. Among them, service registration and discovery 210 is used to ensure Figure 3A The network topology center 220 is used to Figure 3A The network status obtained from the multiple peer nodes shown in FIG. 2 is used to construct a P2P network including the multiple peer nodes. The network server 230 is used to provide network services. The dynamic control center 240 is used to Figure 3A The network status information obtained at the peer node shown is used to adjust the bandwidth of a network channel (eg, network channel 1 or network channel 2) in the network to ensure that the peer nodes included in the P2P network are in a normal working state.

[0073] The peer node is used to send the network resources (e.g., image file resources) stored by the peer node to other peer nodes in the network according to the instructions sent by the control node. The peer node can also receive network resources sent by other peer nodes in the network. The peer node can also send the network status obtained by the peer node to the control node. Exemplary, Figure 5 FIG. 2 is a schematic diagram showing a structure of a peer node 200 provided in an embodiment of the present application. It can be understood that the peer node 200 can be Figure 3A Any peer node in the network architecture shown, i.e. Figure 3A Any peer node in Figure 5 The peer nodes 200 in have the same or similar functions. Figure 5 , the peer node 200 includes the following functional modules: an image shard transmitter 210, a network analysis model 220, a dynamic control client 230, and a file storage server 240. Among them, the image shard transmitter 210 is used to transmit the image shards stored in the file storage service 240 to other peer nodes in the network except the peer node 200. The network analysis module 220 is used to perform speed measurement between nodes, and maintain the network status of other peer nodes that the peer node 100 communicates with the peer node 100. For example, the network analysis module 220 can perform speed measurement between nodes based on raw-socket technology. The dynamic control client 230 is responsible for analyzing the channel traffic status of the peer node 200 transmitting data, and reporting the network status obtained in combination with the network analysis module 220 to the dynamic control center 140 in the control node 100.

[0074] In this application Figure 3A The forms of the control node and multiple peer nodes shown are not specifically limited. For example, the control node and multiple peer nodes can be servers. The server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules for providing distributed services), or it can be implemented as a single software or software module. The embodiments of the present application do not specifically limit this.

[0075] It should be noted that Figure 3AThe control node shown in the figure is a network node independent of peer node 1, peer node 2 and peer node 3. It can be understood that in this implementation, the network architecture applicable to the embodiment of the present application may include at least four nodes, namely, the control node, peer node 1, peer node 2 and peer node 3. Optionally, in other implementations, the control node may also be any one of peer node 1, peer node 2 or peer node 3, and in this case, any one of the peer nodes also has Figure 3A It is understood that in this implementation, the network architecture applicable to the embodiment of the present application may include at least three nodes, namely peer node 1, peer node 2 and peer node 3, and one of the three peer nodes also has Figure 3A Shows the functionality of the control node.

[0076] It should be understood that the above Figures 3A to 5 This is for illustration only and does not constitute any limitation on the network architecture to which the image distribution method provided in the embodiment of the present application is applicable. Figure 3A The network architecture shown may also include a greater number of peer nodes and a greater number of network channels.

[0077] The following, combined Figure 6 FIG9 to FIG9 introduces the image distribution method provided by the embodiment of the present application.

[0078] Figure 6 is a schematic diagram of a mirror distribution method provided in an embodiment of the present application. The mirror distribution method provided in an embodiment of the present application can be applied to a peer-to-peer network including a control node and a first peer node managed by the control node and N second peer nodes, where N is a positive integer greater than or equal to 2. Exemplary, Figure 6 The control node shown may be the control node shown in FIG. 3 above. Figure 6 The first peer node and the N second peer nodes shown may be the multiple peer nodes shown in FIG. 3 above. Figure 6 As shown, the mirror distribution method provided in the embodiment of the present application includes S601 to S606. Before introducing S601 to S606, the control node, the first peer node and N second peer nodes involved in the implementation of the present application are first introduced in detail.

[0079] In an embodiment of the present application, a control node in a peer-to-peer network is used to manage a first peer node and N second peer nodes. For example, the control node is used to manage the network bandwidth of the first peer node and the N second peer nodes, the network topology between the first peer node and the N second peer nodes, etc. In some embodiments, the control node is any one of the following peer nodes: a first peer node, or N second peer nodes. It can be understood that when the control node is a first peer node or a second peer node among the N second peer nodes, the first peer node or the second peer node also has the function of a control node. In other embodiments, the control node can also be a node independent of the first peer node and the N second peer nodes, in which case the first peer node or any one of the N second peer nodes may not have the function of a control node. It can be understood that any two nodes in the peer-to-peer network transmit data through different network channels, and any two nodes are any two of the following nodes: a control node, a first peer node, and N second peer nodes. Exemplarily, with Figure 3A Take as an example, when the control node is Figure 3A In the control node shown, when the first peer node is peer node 1, and the multiple second peer nodes are respectively peer node 2 and peer node 3, the control node and peer node 1 communicate with each other through network channel 5, the control node and peer node 2 communicate with each other through network channel 4, the control node and peer node 3 communicate with each other through network channel 6, peer node 1 and peer node 3 communicate with each other through network channel 3, peer node 1 and peer node 2 communicate with each other through network channel 1, and peer node 2 and peer node 3 communicate with each other through network channel 2. Any two network channels among the above network channels 1 to 6 are not the same.

[0080] In an embodiment of the present application, the first peer node stores an image file associated with an application. That is, the first peer node is a node in the peer network that owns the image file. The image file includes N different image shards, where N is a positive integer greater than or equal to 2. That is, the image file includes at least two different image shards. N different image shards, i.e., the identifiers of the N image shards are different, but the information associated with the application carried by the N different image shards may be the same or different. It is understandable that the identifier of a mirror shard can be used to uniquely identify the one mirror shard. In some implementations, when the image file is stored in an image layered structure, the one image file may include at least one image layer, and the at least one image layer may include the N different image shards. Exemplarily, Figure 7 A schematic diagram showing the relationship between image files and image layers, Figure 7An image file can be divided into P image layers, where P is a positive integer greater than or equal to 1. Figure 8 The figure shows the relationship between the image layer and the image shard. Figure 8 The middle image layer P can be divided into m image slices, where m is a positive integer greater than or equal to 2. The type of the application is not specifically limited. In some implementations, the application is a cloud gaming application, and the image file associated with the application is an updated image file generated by the cloud gaming application. In other implementations, the application may also be a video application, and the image file associated with the application is an image file generated by the video application.

[0081] In the embodiment of the present application, the N second peer nodes are N peer nodes in the peer-to-peer network that do not store the image file associated with the application. That is, before the image distribution method provided by the present application is executed, each second peer node included in the peer-to-peer network does not have at least one image shard included in the image file.

[0082] Next, S601 to S606 are described in detail.

[0083] S601: The control node sends a download instruction to N second peer nodes, where the download instruction is used to instruct to start downloading an image file, and N is a positive integer greater than or equal to 2.

[0084] Optionally, the download instruction may carry an identifier of the image file, and the identifier of the image file is used to uniquely identify the image file. After the control node executes the above S601, the N second peer nodes all receive the download instruction. Each second peer node can determine the image file to be downloaded based on the identifier of the image file included in the download instruction.

[0085] Optionally, in some embodiments, before the above S601, the control node may further perform the following steps: receiving a request sent by a user terminal, the request indicating that N second peer nodes in the peer-to-peer network need to obtain an image file. Optionally, the N second peer nodes may provide network services for the user terminal (e.g., data stored locally by the N second peer nodes). The type of user terminal is not specifically limited. For example, the user terminal may be, but is limited to, any of the following: a smart phone, a tablet computer, a desktop computer, or a wearable smart device (e.g., a smart watch), etc.

[0086] The above S601 is executed, that is, the control node sends an instruction to start downloading the image file associated with the application to the N second peer nodes.

[0087] S602: The i-th second peer node determines the downloading order of N image fragments included in the image file according to the received download instruction sent by the control node, where i=1, 2, ..., N.

[0088] Execute the above S602, that is, each second peer node among the N second peer nodes (that is, the i-th second peer node) will determine the download order of the N image fragments included in the image file downloaded by each second peer node, the N second peer nodes correspond one-to-one to the N download orders, and the N download orders are different.

[0089] In some implementations, the N downloading orders are different, which can be understood as any two downloading orders in the N downloading orders are completely different. Exemplarily, when the image file includes two image fragments (i.e., image fragment 1 and image fragment 2), when the N second peer nodes include two second peer nodes, the downloading order determined by one of the second peer nodes may be to first download image fragment 1 and then download image fragment 2; the downloading order determined by the other second peer node may be to first download image fragment 2 and then download image fragment 1. In this implementation, the downloading orders corresponding to the two second peer nodes are completely different.

[0090] In other implementations, the N downloading orders are different, which can be understood as any two downloading orders in the N downloading orders are not completely the same. Among them, any two downloading orders are not completely the same, which means that the first downloaded image fragments indicated by any two downloading orders are different, and the downloading order of other image fragments indicated by any two downloading orders except the first downloaded image fragment is not specifically limited. Exemplarily, when the image file includes 3 image fragments (i.e., image fragment 1, image fragment 2 and image fragment 3), when the N second peer nodes include 2 second peer nodes, the order of downloading image fragments determined by one second peer node is: image fragment 1, image fragment 2 and image fragment 3; the order of downloading image fragments determined by another second peer node is: image fragment 3, image fragment 2 and image fragment 1; or the order of downloading image fragments determined by another second peer node is: image fragment 2, image fragment 1 and image fragment 3. In this implementation, the downloading orders corresponding to the two second peer nodes are not completely the same.

[0091] S603: The i-th second peer node determines to send a first query message to the first peer node and to send a second query message to other second peer nodes according to the i-th download order corresponding to the i-th second peer node.

[0092] The first query message is used to query the i-th image slice included in the image file, and the i-th image slice is the first image slice downloaded as indicated by the i-th download sequence. In some implementations, when the first image slice downloaded as indicated by the download sequence corresponding to each of the N second peer nodes is different, the above S603 is performed, that is, the query message sent by each second peer node to the first peer node queries for different image slices.

[0093] The second query message is used to query an image slice other than the i-th image slice included in the image file, and the image slice queried by the second query message is the j-th image slice downloaded as indicated by the i-th download order, j=2, 3, ..., N. It can be understood that, when N is a positive integer greater than or equal to 3, if the second query message is the first second query message sent by the i-th second peer node, then j=2; if the second query message is the second second query message sent by the i-th second peer node, then j=3; and so on. Exemplarily, when the image file includes 3 image slices (i.e., image slice 1, image slice 2, and image slice 3), when the N second peer nodes include 2 second peer nodes, the order of downloading the image slices determined by one of the second peer nodes is: image slice 1, image slice 2, and image slice 3; the order of downloading the image slices determined by the other second peer node is: image slice 3, image slice 2, and image slice 1. In this implementation, the first query message sent by the one second peer node is used to query mirror slice 1. The first query message sent by the other second peer node is used to query mirror slice 2. The first second query message sent by the one second peer node is used to query mirror slice 2, and the second second query message sent by the one second peer node is used to query mirror slice 3. The first second query message sent by the other second peer node is used to query mirror slice 2, and the second second query message sent by the other second peer node is used to query mirror slice 1.

[0094] The other second peer nodes refer to N-1 second peer nodes except the ith second peer node among the N second peer nodes.

[0095] S604: The i-th second peer node sends a first query message to the first peer node, and sends a second query message to other second peer nodes to obtain a mirror file.

[0096] In some implementations, the i-th second peer node sends a first query message to the first peer node, and sends a second query message to other second peer nodes to obtain a mirror file, including the following steps: the i-th second peer node sends a first query message to the first peer node; the i-th second peer node receives the i-th mirror slice and the hash value corresponding to the i-th mirror slice sent by the first peer node, and the hash value corresponding to each mirror slice is different; when it is determined that the received i-th mirror slice passes the integrity check, the i-th second peer node saves the i-th mirror slice and sends a second query message to other second peer nodes; the i-th second peer node receives the mirror slice queried by the second query message sent by other second peer nodes and the hash value corresponding to the queried mirror slice, and the number of mirror slices sent by other second peer nodes does not exceed a preset threshold; when it is determined that the mirror slice queried by the received second query message passes the integrity check, the i-th second peer node saves the mirror slice queried by the second query message. It can be understood that after executing the above steps, the i-th second peer node can obtain all the image fragments (i.e., N image fragments) included in the image file sent by the first peer node and other second peer nodes. In this implementation, the N second peer nodes with N different image fragments in the peer-to-peer network can interact with each other to share the image fragments stored by each other, which can reduce the transmission burden of the first peer node with the complete image file and improve the speed and efficiency of node downloading. In this implementation, each second peer node does not need to wait for receiving the complete image file before sending the image file to other second peer nodes that do not store the image file, which can improve the efficiency of image distribution.

[0097] Optionally, in some other implementations, the i-th second peer node may also send a second query message to the first peer node. In this implementation, it is possible that the number of mirror shards being uploaded by the first peer node exceeds a preset threshold. Even if the first peer node receives the second query message and the first peer node locally stores the mirror shard queried by the second query message, the first peer node will not send the mirror shard queried by the second query message to the i-th second peer node. In other words, in this implementation, after the first peer node receives the second query message, the query result of the second query message sent to the i-th second peer node is a failure, and the query result does not include the mirror shard queried by the second query message.

[0098] In the above implementation, the mirror slice queried by the second query message is the jth mirror slice downloaded as indicated by the i-th download order, j=2, 3,…, N. That is, the i-th second peer node will send N-1 second query messages to obtain N-1 different mirror slices queried by the N-1 second query messages. Optionally, in some implementations, after the i-th second peer node determines that a currently received mirror slice passes the integrity check, the i-th second peer node may continue to send new query messages. In other words, when the i-th second peer node determines that a currently received mirror slice does not pass the integrity check, the i-th second peer node will retransmit the message to request to reacquire the complete mirror slice. The i-th second peer node sends the second query message to other second peer nodes, and may send the second query message to all the N-1 second peer nodes at the same time. Based on this, in some possible implementations, the i-th second peer node sends a second query message to other second peer nodes, including: the i-th second peer node sends the first second query message to all second peer nodes among N second peer nodes except the i-th second peer node, and the mirror slice queried by the first second query message is the second mirror slice (j=2) downloaded as indicated by the i-th download order; when the i-th second peer node determines that the mirror slice queried by the first second query message is successfully received, the i-th second peer node sends the second second query message to all second peer nodes among N second peer nodes except the i-th second peer node, and the mirror slice queried by the second second query message is the third mirror slice (j=3) downloaded as indicated by the i-th download order,..., and so on, until the i-th second peer node obtains the mirror slice queried by the N-1-th query message, and the i-th second peer node stops sending the second query message.

[0099] Optionally, in the above implementation, each second peer node that receives the mirror slice can also perform an integrity check on the received mirror slice to confirm whether the mirror slice received by each second peer node is complete or tampered with. Based on this, the mirror distribution method provided in the embodiment of the present application can also include the following steps: the i-th second peer node performs an integrity check on the received mirror slice, and the mirror slice received by the i-th second peer node includes the i-th mirror slice and the mirror slice queried by the second query message; if it is determined that the received i-th mirror slice does not pass the integrity check, the i-th second peer node sends a first retransmission message to the first peer node, and the first retransmission message is used to instruct the first peer node to send the i-th mirror slice; if it is determined that the mirror slice queried by the received second query message does not pass the integrity check, the i-th second peer node sends a second retransmission message to other second peer nodes, and the second retransmission message is used to instruct other second peer nodes to send the mirror slice queried by the second query message.

[0100] Optionally, in some implementations, the i-th second peer node performs an integrity check on each mirror slice received and the hash value corresponding to each mirror slice, including: the i-th second peer node performs a hash calculation on each mirror slice received to obtain a hash calculated value; the i-th second peer node determines whether each mirror slice passes the integrity check by comparing the hash calculated value with the hash value corresponding to each mirror slice; wherein, if the hash calculated value is the same as the hash value corresponding to each mirror slice, it is determined that each mirror slice passes the integrity check; if the hash calculated value is different from the hash value corresponding to each mirror slice, it is determined that each mirror slice fails the integrity check. The type of hash algorithm used for the hash calculation is not specifically limited. For example, the hash algorithm may be, but is not limited to, a hash algorithm or a message digest algorithm.

[0101] Optionally, in some scenarios, the other second peer nodes in the above implementation do not locally store the mirror shard queried by the second query message. In this way, even after the other second peer nodes receive the second query message, they cannot send the mirror shard queried by the second query message and the corresponding hash value to the i-th second peer node. In this implementation, the query result of the second query message sent by the other second peer nodes to the i-th second peer node is failure. Based on this, that is, if the i-th second peer node in the above implementation does not receive the mirror shard queried by the second query message sent by the other second peer nodes and the hash value corresponding to the queried mirror shard, the mirror distribution method provided in the embodiment of the present application may also include the following steps: the i-th second peer node sends a second query message to the first peer node; the i-th second peer node receives the mirror shard queried by the second query message sent by the first peer node and the hash value corresponding to the queried mirror shard. Exemplarily, when the image file includes three image slices (i.e., image slice 1, image slice 2, and image slice 3), and the N second peer nodes include two second peer nodes, the order of downloading the image slices determined by one of the second peer nodes is: image slice 1, image slice 2, and image slice 3; the order of downloading the image slices determined by the other second peer node is: image slice 3, image slice 2, and image slice 1. In this scenario, if the one second peer node and the other second peer node simultaneously download the second image slice (i.e., image slice 2) indicated by the corresponding download order, the other second peer node and the one second peer node send query messages to query image slice 2 to each other. Since the two second peer nodes do not store image slice 2 locally, the two second peer nodes cannot obtain image slice 2 by interacting with each other. Thereafter, the one second peer node and the other second peer node can send query messages to query image slice 2 to the first peer node. Alternatively, the one second peer node may send a query message for querying mirror shard 2 to the first peer node to save the obtained mirror shard 2 locally; the other second peer node then sends a message for querying mirror shard 2 to the one second peer node to obtain the mirror shard 2.

[0102] S605: The first peer node determines, based on the N first query messages, to send N different image slices included in the image file queried by the N first query messages to N second peer nodes.

[0103] S606, the first peer node sends N mirror slices and N different hash values ​​corresponding to the N mirror slices to N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the mirror file.

[0104] There is no specific limitation on the manner in which the first peer node sends the mirror shard and the hash value corresponding to the mirror shard. For example, the first peer node may encapsulate the mirror shard and the hash value corresponding to the mirror shard in the same data packet, and send the encapsulated data packet to the corresponding second peer node. The second peer node can obtain the mirror shard and the hash value corresponding to the mirror shard after parsing the received data packet. For another example, the first peer node may encapsulate the mirror shard and the hash value corresponding to the mirror shard in two different data packets, and send the two encapsulated data packets to the corresponding second peer node at the same time.

[0105] In the embodiment of the present application, the i-th second peer node interacts with other second peer nodes to obtain the mirror file, including: the i-th second peer node sends a first query message to the first peer node, and sends a second query message to other second peer nodes to obtain the mirror file. The process of this implementation method is described in detail in S604 above, and the content not described in detail here can refer to the relevant description in S604 above.

[0106] After executing the above-mentioned S606 "the first peer node sends N mirror fragments and N different hash values ​​corresponding to the N mirror fragments to N second peer nodes through N network channels", each second peer node of the N second peer nodes that do not store the mirror file included in the peer-to-peer network can successfully obtain a mirror fragment included in the mirror file, and the mirror fragments obtained by each second peer node are different. Based on this, the N second peer nodes in the peer-to-peer network can interact with each other to obtain the mirror fragments stored by each other, which can reduce the transmission burden of the first peer node that owns the complete image file 1, and improve the speed and efficiency of node downloading. In addition, when the N second peer nodes share the mirror fragments owned by each other, each second peer node uploads its own stored mirror fragments to other second peer nodes while downloading the mirror fragments stored by other second peer nodes, which can improve the transmission efficiency of the mirror fragments.

[0107] Optionally, after executing the above S601 to S606, the i-th second peer node in the peer-to-peer network can receive the N image slices included in the image file. In order to verify whether the i-th second peer node has successfully received the complete image file, integrity verification can be further performed on all the image slices received by the i-th second peer node to determine whether the i-th second peer node has successfully received the image file. In some implementations, the above-mentioned integrity verification can be performed in the following manner: the i-th second peer node hashes all received image shards to obtain hash value #2, and sends hash value #2 to the control node; the first peer node hashes the image file to obtain hash value #3, and sends hash value #3 to the control node; the control node compares the received hash value #2 and hash value #3 to obtain verification information, and the verification information is used to indicate whether the i-th second peer node has successfully received the complete image file; wherein, if hash value #2 and hash value #3 are the same, the verification information is used to indicate that the i-th second peer node has successfully received the complete image file; or, if hash value #2 and hash value #3 are different, the verification information is used to indicate that the i-th second peer node has not successfully received the complete image file. In some other implementations, the above-mentioned integrity verification can be implemented in the following manner: the i-th second peer node performs hash processing on all received image fragments to obtain hash value #2; the first peer node performs hash processing on the image file to obtain hash value #3, and sends hash value #3 to the i-th second peer node; the i-th second peer node compares hash value #2 and hash value #3 to obtain verification information, and the verification information is used to indicate whether the i-th second peer node has successfully received the complete image file; wherein, if hash value #2 and hash value #3 are the same, the verification information is used to indicate that the i-th second peer node has successfully received the complete image file; or, if hash value #2 and hash value #3 are not the same, the verification information is used to indicate that the i-th second peer node has not successfully received the complete image file. In this implementation, the i-th second peer node can also send a retransmission message to obtain at least one image fragment included in the image file that is not owned.

[0108] Optionally, in the process described by the mirror distribution method shown above, the peer nodes in the P2P network can also communicate with other peer nodes to obtain the current network status of the other peer nodes. The network status of a peer node can include the speed at which the peer node uploads data to other peer nodes, and the speed at which the peer node downloads data from other peer nodes. In the P2P network, if any peer node finds that the speed at which the any peer node uploads data to other peer nodes does not meet the preset upload speed, or the speed at which the any peer node downloads data from other peer nodes does not meet the preset download speed, then the any peer node can also send the acquired network status information to the control node, so that the control node reallocates the network bandwidth of the peer nodes in the P2P network according to the network status information, thereby solving the problem that the upload speed or download speed of any peer node does not meet the preset speed, which is conducive to ensuring that the network is in a stable working state. Based on this, the mirror distribution method provided in the embodiment of the present application may also include the following steps: the i-th second peer node sends N detection messages to the first peer node and other second peer nodes to obtain network qualities corresponding to N network channels, the N second peer nodes correspond one-to-one to the N detection messages, the network quality corresponding to the i-th network channel does not meet the preset requirements, the i-th network channel is a network channel for data transmission between the i-th second peer node and the first peer node, or a network channel for data transmission between the i-th second peer node and one of the other second peer nodes; the i-th second peer node sends the network qualities corresponding to the N network channels to the control node, so that the control node adjusts the bandwidth values ​​corresponding to the network channels in the N network channels except the i-th network channel according to the network qualities corresponding to the N network channels. Exemplarily, the following Fig.10 This is a network bandwidth adjustment method provided in an embodiment of the present application. For details not described in detail here, please refer to the following Fig.10 Related description in .

[0109] It should be understood that the above Figure 6 The image distribution method shown is for illustration only and does not constitute any limitation to the image distribution method provided in the embodiment of the present application.

[0110] In an embodiment of the present application, a first peer node storing an image file in a peer-to-peer network sends the image slices included in the image file to a second peer node in the peer-to-peer network that does not store the image file through different network channels, and the image slices received by each second peer node are different. After receiving the image slices included in the image file, the second peer node that does not store the image file in the peer-to-peer network can serve as a resource node in the peer-to-peer network and provide an upload function to other second peer nodes that do not store the image slices in the peer-to-peer network. In the above implementation process, after receiving the image slices included in the image file, the second peer node that does not store the image file can distribute the image slices included in the image file to other second peer nodes in the network without waiting to receive the complete image file, which can improve the network bandwidth utilization rate and reduce the total time consumed in distributing the image file in the network, and can achieve the purpose of quickly distributing the image file in the network. In the above image distribution process, by performing integrity check on the image slices associated with the image file received by the peer node, it is determined whether the second peer node that does not store the image file in the network has successfully received the image file. When distributing image files in the network, the image fragment is used as the minimum transmission granularity, which can improve the flexibility of image distribution. In the scenario where the image fragment transmission fails, only the abnormal image fragment needs to be retransmitted, avoiding the problem of retransmitting the entire image file in the prior art, which is conducive to reducing the retransmission rate.

[0111] Below, the above text Figure 3A The network architecture shown is an example, combined with Fig. 9A and Fig. 9B Another image distribution method provided by this application is introduced. Figure 3A The network architecture shown is called a P2P network. It is understood that Fig. 9A and Fig. 9B The image distribution method described is as above Figure 6 A specific example of the described image distribution method, Fig. 9A and Fig. 9B The described method is for illustration only and does not constitute any limitation on the image distribution method provided in the embodiment of the present application. Fig. 9A and Fig. 9B With the above Figure 6 The peer-to-peer network in the method includes a control node, a peer node 1, a peer node 2 and a peer node 3. Figure 6 The application scenario in the example is a cloud gaming scenario, and a peer node 1 stores a game update image file 1 to be shared. The peer node 1 can be understood as the above Figure 6 The first peer node, peer node 2 and peer node 3 shown in the figure can be understood as the above-mentioned Figure 6 N second peer nodes are shown, N=2.

[0112] Fig. 9A It is a schematic diagram of another mirror distribution method provided in an embodiment of the present application. It should be understood that Fig. 9A The examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Fig. 9A It is obvious that various equivalent modifications or changes can be made, and such modifications and changes also fall within the scope of the embodiments of the present application. Fig. 9A As shown, the method includes S901 to S911. S901 to S911 are described in detail below.

[0113] S901, the control node obtains request 1.

[0114] The control node is a node in the peer-to-peer network used to manage peer node 1, peer node 2, and peer node 3. In the embodiment of the present application, the control node may be a node independent of peer node 1, peer node 2, and peer node 3.

[0115] Request 1 is used to request to obtain image file 1 generated by running application 1. Application 1 can be a cloud gaming application, and image file 1 can be a game update image file, and the specific type of application 1 is not limited. Image file 1 can include 1 image layer, and the 1 image layer includes image fragment 1 and image fragment 2, that is, image file 1 includes image fragment 1 and image fragment 2, and the identifier of image fragment 1 is different from the identifier of image fragment 2. The identifier of image fragment 1 is different from the identifier of image fragment 2, which means that image fragment 1 and image fragment 2 are two different image fragments included in image file 1. Exemplarily, Figure 7 A schematic diagram showing the relationship between image files and image layers, Figure 7 An image file can be divided into P image layers, where P is a positive integer greater than or equal to 1. Figure 8 A schematic diagram showing the relationship between image layers and image shards, Figure 8 The image layer P can be divided into m image slices, where m is a positive integer greater than or equal to 2, and image slice 1 and image slice 2 are two different image slices included in the image N. There is no specific limitation on the presentation form of the identification of the image slices in the image file. For example, the identification of the image slice m is (T1, T2), where T1 identifies the image layer P where the image slice m is located, and T2 identifies the specific position of the image slice m in the image layer P.

[0116] In actual applications, the control node may actively obtain the request 1 from the user terminal, or the user terminal may actively send the request 1 to the control node, and this application does not make any specific limitation on this.

[0117] It can be understood that all the image fragments included in the image file 1 in the embodiment of the present application are stored in the following order: image fragment 1, image fragment 2.

[0118] S902, the control node sends instruction 1 to peer node 2 and peer node 3 respectively, where instruction 1 is used to instruct to download the image file requested by request 1. Accordingly, peer node 2 and peer node 3 receive instruction 1 respectively.

[0119] In the above S901 , request 1 is used to request to obtain image file 1 . Based on this, instruction 1 is specifically used to instruct to start downloading image file 1 requested by request 1 .

[0120] S903: Peer node 2 determines, according to instruction 1, that all image fragments included in the image file requested by request 1 need to be downloaded in a first downloading order.

[0121] The first downloading sequence is the sequence of downloading all the image fragments included in the image file 1. The first downloading sequence is to download the image fragment 1 first, and then download the image fragment 2.

[0122] Among them, peer node 2 determines according to instruction 1 that all image fragments included in the image file requested by request 1 need to be downloaded in the first download order, including: peer node 2 determines according to instruction 1 that image file 1 including image fragment 1 and image fragment 2 needs to be downloaded; peer node 2 randomly sorts the order of the image fragments included in image file 1 to obtain the first download order.

[0123] S904: Peer node 3 determines, according to instruction 1, that all image fragments included in the image file requested by request 1 need to be downloaded in a second download order.

[0124] The second downloading sequence is the order of downloading all the image fragments included in the image file 1, and the second downloading sequence is different from the first downloading sequence. The second downloading sequence is to download the image fragment 2 first, and then download the image fragment 1.

[0125] Among them, the peer node 3 determines according to instruction 1 that all image fragments included in the image file requested by request 1 need to be downloaded in the second download order, including: the peer node 3 determines according to instruction 1 that the image file 1 including image fragment 1 and image fragment 2 needs to be downloaded; the peer node 3 randomly sorts the order of the image fragments included in the image file 1 to obtain the second download order.

[0126] S905 , peer node 2 sends a query message 1 to a node in the P2P network to query mirror shard 1 .

[0127] The query message 1 is associated with the first downloading sequence. Specifically, the query message 1 is used to query the first image fragment to be downloaded in the order of downloading image fragments indicated by the first downloading sequence, that is, the query message 1 is used to query image fragment 1.

[0128] Among them, peer node 2 sends query message 1 to nodes in the network, including: peer node 2 determines according to instruction 1 that peer node 2 does not locally store all image fragments included in image file 1; peer node 2 generates query message 1 according to the first download order.

[0129] S906, peer node 3 sends query message 2 to nodes in the network to query mirror shard 2.

[0130] The query message 2 is associated with the second downloading sequence. Specifically, the query message 2 is used to query the second image fragment to be downloaded in the order of downloading image fragments indicated by the first downloading sequence, that is, the query message 2 is used to query image fragment 2.

[0131] Among them, peer node 3 sends query message 2 to nodes in the network, including: peer node 3 determines according to instruction 1 that peer node 3 does not locally store all image fragments included in image file 1; peer node 3 generates query message 2 according to the second download order.

[0132] S907, peer node 1 determines that mirror slice 1 is stored locally according to query message 1; and determines that mirror slice 2 is stored locally according to query message 2.

[0133] The peer node 1 determines that the mirror slice 1 is stored locally according to the query message 1, including: the peer node 1 queries the locally stored mirror slice according to the identifier of the mirror slice 1 carried in the query message 1, and determines that the mirror slice 1 is stored locally.

[0134] The peer node 1 determines that the mirror slice 2 is stored locally according to the query message 2, including: the peer node 1 queries the locally stored mirror slice according to the identifier of the mirror slice 2 carried in the query message 2, and determines that the mirror slice 2 is stored locally.

[0135] S908 , in response to condition 1 being met, peer node 1 sends mirror shard 1 and hash value 1 to peer node 2 through network channel 1 .

[0136] Satisfying condition 1 includes: satisfying that the number of image fragments uploaded by peer node 1 does not exceed the preset upload number. The preset upload data volume is not specifically limited, and the preset upload number can be determined according to the current network status of peer node 1. That is, when the current network status of peer node 1 is relatively good, the preset upload number can be relatively large; when the current network status of peer node 1 is not very good, the preset upload number can be relatively small. For example, the preset upload number can be, but is not limited to, equal to 1 or 2.

[0137] Network channel 1 is a network channel for data transmission between peer node 1 and peer node 2.

[0138] Optionally, before S908, peer node 1 may also perform hash calculation on image shard 1 to obtain hash value 1, and hash value 1 is used to implement integrity verification of image shard 1. The type of hash algorithm is not specifically limited. For example, the hash algorithm may be, but is not limited to, a hash algorithm or a message digest algorithm.

[0139] There is no limitation on the form in which peer node 1 sends image shard 1 and hash value 1 to peer node 2 through network channel 1. For example, peer node 1 may encapsulate image shard 1 and hash value 1 in one data packet, and then send the encapsulated data packet to peer node 2. For another example, peer node 1 may also encapsulate image shard 1 and hash value 1 in two data packets respectively, and then send the two encapsulated data packets to peer node 2 together.

[0140] S909 , in response to satisfying condition 1 , peer node 1 sends mirror shard 2 and hash value 2 to peer node 3 through network channel 3 .

[0141] The condition 1 satisfied in S909 is the same as the condition 1 satisfied in S908. When the condition 1 satisfied in S908 includes: the number of mirror fragments uploaded by the peer node 1 does not exceed 1 mirror fragment, the peer node 1 may first execute S908 and then execute S909, or the peer node 1 may first execute S909 and then execute S908.

[0142] Network channel 3 is a network channel for data transmission between peer node 1 and peer node 3, and network channel 3 is not the same network channel as network channel 1. In other words, peer node 1 transmits different mirror shards through different network channels.

[0143] Optionally, before the above S909, peer node 1 may also perform hash calculation on mirror shard 2 to obtain hash value 2.

[0144] S910, peer node 2 performs integrity check on image shard 1 according to image shard 1 and hash value 1, and determines that the received image shard 1 is complete.

[0145] Wherein, peer node 2 performs integrity check on image shard 1 according to image shard 1 and hash value 1 to determine that the received image shard 1 is complete, including: peer node 2 processes image shard 1 using a hash algorithm to obtain hash value #1; by comparing hash value 1 and hash value #1, it is determined that the received image shard 1 is complete, that is, image shard 1 has not been attacked or tampered with during transmission. It can be understood that the hash algorithm used by peer node 1 to determine hash value 1 according to image shard 1 is the same as the hash algorithm used by peer node 2 to determine hash value #1 according to image shard 1.

[0146] Exemplarily, when peer node 1 encapsulates mirror shard 1 and hash value 1 in the same data packet and sends the encapsulated data packet to peer node 2, peer node 2 may further perform the following operations before executing the above S910: parse the data packet to obtain mirror shard 1 and hash value 1.

[0147] S911, peer node 3 performs integrity check on image shard 2 according to image shard 2 and hash value 2, and determines that the received image shard 2 is complete.

[0148] The principle of the peer node 3 executing the above S911 is the same as the principle of the peer node 2 executing the above S910. For the contents not described in detail here, please refer to the above description of S910.

[0149] It can be understood that after executing the above S901 to S911, the first round of distribution of the mirror slices included in the mirror file 1 is completed. During the first round of distribution, the peer nodes in the P2P network that do not own the mirror file (i.e., peer node 2 and peer node 3) can obtain a mirror slice included in the mirror file from the peer node 1 that owns the mirror file. Specifically, peer node 2 obtains mirror slice 1 from peer node 1 through network channel 1, and peer node 3 obtains mirror slice 2 from peer node 1 through network channel 3. Network channel 1 is different from network channel 3, and mirror slice 1 is different from mirror slice 2. In other words, after executing the first round of distribution of mirror slices, peer node 2 and peer node 3 in the P2P network respectively own different mirror slices included in the mirror file 1. Thereafter, peer node 2 and peer node 3 in the P2P network can obtain the mirror slices owned by each other by means of resource sharing. Next, in combination with Fig. 9B S912 to S922 show the second round distribution process in detail.

[0150] S912, peer node 2 generates query message 3 according to instruction 1 and the first download sequence.

[0151] After the first round of distribution is completed, the local storage of the peer node 2 contains the image slice 1 included in the image file 1. Based on this, the peer node 2 generates a query message 3 according to the instruction 1 and the first download sequence. The query message 3 is specifically used to query the second image slice that needs to be downloaded in the order of downloading the image slices indicated by the first download sequence, that is, the query message 3 is used to query the image slice 2. Optionally, the query message 3 may carry the identifier of the image slice 2 and the identifier of the peer node 2. The identifier of the image slice 2 is used to uniquely identify the image slice 2, and the identifier of the peer node 2 is used to uniquely identify the peer node 2.

[0152] S913, the peer node 3 generates a query message 4 according to the instruction 1 and the second download sequence.

[0153] After the first round of distribution is completed, the local storage of the peer node 3 contains the image slice 2 included in the image file 1. Based on this, the peer node 3 generates a query message 4 according to the instruction 1 and the second download sequence. The query message 4 is specifically used to query the second image slice that needs to be downloaded in the order of downloading the image slices indicated by the first download sequence, that is, the query message 4 is used to query the image slice 1. Optionally, the query message 4 may carry the identifier of the image slice 1 and the identifier of the peer node 3. The identifier of the image slice 1 is used to uniquely identify the image slice 1, and the identifier of the peer node 3 is used to uniquely identify the peer node 3.

[0154] S914, peer node 2 sends query message 3 to the nodes in the P2P network to query mirror shard 2. Correspondingly, the nodes in the P2P network receive query message 3.

[0155] Among them, peer node 2 sends query message 3 to the node in the P2P network, including: peer node 2 sends query message 3 to peer node 1 through network channel 1, sends query message 3 to peer node 3 through network channel 2, and sends query message 3 to the control node through network channel 4.

[0156] S915 , peer node 3 sends query message 4 to the nodes in the P2P network to query mirror shard 1 . Correspondingly, the nodes in the P2P network receive query message 4 .

[0157] Among them, peer node 4 sends query message 4 to nodes in the P2P network, including: peer node 4 sends query message 4 to peer node 1 through network channel 3, sends query message 4 to peer node 2 through network channel 2, and sends query message 4 to the control node through network channel 6.

[0158] S916, peer node 3 determines that mirror shard 2 is stored locally according to query message 3 and condition 2 is met.

[0159] Satisfying condition 2 includes: the peer node does not store all the image fragments included in the image file 1 locally, and the number of image fragments uploaded by the peer node does not exceed the preset upload number. In other words, the peer node that satisfies condition 2 is not the peer node that owns the complete image file 1, and the number of image fragments uploaded by the peer node does not exceed the preset upload number.

[0160] There is no specific limit on the preset upload quantity, and it can be set according to the network status of a peer node or user needs. The preset upload quantity corresponding to each peer node in the P2P network can be the same or different.

[0161] Among them, the peer node 3 determines that the mirror shard 2 is stored locally according to the query message 3, including: the peer node 3 queries the locally stored data according to the identifier of the mirror shard 2 carried by the query message 3, and determines that the mirror shard 2 corresponding to the identifier of the mirror shard 2 is stored locally.

[0162] S917, peer node 2 determines, based on query message 4, that mirror shard 1 is stored locally and condition 2 is satisfied.

[0163] The condition 2 described in S917 is the same as the condition 2 described in S916. For the contents not described in detail here, please refer to the relevant description in S916.

[0164] Among them, the peer node 2 determines that the mirror shard 1 is stored locally according to the query message 4, including: the peer node 2 queries the locally stored data according to the identifier of the mirror shard 1 carried by the query message 4, and determines that the mirror shard 1 corresponding to the identifier of the mirror shard 1 is stored locally.

[0165] S918, peer node 1 determines that mirror shard 2 is stored locally according to query message 3, and determines that mirror shard 1 is stored locally according to query message 4, and condition 3 is satisfied.

[0166] Satisfying condition 3 includes: the peer node locally stores all the image fragments included in the image file 1, and the number of image fragments uploaded by the peer node exceeds the preset upload quantity. It is understandable that, when peer node 1 satisfies condition 3, even if peer node 1 locally stores image fragment 2 corresponding to query message 3 and image fragment 1 corresponding to query message 4, peer node 1 will not send image fragment 2 to peer node 2, nor will it send image fragment 1 to peer node 3.

[0167] S919, in response to satisfying condition 2, peer node 3 sends mirror shard 2 and hash value 2 to peer node 2 through network channel 2.

[0168] S920 , in response to condition 2 being met, peer node 2 sends mirror shard 1 and hash value 1 to peer node 3 through network channel 2 .

[0169] It can be understood that the above S919 and S920 can be executed simultaneously. At this time, the peer node 2 that owns a partial image slice of the image file 1 (i.e., image slice 1) not only downloads the partial image slice of the image file 1 owned by the peer node 3 (i.e., image slice 2) from the peer node 3, but also the peer node 2 acts as a resource provider and uploads the locally stored image slice 1 to the peer node 3. In this way, the transmission efficiency of the image slices can be improved.

[0170] S921, peer node 2 performs integrity check on image shard 2 according to image shard 2 and hash value 2, and determines that the received image shard 2 is complete.

[0171] The principle of the integrity check performed on the peer node 2 in the above S921 is similar to the principle of the integrity check performed on the peer node 2 in the above S910. For the contents not described in detail here, please refer to the relevant description in the above S910.

[0172] S922, peer node 3 performs integrity check on image shard 1 according to image shard 1 and hash value 1, and determines that the received image shard 1 is complete.

[0173] The principle of the integrity check performed on the peer node 3 in the above S922 is similar to the principle of the integrity check performed on the peer node 2 in the above S910. For the contents not described in detail here, please refer to the relevant description in the above S910.

[0174] It should be noted that when peer node 3 in the above S919 does not meet condition 2, and peer node 2 in the above S917 does not meet condition 2, after executing the above S917, peer node 1 can also send mirror shard 2 and hash value 2 to peer node 2, and send mirror shard 1 and hash value 1 to peer node 3.

[0175] It is understandable that after executing the above S912 to S922, the second round of distribution process is completed. In the second round of distribution process, the peer node 2 and the peer node 3 that do not store the complete image file 1 exchange the image fragments owned by each other, which can reduce the transmission burden of the peer node 1 that has the complete image file 1 and improve the speed and efficiency of node downloading. Specifically, the peer node (for example, peer node 2 or peer node 3) that has a partial image fragment of the image file 1 is uploading the image fragment to other peer nodes while downloading the image fragment, which can improve the transmission efficiency of the image fragment.

[0176] After executing the above S922, it is also possible to determine whether the peer node 2 and / or the peer node 3 has successfully received the complete image file 1 according to the image fragments received by the peer node 2 and / or the peer node 3.

[0177] In an example, peer node 2 or peer node 3 can perform hash calculation on the received multiple image fragments to obtain hash value A; peer node 2 or peer node 3 can also obtain hash value B corresponding to image file 1 from peer node 1; peer node 2 or peer node 3 can determine that peer node 2 or peer node 3 has successfully received the complete image file 1 by comparing hash value A with hash value B.

[0178] In another example, peer node 2 or peer node 3 can perform hash calculation on the received multiple image shards, obtain hash value A, and send message 1 to the control node, where message 1 is used to indicate that the hash value of the multiple image shards received by peer node 2 or peer node 3 is hash value A; the control node can also obtain hash value B corresponding to image file 1 from peer node 1; the control node can determine that peer node 2 or peer node 3 has successfully received the complete image file 1 by comparing hash value A with hash value B; the control node sends message 2 to peer node 2 or peer node 3, where message 2 is used to indicate that peer node 2 or peer node 3 has successfully received the complete image file 1.

[0179] After executing the first and second rounds of distribution and the image file integrity check, the peer nodes 2 and 3 in the P2P network that did not originally have the image file 1 already have the complete image file 1, thus ending the entire image distribution process.

[0180] It should be understood that the above Fig. 9A and the above Fig. 9B The method shown is for illustration only and does not constitute any limitation on the image distribution method provided in the embodiment of the present application. Fig. 9A and the above Fig. 9B The execution order of the steps shown is for illustration only and is not limiting. For example, in some other possible implementations, the above-mentioned image file 1 may also include a greater number of image fragments, such as image file 1 includes image fragment 1, image fragment 2, and image fragment 3. In this implementation, the first download order is different from the second download order. The first download order may be: image fragment 1, image fragment 3, and image fragment 2, and the second download order may be: image fragment 3, image fragment 1, and image fragment 2. For example, when peer node 2 executes the above-mentioned S921 to determine that the received image fragment 2 is incomplete, peer node 2 may also request peer node 3 to retransmit image fragment 2.

[0181] In the embodiment of the present application, all the multiple peer nodes (i.e., peer node 2 and peer node 3) in the P2P network that do not store the image file 1 first obtain a mirror fragment included in the image file 1 from the peer node 1 that stores the complete image file 1 according to the download instruction sent by the control node, and the multiple peer nodes obtain multiple different mirror fragments (i.e., mirror fragment 1 and mirror fragment 2) through multiple different network channels (i.e., network channel 1 and network channel 3). In the subsequent distribution process of the mirror fragments, the peer nodes (i.e., peer node 2 and peer node 3) in the P2P network that obtain the partial mirror fragments included in the image file 1 can share the mirror fragments owned by each other, which can reduce the transmission burden of the peer node 1 that owns the complete image file 1 and improve the speed and efficiency of node downloading. In addition, when peer node 2 and peer node 3 share each other's mirror slices, the peer node (for example, peer node 2 or peer node 3) that has part of the mirror slices of the mirror file 1 is uploading the mirror slices to other peer nodes while downloading the mirror slices, which can improve the transmission efficiency of the mirror slices. In the above-mentioned mirror distribution process, the integrity of the mirror slices associated with the mirror file 1 received by the peer node is checked to determine whether the peer node that does not store the mirror file 1 in the P2P network has successfully received the mirror file 1. When the distribution of the mirror file 1 is implemented in the P2P network, the mirror slice is used as the minimum transmission granularity, which can improve the flexibility of the mirror distribution. The integrity check of the mirror slice is implemented while the mirror is distributed. Since the mirror distribution and the integrity check of the mirror slice are performed at the same time, it does not affect the efficiency of distributing each mirror slice.

[0182] Above Fig. 9A and Fig. 9B A mirror distribution method for mirror distribution provided by an embodiment of the present application is shown. Optionally, in the process described by the mirror distribution method shown above, the peer nodes in the P2P network can also communicate with other peer nodes to obtain the current network status of the other peer nodes. The network status of a peer node may include the speed at which the peer node uploads data to other peer nodes, and the speed at which the peer node downloads data from other peer nodes. In a P2P network, if any peer node finds that the speed at which the any peer node uploads data to other peer nodes does not meet the preset upload speed, or the speed at which the any peer node downloads data from other peer nodes does not meet the preset download speed, then the any peer node can also send the acquired network status information to the control node, so that the control node reallocates the network bandwidth of the peer nodes in the P2P network according to the network status information, thereby solving the problem that the upload speed or download speed of any peer node does not meet the preset speed. Below, we will combine Fig.10A schematic diagram of a multi-channel bandwidth adjustment method provided in an embodiment of the present application is introduced.

[0183] Fig.10 is a schematic diagram of a network bandwidth adjustment method provided in an embodiment of the present application. It should be understood that Fig.10 The examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Fig.10 It is obvious that various equivalent modifications or changes can be made, and such modifications and changes also fall within the scope of the embodiments of the present application. Fig.10 As shown, the method includes S1001 to S1004. S1001 to S1004 are described in detail below.

[0184] In the present application embodiment, Figure 3A The network architecture shown includes peer nodes in the following states, which are described as an example: Specifically, Figure 3A The speed at which peer node 1 uploads data to peer node 3 as shown satisfies the preset upload speed (i.e., the speed at which peer node 3 downloads data from peer node 1 satisfies the preset download speed), the speed at which peer node 3 uploads data to peer node 1 satisfies the preset upload speed (i.e., the speed at which peer node 1 downloads data from peer node 3 satisfies the preset download speed), and the speed at which peer node 2 uploads data to peer node 3 is less than the preset upload speed (i.e., the speed at which peer node 3 downloads data from peer node 2 is less than the preset download speed). In other words, the transmission quality of network channel 3 is higher than the transmission quality of network channel 2.

[0185] S1001 , within a preset period, peer node 3 detects peer node 1 and peer node 2 respectively to obtain network status information 1 .

[0186] The size of the preset period is not specifically limited and can be set according to actual needs. For example, the preset period can be 1 second, 5 seconds or 20 seconds.

[0187] The network status information 1 includes network bandwidth 1 and network bandwidth 2, and network bandwidth 1 meets the preset bandwidth requirement, while network bandwidth 2 does not meet the preset bandwidth requirement. Among them, network bandwidth 1 represents the speed at which peer node 1 uploads data to peer node 3. Network bandwidth 1 meets the preset bandwidth requirement, that is, the speed at which peer node 1 uploads data to peer node 3 meets the preset upload speed. Network bandwidth 2 represents the speed at which peer node 2 uploads data to peer node 3. Network bandwidth 2 does not meet the preset bandwidth requirement, that is, the speed at which peer node 2 uploads data to peer node 3 is less than the preset upload speed.

[0188] Executing the above S1001 includes: within a preset period, peer node 3 detects peer node 1 to obtain network bandwidth 1; and peer node 3 detects peer node 2 to obtain network bandwidth 2. For example, peer node 3 can use raw-socket technology to perform inter-node speed measurement on peer node 1 to obtain network bandwidth 1.

[0189] S1002 , the peer node 3 sends the network status information 1 to the control node. Correspondingly, the control node receives the network status information 1 sent by the peer node 3 .

[0190] The triggering condition for the peer node 3 to send the network status information 1 to the control node is not specifically limited. For example, the peer node 3 may send the message 1 to the control node when it is determined that the speed at which the peer node 2 uploads data to the peer node 3 is less than the preset upload speed. For another example, the peer node 3 may send the network status information 1 to the control node when it is determined that the speed at which the peer node 2 uploads data to the peer node 3 is less than the preset upload speed, and after waiting for a short preset time (for example, 100 milliseconds), it is still found that the speed at which the peer node 2 uploads data to the peer node 3 is less than the preset upload speed.

[0191] S1003: The control node determines that the network bandwidth 3 needs to be increased according to the preset network bandwidth requirement and the network status information 1 to obtain the network bandwidth #3.

[0192] The network bandwidth 3 indicates the speed at which the peer node 3 uploads data to the peer node 1. The preset bandwidth requirement indicates the preset upload speed at which one peer node uploads data to another peer node.

[0193] Wherein, the control node determines that the network bandwidth 3 needs to be increased according to the preset bandwidth requirement and the network status information 1, including: the control node determines that the preset upload speed minus the upload speed of peer node 2 uploading data to peer node 3 is equal to the first value according to the network bandwidth 2 and the preset bandwidth requirement; the control node determines that the network bandwidth 3 needs to be increased by the first value to obtain network bandwidth #3. Wherein, network bandwidth #3 meets the preset bandwidth requirement. In other words, the speed at which peer node 3 uploads data to peer node 1 indicated by network bandwidth #3 is greater than the speed at which peer node 3 uploads data to peer node 1 indicated by network bandwidth 3. At the same time, the speed at which peer node 3 uploads data to peer node 1 indicated by network bandwidth #3 meets the requirement of the preset upload speed.

[0194] In the above implementation, the speed at which peer node 2 uploads data to peer node 3 is lower than the preset upload speed, that is, the network quality of network channel 2 is not very good. When the speed at which peer node 3 uploads data to peer node 1 meets the preset upload speed (that is, the network quality of network channel 2 is good), the speed at which peer node 3 uploads data to peer node 1 can be increased to cope with network fluctuations.

[0195] S1004: The control node updates the network bandwidth 3 of the peer node 3 to the network bandwidth #3 according to the bandwidth update message.

[0196] Optionally, in order to ensure that the P2P network is in a normal state, after executing the above S1001 to S1004, if the upload speed of peer node 2 to peer node 3 meets the preset upload speed, the control node can also update the speed at which peer node 3 uploads data to peer node 1 to the upload speed indicated by the network bandwidth 3.

[0197] It should be noted that the above Fig.10 The method shown can be combined with the above Fig. 9A and Fig. 9B When the above Fig.10 The method shown is similar to the above Fig. 9A and Fig. 9B When the methods shown are used in combination, the above Fig.10 The method shown in Fig. 9A and Fig. 9B The execution location within the method shown.

[0198] It should be understood that the above Fig.10 The network bandwidth adjustment method shown is for illustration only and does not constitute any limitation to the multi-channel bandwidth adjustment method provided in the present application.

[0199] In an embodiment of the present application, a balancing effect is achieved by increasing the load of non-faulty nodes, so that network bandwidth resources are preferentially allocated to network channels with good network quality to cope with network fluctuations. This method can effectively solve the problem of abnormal network fluctuations.

[0200] Above, combined Figures 1 to 10 The application scenarios, network architecture, image distribution method, and network bandwidth adjustment method applicable to the image distribution method provided by this application are described in detail. Figures 11 to 13 The image distribution device, image distribution system and image distribution equipment provided by the present application are introduced. It should be understood that the image distribution method above corresponds to the image distribution device, image distribution system and equipment below. For the contents not described in detail below, please refer to the relevant description in the above method embodiment.

[0201] Fig.11 Schematic diagram of the structure of a mirror distribution device provided in an embodiment of the present application. Fig.11 As shown, the image distribution device includes a transceiver unit 1101 and a processing unit 1102 .

[0202] In some implementations, the image distribution device is used to implement the above Figure 6 The steps performed by the first peer node in the mirror distribution method shown in FIG. Figure 6 The structure of the first peer node in the mirror distribution method shown is as follows: Figure 5 When showing the structure of the peer node 200, the Fig.11 The functions of the transceiver unit 1101 shown are similar to those described above. Figure 5 The mirror slice transmitter 210 shown has the same function; Fig.11 The functions of the processing unit 1101 shown are similar to those described above. Figure 5 The network analysis module 220, dynamic regulation client 230 and file storage service 240 shown have the same functions.

[0203] In some other implementations, the image distribution device is used to implement the above Figure 6 The steps performed by the i-th second peer node in the mirror distribution method shown in FIG. Figure 6 The structure of the i-th second peer node in the mirror distribution method shown above is Figure 5 When showing the structure of the peer node 200, the Fig.11 The functions of the transceiver unit 1101 shown are similar to those described above. Figure 5 The mirror slice transmitter 210 shown has the same function; Fig.11 The functions of the processing unit 1101 shown are similar to those described above. Figure 5 The network analysis module 220, dynamic regulation client 230 and file storage service 240 shown have the same functions.

[0204] In some other implementations, the image distribution device is used to implement the above Figure 6 The steps performed by the control node in the mirror distribution method shown in FIG. Figure 6 The structure of the control node in the image distribution method shown is as follows: Figure 4 When showing the structure of the control node 100, the Fig.11 The functions of the processing unit 1101 shown are similar to those described above. Figure 5 The functions of the service registration and discovery 110 , the network topology center 120 , the network server 130 , and the dynamic control center 140 are the same.

[0205] Fig.12Schematic diagram of a mirror distribution system provided by an embodiment of the present application. Fig.12 As shown, the system includes a control node 1201, a first peer node 1202, and N second peer nodes 1203, where N is a positive integer greater than or equal to 2.

[0206] Among them, the control node 1201 is used to execute the various steps performed by the control node in the mirror distribution method described above, the first peer node 1202 is used to execute the various steps performed by the first peer node in the mirror distribution method described above, and the N second peer nodes 1203 are used to execute the various steps performed by the N second peer nodes in the mirror distribution method described above. For the contents not described in detail here, please refer to the relevant description above.

[0207] Fig.13 Schematic diagram of the structure of a mirror distribution device provided in an embodiment of the present application. Fig.13 As shown, it includes a memory 1301, a processor 1302, a communication interface 1303 and a communication bus 1304. The memory 1301, the processor 1302 and the communication interface 1303 are connected to each other through the communication bus 1304.

[0208] The memory 1301 may be a read only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 1301 may store a program. When the program stored in the memory 1301 is executed by the processor 1302, the processor 1302 and the communication interface 1303 are used to execute the various steps of the method for implementing the block cipher algorithm of the embodiment of the present application.

[0209] Processor 1302 can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functions required to be performed by the units in the device for implementing the block cipher algorithm of the embodiment of the present application, or to execute the various steps of the method for implementing the block cipher algorithm of the embodiment of the present application.

[0210] The processor 1302 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the method for implementing the block cipher algorithm provided in the present application may be completed by an integrated logic circuit of hardware or software instructions in the processor 1302. The above-mentioned processor 1302 may also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1301, and the processor 1302 reads the information in the memory 1301, and combines its hardware to complete the functions required to be performed by the units included in the device for implementing the block cipher algorithm of the embodiment of the present application, or executes the method for implementing the block cipher algorithm of the method embodiment of the present application.

[0211] The communication interface 1303 uses a transceiver such as, but not limited to, a transceiver to implement Fig.13 The communication between the device shown and other devices or communication networks. For example, encrypted data can be output through the communication interface 1303.

[0212] The communication bus 1304 may include Fig.13 The pathway for transmitting information between the various components of the device (e.g., memory 1301, processor 1302, communication interface 1303) is shown.

[0213] An embodiment of the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed by a processor, they are used to implement the technical solution of any image distribution method in the embodiments of the present application.

[0214] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored on a computer-readable medium, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present application.

[0215] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0216] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0217] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage media or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0218] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0219] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

Claims

1. A mirror distribution method, characterized in that: Applied to a peer-to-peer network including a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application program, and N is a positive integer greater than or equal to 2, comprising: The first peer node receives N first query messages sent by the N second peer nodes, and the N first query messages correspond one-to-one to the N second peer nodes; the N second peer nodes correspond one-to-one to N download orders, and the N download orders are different; wherein the first query message sent by the i-th second peer node is used to query the i-th mirror fragment included in the mirror file, and the i-th mirror fragment is the first mirror fragment downloaded as indicated by the i-th download order corresponding to the i-th second peer node, i=1,2,…,N; the download order is the sorting order in which the second peer node sorts the N mirror fragments included in the mirror file; The first peer node determines, according to the N first query messages, to send N different image slices included in the image file queried by the N first query messages to the N second peer nodes; The first peer node sends the N different mirror slices and N different hash values ​​corresponding to the N different mirror slices to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the image file, wherein the i-th network channel is a network channel for the first peer node and the i-th second peer node to transmit the i-th mirror slice and the hash value corresponding to the i-th mirror slice, i=1,2,…,N; the hash value is used to determine whether the second peer node has successfully received the mirror slice corresponding to the hash value.

2. The image distribution method according to claim 1, characterized in that: The method further comprises: The first peer node receives a first retransmission message sent by the i-th second peer node; The first peer node determines, according to the first retransmission message, to send the i-th mirrored shard to the i-th second peer node; The first peer node sends the i-th mirror shard and the hash value corresponding to the i-th mirror shard to the i-th second peer node through the i-th network channel.

3. The image distribution method according to claim 1 or 2, characterized in that: The application is a cloud gaming application, and the image file associated with the application is an updated image file generated by the cloud gaming application.

4. The image distribution method according to any one of claims 1 to 2, characterized in that: The peer-to-peer network includes a control node, and the control node is used to manage the first peer node and the N second peer nodes. The control node is any one of the following peer nodes: The first peer node, or the N second peer nodes.

5. A mirror distribution method, characterized in that: Applied to a peer-to-peer network including a control node and a first peer node and N second peer nodes managed by the control node, wherein the first peer node stores an image file associated with an application program, and N is a positive integer greater than or equal to 2, comprising: The i-th second peer node determines the downloading order of the N image fragments included in the image file according to the received download instruction sent by the control node, wherein the download instruction is used to instruct to start downloading the image file, and the N second peer nodes all receive the download instruction, and the N second peer nodes correspond to the N downloading orders one by one, and the N downloading orders are different, i=1,2,…,N; The i-th second peer node determines to send a first query message to the first peer node and a second query message to other second peer nodes according to the i-th download order corresponding to the i-th second peer node; the first query message is used to query the i-th image fragment included in the image file, and the i-th image fragment is the first image fragment downloaded as indicated by the i-th download order; the second query message is used to query an image fragment included in the image file other than the i-th image fragment, and the image fragment queried by the second query message is the j-th image fragment downloaded as indicated by the i-th download order, j=2,3,…,N; the download order is the sorting order in which the second peer node sorts the N image fragments; The i-th second peer node sends the first query message to the first peer node, and sends the second query message to other second peer nodes, so as to obtain the mirror file.

6. The image distribution method according to claim 5, characterized in that: The i-th second peer node sends the first query message to the first peer node, and sends the second query message to other second peer nodes to obtain the mirror file, including: The i-th second peer node sends the first query message to the first peer node; The i-th second peer node receives the i-th mirror shard and the hash value corresponding to the i-th mirror shard sent by the first peer node, and the hash value corresponding to each mirror shard is different; When it is determined that the received i-th mirror slice passes the integrity check, the i-th second peer node saves the i-th mirror slice and sends the second query message to other second peer nodes; The i-th second peer node receives the mirror shard queried by the second query message sent by the other second peer nodes and the hash value corresponding to the queried mirror shard, and the number of mirror shards sent by the other second peer nodes does not exceed a preset threshold; In the case where it is determined that the mirrored slice queried by the received second query message passes the integrity check, the i-th second peer node saves the mirrored slice queried by the second query message.

7. The image distribution method according to claim 6, characterized in that: The method further comprises: The i-th second peer node performs integrity check on the received mirror slice, where the mirror slice received by the i-th second peer node includes the i-th mirror slice and the mirror slice queried by the second query message; If it is determined that the received i-th mirrored slice fails the integrity check, the i-th second peer node sends a first retransmission message to the first peer node, where the first retransmission message is used to instruct the first peer node to send the i-th mirrored slice; If it is determined that the mirror shard queried by the received second query message does not pass the integrity check, the i-th second peer node sends a second retransmission message to the other second peer nodes, and the second retransmission message is used to instruct the other second peer nodes to send the mirror shard queried by the second query message.

8. The image distribution method according to claim 6 or 7, characterized in that: The method further comprises: If the i-th second peer node has not received the mirror shard queried by the second query message sent by the other second peer nodes and the hash value corresponding to the queried mirror shard, the i-th second peer node sends the second query message to the first peer node; The i-th second peer node receives the mirror shard queried by the second query message sent by the first peer node and a hash value corresponding to the queried mirror shard.

9. The image distribution method according to any one of claims 5 to 7, characterized in that: The method further comprises: The i-th second peer node sends N detection messages to the first peer node and the other second peer nodes to obtain network qualities corresponding to N network channels, the N second peer nodes correspond one-to-one to the N detection messages, the network quality corresponding to the i-th network channel among the N network channels does not meet the preset requirements, and the i-th network channel is a network channel for data transmission between the i-th second peer node and the first peer node, or is a network channel for data transmission between the i-th second peer node and one of the other second peer nodes; The i-th second peer node sends the network qualities corresponding to the N network channels to the control node, so that the control node adjusts the bandwidth values ​​corresponding to the network channels among the N network channels except the i-th network channel according to the network qualities corresponding to the N network channels.

10. The image distribution method according to any one of claims 5 to 7, characterized in that: The application is a cloud gaming application, and the image file associated with the application is an updated image file generated by the cloud gaming application.

11. The image distribution method according to any one of claims 5 to 7, characterized in that: The control node is any one of the following peer nodes: The first peer node, or the N second peer nodes.

12. A mirror distribution device, characterized in that: Applied to a peer-to-peer network including a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application program, and N is a positive integer greater than or equal to 2, comprising: A transceiver unit, used for receiving N first query messages sent by the N second peer nodes, the N first query messages corresponding one-to-one to the N second peer nodes; the N second peer nodes corresponding one-to-one to N download orders, and the N download orders are different; wherein the first query message sent by the i-th second peer node is used for querying the i-th mirror fragment included in the mirror file, and the i-th mirror fragment is the first mirror fragment downloaded as indicated by the i-th download order corresponding to the i-th second peer node, i=1,2,…,N; the download order is the sorting order in which the second peer node sorts the N mirror fragments included in the mirror file; A processing unit, configured to determine, according to the N first query messages, to send to the N second peer nodes N different image fragments included in the image file queried by the N first query messages; The transceiver unit is further used to send the N different mirror slices and N different hash values ​​corresponding to the N different mirror slices to the N second peer nodes through N network channels, so that the i-th second peer node interacts with other second peer nodes to obtain the image file, wherein the i-th network channel is a network channel for the first peer node and the i-th second peer node to transmit the i-th mirror slice and the hash value corresponding to the i-th mirror slice, i=1,2,…,N; the hash value is used to determine whether the second peer node has successfully received the mirror slice corresponding to the hash value.

13. A mirror distribution device, characterized in that: Applied to a peer-to-peer network including a control node and a first peer node and N second peer nodes managed by the control node, wherein the first peer node stores an image file associated with an application program, and N is a positive integer greater than or equal to 2, comprising: a processing unit, configured to determine a downloading order of N image fragments included in the image file according to a received download instruction sent by the control node, wherein the download instruction is used to instruct to start downloading the image file, the N second peer nodes all receive the download instruction, the N second peer nodes correspond to the N downloading orders one by one, and the N downloading orders are different, i=1, 2, ..., N; The processing unit is further used to determine, according to the i-th download order corresponding to the i-th second peer node, to send a first query message to the first peer node and to send a second query message to other second peer nodes; the first query message is used to query the i-th image fragment included in the image file, and the i-th image fragment is the first image fragment downloaded as indicated by the i-th download order; the second query message is used to query an image fragment other than the i-th image fragment included in the image file, and the image fragment queried by the second query message is the j-th image fragment downloaded as indicated by the i-th download order, j=2,3,…,N; the download order is the sorting order in which the second peer node sorts the N image fragments; The transceiver unit is used to send the first query message to the first peer node, and send the second query message to other second peer nodes to obtain the mirror file.

14. An image distribution device, characterized in that: include: A memory and a processor, wherein the memory and the processor are coupled; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to implement the method according to any one of claims 1 to 4.

15. An image distribution device, characterized in that: include: A memory and a processor, wherein the memory and the processor are coupled; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to implement the method according to any one of claims 5 to 11.

16. A mirror distribution system, characterized in that: The system includes a control node, a first peer node managed by the control node and a peer-to-peer network of N second peer nodes, wherein the first peer node stores an image file associated with an application program, and N is a positive integer greater than or equal to 2, including: The control node sends a download instruction to the N second peer nodes, where the download instruction is used to instruct to start downloading the image file; The first peer node is used to execute the method as described in any one of claims 1 to 4, and the i-th second peer node among the N second peer nodes is used to execute the method as described in any one of claims 5 to 11, i=1,2,…,N.

17. A computer-readable storage medium having one or more computer instructions stored thereon, characterized in that: The instructions are executed by a processor to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Container mirror image downloading and uploading method and device

    CN110912955A

  • Resource packet downloading method, device and system

    CN111064785A

  • Enterprise-level container mirror image acceleration method and device, electronic equipment and storage medium

    CN112883006A