CN115567547A - Mirror image distribution method, system and equipment - Google Patents

Mirror image distribution method, system and equipment Download PDF

Info

Publication number
CN115567547A
CN115567547A CN202210994948.8A CN202210994948A CN115567547A CN 115567547 A CN115567547 A CN 115567547A CN 202210994948 A CN202210994948 A CN 202210994948A CN 115567547 A CN115567547 A CN 115567547A
Authority
CN
China
Prior art keywords
peer
image
peer node
ith
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210994948.8A
Other languages
Chinese (zh)
Inventor
林鸿清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210994948.8A priority Critical patent/CN115567547A/en
Publication of CN115567547A publication Critical patent/CN115567547A/en
Priority to PCT/CN2023/074444 priority patent/WO2024036889A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/34Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers using peer-to-peer connections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/40Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of platform network
    • A63F2300/408Peer to peer connection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • Child & Adolescent Psychology (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Library & Information Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a mirror image distribution method, a mirror image distribution system and mirror image distribution equipment. The method comprises the following steps: the first peer node receives N first query messages sent by N second peer nodes; the first peer node determines N different mirror image fragments included in a mirror image file queried by N first query messages to N second peer nodes according to the N first query messages; the first peer node sends N image fragments and N different hash values corresponding to the N image fragments to N second peer nodes through N network channels, so that the ith second peer node interacts with other second peer nodes to obtain an image file, the ith network channel is a network channel through which the ith peer node and the ith second peer node transmit the hash values corresponding to the ith image fragment and the ith image fragment, N is a positive integer greater than or equal to 2, i =1,2, …, N. The method can improve the efficiency of image distribution.

Description

Mirror image distribution method, system and equipment
Technical Field
The present application relates to the field of network technologies, and in particular, to a method, a system, and a device for distributing images.
Background
With the development of cloud technology, in more and more application scenarios, resource sharing in a network is realized based on the cloud technology. For example, in a cloud game application scenario, a user needs to be provided with multiple games for playing, and meanwhile, the requirements of users in different regions for playing games need to be met. To meet the user's demands for low latency and high image quality, cloud game systems, including cloud game storage devices, need to be deployed in various locations. Therefore, game storage in a plurality of local areas needs to be maintained at the same time, and real-time updating of game resources becomes a difficult problem.
In the traditional scheme, the Qcow2 mirror image is mainly used for storing game data, the game data are mounted in the cloud game system by the method, and the Qcow2 mirror images of all areas are kept consistent. When the game image file is shared, the node storing the game image file transmits the complete game image file to the child node of the node. And after the child node acquires the complete game image file, the child node transmits the complete game image file to the child node of the child node, and the process of sharing the game image file is stopped until all communication nodes in the network acquire the complete game image file. In the above-described technology, there is a problem that the image file distribution efficiency is low.
Therefore, there is a need for a method of image distribution, by which the efficiency of image distribution can be improved.
Disclosure of Invention
The application provides a method, a system and equipment for distributing mirror images, and the method can improve the efficiency of mirror image distribution.
A first aspect of the embodiments of the present application provides a mirror image distribution method, which is applied to a peer-to-peer network including a first peer node and N second peer nodes, where the first peer node stores a mirror image file associated with an application program, N is a positive integer greater than or equal to 2, and the method includes: the first peer node receives N first query messages sent by the N second peer nodes, wherein the N first query messages correspond to the N second peer nodes one by one; the first peer node determines, according to the N first query messages, N different image fragments included in the image file queried by the N first query messages to be sent to the N second peer nodes; the first peer node sends the N image fragments and N different hash values corresponding to the N image fragments to the N second peer nodes through N network channels, so that an ith second peer node interacts with other second peer nodes to obtain the image file, where an ith network channel is a network channel through which the first peer node and the ith second peer node transmit the ith image fragment and the hash value corresponding to the ith image fragment, and i =1,2, …, N.
A second aspect of the present application provides an image distribution method, 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, where 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 ith second peer node determines a downloading sequence of N image fragments included in the image file according to a received downloading instruction sent by the control node, wherein the downloading instruction is used for indicating the start of downloading the image file, the N second peer nodes all receive the downloading instruction, the N second peer nodes correspond to the N downloading sequences one by one, and the N downloading sequences are different, i =1,2, …, N; the ith second peer node determines to send a first query message to the first peer node and send second query messages to other second peer nodes according to an ith downloading sequence corresponding to the ith second peer node; the first query message is used for querying an ith image fragment included in the image file, and the ith image fragment is a first image fragment downloaded according to the ith downloading sequence; the second query message is used for querying an image fragment, which is included in the image file, except for the ith image fragment, and the image fragment queried by the second query message is the jth image fragment downloaded according to the ith downloading sequence, j =2,3, …, N; the ith 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 image file.
A third aspect of the present embodiment provides an image distribution apparatus applied to a peer-to-peer network including a first peer node and N second peer nodes, where 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: a transceiver unit, configured to receive N first query messages sent by the N second peer nodes, where the N first query messages correspond to the N second peer nodes one to one; a processing unit, configured to determine, according to the N first query messages, N different image fragments included in the image file queried by the N first query messages to be sent to the N second peer nodes; the transceiver unit is further configured to send the N image fragments and N different hash values corresponding to the N image fragments to the N second peer nodes through N network channels, so that an ith second peer node interacts with other second peer nodes to obtain the image file, where an ith network channel is a network channel through which the first peer node and the ith second peer node transmit the ith image fragment and a hash value corresponding to the ith image fragment, and i =1,2, …, N.
A fourth aspect of the present embodiment provides an image distribution apparatus, 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, where 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 processing unit is used for determining a downloading sequence of N image fragments included in the image file according to a received downloading instruction sent by the control node, wherein the downloading instruction is used for indicating the start of downloading the image file, the N second peer nodes all receive the downloading instruction, the N second peer nodes correspond to the N downloading sequences one by one, and the N downloading sequences are different, i =1,2, … and N; the processing unit is further configured to determine, according to an ith download sequence corresponding to the ith second peer node, to send a first query message to the first peer node and send second query messages to other second peer nodes; the first query message is used for querying an ith image fragment included in the image file, and the ith image fragment is a first image fragment downloaded according to the ith downloading sequence; the second query message is used for querying an image fragment, which is included in the image file, except for the ith image fragment, and the image fragment queried by the second query message is the jth image fragment downloaded according to the ith downloading sequence, j =2,3, …, N; and the transceiving unit is used for sending the first query message to the first peer node and sending the second query message to other second peer nodes to obtain the image file.
A fifth aspect of the embodiments of the present application provides an image distribution device, where the image distribution device has a function of implementing the first aspect or any one of the possible implementations of the first aspect, and the image distribution apparatus described in any one of the possible implementations of the third aspect or the third aspect. The function can be realized based on hardware, and can also be realized by executing corresponding software based on hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a possible implementation manner, the structure of the image distribution device includes a processor configured to support the image distribution device to execute the corresponding functions in the above method.
The image distribution device can also include a memory, coupled to the processor, that retains program instructions and data necessary for the image distribution device.
In another possible implementation, the image distribution apparatus includes: a processor, a transmitter, a receiver, a random access memory, a read only memory, and a bus. The processor is coupled to the transmitter, the receiver, the random access memory and the read only memory through the bus respectively. When the image distribution device needs to be operated, the image distribution device is guided to enter a normal operation state by starting a basic input/output system solidified in a read-only memory or a bootloader guide system in an embedded system. After the image distribution device enters the normal operation state, the application program and the operating system are operated in the random access memory, so that the processor executes the image distribution method in the first aspect or any possible implementation manner of the first aspect.
A sixth aspect of the embodiments of the present application provides an image distribution device, where the image distribution device has a function of implementing any one of the possible implementations of the second aspect or the second aspect described above, and the image distribution apparatus described in any one of the possible implementations of the fourth aspect or the fourth aspect. The function can be realized based on hardware, and can also be realized by executing corresponding software based on hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a possible implementation manner, the structure of the image distribution device includes a processor configured to support the image distribution device to execute the corresponding functions in the above method.
The image distribution device can also include a memory, coupled to the processor, that retains program instructions and data necessary for the image distribution device.
In another possible implementation, the image distribution apparatus includes: a processor, a transmitter, a receiver, a random access memory, a read only memory, and a bus. The processor is coupled to the transmitter, the receiver, the random access memory and the read only memory through the bus respectively. When the image distribution device needs to be operated, the image distribution device is guided to enter a normal operation state by starting a basic input/output system solidified in a read-only memory or a bootloader guide system in an embedded system. After the image distribution device enters the normal operation state, the application program and the operating system are operated in the random access memory, so that the processor executes the image distribution method in the second aspect or any possible implementation manner of the second aspect.
A seventh aspect of the embodiments of the present application further provides a computer-readable storage medium, having one or more computer instructions stored thereon, where the instructions are executed by a processor to implement the method according to any one of the above-mentioned technical solutions.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments disclosed herein, nor do they necessarily limit the scope of the present disclosure. Other features disclosed in the present application will become apparent from the following description.
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, where 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, and the method includes: the first peer node receives N first query messages sent by N second peer nodes, wherein the N first query messages correspond to the N second peer nodes one to one; the first peer node determines N different mirror image fragments included in a mirror image file queried by N first query messages to N second peer nodes according to the N first query messages; the first peer node sends N image fragments and N different hash values corresponding to the N image fragments to N second peer nodes through N network channels, so that the ith second peer node interacts with other second peer nodes to obtain an image file, wherein the ith network channel is a network channel through which the ith peer node transmits the ith image fragment and the hash value corresponding to the ith image fragment, and i =1,2, …, N. In the process of distributing the image file, a first peer node storing the image file associated with the application program in the peer-to-peer network sends N different image fragments included in the image file to N second peer nodes which do not store the image file in the peer-to-peer network through N different network channels, wherein the N different network channels and the N second peer nodes are in one-to-one correspondence with the N different image fragments. After that, the N second peer nodes having N different image fragments in the peer-to-peer network share the image fragments stored with each other through interaction, and the method can reduce the transmission load of the first peer node having the complete image file and improve the image distribution efficiency. When the mirror image fragments stored by the opposite side are shared among the N second peer-to-peer nodes, the second peer-to-peer nodes which do not store the mirror image files can distribute the mirror image fragments to other second peer-to-peer nodes in the network without waiting for receiving the complete mirror image files after receiving the mirror image fragments, so that the utilization rate of network bandwidth can be improved, and the total time consumption for distributing the mirror image files in the network is reduced. Meanwhile, the method is beneficial to improving the efficiency of image distribution. When the distribution of the mirror image file is realized, the mirror image fragment is taken as the minimum transmission granularity, and the flexibility of mirror image distribution can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an application scenario applicable to the image distribution method provided in the embodiment of the present application.
Fig. 2 is a schematic diagram of a transmission process of an image distribution method provided by the conventional technology.
Fig. 3A is a schematic diagram of a network architecture suitable for use in embodiments of the present application.
Fig. 3B is a schematic diagram of another network architecture suitable for use in embodiments of the present application.
Fig. 4 is a schematic structural diagram of a control node 100 according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a peer node 200 according to an embodiment of the present disclosure.
Fig. 6 is a schematic diagram of an image distribution method provided in an embodiment of the present application.
Fig. 7 is a schematic diagram of a relationship between an image file and an image layer according to an embodiment of the present application.
Fig. 8 is a schematic relationship diagram of a mirror layer and a mirror fragment according to an embodiment of the present application.
Fig. 9A is a schematic diagram of another image distribution method provided in an embodiment of the present application.
Fig. 9B is a schematic diagram of another image distribution method provided in the embodiment of the present application.
Fig. 10 is a schematic diagram of a network bandwidth adjustment method according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of a mirror image distribution apparatus according to an embodiment of the present application.
Fig. 12 is a schematic structural diagram of an image distribution system according to an embodiment of the present application.
Fig. 13 is a schematic structural diagram of an image distribution apparatus according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the technical solution of the present application, the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. This application is capable of embodiments in many different forms than those described above and it is therefore intended that all such other embodiments, which would be within the scope of the present application and which are obtained by a person of ordinary skill in the art based on the embodiments provided herein without the exercise of inventive faculty, be covered by the present application.
It should be noted that the terms "first," "second," "third," and the like in the claims, the description, and the drawings of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. The data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, first, technical terms that may be referred to in the embodiments of the present application are briefly described.
Cloud technology (cloud technology)
The cloud technology is a hosting technology for unifying series resources such as hardware, software, network and the like in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data.
2 cloud gaming (cloud gaming)
The cloud game is a game mode based on cloud computing, all games run at a server side in a running mode of the cloud game, and a rendered game picture is compressed and then transmitted to a user through a network.
3, cloud computer (cloud computer)
Similar to cloud gaming, it is a cloud computing based gaming approach. In contrast, this scenario provides the user with a completely open environment, without restricting the user to only play games. The user can carry out a series of operations such as video editing, machine learning and the like through the cloud computer.
4, peer-to-Peer (P2P) network
A peer-to-peer network, also known as a peer-to-peer network or a peer-to-peer computer network. A peer-to-peer network is a distributed application architecture that distributes tasks and workloads between peer nodes, and is a networking or networking form of the peer-to-peer computing model formed at the application layer. In particular, in peer-to-peer networks, participants of the network share a portion of the hardware resources (e.g., computing resources, storage resources, network connection resources, printer resources, etc.) they own, and these shared resources provide services and content over the network and can be accessed directly by other peer nodes without going through intermediate entities. That is, participants in a peer-to-peer network are both providers (servers) and acquirers (clients) of resources, services and content.
Mirror image (mirror)
The mirror is also called a mirror file. An image is a form of file storage, and an image can be regarded as a copy of an original file.
Mirror layer (mirror layer)
The mirror image is usually stored in a layered structure, and the mirror image structure corresponding to each layer is a mirror image layer.
7, mirror slicing
A mirror fragment is a logical fragment to the mirror layer. That is, a mirror layer may be logically divided into a plurality of mirror slices. For example, one image layer is 40 megabytes (Mbyte, MB), which may be logically divided into 10 image slices, each of which is 4MB in size.
8, tree network
The tree network is a network topology, all nodes in the tree network are organized in a tree, and the tree network comprises a root node and leaf nodes. In a tree network, data may flow unidirectionally along branches, i.e., only from a root node to a leaf node, but not from the leaf node to the root node.
9 mesh network
The mesh network is a network topology in which all nodes are randomly interconnected without absolute parent-child relationship, i.e., node a may flow resources to node B, which may also flow resources to node a.
File format of 10,qcow2 disk image file
Qcow2 is the file format of the disk image file used by QEMU.
Hereinafter, an application scenario, a network architecture, and a mirror distribution method applied to the mirror distribution method according to the embodiments of the present application will be described in detail with reference to the drawings. It is understood that the features of the embodiments and examples described below can be combined with each other without conflict between the embodiments provided in this application. In addition, the sequence of steps in the embodiments of the methods described below is merely an example, and is not strictly limited.
First, an application scenario of an image distribution method applicable to the embodiment of the present application is described with reference to the drawings.
Fig. 1 is a schematic diagram of an application scenario applicable to the image distribution method provided in the embodiment of the present application. Illustratively, as shown in fig. 1, the application scenario includes a network, a plurality of nodes i, and a plurality of terminals i, i =1,2,3,4. Any two nodes in the plurality of nodes i can communicate with each other through a network to realize data transmission, and the ith node communicates with the ith terminal to realize data transmission. Optionally, the application scenario may also include a greater (e.g., 10, etc.) number of nodes that communicate over the network to enable transmission of data. Optionally, any node i in the application scenario may also communicate with a greater number (e.g., 2 or 3, etc.) of terminals to implement data transmission. The network shown in fig. 1 may be a wired network or a wireless network, and this is not particularly limited in this application. The node i and the terminal i may be connected in a wired manner, or may be connected in a wireless manner (e.g., bluetooth (bluetooth) or wireless communication technology (WIFI)), which is not particularly limited in this application.
The node i may be a server with storage capabilities (e.g., storing cloud game update image files), computing capabilities. In the application scenario shown in fig. 1, an application (e.g., a game application) installed in a terminal i may run in a node i. That is, the node i can perform operations related to calculations and processes for running the application. After the application program is run by the node i, the data generated by the application program is transmitted to the terminal i, so that the terminal i can obtain the data associated with the application program. For example, in a cloud game scene, a game application installed in a terminal i may run on a node i, the node i may also render and compress acquired application data after running the game application, and then the node i may transmit the processed data to the terminal i to meet the requirements of the terminal i. The node i may also send resources stored in the node i (e.g., an image file generated by an application running in the node i) to other nodes in fig. 1 through the network, or obtain resources stored in other nodes from other nodes in fig. 1 through the network. Alternatively, node i may have a memory and a processor. The processor of node i may be a Central Processing Unit (CPU). Optionally, the node i may further have one or more of a Graphics Processing Unit (GPU), a neural Network Processing Unit (NPU), and a Field Programmable Gate Array (FPGA), and the memory of the node i may be a Random Access Memory (RAM) or a solid-state drive (SSD), and other devices or memory instances with storage capability. A solid-state drive may also be referred to as a solid-state drive (SSD). The form of the node i is not particularly limited. The node i may be hardware or software. When the node i is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server. When the node i is software, it may be implemented as a plurality of software or software modules (for example, software or software modules for providing distributed services), or may be implemented as a single software or software module. The embodiment of the present application is not particularly limited to this.
The terminal i can install and run the application program and display the running result of the application program. For example, a game application installed in the terminal i may be run in the node i, the node i may perform rendering and compression processing on generated game data after running the game application, and send the processed data to the terminal i, and the terminal i may display the game data to a user through a display interface after receiving the data. The form of the terminal i is not particularly limited. For example, the terminal i may be, but is not limited to, a personal computer, a smart phone, a tablet computer, a desktop computer, a wearable device (e.g., a smart watch), or the like.
Optionally, the wireless network or wired network described above uses standard communication techniques and/or protocols. The network is typically the internet, but can 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 private network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including hypertext markup language (HTML), extensible markup language (XML), and the like. In addition, all or some of the links can be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), transport Layer Security (TLS), virtual Private Network (VPN), internet protocol security (IPsec), and the like. In other embodiments, custom and/or dedicated data communication techniques can also be used in place of or in addition to the data communication techniques described above.
It should be understood that the application scenario shown in fig. 1 is only an illustration, and does not set any limit to the application scenario applicable to the image distribution method provided in the embodiment of the present application. Optionally, the application scenario may further include a greater number of nodes or terminals. Optionally, any node in the application scenario may further communicate with a greater number of terminals to implement data transmission.
When the application scenario shown in fig. 1 is a cloud game application scenario, a plurality of nodes in the cloud game application scenario may share a game update image file stored or generated by one node, so as to achieve the purpose of sharing the game update image file. Illustratively, a game update image file generated by running a game application program is stored in the node 1, the node 1 communicates with the nodes 2,3 and 4, and the game update image file stored in the node 1 is transmitted to the nodes 2,3 and 4, so as to realize the sharing of the game update image file. In practical applications, when the number of nodes not owning resources in the network is large, the node 1 owning resources transmits the game update image file to a large number of nodes not owning resources (for example, the game update image file includes 2 Qcow2 image files), which not only increases the overhead of uploading files by the node 1, but also causes high transmission delay when the node 1 transmits the locally stored game update image file to the node 2, the node 3 and the node 4 respectively. In some cases, during the process of transmitting the image file to the node 2, the node 3 and the node 4 by the node 1, there may be a phenomenon that the image file is attacked or tampered, so that the image file received by the node 2, the node 3 and the node 4 is incomplete.
In order to solve the problems in the cloud game application scenario, a conventional technology provides a mirror image distribution method. In the traditional technology, the Qcow2 mirror image is mainly used for storing game data, the method mounts the game data into a cloud game system, the Qcow2 mirror images stored in the nodes of all areas are kept consistent, and the game mirror images existing in the nodes of all areas cannot be configured independently. Fig. 2 is a schematic diagram showing a transmission process of the image distribution method provided by the conventional technique. Referring to fig. 2, the network architecture shown in fig. 2 is a tree structure, and 7 nodes included in the tree structure may be nodes included in the application scenario shown in fig. 1. The node 1 in fig. 2 may be a node storing a cloud game update image file, and in a case that the image file needs to be shared with other nodes shown in fig. 2, the node 1 may first transmit the image file and a hash value 1 corresponding to the image file to the node 2 and the node 3, respectively. After receiving the image file and the hash value 1, the node 2 or the node 3 performs hash operation on the image file to obtain a hash value 2, and determines that the node 2 or the node 3 has successfully received the image file by comparing that the hash value 1 is the same as the hash value 2. Thereafter, node 2 or node 3 will send the image file and the hash value 2 to their respective children, and so on, until all nodes receive the image file, where the children of node 2 are node 4 and node 5, and the children of node 3 are node 6 and node 7. In this implementation, if a node finds that it fails to receive a complete image file, the node needs to send a request for retransmitting the image file to an upstream node to obtain the image file again. The method includes the steps that data of an image file is large in quantity (for example, image files of dozens of gigabytes (Ji Zijie (gigabytes, GB or G)) to hundreds of GB), in the implementation mode, a long time is needed for a node to carry out integrity check on the received image file (for example, dozens of minutes are usually needed), so that high delay exists in transmission of the image file.
Therefore, embodiments of the present application provide an image distribution method, apparatus, and system to solve the existing problems.
Next, a network architecture to which the image distribution method provided in the embodiment of the present application is applied will be described with reference to fig. 3A to 5.
Fig. 3A is a schematic diagram of a network architecture suitable for use in embodiments of the present application. As shown in fig. 3A, the network architecture includes a control node and a plurality of peer nodes. Illustratively, the plurality of peer nodes are shown in fig. 3A as peer node 1, peer node 2, and peer node 3, respectively. Any two nodes in all the nodes (i.e., the control node and the plurality of 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 realize communication and data interaction based on a P2P network communication protocol. For example, the P2P network communication protocol may be a TCP/UDP-based P2P network communication protocol. Optionally, the network architecture may further include a greater number of peer nodes, which is not specifically limited in this application. When the network architecture comprises a larger number of peer nodes, any two nodes in the network architecture can communicate with each other to realize data interaction. For example, fig. 3B illustrates another network architecture suitable for use in the embodiments of the present application, where the network architecture includes 5 peer nodes and 1 control node, and any two nodes included in the network architecture may communicate with each other to implement data transmission.
A control node for managing a plurality of peer nodes in the network architecture. For example, fig. 4 shows a schematic structural diagram of a control node 100 provided in an embodiment of the present application. It is to be understood that the control node 100 may be a control node in the network architecture shown in fig. 3A, i.e. the control node in fig. 3A has the same or similar functionality as the control node 100 in fig. 4. Referring to fig. 4, the control node 100 includes the following functional modules: service registration and discovery 210, network topology center 220, network services (web server), and dynamic regulation center 240. Therein, service registration and discovery 210 is used to ensure that multiple peer nodes in the network architecture shown in fig. 3A are alive. A network topology center 220, configured to construct a P2P network including a plurality of peer nodes shown in fig. 3A according to network states obtained from the plurality of peer nodes. And a web server 230 for providing a web service. The dynamic regulation center 240 is configured to adjust a bandwidth of a network channel (e.g., network channel 1 or network channel 2) in the network according to the network status information obtained from the peer node shown in fig. 3A, so as to ensure that the peer node included in the P2P network is in a normal operating state.
And the peer node is used for sending the network resources (such as image file resources) stored by the peer node to other peer nodes in the network according to the instruction sent by the control node. The peer node may also receive network resources sent by other peer nodes in the network. The peer node may also send the network status obtained by the peer node to the control node. Exemplarily, fig. 5 illustrates a schematic structural diagram of a peer node 200 according to an embodiment of the present application. It is to be understood that peer node 200 may be any one of the peer nodes in the network architecture shown in fig. 3A, i.e., any one of the peer nodes in fig. 3A has the same or similar functionality as peer node 200 in fig. 5. Referring to fig. 5, peer node 200 includes the following functional modules: a mirror fragment transmitter 210, a network analysis model 220, a dynamic regulation client 230, and a file storage server 240. Wherein image fragment transmitter 210 is configured to transmit the image fragment stored in file storage service 240 to other peer nodes in the network except peer node 200. The network analysis module 220 is configured to perform inter-node speed measurement and maintain network conditions of other peer nodes where the peer node 100 communicates with the peer node 100. For example, the network analysis module 220 may perform inter-node velocity measurement based on raw-socket (raw-socket) technology. The dynamic regulation client 230 is responsible for analyzing the channel traffic state of the data transmitted by the peer node 200, and reporting the network condition obtained by the network analysis module 220 to the dynamic regulation center 140 in the control node 100.
The form of the control node and the plurality of peer nodes shown in fig. 3A is not particularly limited in the present application. For example, the control node and the plurality of peer nodes may be servers. The server may be hardware or software. When the server is hardware, the server can be implemented as a distributed server cluster formed by a plurality of servers, or can be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules for providing distributed services) or as a single piece of software or software module. The embodiment of the present application is not particularly limited to this.
Note that the control node shown in fig. 3A is a network node independent of the peer node 1, the peer node 2, and the peer node 3. It is understood that in this implementation manner, the network architecture suitable for the embodiment of the present application may include at least 4 nodes, i.e., a control node, a peer node 1, a peer node 2, and a peer node 3. Optionally, in other implementations, the control node may also be any one of the peer node 1, the peer node 2, or the peer node 3, and in this case, the any one peer node also has the function of the control node shown in fig. 3A. It can be understood that, in this implementation manner, the network architecture applicable to this embodiment of the present application may include at least 3 nodes, that is, peer node 1, peer node 2, and peer node 3, and one of these 3 peer nodes also has the function of the control node shown in fig. 3A.
It should be understood that fig. 3A to fig. 5 are only schematic diagrams, and do not set any limit to a network architecture to which the image distribution method provided in the embodiment of the present application is applicable. For example, fig. 3A illustrates a network architecture that may also include a greater number of peer nodes and a greater number of network channels.
Hereinafter, a method for distributing images provided by the embodiment of the present application is described with reference to fig. 6 to 9.
Fig. 6 is a schematic diagram of an image distribution method provided in an embodiment of the present application. The mirror image distribution method provided by the embodiment of the application can be applied to a peer-to-peer network comprising a control node, a first peer node managed by the control node and N second peer nodes, wherein N is a positive integer greater than or equal to 2. For example, the control node shown in fig. 6 may be the control node shown in fig. 3, and the first peer node and the N second peer nodes shown in fig. 6 may be a plurality of peer nodes shown in fig. 3. As shown in fig. 6, the image distribution method provided in the embodiment of the present application includes S601 to S606. Before introducing S601 to S606, detailed descriptions of the control node, the first peer node, and the N second peer nodes are provided in this application.
In the embodiment of the application, the control node in the peer-to-peer network is used for managing the first peer node and the N second peer nodes. For example, the control node is configured to manage network bandwidths of the first peer node and the N second peer nodes, network topologies between the first peer node and the N second peer nodes, and the like. In some embodiments, the control node is any one of the following peer nodes: a first peer node, or N second peer nodes. It is to be understood that when the control node is the first peer node or one of the N second peer nodes, the first peer node or the one second peer node also has the function of the control node. In other embodiments, the control node may be a node independent from the first peer node and the N second peer nodes, and in this case, any one of the first peer node and the N second peer nodes may not have the function of the control node. It can be understood that any two nodes in the peer-to-peer network perform data transmission 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. Illustratively, taking fig. 3A as an example for introduction, when the control node is the control node shown in fig. 3A, the first peer node is a peer node 1, and the plurality of second peer nodes are peer nodes 2 and peer nodes 3, the control node and the peer node 1 communicate with each other through a network channel 5, the control node and the peer node 2 communicate with each other through a network channel 4, the control node and the peer node 3 communicate with each other through a network channel 6, the peer node 1 and the peer node 3 communicate with each other through a network channel 3, the peer node 1 and the peer node 2 communicate with each other through a network channel 1, and the peer node 2 and the peer node 3 communicate with each other through a network channel 2. And any two of the network channels 1 to 6 are different.
In an embodiment of the application, a first peer node stores an image file associated with an application program. That is, the first peer node is the node in the peer-to-peer network that owns the image file. The image file comprises N different image fragments, wherein N is a positive integer greater than or equal to 2. That is, the image file includes at least two different image slices. The N different image fragments, that is, the identifiers of the N image fragments are different, but the N different image fragments carrying information associated with the application program may be the same or different. It is to be understood that the identity of one mirror fragment may be used to uniquely identify the one mirror fragment. In some implementations, when the image file is stored in a mirror hierarchy structure, the one image file may include at least one mirror hierarchy, and the at least one mirror hierarchy may include the N different mirror slices. For example, fig. 7 shows a schematic diagram of a relationship between an image file and image layers, where in fig. 7, an image file may be divided into P image layers, where P is a positive integer greater than or equal to 1. Fig. 8 shows a relationship diagram of a mirror layer and mirror slices, where the mirror layer P in fig. 8 may be divided into m mirror slices, where m is a positive integer greater than or equal to 2. The type of the application program is not particularly limited. In some implementations, the application is a cloud game application, and the image file associated with the application is an updated image file generated by the cloud game 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.
In an 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 program. That is, before the image distribution method provided by the present application is not executed, each second peer node included in the peer-to-peer network does not own at least one image fragment included in the image file.
Next, S601 to S606 will be described in detail.
S601, the control node sends a downloading instruction to the N second peer-to-peer nodes, wherein the downloading instruction is used for indicating the start of downloading the image file, and N is a positive integer greater than or equal to 2.
Optionally, the downloading instruction may carry an identifier of the image file, where 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 according to the identifier of the image file included in the downloading instruction.
Optionally, in some embodiments, before the step S601, the control node may further perform the following steps: and receiving a request sent by the user terminal, wherein the request indicates that N second peer-to-peer nodes in the peer-to-peer network need to acquire the 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 the user terminal is not particularly limited. For example, the user terminal may be, but is not limited to, any of the following: a smartphone, a tablet, a desktop, or a wearable smart device (e.g., a smart watch), etc.
And executing the step S601, that is, the control node sends an instruction for starting downloading the image file associated with the application program to the N second peer nodes.
S602, the ith second peer node determines, according to the received download instruction sent by the control node, a download order of the N image fragments included in the downloaded image file, i =1,2, …, N.
The above S602 is executed, that is, each second peer node (i.e., the ith second peer node) in the N second peer nodes determines a downloading sequence of the N image fragments included in the image file downloaded by each second peer node, where the N second peer nodes are in one-to-one correspondence with the N downloading sequences, and the N downloading sequences are different.
In some implementations, the N download orders are different, and it can be understood that any two download orders of the N download orders are completely different. Illustratively, when the image file includes 2 image fragments (i.e., image fragment 1 and image fragment 2), and the N second peer nodes include 2 second peer nodes, the downloading order determined by one of the second peer nodes may be to download the image fragment 1 first and then download the image fragment 2; the downloading order determined by the other second peer node may be to download the image fragment 2 first and then download the image fragment 1. In this implementation, the downloading order corresponding to the two second peer nodes is completely different.
In other implementations, the N download orders are different, and it is understood that any two download orders of the N download orders are not identical. Any two downloading sequences are not completely the same, which means that the first downloaded image fragment indicated by any two downloading sequences is different, and the downloading sequences of the other image fragments except the first downloaded image fragment indicated by any two downloading sequences are not specifically limited. Illustratively, when the image file includes 3 image fragments (i.e., image fragment 1, image fragment 2, and image fragment 3), and the N second peer nodes include 2 second peer nodes, the order of downloading the image fragments determined by one of the second peer nodes is: a mirror image fragment 1, a mirror image fragment 2 and a mirror image fragment 3; the order of downloading the mirror image fragments determined by the other second peer node is as follows: a mirror image fragment 3, a mirror image fragment 2 and a mirror image fragment 1; or the order of downloading the mirror image fragments determined by the other second peer node is as follows: mirror segment 2, mirror segment 1, and mirror segment 3. In this implementation, the downloading order corresponding to the two second peer nodes is not identical.
S603, the ith second peer node determines to send the first query message to the first peer node and send the second query message to other second peer nodes according to the ith downloading sequence corresponding to the ith second peer node.
The first query message is used for querying the ith image fragment included in the image file, and the ith image fragment is the first image fragment downloaded according to the downloading order indicated by the ith downloading order. In some implementation manners, when the downloading order corresponding to each of the N second peer nodes indicates that the downloaded first mirror image segments are different, the foregoing S603 is executed, that is, the mirror image segments queried by the query message sent by each second peer node to the first peer node are different.
The second query message is used for querying an image fragment, except for the ith image fragment, included in the image file, and the image fragment queried by the second query message is the jth image fragment downloaded according to the ith downloading sequence, j =2,3, …, N. It can be understood that, when N is specifically a positive integer greater than or equal to 3, if the second query message is a first second query message sent by an ith second peer node, j =2; if the second query message is a second query message sent by the ith second peer node, j =3; and so on. Illustratively, when the image file includes 3 image fragments (i.e., image fragment 1, image fragment 2, and image fragment 3), and the N second peer nodes include 2 second peer nodes, the order of downloading the image fragments determined by one of the second peer nodes is: a mirror image fragment 1, a mirror image fragment 2 and a mirror image fragment 3; the order of downloading the mirror image fragments determined by the other second peer node is as follows: mirror segment 3, mirror segment 2, and mirror segment 1. In this implementation, the first query message sent by the one second peer node is used to query the image fragment 1. The first query message sent by the further second peer node is used to query the mirror fragment 2. The first second query message sent by the one second peer node is used to query the mirror fragment 2, and the second query message sent by the one second peer node is used to query the mirror fragment 3. The first second query message sent by the other second peer node is used to query the mirror fragment 2, and the second query message sent by the other second peer node is used to query the mirror fragment 1.
The other second peer nodes refer to N-1 second peer nodes except the ith second peer node in the N second peer nodes.
S604, the ith second peer node sends a first query message to the first peer node and sends second query messages to other second peer nodes to obtain the image file.
In some implementations, the ith second peer node sends a first query message to the first peer node and sends second query messages to other second peer nodes to obtain the image file, including the following steps: the ith second peer node sends a first query message to the first peer node; the ith second peer node receives the ith image fragment sent by the first peer node and the hash value corresponding to the ith image fragment, wherein the hash value corresponding to each image fragment is different; under the condition that the received ith mirror image fragment passes the integrity check, the ith second peer node saves the ith mirror image fragment and sends second query messages to other second peer nodes; the ith second peer node receives the image fragments inquired by the second inquiry messages sent by other second peer nodes and the hash values corresponding to the inquired image fragments, and the number of the image fragments sent by other second peer nodes does not exceed a preset threshold value; and under the condition that the received image fragment inquired by the second inquiry message passes the integrity check, the ith second peer node stores the image fragment inquired by the second inquiry message. It is understood that after the above steps are performed, the ith second peer node may obtain all the image fragments (i.e., N image fragments) included in the image file sent by the first peer node and the other second peer nodes. In the implementation mode, N second peer nodes which have N different image fragments in the peer-to-peer network can interact with each other to share the image fragments stored mutually, so that the transmission load of the first peer node which has a complete image file can be reduced, and the node downloading speed and efficiency are improved. In this implementation manner, each second peer node does not need to wait for receiving the complete image file and then send the image file to other second peer nodes that do not store the image file, so that the image distribution efficiency can be improved.
Optionally, in some other implementations, the ith second peer node may further send a second query message to the first peer node. In this implementation, there may be a case where the number of the image fragments uploaded by the first peer node exceeds a preset threshold, and based on a situation that the first peer node receives the second query message and the first peer node locally stores the image fragment queried by the second query message, the first peer node does not send the image fragment queried by the second query message as an ith second peer node. That is to say, in this implementation manner, after receiving the second query message, the first peer node sends the second query message to the ith second peer node with a query result that is a failure, where the query result does not include the mirror segment queried by the second query message.
In the foregoing implementation manner, the image fragment queried by the second query message is the jth image fragment downloaded according to the ith download order, and j =2,3, …, N. That is, the ith second peer node sends N-1 second query messages to obtain N-1 different image fragments queried by the N-1 second query messages. Optionally, in some implementation manners, after the ith second peer node determines that a currently received image fragment passes the integrity check, the ith second peer node may continue to send a new query message. In other words, when the ith second peer node determines that a currently received image fragment does not pass the integrity check, the ith second peer node may retransmit a message to request to retrieve the complete image fragment. And the ith second peer node sends the second query message to other second peer nodes, which may be sending the second query message to all of the N-1 second peer nodes at the same time. Based on this, in some possible implementations, the sending, by the ith second peer node, the second query message to the other second peer nodes includes: the ith second peer node sends 1 st second query message to all second peer nodes except the ith second peer node in the N second peer nodes, wherein the image fragment queried by the 1 st second query message is the 2 nd image fragment (j = 2) downloaded according to the ith downloading sequence; under the condition that the ith second peer node determines to successfully receive the image fragment queried by the 1 st second query message, the ith second peer node sends the 2 nd second query message to all second peer nodes except the ith second peer node in the N second peer nodes, wherein the image fragment queried by the 2 nd second query message is the 3 rd image fragment (j = 3) downloaded by the ith download sequence, … …, and so on, until the ith second peer node obtains the image fragment queried by the N-1 st query message, the ith second peer node stops sending the second query message.
Optionally, in the foregoing implementation manner, each second peer node that receives the image fragment may further perform integrity check on the received image fragment to determine whether the image fragment received by each second peer node is complete or tampered. Based on this, the image distribution method provided in the embodiment of the present application may further include the following steps: the ith second peer node performs integrity check on the received image fragments, and the image fragments received by the ith second peer node include the ith image fragment and the image fragments inquired by the second inquiry message; if the received ith mirror image fragment is determined not to pass the integrity check, the ith second peer node sends a first retransmission message to the first peer node, wherein the first retransmission message is used for indicating the first peer node to send the ith mirror image fragment; and if the mirror image fragment inquired by the received second inquiry message is determined not to pass the integrity check, the ith second peer node sends a second retransmission message to other second peer nodes, wherein the second retransmission message is used for indicating the other second peer nodes to send the mirror image fragment inquired by the second inquiry message.
Optionally, in some implementation manners, the i-th second peer node performs integrity check on each received image fragment according to each image fragment and the hash value corresponding to each image fragment, including: the ith second peer node performs hash calculation on each received image fragment to obtain a value after the hash calculation; the ith second peer node determines whether each image fragment passes integrity check by comparing the value after hash calculation with the hash value corresponding to each image fragment; if the value after the hash calculation is the same as the hash value corresponding to each image fragment, determining that each image fragment passes the integrity check; and if the value after the hash calculation is different from the hash value corresponding to each image fragment, determining that each image fragment does not pass the integrity check. The type of hash algorithm used for the hash calculation is not particularly limited. For example, the hash algorithm may be, but is not limited to, a hash algorithm or a message digest algorithm.
Optionally, in some scenarios, other second peer nodes in the above implementation do not locally store the image fragment queried by the second query message, so that even after the other second peer nodes receive the second query message, the image fragment queried by the second query message and the corresponding hash value cannot be sent to the ith second peer node. Based on this, that is, if the ith second peer node in the foregoing implementation manner does not receive the image fragment queried by the second query message sent by the other second peer node and the hash value corresponding to the queried image fragment, the image distribution method provided in the embodiment of the present application may further include the following steps: the ith second peer node sends a second query message to the first peer node; and the ith second peer node receives the image fragment inquired by the second inquiry message sent by the first peer node and the hash value corresponding to the inquired image fragment. Illustratively, when the image file includes 3 image fragments (i.e., image fragment 1, image fragment 2, and image fragment 3), and the N second peer nodes include 2 second peer nodes, the order of downloading the image fragments determined by one of the second peer nodes is: a mirror image fragment 1, a mirror image fragment 2 and a mirror image fragment 3; the order of downloading the mirror image fragments determined by the other second peer node is as follows: mirror segment 3, mirror segment 2, and mirror segment 1. In this scenario, if the second image fragment (i.e., the image fragment 2) indicated by the corresponding download order is downloaded by the second peer node and the another second peer node at the same time, the another second peer node and the one second peer node send query messages for querying the image fragment 2 to each other, and since the image fragment 2 is not locally stored in the two second peer nodes, the two second peer nodes cannot interact with each other to obtain the image fragment 2. Thereafter, the one second peer node and the another second peer node may send query messages to the first peer node querying the mirrored slice 2. Or, the second peer node may send a query message for querying the image fragment 2 to the first peer node, so as to store the obtained image fragment 2 locally; and the other second peer node sends a message for inquiring the image fragment 2 to the second peer node to obtain the image fragment 2.
S605, the first peer node determines N different image fragments included in the image file queried by the N first query messages to be sent to N second peer nodes according to the N first query messages.
S606, the first peer node sends N image fragments and N different hash values corresponding to the N image fragments to N second peer nodes through N network channels, so that the ith second peer node interacts with other second peer nodes to obtain an image file.
The sending method of the first peer node sending the mirror fragment and the hash value corresponding to the mirror fragment is not particularly limited. For example, the first peer node may encapsulate the mirror fragment and the hash value corresponding to the mirror fragment in the same data packet, and send the encapsulated data packet to the corresponding second peer node. The second peer node analyzes the received data packet to obtain the mirror image fragment and the hash value corresponding to the mirror image fragment. For another example, the first peer node may encapsulate the mirror fragment and the hash value corresponding to the mirror fragment in two different data packets, and send the two encapsulated data packets to the corresponding second peer node at the same time.
In this embodiment of the present application, the interacting between the ith second peer node and other second peer nodes to obtain an image file includes: the ith second peer node sends a first query message to the first peer node and sends second query messages to other second peer nodes to obtain the image file. The above S604 describes the flow of this implementation in detail, and the content not described in detail herein may refer to the relevant description in S604 above.
After the step S606 is executed that the first peer node sends the N image fragments and N different hash values corresponding to the N image fragments to the N second peer nodes through the N network channels, each second peer node in the N second peer nodes which do not store the image file and are included in the peer-to-peer network may successfully acquire one image fragment included in the image file, and the image fragments acquired by each second peer node are different. Based on this, the N second peer nodes in the peer-to-peer network can obtain the mirror image fragments stored by the other peer nodes through mutual interaction, so that the transmission burden of the first peer node having the complete mirror image file 1 can be reduced, and the node downloading speed and efficiency are improved. In addition, when the image fragments owned by the opposite side are shared among the N second peer nodes, each second peer node downloads the image fragments stored by other second peer nodes and uploads the image fragments stored by itself to other second peer nodes, so that the transmission efficiency of the image fragments can be improved.
Optionally, after executing the foregoing S601 to S606, the ith second peer node in the peer-to-peer network may receive N image fragments included in the image file. In order to verify whether the ith second peer node successfully receives the complete image file, the integrity verification of all image fragments received by the ith second peer node may be further performed to determine whether the ith second peer node successfully receives the image file. In some implementations, performing the integrity verification described above may be accomplished by: the ith second peer node performs hash processing on all the received image fragments to obtain a hash value #2, and sends the hash value #2 to the control node; the first peer node performs hash processing on the image file to obtain a hash value #3, and sends the hash value #3 to the control node; the control node compares the received hash value #2 with the hash value #3 to obtain check information, wherein the check information is used for indicating whether the ith second peer node successfully receives the complete image file; if the hash value #2 is the same as the hash value #3, the check information is used for indicating that the ith second peer node successfully receives the complete image file; or, if the hash value #2 is different from the hash value #3, the check information is used to indicate that the ith second peer node has not successfully received the complete image file. In other implementations, performing the integrity verification may be accomplished by: the ith second peer node performs hash processing on all the received image fragments to obtain a hash value #2; the first peer node performs hash processing on the image file to obtain a hash value #3, and sends the hash value #3 to the ith second peer node; the ith second peer node compares the hash value #2 with the hash value #3 to obtain check information, wherein the check information is used for indicating whether the ith second peer node successfully receives the complete image file; if the hash value #2 is the same as the hash value #3, the check information is used for indicating that the ith second peer node successfully receives the complete image file; or, if the hash value #2 is different from the hash value #3, the check information is used to indicate that the ith second peer node has not successfully received the complete image file. In this implementation, the ith second peer node may further send a retransmission message to obtain at least one image fragment included in the image file that is not owned.
Optionally, in the process described in the image distribution method shown above, the peer node in the P2P network may also communicate with other peer nodes to obtain the current network state of the other peer nodes. The network state of a peer may include the speed at which the peer uploads data to other peers and the speed at which the peer downloads data from other peers. In the P2P network, if any one peer node finds that the speed of uploading data to other peer nodes by the any one peer node does not meet the preset uploading speed, or the speed of downloading data from other peer nodes by the any one peer node does not meet the preset downloading speed, the any one peer node may further send the acquired network state information to the control node, so that the control node reallocates the network bandwidth of the peer node in the P2P network according to the network state information, thereby solving the problem that the uploading speed or the downloading speed of the any one peer node does not meet the preset speed, and facilitating to ensure that the network is in a stable working state. Based on this, the image distribution method provided in the embodiment of the present application may further include the following steps: the ith second peer node sends N detection messages to the first peer node and other second peer nodes to obtain network quality corresponding to N network channels, the N second peer nodes correspond to the N detection messages one by one, the network quality corresponding to the ith network channel does not meet the preset requirement, and the ith network channel is a network channel for data transmission between the ith second peer node and the first peer node or a network channel for data transmission between the ith second peer node and one of the other second peer nodes; and the ith second peer node sends the network quality corresponding to the N network channels to the control node, so that the control node adjusts the bandwidth values corresponding to the network channels except the ith network channel in the N network channels according to the network quality corresponding to the N network channels. For example, fig. 10 below is a method for adjusting a network bandwidth provided in an embodiment of the present application, and details that are not described herein may be referred to in the related description of fig. 10 below.
It should be understood that the image distribution method shown in fig. 6 is only an illustration and does not limit the image distribution method provided in the embodiments of the present application in any way.
In the embodiment of the application, a first peer node storing an image file in a peer-to-peer network sends an image fragment included in the image file to a second peer node not storing the image file in the peer-to-peer network through different network channels, and the image fragments received by each second peer node are different. After receiving the image fragment included in the image file, the second peer node in the peer-to-peer network, which does not store the image file, can serve as a resource node in the peer-to-peer network, and provide an upload function for other second peer nodes in the peer-to-peer network, which do not store the image fragment. In the implementation process, after receiving the image fragment included in the image file, the second peer node which does not store the image file can distribute the image fragment included in the image file to other second peer nodes in the network without waiting for receiving the complete image file, so that the network bandwidth utilization rate can be increased, the total time consumption for distributing the image file in the network can be reduced, and the purpose of rapidly distributing the image file in the network can be achieved. In the process of distributing the image, the integrity of the image fragments which are received by the peer node and are associated with the image file is checked to determine whether a second peer node which does not store the image file in the network successfully receives the image file. When the distribution of the mirror image file is realized in the network, the mirror image fragment is taken as the minimum transmission granularity, so that the flexibility of the mirror image distribution can be improved. Under the scene of the failure of the transmission of the mirror image fragment, only the abnormal mirror image fragment needs to be retransmitted, so that the problem that the whole mirror image file needs to be retransmitted in the prior art is avoided, and the retransmission rate is favorably reduced.
Next, by taking the network architecture shown in fig. 3A above as an example, another image distribution method provided by the present application is described with reference to fig. 9A and 9B. For convenience of description, the network architecture shown in fig. 3A will be referred to as a P2P network hereinafter. It is to be understood that the image distribution method described in fig. 9A and 9B is a specific example of the image distribution method described in fig. 6, and the method described in fig. 9A and 9B is only an illustration and does not constitute any limitation to the image distribution method provided in the embodiment of the present application. Specifically, fig. 9A and 9B are introduced by taking the application scenario in fig. 6 as a cloud game scenario, and taking the game update image file 1 to be shared stored in the peer node 1 as an example, where the peer-to-peer network in the method described in fig. 6 includes a control node, a peer node 1, a peer node 2, and a peer node 3. Here, the peer node 1 may be understood as the first peer node shown in fig. 6 described above, and the peer nodes 2 and 3 may be understood as N second peer nodes shown in fig. 6 described above, where N =2.
Fig. 9A is a schematic diagram of another image distribution method provided in the embodiment of the present application. It should be understood that the example of fig. 9A is only for assisting the skilled person in understanding the embodiments of the present application, and is not intended to limit the embodiments of the present application to the specific values or specific scenarios illustrated. It will be apparent to those skilled in the art that various equivalent modifications or variations are possible in light of the example of fig. 9A given below, and such modifications and variations also fall within the scope of the embodiments of the present application. As shown in fig. 9A, the method includes S901 to S911. Next, S901 to S911 are described in detail.
S901, the control node obtains request 1.
The control node is a node in the peer-to-peer network for managing 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 from the peer node 1, the peer node 2, and the peer node 3.
The request 1 is used for requesting to acquire the image file 1 generated by running the application 1. The application 1 may be a cloud game application, and the image file 1 may be a game update image file, and the specific type of the application 1 is not limited. The image file 1 may include 1 image layer, where the 1 image layer includes an image fragment 1 and an image fragment 2, that is, the image file 1 includes the image fragment 1 and the image fragment 2, and the identifier of the image fragment 1 is different from the identifier of the image fragment 2. The identifier of the image fragment 1 is different from the identifier of the image fragment 2, which means that the image fragment 1 and the image fragment 2 are two different image fragments included in the image file 1. For example, fig. 7 shows a schematic diagram of a relationship between an image file and image layers, where in fig. 7, an image file may be divided into P image layers, where P is a positive integer greater than or equal to 1. Fig. 8 shows a schematic diagram of a relationship between a mirror layer and a mirror segment, where the mirror layer P in fig. 8 may be divided into m mirror segments, m is a positive integer greater than or equal to 2, and the mirror segment 1 and the mirror segment 2 are two different mirror segments included in the mirror N. The presentation form of the identifier of the mirror fragment in the mirror file is not particularly limited. For example, the identifier of the mirror image slice m is (T1, T2), T1 identifies the mirror image layer P where the mirror image slice m is located, and T2 identifies a specific position where the mirror image slice m is located in the mirror image layer P.
In practical application, 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, which is not specifically limited in this application.
It can be understood that, in the embodiment of the present application, all the image fragments included in the image file 1 are stored in the following order: mirror segment 1, mirror segment 2.
And S902, the control node respectively sends an instruction 1 to the peer node 2 and the peer node 3, wherein the instruction 1 is used for indicating the image file requested by the downloading request 1. Accordingly, peer node 2 and peer node 3 each receive instruction 1.
In the above S901, the request 1 is used to request to acquire the image file 1, and based on this, the instruction 1 is specifically used to instruct to start downloading the image file 1 requested by the request 1.
And S903, the peer node 2 determines that all the image fragments included in the image file requested by the request 1 need to be downloaded in the first downloading sequence according to the instruction 1.
The first downloading order is the order of downloading all the image fragments included in the image file 1. Wherein, the first downloading sequence is to download the image fragment 1 first and then download the image fragment 2.
Wherein, the peer node 2 determines, according to the instruction 1, that all the image fragments included in the image file requested by the request 1 need to be downloaded in the first downloading order, including: the peer node 2 determines that the image file 1 needing to be downloaded comprises an image fragment 1 and an image fragment 2 according to the instruction 1; the peer node 2 randomly orders the sequence of the mirror image fragments included in the mirror image file 1 to obtain a first downloading sequence.
S904, the peer node 3 determines, according to the instruction 1, that all the image fragments included in the image file requested by the request 1 need to be downloaded in the second downloading order.
The second downloading order, that is, the order of downloading all the image fragments included in the image file 1, is different from the first downloading order. Wherein, the second downloading sequence is to download the image fragment 2 first and then download the image fragment 1.
Wherein, the peer node 3 determines, according to the instruction 1, that all the image fragments included in the image file requested by the request 1 need to be downloaded in the second downloading order, including: the peer node 3 determines that the image file 1 needing to be downloaded comprises an image fragment 1 and an image fragment 2 according to the instruction 1; the peer node 3 randomly orders the order of the mirror image fragments included in the mirror image file 1 to obtain a second downloading order.
S905, the peer node 2 sends a query message 1 to the nodes in the P2P network, and queries the mirror fragment 1.
The query message 1 is associated with the first downloading order, and the query message 1 is specifically used for querying a first image fragment to be downloaded in the order of downloading image fragments indicated by the first downloading order, that is, the query message 1 is used for querying the image fragment 1.
Wherein, the peer node 2 sends the query message 1 to the nodes in the network, including: the peer node 2 determines that all the image fragments included in the image file 1 are not stored locally in the peer node 2 according to the instruction 1; the peer node 2 generates a query message 1 according to the first download order.
S906, the peer node 3 sends a query message 2 to the nodes in the network, querying the mirror fragment 2.
The query message 2 is associated with the second downloading order, and the query message 2 is specifically used for querying the second image fragment to be downloaded in the order of downloading the image fragments indicated by the first downloading order, that is, the query message 2 is used for querying the image fragment 2.
Wherein, the peer node 3 sends the query message 2 to the nodes in the network, including: the peer node 3 determines that all the image fragments included in the image file 1 are not stored locally in the peer node 3 according to the instruction 1; the peer node 3 generates the query message 2 according to the second downloading order.
S907, the peer node 1 determines that the mirror image fragment 1 is locally stored according to the query message 1; and determining that the mirror image fragment 2 is locally stored according to the query message 2.
The peer node 1 determines that the mirror image fragment 1 is locally stored according to the query message 1, and the method includes the following steps: the peer node 1 queries the locally stored mirror image fragment according to the identifier of the mirror image fragment 1 carried in the query message 1, and determines that the locally stored mirror image fragment 1 is stored.
The peer node 1 determines that the mirror image fragment 2 is locally stored according to the query message 2, and the method includes the following steps: the peer node 1 queries the locally stored mirror image fragment according to the identifier of the mirror image fragment 2 carried in the query message 2, and determines that the locally stored mirror image fragment 2 is stored.
S908, in response to satisfying condition 1, peer node 1 sends the mirror fragment 1 and the hash value 1 to peer node 2 through network channel 1.
Satisfying the condition 1 includes: the requirement that the number of the mirror image fragments uploaded by the peer node 1 does not exceed the preset uploading number is met. The preset upload data amount is not specifically limited, and the preset upload amount may be determined according to the current network state of the peer node 1. That is, when the current network state of the peer node 1 is good, the preset upload number may be large; the preset upload number may be smaller when the current network status of the peer node 1 is not good. For example, the preset number of uploads may be, but is not limited to, equal to 1 or 2, etc.
The network channel 1 is a network channel for data transmission between the peer node 1 and the peer node 2.
Optionally, before S908, the peer node 1 may further perform hash calculation on the image fragment 1 to obtain a hash value 1, where the hash value 1 is used to implement integrity check of the image fragment 1. The type of hash algorithm is not particularly limited. For example, the hash algorithm may be, but is not limited to, a hash algorithm or a message digest algorithm.
The form in which the peer node 1 sends the mirror fragment 1 and the hash value 1 to the peer node 2 through the network channel 1 is not limited. For example, peer node 1 may encapsulate image fragment 1 and hash value 1 in one data packet, and then send the encapsulated one data packet to peer node 2. For another example, the peer node 1 may further encapsulate the image fragment 1 and the hash value 1 in two data packets, and then send the two encapsulated data packets to the peer node 2 together.
S909, in response to the condition 1 being satisfied, the peer node 1 transmits the mirror fragment 2 and the hash value 2 to the peer node 3 through the network channel 3.
The satisfaction condition 1 in S909 is the same as the satisfaction condition 1 in S908. When the condition 1 is satisfied in the above S908, it includes: when the number of the mirror fragments uploaded by the peer node 1 does not exceed 1 mirror fragment, the peer node 1 may first perform the above S908 and then perform the above S909, or the peer node 1 may first perform the above S909 and then perform the above S908.
The network channel 3 is a network channel for data transmission between the peer node 1 and the peer node 3, and the network channel 3 and the network channel 1 are not the same network channel. In other words, peer node 1 transmits different image slices over different network channels.
Optionally, before S909, the peer node 1 may further perform hash calculation on the mirror image slice 2 to obtain a hash value 2.
S910, the peer node 2 performs integrity check on the mirror fragment 1 according to the mirror fragment 1 and the hash value 1, and determines that the received mirror fragment 1 is complete.
The peer node 2 performs integrity check on the mirror fragment 1 according to the mirror fragment 1 and the hash value 1, and determines that the received mirror fragment 1 is complete, including: the peer node 2 processes the mirror image fragment 1 by using a hash algorithm to obtain a hash value #1; by comparing that the hash value 1 is the same as the hash value #1, it is determined that the received image fragment 1 is complete, i.e. the image fragment 1 has not been attacked or tampered during transmission. It will be appreciated that the hash algorithm for peer node 1 to determine hash value 1 from image slice 1 is the same as the hash algorithm for peer node 2 to determine hash value #1 from image slice 1.
Illustratively, when peer node 1 encapsulates image fragment 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 performing S910 above: and analyzing the data packet to obtain the mirror image fragment 1 and the hash value 1.
And S911, the peer node 3 checks the integrity of the mirror image fragment 2 according to the mirror image fragment 2 and the hash value 2, and determines that the received mirror image fragment 2 is complete.
The principle of the peer node 3 performing the above S911 is the same as that of the peer node 2 performing the above S910, and details which are not described herein may be referred to the above description of S910.
It can be understood that after the foregoing S901 to S911 are executed, the first round of distribution of the mirror image fragments included in the mirror image file 1 is completed. In the first round of distribution, peer nodes (i.e., peer node 2 and peer node 3) in the P2P network that do not own the image file may obtain one image fragment included in the image file from peer node 1 that owns the image file. Specifically, the peer node 2 acquires the mirror fragment 1 from the peer node 1 through the network channel 1, the peer node 3 acquires the mirror fragment 2 from the peer node 1 through the network channel 3, the network channel 1 is different from the network channel 3, and the mirror fragment 1 is different from the mirror fragment 2. That is, after the first round of distribution of the image fragments is performed, the peer node 2 and the peer node 3 in the P2P network respectively own different image fragments included in the image file 1. After that, the peer node 2 and the peer node 3 in the P2P network may acquire the mirror fragments owned by each other in a resource sharing manner. Next, the second round of distribution process is described in detail in conjunction with S912 to S922 shown in fig. 9B.
S912, the peer node 2 generates a query message 3 according to the instruction 1 and the first downloading order.
After the first round of distribution is performed, the mirror fragment 1 included in the mirror file 1 is stored locally in the peer node 2. Based on this, the peer node 2 generates the query message 3 according to the instruction 1 and the first downloading order, where the query message 3 is specifically used to query the second image fragment to be downloaded in the order of downloading the image fragments indicated by the first downloading order, that is, the query message 3 is used to query the image fragment 2. Optionally, the query message 3 may carry an identifier of the mirror fragment 2 and an identifier of the peer node 2, where the identifier of the mirror fragment 2 is used to uniquely identify the mirror fragment 2, and the identifier of the peer node 2 is used to uniquely identify the peer node 2.
S913, the peer node 3 generates the query message 4 according to the instruction 1 and the second downloading order.
After the first round of distribution is performed, the mirror fragment 2 included in the mirror file 1 is stored locally in the peer node 3. Based on this, the peer node 3 generates the query message 4 according to the instruction 1 and the second downloading order, where the query message 4 is specifically used to query the second image fragment to be downloaded in the order of downloading the image fragments indicated by the first downloading order, that is, the query message 4 is used to query the image fragment 1. Optionally, the query message 4 may carry an identifier of the mirror fragment 1 and an identifier of the peer node 3, where the identifier of the mirror fragment 1 is used to uniquely identify the mirror fragment 1, and the identifier of the peer node 3 is used to uniquely identify the peer node 3.
S914, the peer node 2 sends a query message 3 to the nodes in the P2P network, querying the mirror fragment 2. Accordingly, a node in the P2P network receives the query message 3.
Wherein, the peer node 2 sends the query message 3 to the nodes in the P2P network, including: peer node 2 sends query message 3 to peer node 1 over network channel 1, query message 3 to peer node 3 over network channel 2, and query message 3 to the control node over network channel 4.
S915, the peer node 3 sends a query message 4 to the nodes in the P2P network, and queries the mirror fragment 1. Accordingly, a node in the P2P network receives the query message 4.
Wherein, the peer node 4 sends the query message 4 to the nodes in the P2P network, including: peer node 4 sends query message 4 to peer node 1 over network channel 3, query message 4 to peer node 2 over network channel 2, and query message 4 to the control node over network channel 6.
S916, the peer node 3 determines that the mirror image fragment 2 is locally stored according to the query message 3, and meets the condition 2.
Satisfying the condition 2 includes: the method meets the condition that the peer node does not locally store all the image fragments included in the image file 1, and the number of the image fragments uploaded by the peer node does not exceed the preset uploading number. That is to say, the peer node satisfying the condition 2 is not the peer node having the complete image file 1, and the number of the image fragments uploaded by the peer node does not exceed the preset uploading number.
The preset uploading number is not specifically limited, and may be set according to a network state of a peer node or a user requirement. The preset uploading number corresponding to each peer node in the P2P network may be the same or different.
The peer node 3 determines that the mirror image fragment 2 is locally stored according to the query message 3, and the method includes: the peer node 3 queries the locally stored data according to the identifier of the mirror image fragment 2 carried in the query message 3, and determines the mirror image fragment 2 corresponding to the identifier of the locally stored mirror image fragment 2.
S917, the peer node 2 determines that the mirror fragment 1 is locally stored according to the query message 4, and meets the condition 2.
The condition 2 satisfied in the above S917 is the same as the condition 2 satisfied in the above S916, and the details not described herein can be referred to the related description in the above S916.
The peer node 2 determines that the mirror image fragment 1 is locally stored according to the query message 4, and the method includes the following steps: the peer node 2 queries the locally stored data according to the identifier of the mirror fragment 1 carried in the query message 4, and determines the mirror fragment 1 corresponding to the identifier of the mirror fragment 1 stored locally.
S918, the peer node 1 determines that the mirror image fragment 2 is locally stored according to the query message 3, and determines that the mirror image fragment 1 is locally stored according to the query message 4, and meets the condition 3.
Satisfying the condition 3 includes: and the peer node locally stores all the image fragments included in the image file 1, and the number of the image fragments uploaded by the peer node exceeds the preset uploading number. It can be understood that, in the case that the peer node 1 satisfies the condition 3, even if the peer node 1 locally stores the mirror fragment 2 corresponding to the query message 3 and the mirror fragment 1 corresponding to the query message 4, the peer node 1 does not send the mirror fragment 2 to the peer node 2, and does not send the mirror fragment 1 to the peer node 3.
S919, in response to satisfying condition 2, the peer node 3 sends the image fragment 2 and the hash value 2 to the peer node 2 through the network path 2.
S920, in response to satisfying the condition 2, the peer node 2 sends the mirror fragment 1 and the hash value 1 to the peer node 3 through the network channel 2.
It can be understood that S919 and S920 may be executed simultaneously, at this time, peer node 2 owning partial image fragment of image file 1 (i.e., image fragment 1) not only downloads partial image fragment of image file 1 owned by peer node 3 (i.e., image fragment 2) from peer node 3, but also peer node 2 serves as a resource provider to upload locally stored image fragment 1 to peer node 3, which may improve transmission efficiency of image fragment.
And S921, the peer node 2 performs integrity check on the mirror image fragment 2 according to the mirror image fragment 2 and the hash value 2, and determines that the received mirror image fragment 2 is complete.
The principle of the integrity check performed by the peer node 2 in S921 is similar to the principle of the integrity check performed by the peer node 2 in S910, and details that are not described herein may be referred to the related description in S910.
And S922, the peer node 3 performs integrity check on the mirror fragment 1 according to the mirror fragment 1 and the hash value 1, and determines that the received mirror fragment 1 is complete.
The principle of the integrity check performed by the peer node 3 in S922 is similar to the principle of the integrity check performed by the peer node 2 in S910, and details that are not described herein may be referred to the related description in S910.
Note that, when the peer node 3 in S919 does not satisfy the condition 2 and the peer node 2 in S917 does not satisfy the condition 2, after performing S917, the peer node 1 may further send the mirror fragment 2 and the hash value 2 to the peer node 2 and send the mirror fragment 1 and the hash value 1 to the peer node 3.
It is understood that after the above steps S912 to S922 are performed, the second round of distribution process is performed. In the second round of distribution process, the peer node 2 and the peer node 3 which do not store the complete mirror image file 1 exchange mutually owned mirror image fragments, so that the transmission load of the peer node 1 which has the complete mirror image file 1 can be reduced, and the speed and the efficiency of node downloading are improved. Specifically, a peer node (e.g., peer node 2 or peer node 3) that owns part of the image fragment of the image file 1 uploads the image fragment to other peer nodes while downloading the image fragment, so that the transmission efficiency of the image fragment can be improved.
After executing S922, it may also be determined whether peer node 2 and/or peer node 3 successfully received the complete image file 1 according to the image fragment received by peer node 2 and/or peer node 3.
In one example, the peer node 2 or the peer node 3 may perform hash calculation on the received plurality of image fragments to obtain a hash value a; the peer node 2 or the peer node 3 can also obtain a hash value B corresponding to the image file 1 from the peer node 1; peer 2 or peer 3 may determine that peer 2 or peer 3 has successfully received the complete image file 1 by comparing hash value a to hash value B.
In another example, the peer node 2 or the peer node 3 may perform hash calculation on the received multiple image fragments, obtain a hash value a, and send a message 1 to the control node, where the message 1 is used to indicate that the hash value of the multiple image fragments received by the peer node 2 or the peer node 3 is the hash value a; the control node can also obtain a hash value B corresponding to the image file 1 from the peer node 1; the control node can determine that the peer node 2 or the peer node 3 successfully receives the complete image file 1 by comparing that the hash value A is the same as the hash value B; the control node sends a 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.
After the first round of distribution and the second round of distribution are executed and the integrity of the image file is checked, the peer node 2 and the peer node 3 which originally do not own the image file 1 in the P2P network already own the complete image file 1, and the whole image distribution process is ended.
It should be understood that the methods shown in fig. 9A and fig. 9B are only illustrative, and do not limit the mirror image distribution method provided in the embodiments of the present application in any way. For example, the execution sequence of the steps shown in fig. 9A and 9B is merely illustrative and not limiting. For example, in other possible implementations, the image file 1 may further include a greater number of image fragments, such as the image file 1 includes an image fragment 1, an image fragment 2, and an image fragment 3. In this implementation, the first downloading order is different from the second downloading order, and the first downloading order may be: the second downloading order may be the image fragment 3, the image fragment 1, and the image fragment 2. For example, when the peer node 2 performs the above S921 to determine that the received mirror fragment 2 is incomplete, the peer node 2 may also request the peer node 3 to retransmit the mirror fragment 2.
In this embodiment of the present application, according to a download instruction sent by a control node, all peer nodes (i.e., peer node 2 and peer node 3) that do not store an image file 1 in a P2P network first obtain an image fragment included in the image file 1 from the peer node 1 that stores the complete image file 1, and the peer nodes obtain a plurality of different image fragments (i.e., image fragment 1 and image fragment 2) through a plurality of different network channels (i.e., network channel 1 and network channel 3). In the subsequent mirror image fragment distribution process, the peer nodes (i.e., the peer node 2 and the peer node 3) which acquire part of the mirror image fragments included in the mirror image file 1 in the P2P network can share the mirror image fragments owned by the other peer, so that the transmission burden of the peer node 1 which owns the complete mirror image file 1 can be reduced, and the node downloading speed and efficiency are improved. In addition, when the peer node 2 and the peer node 3 share the mirror image fragment owned by the other peer, the peer node (e.g., the peer node 2 or the peer node 3) owning part of the mirror image fragment of the mirror image file 1 downloads the mirror image fragment and uploads the mirror image fragment to other peer nodes, so that the transmission efficiency of the mirror image fragment can be improved. In the process of distributing the image, integrity check is performed on the image fragment received by the peer node and associated with the image file 1, so as to determine whether the peer node which does not store the image file 1 in the P2P network successfully receives the image file 1. When the distribution of the image file 1 is realized in the P2P network, the image fragment is taken as the minimum transmission granularity, so that the flexibility of image distribution can be improved. And the integrity check of the mirror image fragments is realized while the mirror image is distributed. Because the mirror image distribution and the integrity check of the mirror image fragments are carried out simultaneously, the efficiency of distributing each mirror image fragment cannot be influenced.
Fig. 9A and 9B described above illustrate a method for distributing images according to the image distribution provided by the embodiment of the present application. Optionally, in the process described in the image distribution method shown above, the peer node in the P2P network may also communicate with other peer nodes to obtain the current network state of the other peer nodes. The network state of a peer may include the speed at which the peer uploads data to other peers and the speed at which the peer downloads data from other peers. In the P2P network, if any one peer node finds that the speed of uploading data to other peer nodes by the any one peer node does not meet the preset uploading speed, or the speed of downloading data from other peer nodes by the any one peer node does not meet the preset downloading speed, the any one peer node may further send the acquired network state information to the control node, so that the control node reallocates the network bandwidth of the peer node in the P2P network according to the network state information, thereby solving the problem that the uploading speed or the downloading speed of the any one peer node does not meet the preset speed. Next, a schematic diagram of a multi-channel bandwidth adjustment method provided in the embodiment of the present application will be described with reference to fig. 10.
Fig. 10 is a schematic diagram of a network bandwidth adjustment method according to an embodiment of the present application. It should be understood that the example of fig. 10 is merely to assist those skilled in the art in understanding the embodiments of the present application, and is not intended to limit the embodiments of the application to the specific values or specific scenarios illustrated. It will be apparent to those skilled in the art that various equivalent modifications or variations are possible in light of the example of fig. 10 given below, and such modifications and variations also fall within the scope of the embodiments of the present application. As shown in fig. 10, the method includes S1001 to S1004. Next, S1001 to S1004 will be described in detail.
In the embodiment of the present application, a peer node included in the network architecture shown in fig. 3A is described as an example in which: specifically, the speed of uploading data from the peer node 1 to the peer node 3 shown in fig. 3A satisfies the preset uploading speed (i.e., the speed of downloading data from the peer node 1 by the peer node 3 satisfies the preset downloading speed), the speed of uploading data from the peer node 3 to the peer node 1 satisfies the preset uploading speed (i.e., the speed of downloading data from the peer node 3 by the peer node 1 satisfies the preset downloading speed), and the speed of uploading data from the peer node 2 to the peer node 3 by the peer node 2 is less than the preset uploading speed (i.e., the speed of downloading data from the peer node 2 by the peer node 3 is less than the preset downloading speed). That is to say. The transmission quality of network channel 3 is higher than the transmission quality of network channel 2.
And S1001, in a preset period, the peer node 3 respectively detects the peer node 1 and the peer node 2 to acquire the network state information 1.
The size of the preset period is not particularly limited, and can be set according to actual requirements. For example, the preset period may be 1 second, 5 seconds, 20 seconds, or the like.
The network state information 1 comprises a network bandwidth 1 and a network bandwidth 2, the network bandwidth 1 meets the preset bandwidth requirement, and the network bandwidth 2 does not meet the preset bandwidth requirement. Where network bandwidth 1 represents the speed at which peer 1 uploads data to peer 3. The network bandwidth 1 meets the preset bandwidth requirement, that is, the speed of uploading data to the peer node 3 by the peer node 1 meets the preset uploading speed. Network bandwidth 2 represents the speed at which peer node 2 uploads data to peer node 3. The network bandwidth 2 does not meet the requirement of the preset bandwidth, namely the speed of uploading data to the peer node 3 by the peer node 2 is less than the preset uploading speed.
Executing the above S1001 includes: in a preset period, the peer node 3 detects the peer node 1 to obtain a network bandwidth 1; and the peer node 3 probes the peer node 2 to acquire the network bandwidth 2. For example, the peer node 3 may perform inter-node speed measurement on the peer node 1 by using a raw-socket technique to obtain the network bandwidth 1.
S1002, the peer node 3 sends network status information 1 to the control node. Accordingly, the control node receives the network status information 1 sent by the peer node 3.
The trigger condition for the peer node 3 to send the network state information 1 to the control node is not particularly limited. For example, it may be that the peer node 3 sends the message 1 to the control node in the case that 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 the peer node 3 determines that the speed of uploading data to the peer node 3 by the peer node 2 is less than the preset uploading speed and waits for a short preset time (e.g., 100 milliseconds), and still finds that the speed of uploading data to the peer node 3 by the peer node 2 is less than the preset uploading speed.
And S1003, the control node determines that the network bandwidth 3 needs to be increased according to the preset network bandwidth requirement and the network state information 1 so as to obtain the network bandwidth #3.
Network bandwidth 3 represents the speed at which peer node 3 uploads data to peer node 1. The preset bandwidth requirement represents a preset upload speed of data from one peer node to another peer node.
The method for determining that the network bandwidth 3 needs to be increased by the control node according to the preset bandwidth requirement and the network state information 1 includes: the control node determines that the difference between the preset uploading speed and the uploading speed of the peer node 2 for uploading data to the peer node 3 is equal to a first value according to the network bandwidth 2 and the preset bandwidth requirement; the control node determines that it is necessary to increase the network bandwidth 3 by a first value to obtain the network bandwidth #3. Wherein, the network bandwidth #3 meets the preset bandwidth requirement. That is, the speed at which peer node 3 uploads data to peer node 1, as indicated by network bandwidth #3, is greater than the speed at which peer node 3 uploads data to peer node 1, as indicated by network bandwidth #3. Meanwhile, the speed of uploading data to the peer node 1 by the peer node 3 indicated by the network bandwidth #3 meets the requirement of the preset uploading speed.
In the above implementation manner, the speed of uploading data from the peer node 2 to the peer node 3 is less than the preset uploading speed, that is, the network quality of the network channel 2 is not good. In the case that the speed of uploading data to the peer node 1 by the peer node 3 satisfies the preset uploading speed (i.e. the network quality of the network channel 2 is good), the condition of network fluctuation can be dealt with by increasing the speed of uploading data to the peer node 1 by the peer node 3.
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.
Optionally, in order to ensure that the P2P network is in a normal state, after executing the above steps S1001 to S1004, if the speed of uploading data to the peer node 3 by the peer node 2 meets the preset uploading speed, the control node may further update the speed of uploading data to the peer node 1 by the peer node 3 to the uploading speed indicated by the network bandwidth 3.
It should be noted that the method shown in fig. 10 can be used in combination with the methods shown in fig. 9A and 9B. When the method shown in fig. 10 described above is used in combination with the method shown in fig. 9A and 9B described above, the execution position of the method shown in fig. 10 described above in the method shown in fig. 9A and 9B described above is not limited.
It should be understood that the network bandwidth adjustment method shown in fig. 10 is only an illustration, and does not constitute any limitation to the multi-channel bandwidth adjustment method provided in the present application.
In the embodiment of the application, the load of the non-fault node is increased to achieve a balancing effect, network bandwidth resources are preferentially allocated to network channels with good network quality so as to deal with the condition of network fluctuation, and the method can effectively solve the problem of abnormal network fluctuation.
In the above, an application scenario, a network architecture, an image distribution method, and a network bandwidth adjustment method to which the image distribution method provided by the present application is applied are described in detail with reference to fig. 1 to 10. Next, the image distribution apparatus, the image distribution system, and the image distribution device provided by the present application will be described with reference to fig. 11 to 13. It should be understood that the above image distribution method corresponds to the image distribution apparatus, the image distribution system, and the device in the following. What is not described in detail below can be referred to the relevant description in the above-described method embodiments.
Fig. 11 is a schematic structural diagram of a mirror image distribution apparatus according to an embodiment of the present application. As shown in fig. 11, the image distribution apparatus includes a transceiver unit 1101 and a processing unit 1102.
In some implementations, the image distribution apparatus is configured to implement the steps performed by the first peer node in the image distribution method shown in fig. 6. When the structure of the first peer node in the image distribution method shown in fig. 6 is the structure of the peer node 200 shown in fig. 5, the function of the transceiver unit 1101 shown in fig. 11 is the same as the function of the image fragment transmitter 210 shown in fig. 5; the functions of the processing unit 1101 shown in fig. 11 are the same as those of the network analysis module 220, the dynamic control client 230 and the file storage service 240 shown in fig. 5.
In other implementations, the image distribution apparatus is configured to implement the steps performed by the ith second peer node in the image distribution method shown in fig. 6. When the structure of the ith second peer node in the image distribution method shown in fig. 6 is the structure of the peer node 200 shown in fig. 5, the function of the transceiver unit 1101 shown in fig. 11 is the same as the function of the image slicing transmitter 210 shown in fig. 5; the functions of the processing unit 1101 shown in fig. 11 are the same as those of the network analysis module 220, the dynamic regulation client 230 and the file storage service 240 shown in fig. 5.
In still other implementations, the image distribution apparatus is used to implement the steps performed by the control node in the image distribution method shown in fig. 6. When the structure of the control node in the image distribution method shown in fig. 6 is the structure of the control node 100 shown in fig. 4, the function of the processing unit 1101 shown in fig. 11 is the same as the function of the service registration and discovery 110, the network topology center 120, the network server 130, and the dynamic regulation center 140 shown in fig. 5.
Fig. 12 is a schematic structural diagram of an image distribution system according to an embodiment of the present application. As shown in fig. 12, the system includes a control node 1201, a first peer node 1202, and N second peer nodes 1203, N being a positive integer greater than or equal to 2.
The control node 1201 is configured to execute each step executed by the control node in the above-described image distribution method, the first peer node 1202 is configured to execute each step executed by the first peer node in the above-described image distribution method, and the N second peer nodes 1203 are configured to execute each step executed by the N second peer nodes in the above-described image distribution method, where details that are not described herein may refer to relevant descriptions in the foregoing.
Fig. 13 is a schematic structural diagram of an image distribution apparatus according to an embodiment of the present application. As shown in fig. 13, 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 communicatively connected to each other through a communication bus 1304.
The memory 1301 may be a Read Only Memory (ROM), a static memory device, a dynamic memory device, or a Random Access Memory (RAM). The memory 1301 may store a program, and when the program stored in the memory 1301 is executed by the processor 1302, the processor 1302 and the communication interface 1303 are configured to perform each step of the method implemented by the block cipher algorithm according to the embodiment of the present application.
The processor 1302 may be 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, and is configured to execute related programs to implement functions that need to be executed by units in the apparatus implemented by the block cipher algorithm according to the embodiment of the present application, or to execute the steps of the method implemented by the block cipher algorithm according to the embodiment of the present application.
The processor 1302 may also be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the method implemented by the block cipher algorithm provided in the present application may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 1302. The processor 1302 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 1301, the processor 1302 reads information in the memory 1301, and completes, in combination with hardware of the processor, functions required to be executed by units included in the apparatus implemented by using the block cipher algorithm of the embodiment of the present application, or executes a method implemented by using the block cipher algorithm of the embodiment of the present application.
Communication interface 1303 uses transceiver means, such as but not limited to a transceiver, to enable communication between the device shown in fig. 13 and other devices or communication networks. For example, ciphertext data or the like may be output via the communication interface 1303.
Communication bus 1304 may include pathways for communicating information between components of the device illustrated in fig. 13 (e.g., memory 1301, processor 1302, communication interface 1303).
The embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes computer instructions, and the computer instructions, when executed by a processor, are used to implement a technical solution of any one of the image distribution methods in the embodiment of the present application.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored on a computer-readable medium and include several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device) to execute the method according to the embodiments of the present disclosure.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage media, or any other non-transmission medium 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 computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the appended claims.

Claims (17)

1. An image distribution method 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, N being a positive integer greater than or equal to 2, includes:
the first peer node receives N first query messages sent by the N second peer nodes, wherein the N first query messages correspond to the N second peer nodes one by one;
the first peer node determines N different image fragments included in the image file inquired by the N first inquiry messages to be sent to the N second peer nodes according to the N first inquiry messages;
the first peer node sends the N image fragments and N different hash values corresponding to the N image fragments to the N second peer nodes through N network channels, so that an ith second peer node interacts with other second peer nodes to obtain the image file, where an ith network channel is a network channel through which the ith peer node and the ith second peer node transmit the ith image fragment and a hash value corresponding to the ith image fragment, and i =1,2, …, N.
2. The image distribution method of claim 1, wherein the method further comprises:
the first peer node receives a first retransmission message sent by the ith second peer node;
the first peer node determines to send the ith mirror image fragment to the ith second peer node according to the first retransmission message;
and the first peer node sends the ith image fragment and a hash value corresponding to the ith image fragment to the ith second peer node through the ith network channel.
3. The image distribution method according to claim 1 or 2, wherein the application is a cloud game application, and the image file associated with the application is an updated image file generated by the cloud game application.
4. A mirror distribution method according to any of claims 1 to 3, wherein the control node is any one of the following peer nodes:
the first peer node, or the N second peer nodes.
5. An image distribution method 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, includes:
the ith second peer node determines a downloading sequence of N image fragments included in the image file according to a received downloading instruction sent by the control node, wherein the downloading instruction is used for indicating the start of downloading the image file, the N second peer nodes all receive the downloading instruction, the N second peer nodes correspond to the N downloading sequences one by one, and the N downloading sequences are different, i =1,2, …, N;
the ith second peer node determines to send a first query message to the first peer node and send second query messages to other second peer nodes according to an ith downloading sequence corresponding to the ith second peer node; the first query message is used for querying an ith image fragment included in the image file, and the ith image fragment is a first image fragment downloaded according to the ith downloading sequence; the second query message is used for querying an image fragment, which is included in the image file, except for the ith image fragment, and the image fragment queried by the second query message is the jth image fragment downloaded according to the ith downloading sequence, j =2,3, …, N;
and the ith 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 image file.
6. The image distribution method of claim 5, wherein the i second peer node sends the first query message to the first peer node and the second query message to other second peer nodes to obtain the image file, comprising:
the ith second peer node sending the first query message to the first peer node;
the ith second peer node receives the ith image fragment sent by the first peer node and a hash value corresponding to the ith image fragment, wherein the hash value corresponding to each image fragment is different;
under the condition that the received ith mirror image fragment passes the integrity check, the ith second peer node saves the ith mirror image fragment and sends the second query message to other second peer nodes;
the ith second peer node receives the image fragments inquired by the second inquiry message sent by the other second peer nodes and the hash values corresponding to the inquired image fragments, wherein the number of the image fragments sent by the other second peer nodes does not exceed a preset threshold value;
and under the condition that the received image fragment inquired by the second inquiry message passes the integrity check, the ith second peer node stores the image fragment inquired by the second inquiry message.
7. The image distribution method of claim 6, wherein the method further comprises:
the ith second peer node performs integrity check on the received image fragments, where the image fragments received by the ith second peer node include the ith image fragment and the image fragments queried by the second query message;
if the received ith image fragment is determined not to pass the integrity check, the ith second peer node sends a first retransmission message to the first peer node, wherein the first retransmission message is used for indicating the first peer node to send the ith image fragment;
if it is determined that the received image fragment queried by the second query message does not pass the integrity check, the ith second peer node sends a second retransmission message to the other second peer nodes, where the second retransmission message is used to instruct the other second peer nodes to send the image fragment queried by the second query message.
8. The image distribution method of claim 6 or 7, wherein the method further comprises:
if the ith second peer node does not receive the image fragments inquired by the second inquiry message and the hash values corresponding to the inquired image fragments sent by the other second peer nodes, the ith second peer node sends the second inquiry message to the first peer node;
and the ith second peer node receives the image fragment inquired by the second inquiry message sent by the first peer node and the hash value corresponding to the inquired image fragment.
9. The image distribution method according to any one of claims 5 to 8, wherein the method further comprises:
the ith second peer node sends N detection messages to the first peer node and the other second peer nodes to obtain network qualities corresponding to the N network channels, where the N second peer nodes correspond to the N detection messages one to one, and the network quality corresponding to the ith network channel does not meet a preset requirement, and the ith network channel is a network channel through which the ith second peer node performs data transmission with the first peer node or a network channel through which the ith second peer node performs data transmission with one of the other second peer nodes;
and the ith second peer node sends the network quality corresponding to the N network channels to the control node, so that the control node adjusts bandwidth values corresponding to network channels except the ith network channel in the N network channels according to the network quality corresponding to the N network channels.
10. The image distribution method according to any one of claims 5 to 9, wherein the application is a cloud game application, and the image file associated with the application is an updated image file generated by the cloud game application.
11. The image distribution method according to any one of claims 5 to 10, wherein the control node is any one of the following peer nodes:
the first peer node, or the N second peer nodes.
12. An image distribution apparatus 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, N being a positive integer equal to or greater than 2, comprising:
a transceiver unit, configured to receive N first query messages sent by the N second peer nodes, where the N first query messages correspond to the N second peer nodes one to one;
a processing unit, configured to determine, according to the N first query messages, N different image fragments included in the image file queried by the N first query messages to be sent to the N second peer nodes;
the transceiving unit is further configured to send the N image fragments and N different hash values corresponding to the N image fragments to the N second peer nodes through N network channels, so that an ith second peer node interacts with other second peer nodes to obtain the image file, where an ith network channel is a network channel through which the ith image fragment and a hash value corresponding to the ith image fragment are transmitted by the first peer node and the ith second peer node, and i =1,2, …, N.
13. An image distribution apparatus 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, N being a positive integer equal to or greater than 2, includes:
the processing unit is used for determining a downloading sequence of N image fragments included in the image file according to a received downloading instruction sent by the control node, wherein the downloading instruction is used for indicating the start of downloading the image file, the N second peer nodes all receive the downloading instruction, the N second peer nodes correspond to the N downloading sequences one by one, and the N downloading sequences are different, i =1,2, … and N;
the processing unit is further configured to determine, according to an ith download sequence corresponding to the ith second peer node, to send a first query message to the first peer node and send second query messages to other second peer nodes; the first query message is used for querying an ith image fragment included in the image file, and the ith image fragment is a first image fragment downloaded according to the ith downloading sequence; the second query message is used for querying an image fragment, which is included in the image file, except for the ith image fragment, and the image fragment queried by the second query message is the jth image fragment downloaded according to the ith downloading sequence, j =2,3, …, N;
and the transceiving unit is used for sending the first query message to the first peer node and sending the second query message to other second peer nodes to obtain the image file.
14. An image distribution apparatus, comprising: a memory and a processor, the memory and the processor coupled;
the memory is to store one or more computer instructions;
the processor is configured to execute the one or more computer instructions to implement the method of any of claims 1 to 6.
15. An image distribution apparatus, comprising: a memory and a processor, the memory and the processor coupled;
the memory is to store one or more computer instructions;
the processor is configured to execute the one or more computer instructions to implement the method of any of claims 7 to 11.
16. An image distribution system, comprising a control node that manages a peer-to-peer network of a first peer node and N second peer nodes, wherein the first peer node stores an image file associated with an application program, N being a positive integer greater than or equal to 2, comprising:
the control node sends a downloading instruction to the N second peer-to-peer nodes, wherein the downloading instruction is used for indicating the start of downloading the image file;
wherein the first peer node is configured to perform the method of any of claims 1 to 4, and an ith second peer node of the N second peer nodes is configured to perform the method of any of claims 5 to 11, i =1,2, …, N.
17. A computer readable storage medium having stored thereon one or more computer instructions for execution by a processor to perform the method of any one of claims 1 to 11.
CN202210994948.8A 2022-08-18 2022-08-18 Mirror image distribution method, system and equipment Pending CN115567547A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210994948.8A CN115567547A (en) 2022-08-18 2022-08-18 Mirror image distribution method, system and equipment
PCT/CN2023/074444 WO2024036889A1 (en) 2022-08-18 2023-02-03 Mirror image distribution method, system, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210994948.8A CN115567547A (en) 2022-08-18 2022-08-18 Mirror image distribution method, system and equipment

Publications (1)

Publication Number Publication Date
CN115567547A true CN115567547A (en) 2023-01-03

Family

ID=84738608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210994948.8A Pending CN115567547A (en) 2022-08-18 2022-08-18 Mirror image distribution method, system and equipment

Country Status (2)

Country Link
CN (1) CN115567547A (en)
WO (1) WO2024036889A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024036889A1 (en) * 2022-08-18 2024-02-22 网易(杭州)网络有限公司 Mirror image distribution method, system, and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030050966A1 (en) * 2001-09-13 2003-03-13 International Business Machines Corporation Method and system for redirecting data requests in peer-to-peer data networks
CN101471919A (en) * 2007-12-29 2009-07-01 突触计算机***(上海)有限公司 Method and device for downloading slicing of equipment based on point-to-point transmission protocol
CN109491758A (en) * 2018-10-11 2019-03-19 深圳市网心科技有限公司 Docker mirror image distribution method, system, data gateway and computer readable storage medium
CN110912955A (en) * 2018-09-17 2020-03-24 阿里巴巴集团控股有限公司 Container mirror image downloading and uploading method and device
WO2020125389A1 (en) * 2018-12-17 2020-06-25 深圳壹账通智能科技有限公司 Image file acquisition method, apparatus, computer device and storage medium
CN112883006A (en) * 2021-03-12 2021-06-01 云知声智能科技股份有限公司 Enterprise-level container mirror image acceleration method and device, electronic equipment and storage medium
CN113064696A (en) * 2021-03-25 2021-07-02 网易(杭州)网络有限公司 Cluster system capacity expansion method, device and medium
US20210247905A1 (en) * 2020-02-12 2021-08-12 Red Hat, Inc. Scalable storage cluster mirroring
CN114003556A (en) * 2021-10-29 2022-02-01 北京航空航天大学 Container deployment acceleration method based on delayed loading and P2P distribution

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100527672C (en) * 2005-09-02 2009-08-12 腾讯科技(深圳)有限公司 Network communication system and method realizing file downloading
US10387072B2 (en) * 2016-12-29 2019-08-20 Intel Corporation Systems and method for dynamic address based mirroring
CN108958742A (en) * 2017-05-26 2018-12-07 华为技术有限公司 A kind of method of batch installing operating system, relevant device and system
CN111064785B (en) * 2019-12-16 2021-12-14 腾讯科技(深圳)有限公司 Resource package downloading method, device and system
CN115567547A (en) * 2022-08-18 2023-01-03 网易(杭州)网络有限公司 Mirror image distribution method, system and equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030050966A1 (en) * 2001-09-13 2003-03-13 International Business Machines Corporation Method and system for redirecting data requests in peer-to-peer data networks
CN101471919A (en) * 2007-12-29 2009-07-01 突触计算机***(上海)有限公司 Method and device for downloading slicing of equipment based on point-to-point transmission protocol
CN110912955A (en) * 2018-09-17 2020-03-24 阿里巴巴集团控股有限公司 Container mirror image downloading and uploading method and device
CN109491758A (en) * 2018-10-11 2019-03-19 深圳市网心科技有限公司 Docker mirror image distribution method, system, data gateway and computer readable storage medium
WO2020125389A1 (en) * 2018-12-17 2020-06-25 深圳壹账通智能科技有限公司 Image file acquisition method, apparatus, computer device and storage medium
US20210247905A1 (en) * 2020-02-12 2021-08-12 Red Hat, Inc. Scalable storage cluster mirroring
CN112883006A (en) * 2021-03-12 2021-06-01 云知声智能科技股份有限公司 Enterprise-level container mirror image acceleration method and device, electronic equipment and storage medium
CN113064696A (en) * 2021-03-25 2021-07-02 网易(杭州)网络有限公司 Cluster system capacity expansion method, device and medium
CN114003556A (en) * 2021-10-29 2022-02-01 北京航空航天大学 Container deployment acceleration method based on delayed loading and P2P distribution

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024036889A1 (en) * 2022-08-18 2024-02-22 网易(杭州)网络有限公司 Mirror image distribution method, system, and device

Also Published As

Publication number Publication date
WO2024036889A1 (en) 2024-02-22

Similar Documents

Publication Publication Date Title
US20200304508A1 (en) Method and device for providing authentication in network-based media processing (nbmp) system
CN108683747B (en) Resource obtaining, distributing and downloading method, device, equipment and storage medium
US10491523B2 (en) Load distribution in data networks
Sinha et al. Building an E Ective IoT Ecosystem for Your Business
WO2021228102A1 (en) Method, device, and storage medium
KR102046287B1 (en) Internet of things(iot) adaptation services
US20190332522A1 (en) Microservice platform with messaging system
JP2016006671A (en) Data transmission/reception system and data transmission/reception method
CN113163162B (en) Service providing method based on video cloud and video cloud system
CN115604199B (en) Service routing method and system for cloud native platform micro-service gateway
US20160381127A1 (en) Systems and methods for dynamic networked peer-to-peer content distribution
US20230137879A1 (en) In-flight incremental processing
WO2024036889A1 (en) Mirror image distribution method, system, and device
CN116633934A (en) Load balancing method, device, node and storage medium
CN110719526B (en) Video playing method and device
CA2952785A1 (en) Method of reducing bandwidth required for sharing of files on a server
WO2016180284A1 (en) Service node allocation method, device, cdn management server and system
CN114338682A (en) Flow identity mark transmission method and device, electronic equipment and storage medium
CN114650281A (en) File downloading method, device, equipment and storage medium based on complex network
US10225339B2 (en) Peer-to-peer (P2P) network management system and method of operating the P2P network management system
CN103685497A (en) On-line storing and sharing method and system
KR101436406B1 (en) Client, server, system and method for updating data based on peer to peer
CN115242646B (en) Block chain-based network slice application method and related device
Baydeti et al. Scalable Models for Redundant Data Flow Analysis in Online Social Networks
US20230336360A1 (en) Server to synchronize a digital avatar with a device based on items of information wrapped together

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination