CN108833591B - method, electronic equipment, device and network architecture for data transmission in P2P network - Google Patents
method, electronic equipment, device and network architecture for data transmission in P2P network Download PDFInfo
- Publication number
- CN108833591B CN108833591B CN201810771757.9A CN201810771757A CN108833591B CN 108833591 B CN108833591 B CN 108833591B CN 201810771757 A CN201810771757 A CN 201810771757A CN 108833591 B CN108833591 B CN 108833591B
- Authority
- CN
- China
- Prior art keywords
- identifier
- client
- server
- data packet
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 74
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004590 computer program Methods 0.000 claims description 7
- 238000004806 packaging method and process Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 8
- 230000003993 interaction Effects 0.000 description 4
- 230000011664 signaling Effects 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
- H04L67/1078—Resource delivery mechanisms
- H04L67/108—Resource delivery mechanisms characterised by resources being split in blocks or fragments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
- H04L67/1078—Resource delivery mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method, electronic equipment, a device and a network architecture for data transmission in a P2P network, wherein the method comprises the following steps: receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet; and after establishing the P2P network with other clients, interacting the data packet with other clients based on the pre-agreed transmission strategy and the first identifier. The method aims to solve the technical problem that the traditional P2P technology cannot be applied to transmission of real-time video streams in a live broadcast mode.
Description
Technical Field
the application relates to the field of communication, in particular to the technical field of data transmission.
background
Peer-to-Peer (P2P) is a distributed network where participants in the P2P network share a portion of their own hardware resources (processing power, storage power, network connectivity, printers, etc.) that need to be served and content by the network, and that can be accessed directly by other Peer nodes (peers) without going through intermediate entities. Participants in this network are both resource (service and content) providers (server) and resource (service and content) acquirers (client).
the P2P model is often used in scenarios where video or audio material is shared (e.g., video resource downloads for websites such as audio and video). When each network node shares resources, the resources are usually stored on each network node in the form of a file, and the file is split into a plurality of sub-files and transmitted to the opposite node. Since the conventional P2P technology generally transfers data in a file-based manner, the file needs to be prepared in advance, and thus, the application scenarios are limited, for example, the P2P technology cannot be applied to the transmission of real-time video stream in live mode.
Disclosure of Invention
The application provides a method, electronic equipment, a device and a network architecture for data transmission in a P2P network.
According to a first aspect of embodiments of the present application, there is provided a data transmission method based on a P2P network, the method including the steps of:
Receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
And after establishing the P2P network with other clients, interacting the data packet with other clients based on the pre-agreed transmission strategy and the first identifier.
In some examples, the shared resources include file data, streaming media data; the size of the data packet matches the transmission bandwidth of the P2P network.
In some examples, the establishing the P2P network with other clients further includes the following steps:
Notifying a server of a second identifier, wherein the second identifier is used for describing the uniqueness of the shared resource; so that the server informs the clients to establish the P2P network connection based on the second identifier.
In some examples, the streaming media data is a live video stream, the client is a viewer client, and the second identifier is an identifier of a live room; the pre-agreed transmission strategies include:
And acquiring a data packet from the server within preset time, then inquiring whether a client corresponding to the second identifier exists in the server, and if so, requesting the data packet from the client corresponding to the second identifier.
in some examples, the size of the packet is 1 KB.
According to a second aspect of embodiments of the present application, there is provided a network architecture established by using the method of any one of the above first aspects, the network architecture including a server and a plurality of clients;
The server is used for packaging the data packets according to a self-defined format after the shared resource is split into a plurality of data packets, sending the packaged data packets to each client and informing each client to establish a P2P network; the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
The client is used for establishing a P2P network with other clients according to the notification of the server and interacting the data packet with other clients based on a pre-agreed transmission strategy and the first identifier.
according to a third aspect of the embodiments of the present application, there is provided a data transmission method based on a P2P network, the method including the steps of:
After the shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
And sending the encapsulated data packet to each client, so that the data packet is interacted based on a pre-agreed transmission strategy and the first identifier after each client establishes a P2P network.
In some examples, the shared resources include file data, streaming media data;
the size of the data packet matches the transmission bandwidth of the P2P network.
in some examples, the size of the packet is 1 KB.
in some examples, further comprising the step of:
Receiving a second identifier sent by a client, wherein the second identifier is used for describing the uniqueness of the shared resource; and informing the clients to establish the P2P network connection based on the second identification.
in some examples, the streaming media data is a live video stream, the client is a viewer client, and the second identifier is an identifier of a live room; and acquiring a data packet from the server within preset time, then inquiring whether a client corresponding to the second identifier exists in the server, and if so, requesting the data packet from the client corresponding to the second identifier.
According to a fourth aspect of the embodiments of the present application, there is provided a data transmission apparatus based on a P2P network, including:
The receiving module is used for receiving data packets sent by the server, the data packets are formed by splitting shared resources and are packaged by the server according to a self-defined format, the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
And the transmission module is used for interacting the data packet with other clients based on a pre-agreed transmission strategy and the first identifier after establishing a P2P network with other clients.
according to a fifth aspect of the embodiments of the present application, there is provided a data transmission apparatus based on a P2P network, including:
The packaging module is used for packaging the data packets according to a self-defined format after the shared resource is split into a plurality of data packets, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
and the sending module is used for sending the encapsulated data packet to each client so that the data packet is interacted based on a pre-agreed transmission strategy and the first identifier after each client establishes a P2P network.
According to a sixth aspect of embodiments of the present application, there is provided an electronic apparatus, comprising:
a processor; and
A memory configured to store a computer program configured to be executed by the processor,
Receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
and after establishing the P2P network with other clients, interacting the data packet with other clients based on the pre-agreed transmission strategy and the first identifier.
according to a sixth aspect of embodiments of the present application, there is provided an electronic apparatus, comprising:
A processor; and
A memory configured to store a computer program configured to be executed by the processor,
After the shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
and sending the encapsulated data packet to each client, so that the data packet is interacted based on a pre-agreed transmission strategy and the first identifier after each client establishes a P2P network.
According to a seventh aspect of embodiments herein, there is provided a computer storage medium, which when executed by a processor, performs the steps of the method of any one of the first aspect above.
Unlike the conventional P2P mode, the present application first cuts the shared resources into packets instead of file blocks, where the size of the file blocks may be hundreds of KB, and the packet size is smaller than the file blocks, and the packets can be transmitted in the network as smaller transmission units, for example, when the size of the cut packets is considered, the packet size can be designed by combining the transmission characteristics of the internet link layer, so that the packet size matches the transmission bandwidth of each connection channel in the P2P network, and therefore, the present application is more efficient than the file splitting method, and thus, has wider application scenarios.
Drawings
fig. 1 is a network architecture built based on a P2P network in the embodiment of the present application;
Fig. 2 is a partial flow of a data transmission method based on a P2P network in the embodiment of the present application;
FIGS. 3 a-3 c are diagrams of networks built under three different server architectures according to an embodiment of the present application;
Fig. 4 is a partial flow of a data transmission method based on a P2P network on a server side in the embodiment of the present application;
Fig. 5 is a partial flow of a data transmission method based on a P2P network on a client side in an embodiment of the present application;
fig. 6 is a signaling interaction diagram of a server and a client in an application scenario of the present application;
FIG. 7a is a diagram of a network architecture in an application scenario of the present application;
FIG. 7b is a signaling interaction diagram of a network device in the application scenario of FIG. 7 a;
fig. 8 is a schematic diagram of a data transmission apparatus based on a P2P network in the embodiment of the present application;
FIG. 9 is a schematic view of an electronic device in an embodiment of the application;
fig. 10 is a schematic diagram of another data transmission apparatus based on a P2P network in the embodiment of the present application;
fig. 11 is a schematic diagram of another electronic device in this embodiment of the application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a network architecture proposed in an embodiment of the present application, and the network architecture includes a server device 100 and client devices (110, 120, 130), and the client devices are built with each other through the server device to form a P2P network. Since the functional requirements of the network device may be different for users in different application environments, the number and functions of the servers and the client devices may be different in each application scenario.
In order to enable the P2P network of the embodiment of the present application to break through the conventional transmission mode of the conventional P2P network (i.e. transmit data between peer nodes in a manner of splitting files in the conventional technology), the present application proposes the following technical solutions, and fig. 2 is a partial step:
After the shared resource is split into a plurality of data packets (S200), the server packages the data packets according to a self-defined format (S201); the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
The server sends the encapsulated data packet to each client (S202);
after the server notifies each client to establish a P2P network (S203), the client interacts the data packet with other clients based on the pre-agreed transmission policy and the first identifier (S204).
in the embodiment, the shared resource refers to a resource that needs to be shared to each peer node, and it should be noted that the shared resource is not limited to file data in a file form (for example, common audio/video files, picture files, various Office documents, and the like), and is also applicable to streaming media data, for example, live data in a live scene, and the like.
Unlike the conventional P2P mode, in the embodiment, when S200 is executed, the shared resource is first cut into data packets instead of file blocks, the size of the file blocks may be hundreds of KB, but the packet size is smaller than the file blocks, and the data packets can be transmitted in the network as smaller transmission units, for example, when the size of the cut data packets is considered, the data packets can be designed by combining the transmission characteristics of the internet link layer, so that the size of the data packets matches the transmission bandwidth of each connection channel in the P2P network. For example, the channel established between each pair of peer nodes may be a UDP channel, and the size of each packet may be about 1KB, which is approximately equal to MTU (maximum transmission unit of internet link layer), so that each packet may be transmitted by 1 UDP packet without unpacking based on the UDP packet, which is more efficient than a file splitting method, thereby having a wider application scenario.
The server that is the subject of the execution of S201 may be assumed by various entities depending on the division of roles of different network devices by the designer. For example, fig. 3a, fig. 3b, and fig. 3c are network architectures in three different scenarios, and it can be seen that, in different service modes, due to different requirements of service or device management, different server devices may undertake the execution subject of step S201. In fig. 3a, a first server takes on the role of collecting shared resources, a second server takes on the role of splitting packets, and a third server takes on the role of distributing packets to peers. In fig. 3b, the first server integrates the functions of collecting shared resources and splitting packets, and the second server acts as the server for distributing packets. In fig. 3c, the server integrates the functions of collecting shared resources, splitting data packets, and distributing data packets. It is noted that other forms of network architecture or server functionality than the examples listed in fig. 3a, 3b, 3c are not excluded.
in the data encapsulation phase of S201, in order to enable the split data packets to be sequentially assembled after being received by the clients and to interact with the data packets after peer nodes are formed between the clients, the server may number each data packet as a field describing a unique identifier of each data packet, where the unique identifier is a first identifier, and in some examples, the purpose may be achieved by customizing a format of the data packet, and a specific field may be specified in the customized format as the unique identifier. In some examples, the first identifier proposed in the present application may be a unique identifier for distinguishing other data packets in the same shared resource. Of course, other ways of achieving this are not excluded. As an example, exchanging data packets between clients may mean that after some clients send out a message requesting some numbers, the clients that have downloaded the number data packets may send the data packets to the requesting party in response to the request. Since the clients are in equal-position roles (i.e., peer nodes) in the P2P network, a requester at a certain time can become a responder at the next time, and therefore, the packet interaction between the clients in the P2P network can be bidirectional, not necessarily unidirectional.
In stage S202, in some examples, the server may send the data packet to each client in order to widely spread the data packet among the peers in the P2P network so that the peers can transmit the data packet to each other. Of course, the designer may set different delivery policies for different service scenarios, for example, the server may send only some of the designated clients. In one example, the client may make an active request to the server to inform the server of the identity of the shared resource (e.g., in a live scenario, similar to the conventional technique in which the client informs the server of the identity of the required live stream), and the server determines to which clients to send the data packet based on the identity of the shared resource.
when S203 constructs the P2P network, the way of establishing the connection path may be different in different application instances. For example, some examples may be implemented with reference to the way in which a peer node in a P2P network in the prior art establishes a UDP channel; in other examples, a new flow may be designed for the actual scenario. For example, all clients initiate a registration request to the server, and notify the server of some information related to the shared resource and information necessary for establishing a connection (e.g., a network connection address, a port number, etc.), which may be carried in the registration request or sent to the server in other messages. The server informs which clients need to establish network connection to form the peer node based on the information related to the shared resources. By way of example, this application refers to some information about the shared resource as a second identifier, which is used to describe the uniqueness of the shared resource. In the example of fig. 7b, which is a flow of establishing a network connection in a live scenario, it can be seen that in this example, the server aggregates viewer clients watching the same channel into a P2P network by using the identity of the live broadcast room (e.g. channel number, live stream identity, etc.) as a second identity. In other instances, various modifications to the specific flow may still be made.
the server notifies each client of the opportunity of constructing the P2P network, which is not limited in the present application, and may notify each client after the server receives the second identifier, or notify each client after transmitting a data packet to the client for a period of time. As an example, the relevant control policy may be issued to the client when the server issues the configuration information to the client, or of course, the relevant control policy may be set in the client in advance. Still taking the live broadcast scenario as an example, in some examples, the client enters a certain channel, and sends the control policy for establishing the P2P network to the client when requesting the configuration information related to the channel from the server, and in some examples, when the client registers with the server, the server sends the control policy for establishing the P2P network to the client.
Any peer node in the network may request packets from other peer nodes, and at stage S204, the peer node may request packets from other peer nodes based on the first identifier and a pre-agreed transmission policy, which may specify which identified packets may be propagated in the P2P network. As an example, in a live broadcast scenario, in order to ensure the requirement of fast playing video stream, the transmission policy may specify that the viewer client first obtains the data packet from the server within a predetermined time, then queries the server whether there is a client corresponding to the second identifier, and if so, requests the other clients for the data packet
In some examples, in order to prevent some peers from accessing a certain P2P network by mistake, the peers may also carry a second identifier to check the identity of the peer in the P2P network when exchanging data packets.
Fig. 4 is a diagram illustrating part of the steps of the technical solution from the server side.
S401, after a shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
S402, the encapsulated data packet is sent to each client, so that after each client establishes a P2P network, the data packet is interacted based on a pre-agreed transmission strategy and the first identifier.
other steps executed by the server may refer to descriptions of other parts in this application, and are not described again.
fig. 5 is a diagram illustrating part of the steps of the technical solution from the server side.
S501, receiving a data packet sent by a server, wherein the data packet is formed by splitting shared resources and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
s502, after the P2P network is established with other clients, the data packet is interacted with the other clients based on the prearranged transmission strategy and the first identification.
other steps executed by the client may refer to descriptions of other parts in this application, and are not described again.
Since the present application is applicable to a variety of resource sharing scenarios, for convenience of understanding, a few application examples are listed below.
Fig. 6 is a network environment using a manufactured video file as a shared resource. The network architecture formed by the network devices can be described by taking an example that one server integrates multiple functions with reference to fig. 3 c.
In this example, a server having a cloud storage function, such as a network disk, may be used to take on the role of the server.
s601, the server stores a video file, wherein the video file can be static data stored on the server or uploaded to the server by a certain client.
s602, several clients register with the server to notify their respective network connection information such as IP addresses and port numbers.
S603, the server divides the video file into data packets, and encapsulates the data packets according to a user-defined format, wherein each encapsulated data packet carries the number of the data packet as a first identifier.
s604, when the client b, c requests the server for the video file, the server informs the client to establish the P2P network according to the identification of the video file.
and S605, the server respectively sends the data packets with the first identification to the clients b and c.
s606, the client side b and the client side c receive the data packets sent by the server and request the data packets with the assigned numbers to other peer nodes according to the prearranged transmission strategy.
And S607, downloading and storing the data packets received by the client sides b and c.
s608, when the client side b and c need to read the video file, the data packets are recombined into the video file according to the first identifier.
The newly accessed client d requests the server for the video file, and the server informs the client d to establish a P2P connection with the clients b and c according to the file name of the video file. The client d requests the data packets with the specified numbers from other peer nodes in the P2P network according to the prearranged transmission strategy. And the client b and the client c send each data packet obtained by segmenting the video file to the client d. When the client d judges that the data packet with a certain number is lacked according to the first identifier, the data packet is broadcasted in the P2P network again. And after receiving the request, the client b and the client c send the data packet corresponding to the number to the client d. And when the client d needs to read the video file, recombining the data packets into the video file according to the first identifier.
fig. 7a is a network environment in a live scenario. In the network of fig. 7a, a TCP connection channel is established between the anchor client and the live server, the live server is connected to the slicing server, and the slicing server is connected to the CDN server. Referring to fig. 7b, a signaling interaction diagram of a network device in a live broadcast scenario is specifically as follows:
S701 registers a stage for the viewer client.
when the audience client registers to the live broadcast server, the live broadcast server is informed of the IP address of the local terminal equipment, the port number of the client and the concerned channel number.
In S702, the live broadcast server forwards the live broadcast video stream sent by the anchor client to the slice server, where the live broadcast video stream carries the corresponding video stream identifier.
in S703, the slicing server cuts the live video stream into 1 KB-sized data packets, and packages each data packet in a customized format after numbering the data packet.
In S704, the encapsulated packet is sent to the CDN server by the slicing server.
in S705, the audience client requests the CDN to obtain a live video stream to be acquired, and the CDN server sends an assigned data packet to the audience client according to a preset transmission policy.
S706 is a stage of establishing P2P channel.
in order to ensure the timeliness of live data playing, after the CDN server sends the data packet to the client for a period of time, the live server notifies the viewer client who concerns the same channel number to establish a P2P connection channel according to the channel number. In this example, in order to ensure the viewing effect of the live video stream, after the CDN server sends a video block to each client for a period of time, each viewer client may establish a P2P network.
after receiving the data packets of the CDN for a period of time, the viewer clients mutually establish a P2P network according to the channel number notified by the live server.
S707, after establishing the P2P network, the spectator client requests the data packets with the assigned numbers from other peer nodes according to the pre-agreed transmission strategy.
corresponding to the foregoing embodiments of the method for data transmission in the P2P network, the present application also provides embodiments of an apparatus 800 for data transmission in the P2P network.
referring to fig. 8, the data transmission apparatus 800 based on the P2P network includes:
a receiving module 801, configured to receive a data packet sent by a server, where the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format includes a first identifier, where the first identifier is used to describe uniqueness of each data packet;
a transmission module 802, configured to interact the data packet with other clients based on a pre-agreed transmission policy and the first identifier after establishing a P2P network with other clients.
The embodiment of the apparatus for data transmission in the P2P network can be applied to the client device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for running through the processor of the client device where the device is located. In terms of hardware, as shown in fig. 9, a hardware structure diagram of a client device where a device for data transmission in a P2P network is located in the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 9, the client device where the device is located in the embodiment may also include other hardware, such as a camera, a microphone, and the like, according to the actual function of the device, which is not described again. The processor is configured to perform the following operations:
Receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
and after establishing the P2P network with other clients, interacting the data packet with other clients based on the pre-agreed transmission strategy and the first identifier.
Embodiments of an apparatus 1000 for data transmission in a P2P network are also provided.
Referring to fig. 10, a data transmission apparatus 1000 based on a P2P network includes:
the encapsulation module 1001 is configured to package, after the shared resource is split into a plurality of data packets, the data packets according to a self-defined format, where the self-defined format includes a first identifier, and the first identifier is used to describe uniqueness of each data packet;
a sending module 1002, configured to send the encapsulated data packet to each client, so that after each client establishes a P2P network, the data packet is interacted based on a pre-agreed transmission policy and the first identifier.
the embodiment of the device for data transmission in the P2P network can be applied to a server device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for running through the processor of the client device where the device is located. From a hardware aspect, as shown in fig. 11, the hardware structure diagram of the client device where the apparatus for data transmission in the P2P network is located is shown in fig. 11, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 11, the client device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the device, which is not described again. The processor is configured to perform the following operations:
After the shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
And sending the encapsulated data packet to each client, so that the data packet is interacted based on a pre-agreed transmission strategy and the first identifier after each client establishes a P2P network.
the implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
the above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (14)
1. a data transmission method based on P2P network, characterized in that the method comprises the steps of:
receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
After the data packet is received for a set time, notifying a server of a second identifier, wherein the second identifier is used for describing uniqueness of shared resources, so that the server notifies clients to establish P2P network connection based on the second identifier, establishes P2P networks with other clients according to the notification of the server, and interacts the data packet with other clients based on a pre-agreed transmission strategy and the first identifier, wherein the clients carry the second identifier when interacting the data packet.
2. the method of claim 1, wherein the shared resources comprise file data, streaming media data; the size of the data packet matches the transmission bandwidth of the P2P network.
3. The method of claim 2, wherein the streaming media data is a live video stream, the client is a viewer client, and the second identifier is an identifier of a live room; the pre-agreed transmission strategies include:
and after acquiring the data packet from the server in preset time, inquiring whether the client corresponding to the second identifier exists in the server, and if so, requesting the data packet from the client corresponding to the second identifier.
4. the method of claim 1, wherein the size of the data packet is 1 KB.
5. A network architecture established by the method of any one of claims 1-4, wherein the network architecture comprises a server and a plurality of clients;
The server is used for packaging the data packets according to a self-defined format after the shared resource is split into a plurality of data packets, sending the packaged data packets to each client and informing each client to establish a P2P network; the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
The client is used for notifying the server of a second identifier after receiving the data packet for setting time, wherein the second identifier is used for describing uniqueness of shared resources, so that the server notifies the clients to establish P2P network connection based on the second identifier, establishes a P2P network with other clients according to the notification of the server, and interacts the data packet with other clients based on a pre-agreed transmission strategy and the first identifier, and each client carries the second identifier when interacting the data packet between the clients.
6. a data transmission method based on P2P network, characterized in that the method comprises the steps of:
After the shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
Sending the encapsulated data packets to each client, receiving a second identifier notified by the client after the data packets are sent for a set time, wherein the second identifier is used for describing the uniqueness of shared resources, so that the server notifies each client to establish P2P network connection based on the second identifier, notifies each client to establish a P2P network with other clients, and interacts the data packets based on a pre-agreed transmission strategy and the first identifier, wherein each client carries the second identifier when the data packets are interacted between the clients.
7. The method of claim 6, wherein the shared resources comprise file data, streaming media data;
the size of the data packet is matched with the transmission bandwidth of the P2P network; or
the size of the data packet is 1 KB.
8. The method of claim 7, further comprising the step of:
Receiving a second identifier sent by a client, wherein the second identifier is used for describing the uniqueness of the shared resource; and informing the clients to establish the P2P network connection based on the second identification.
9. The method of claim 8, wherein the streaming media data is a live video stream, the client is a viewer client, and the second identifier is an identifier of a live room; and after acquiring the data packet from the server in preset time, inquiring whether the client corresponding to the second identifier exists in the server, and if so, requesting the data packet from the client corresponding to the second identifier.
10. a data transmission device based on P2P network, comprising:
the receiving module is used for receiving data packets sent by the server, the data packets are formed by splitting shared resources and are packaged by the server according to a self-defined format, the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
the transmission module is used for notifying the server of a second identifier after the time is set after the data packet is received, wherein the second identifier is used for describing the uniqueness of the shared resource, so that the server notifies each client to establish P2P network connection based on the second identifier, establishes a P2P network with other clients according to the notification of the server, and interacts the data packet with other clients based on a predetermined transmission strategy and the first identifier, and each client carries the second identifier when the data packet is interacted between the clients.
11. A data transmission device based on P2P network, comprising:
The packaging module is used for packaging the data packets according to a self-defined format after the shared resource is split into a plurality of data packets, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
And the sending module is used for sending the encapsulated data packets to each client, receiving a second identifier notified by the client after the data packets are sent for a set time, wherein the second identifier is used for describing the uniqueness of shared resources, so that the server notifies each client to establish P2P network connection based on the second identifier, notifies each client to establish a P2P network with other clients, and interacts the data packets based on a pre-agreed transmission strategy and the first identifier, wherein when the data packets are interacted between the clients, each client carries the second identifier.
12. an electronic device, comprising:
A processor; and
A memory configured to store a computer program configured to be executed by the processor to:
Receiving a data packet sent by a server, wherein the data packet is formed by splitting a shared resource and is encapsulated by the server according to a self-defined format, and the self-defined format comprises a first identifier which is used for describing the uniqueness of each data packet;
After the data packet is received for a set time, notifying a server of a second identifier, wherein the second identifier is used for describing uniqueness of shared resources, so that the server notifies clients to establish P2P network connection based on the second identifier, establishes P2P networks with other clients according to the notification of the server, and interacts the data packet with other clients based on a pre-agreed transmission strategy and the first identifier, wherein the clients carry the second identifier when interacting the data packet.
13. An electronic device, comprising:
A processor; and
a memory configured to store a computer program configured to be executed by the processor to:
After the shared resource is split into a plurality of data packets, the data packets are packaged according to a self-defined format, wherein the self-defined format comprises a first identifier, and the first identifier is used for describing the uniqueness of each data packet;
Sending the encapsulated data packets to each client, receiving a second identifier notified by the client after the data packets are sent for a set time, wherein the second identifier is used for describing the uniqueness of shared resources, so that the server notifies each client to establish P2P network connection based on the second identifier, notifies each client to establish a P2P network, and interacts the data packets based on a pre-agreed transmission strategy and the first identifier, wherein each client carries the second identifier when the data packets are interacted between the clients.
14. A computer storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810771757.9A CN108833591B (en) | 2018-07-13 | 2018-07-13 | method, electronic equipment, device and network architecture for data transmission in P2P network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810771757.9A CN108833591B (en) | 2018-07-13 | 2018-07-13 | method, electronic equipment, device and network architecture for data transmission in P2P network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108833591A CN108833591A (en) | 2018-11-16 |
CN108833591B true CN108833591B (en) | 2019-12-06 |
Family
ID=64135880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810771757.9A Active CN108833591B (en) | 2018-07-13 | 2018-07-13 | method, electronic equipment, device and network architecture for data transmission in P2P network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108833591B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109688417A (en) * | 2018-12-12 | 2019-04-26 | 广州虎牙信息科技有限公司 | A kind of data distribution systems, method, apparatus, TV box and storage medium |
CN110061966B (en) * | 2019-03-14 | 2021-06-29 | 浙江糖链科技有限公司 | Communication protocol system and method for realizing peer-to-peer network in computer network |
CN110489484B (en) * | 2019-07-11 | 2022-07-05 | 视联动力信息技术股份有限公司 | Data synchronization method and device, readable storage medium and electronic equipment |
CN114531446B (en) * | 2020-10-31 | 2023-04-18 | 华为技术有限公司 | Data distribution method, device and system based on P2P |
CN112565907A (en) * | 2020-11-25 | 2021-03-26 | 上海连尚网络科技有限公司 | Video acquisition method, electronic device and storage medium |
CN113132944B (en) * | 2021-04-22 | 2023-10-20 | 上海银基信息安全技术股份有限公司 | Multi-path secure communication method, device, vehicle end, equipment end and medium |
CN114928641A (en) * | 2022-05-13 | 2022-08-19 | 阿里巴巴(中国)有限公司 | Data sharing method and device based on cloud application, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101155045A (en) * | 2006-09-28 | 2008-04-02 | 腾讯科技(深圳)有限公司 | Method for group members simultaneously watching IPTV, its server and client |
CN101163230A (en) * | 2006-10-13 | 2008-04-16 | 贾波 | Method of performing on-site living broadcast and client terminal node preparation through network camera |
CN101924793A (en) * | 2010-08-17 | 2010-12-22 | 北京易视腾科技有限公司 | P2P streaming media-based secondary coding play method and system |
CN101945129A (en) * | 2010-09-10 | 2011-01-12 | 北京易视腾科技有限公司 | P2P (Peer to Peer) stream media live-broadcast low-delay transmission method and system thereof |
CN105392020A (en) * | 2015-11-19 | 2016-03-09 | 广州华多网络科技有限公司 | Internet video direct broadcasting method and system |
CN105656986A (en) * | 2015-11-26 | 2016-06-08 | 乐视云计算有限公司 | Live video play method, device and system |
CN106034242A (en) * | 2015-03-09 | 2016-10-19 | 杭州施强网络科技有限公司 | Audio/video live broadcast streaming media data transmission method in P2P system |
-
2018
- 2018-07-13 CN CN201810771757.9A patent/CN108833591B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101155045A (en) * | 2006-09-28 | 2008-04-02 | 腾讯科技(深圳)有限公司 | Method for group members simultaneously watching IPTV, its server and client |
CN101163230A (en) * | 2006-10-13 | 2008-04-16 | 贾波 | Method of performing on-site living broadcast and client terminal node preparation through network camera |
CN101924793A (en) * | 2010-08-17 | 2010-12-22 | 北京易视腾科技有限公司 | P2P streaming media-based secondary coding play method and system |
CN101945129A (en) * | 2010-09-10 | 2011-01-12 | 北京易视腾科技有限公司 | P2P (Peer to Peer) stream media live-broadcast low-delay transmission method and system thereof |
CN106034242A (en) * | 2015-03-09 | 2016-10-19 | 杭州施强网络科技有限公司 | Audio/video live broadcast streaming media data transmission method in P2P system |
CN105392020A (en) * | 2015-11-19 | 2016-03-09 | 广州华多网络科技有限公司 | Internet video direct broadcasting method and system |
CN105656986A (en) * | 2015-11-26 | 2016-06-08 | 乐视云计算有限公司 | Live video play method, device and system |
Also Published As
Publication number | Publication date |
---|---|
CN108833591A (en) | 2018-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108833591B (en) | method, electronic equipment, device and network architecture for data transmission in P2P network | |
CN109474684B (en) | Method, device, terminal equipment and storage medium for acquiring live video stream | |
CN109151497B (en) | Live wheat-connecting method and device, electronic equipment and storage medium | |
US9602591B2 (en) | Managing TCP anycast requests | |
WO2017088381A1 (en) | Method, apparatus and system for playing live video | |
US8694675B2 (en) | Generalized dual-mode data forwarding plane for information-centric network | |
US9426176B2 (en) | Method, system, and logic for in-band exchange of meta-information | |
US20170155695A1 (en) | Method, device and system for uploading live video | |
CN108924609B (en) | Streaming media data transmission method, electronic equipment, device and storage medium | |
KR102110421B1 (en) | System and method for delivering an audio-visual content to a client device | |
KR102685010B1 (en) | Account linking methods and devices, storage media and electronic devices | |
KR20120092622A (en) | Streaming with optional broadcast delivery of data segments | |
CN108965428A (en) | The transmission method of live data, device, electronic equipment, system | |
WO2013029569A1 (en) | A Generalized Dual-Mode Data Forwarding Plane for Information-Centric Network | |
CN109561137B (en) | Method, device, terminal equipment and medium for establishing P2P network | |
US20150127837A1 (en) | Relay apparatus and data transfer method | |
US20120239727A1 (en) | Multimedia service network and method for providing the same | |
CN109510868B (en) | Method, device, terminal equipment and storage medium for establishing P2P network | |
CN106790609B (en) | Data transmission method and device | |
US12047437B1 (en) | Systems and methods for implementing an on-demand computing network environment utilizing a bridge device | |
CN109040199A (en) | A kind of method, system and storage medium for distributing resource data | |
US9124586B2 (en) | Confidential or protected access to a network of nodes distributed over a communication architecture with the aid of a topology server | |
CN106060155B (en) | The method and device of P2P resource-sharing | |
CN108900907A (en) | Encapsulated data packet method and device, electronic equipment, medium | |
US20170085623A1 (en) | Content downloading and network provisioning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |