CN111064785A - Resource package downloading method, device and system - Google Patents

Resource package downloading method, device and system Download PDF

Info

Publication number
CN111064785A
CN111064785A CN201911291548.5A CN201911291548A CN111064785A CN 111064785 A CN111064785 A CN 111064785A CN 201911291548 A CN201911291548 A CN 201911291548A CN 111064785 A CN111064785 A CN 111064785A
Authority
CN
China
Prior art keywords
sequence number
terminal
queue
fragment
resource packet
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.)
Granted
Application number
CN201911291548.5A
Other languages
Chinese (zh)
Other versions
CN111064785B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911291548.5A priority Critical patent/CN111064785B/en
Publication of CN111064785A publication Critical patent/CN111064785A/en
Application granted granted Critical
Publication of CN111064785B publication Critical patent/CN111064785B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • 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 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a resource package downloading method, device and system, wherein the method comprises the following steps: establishing point-to-point connection with a second terminal; downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; and after point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal. The scheme provided by the application can reduce the time required by the terminal to download the resource package fragments and improve the efficiency of application updating.

Description

Resource package downloading method, device and system
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a method and an apparatus for downloading a resource package, a system, a computer-readable storage medium, and a computer device.
Background
Currently, point-to-point transmission (P2P, Peer-to-Peer) has become one of the important means for data transmission between terminals, and is applied to various application scenarios requiring data transmission. For example, in an application scene of updating game application, a point-to-point connection is established between a terminal Peer _ A, Peer _ B and Peer _ C, a terminal Peer _ A downloads a plurality of resource package fragments from the terminal Peer _ B, then downloads other resource package fragments from the terminal Peer _ C, and finally merges the downloaded resource packages into a complete resource package to update the game application.
In practical application, the terminal needs to synchronize the real-time downloading progress to the server, that is, notify the server of the currently downloaded resource package fragment. Then, the server diffuses the downloading progress of each terminal to other terminals, so that the terminal can download the required resource package fragments according to the downloading progress of another terminal.
At present, because resource package fragments are downloaded in an unordered downloading manner, a Bitmap (a file format) manner is adopted for synchronization, specifically, a unique corresponding Bitmap is generated for each resource package fragment, the Bitmap records relevant information of the resource package fragment, and the Bitmap is synchronized to a server, so that the server obtains the resource package fragments downloaded by a terminal.
Since the data size of the Bitmap file is large, frequent synchronization of the Bitmap file to the server consumes a large amount of bandwidth resources. Therefore, it is necessary to perform synchronization with a lower synchronization frequency. However, the low frequency synchronization may cause a large delay in the diffusion of the downloading progress, and the terminal may not know the downloading progress of other terminals in time and may not download the required resource package fragments in time, thereby increasing the time required by the terminal to download the resource package.
Therefore, the resource package downloading method of the related art has the problem that the resource downloading takes a long time.
Disclosure of Invention
In view of the above, it is necessary to provide a resource package downloading method and apparatus, a system, a computer-readable storage medium, and a computer device, aiming at the problem that the resource package downloading method in the related art takes a long time for downloading resources.
A resource package downloading method is applied to a first terminal, and comprises the following steps:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the first terminal; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and after point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal.
A resource package downloading method is applied to a first terminal, and comprises the following steps:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
A resource package downloading method comprises the following steps:
receiving a queue head serial number and a queue tail serial number uploaded by a first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue, and determining a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
determining available third terminals among the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
and issuing the terminal address of the available third terminal to the first terminal, so that the first terminal downloads the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
A system, comprising:
the system comprises a first terminal, a second terminal, a third terminal and a server; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the first terminal is used for downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments after establishing point-to-point connection with the second terminal, and determining a sequence number queue according to the fragment sequence numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the first terminal is further used for uploading the queue head sequence number and the queue tail sequence number to a server; the server records a sequence number queue of the third terminal;
the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue, and determining a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
the server is further used for determining an available third terminal in the third terminal; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
the server is also used for sending the terminal address of the available third terminal to the first terminal;
and the first terminal is further used for downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal after the point-to-point connection is established with the available third terminal.
A resource package downloading apparatus, comprising:
the connection module is used for establishing point-to-point connection with the second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the first downloading module is used for downloading the plurality of resource packet fragments from the second terminal according to the sequence of the fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the plurality of resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the uploading module is used for uploading the queue head serial number and the queue tail serial number to a server; the server is used for determining a sequence number queue of the resource packet downloading device according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the resource package downloading device; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and the second downloading module is used for downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal after the point-to-point connection is established with the available third terminal.
A resource package downloading apparatus, comprising:
the connection module is used for establishing point-to-point connection with the second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the downloading module is used for downloading the plurality of resource packet fragments from the second terminal according to the sequence of the fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the plurality of resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the uploading module is used for uploading the queue head serial number and the queue tail serial number to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
A resource package downloading apparatus, comprising:
the receiving module is used for receiving a queue head serial number and a queue tail serial number uploaded by the first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
a sequence number determining module, configured to determine a sequence number queue of the first terminal according to the head sequence number and the tail sequence number of the queue, and determine a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
a terminal determining module for determining an available third terminal among the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
and the issuing module is used for issuing the terminal address of the available third terminal to the first terminal so that the first terminal can download the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the first terminal; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and after point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal.
A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the first terminal; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and after point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal.
According to the resource packet downloading method and device, the system, the computer readable storage medium and the computer equipment, in the process of point-to-point transmission of the resource packet fragments, the resource packet fragments are downloaded according to the sequence of the fragment sequence numbers of the resource packet fragments, so that the sequence numbers of all the fragments are arranged in order in a sequence number queue formed according to the fragment sequence numbers of the downloaded resource packet fragments, and therefore, only the head sequence number and the tail sequence number of a queue with small data volume are uploaded to the server, the server can determine the sequence number queue of each terminal for marking the downloading progress, and the Bitmap with large data volume is not uploaded to the server. After obtaining the sequence number queues of the terminals, the server may provide another terminal to the terminal, so that the terminal may download the required resource packet fragments from the other terminal. Because the data volume of the queue head serial number and the queue tail serial number is small, under the condition of consuming less bandwidth resources, the terminal and the server can adopt higher frequency to carry out information synchronization, the delay of information transmission is reduced, and the terminal can synchronize the relevant information of the downloading progress to the server in time, so that other terminals can also download the required resource package fragments in time, the time for the terminal to download the resource package fragments is reduced, and the efficiency of application updating is improved.
Moreover, in the application scene of game application update, because the application scene has the characteristic of short update time, the terminal has the problem of update failure caused by the fact that the download progress of other terminals cannot be obtained in time. When the resource package downloading method is applied to the application scene of game application updating, the time required by the terminal for downloading the resource package fragments can be reduced, so that the problem of updating failure caused by the fact that the downloading progress of other terminals cannot be obtained in time can be solved.
Drawings
FIG. 1 is a diagram of an application environment of a resource package downloading method in one embodiment;
FIG. 2 is a flowchart illustrating a resource package downloading method according to an embodiment;
FIG. 3 is a schematic diagram of another application update system, according to an embodiment;
FIG. 4 is a flowchart illustrating a method for downloading resource package fragments from a server in one embodiment;
fig. 5 is a flowchart illustrating a method for downloading resource package fragments from a router in one embodiment;
FIG. 6 is a flowchart illustrating another resource package downloading method according to an embodiment;
FIG. 7 is a flowchart illustrating a further method for downloading a resource package in one embodiment;
FIG. 8 is a block diagram of a system in one embodiment;
FIG. 9 is a timing diagram illustrating a resource package download process, under an embodiment;
FIG. 10 is a block diagram of an apparatus for downloading resource packages, according to an embodiment;
FIG. 11 is a block diagram of an alternative resource package downloading apparatus in one embodiment;
FIG. 12 is a block diagram of an apparatus for downloading resource packages, according to an embodiment;
FIG. 13 is a block diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an application environment of a resource package downloading method in one embodiment. Referring to fig. 1, the resource package downloading method is applied to an application update system. The application updating system comprises a first terminal 110, a second terminal 120, a third terminal 130 and a query server 140. The first terminal 110, the second terminal 120, and the third terminal 130 may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 140 may be implemented as a stand-alone server or a server cluster comprising a plurality of servers.
It should be noted that the resource package downloading method can be applied to an application scenario in which a resource package for updating application software needs to be downloaded. For example, the application scenario may be specifically a scenario in which different application software such as an instant messaging application, a multimedia playing application, a content recommendation application, a live broadcast application, a shopping application, a financial service application, a game application, and the like is updated. For example, when a game application is updated, a resource package for updating the game application is divided into a plurality of resource package fragments, each terminal has downloaded part of the resource package fragments, the required resource package fragments are downloaded among the terminals in a point-to-point transmission mode to obtain all the resource package fragments, all the downloaded resource package fragments are combined into a complete resource package, and the game application is updated by using the complete resource package.
The resource package downloading method is applied to the application scene, the downloading progress of the terminal can be marked by the fragment sequence number with small data volume, so that the downloading progress can be synchronized to the server at high frequency under the condition of consuming a small amount of bandwidth resources, the server can spread the downloading progress of the terminal to other terminals in time, the time required by the terminal for downloading the resource package is shortened, and the application updating efficiency is improved.
In one embodiment, as shown in FIG. 2, a resource package download method is provided. The embodiment is mainly illustrated by applying the method to the first terminal 110 in fig. 1. Referring to fig. 2, the resource package downloading method specifically includes the following steps:
s202, establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragment carries a fragment sequence number.
The resource packet fragment may be data obtained by dividing a complete resource packet for updating an application.
The fragment sequence number may be identification information for marking the sequence between resource packet fragments. For example, the slice number may be a numeric value such as 001 or 002, or may be a character such as AA, AB, or AC.
In a specific implementation, the first terminal 110 may be installed with application software of an instant messaging application, a multimedia playing application, a content recommendation application, a live broadcast application, a shopping application, a financial service application, a game application, and the like, and when a user starts the application software, the application software may start update detection to detect whether a new version of the application software needs to be updated currently. When it is determined that the application software needs to be updated, the first terminal 110 may start an application update program to trigger downloading of the resource package fragment.
After the application update program is initiated, the first terminal 110 may request the application server for information related to a resource package for updating the application software.
The application server may divide the resource packet into a plurality of resource packet fragments in advance, and mark a fragment sequence number for each resource packet fragment. For example, a certain resource packet may be divided into 100 resource packet fragments, and fragment numbers of 001, 002, 003 … 100, and the like may be sequentially assigned to the respective resource packet fragments.
The application server may send all the fragment sequence numbers as the related information of the resource packet to the first terminal 110, and the first terminal 110 may randomly select a certain fragment sequence number from all the fragment sequence numbers, and request the query server 140 to provide the terminal address of the second terminal 120, and establish a point-to-point connection with the second terminal 120 according to the terminal address, so as to start downloading the resource packet fragments corresponding to the selected fragment sequence number from the second terminal 120.
In practical applications, the first terminal 110 may use any connectable terminal as the second terminal 120, and perform a peer-to-peer connection with the second terminal 120 to start downloading resource packet fragments corresponding to a certain fragment number from the second terminal 120.
It should be noted that the second terminal 120 may download, from another terminal to the first terminal 110, the partial resource package fragments to be downloaded in a point-to-point transmission manner, or may download, from the application server, the partial resource package fragments to be downloaded in a hypertext Transfer Protocol (HTTP) transmission manner to the first terminal 110.
For example, the second terminal 120 has the resource packet fragments with the fragment sequence numbers of 005 to 015, and the first terminal 110 may download the resource packet fragments with the fragment sequence numbers of 005 to 015 from the second terminal 120.
S204, downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; and the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue.
The sequence number queue may be a queue formed by orderly arranging the fragment sequence numbers of the resource packet fragments.
The queue head sequence number may be a fragment sequence number sorted foremost in the sequence number queue, that is, a fragment sequence number of a resource packet fragment obtained by first downloading by the first terminal 110.
The queue tail sequence number may be a last fragment sequence number sequenced in the sequence number queue, that is, a fragment sequence number of a resource packet fragment downloaded by the first terminal 110 most recently.
In a specific implementation, after the point-to-point connection is established between the first terminal 110 and the second terminal 120, the resource packet fragments may be sequentially downloaded from the second terminal 120 according to the sequence of the fragment sequence numbers. More specifically, first, the first terminal 110 may download a certain resource packet fragment from the second terminal 120 as a first resource packet fragment, where a fragment sequence number carried by the first resource packet fragment is used as a first fragment sequence number. The first terminal 110 determines the fragment sequence number that is sequenced after the first fragment sequence number and is consecutive to the first fragment sequence number as the second fragment sequence number. Then, the first terminal 110 downloads the resource package fragment corresponding to the second fragment sequence number from the second terminal 120. By repeating the above process, the plurality of resource packet fragments can be downloaded from the second terminal 120 according to the sequence of the fragment sequence numbers carried by the resource packet fragments.
For example, the second terminal 120 has the resource packet fragments with fragment numbers of 005 to 015, first, the first terminal 110 downloads the resource packet fragment with fragment number 005 from the second terminal 120, the first terminal 110 determines that the fragment number that is sequenced after 005 and is consecutive to 005 is 006, and the first terminal 110 downloads the resource packet fragment with fragment number 006 from the second terminal 120 until the resource packet fragments with fragment numbers of 005 to 015 are downloaded from the second terminal 120, that is, a plurality of resource packet fragments that the second terminal 120 has are synchronized to the first terminal 110.
The first terminal 110 may form a sequence number queue with the segment sequence numbers of the downloaded resource packet segments during the process of downloading the resource packet segments from the second terminal 120. For example, the first terminal 110 has currently downloaded resource packet fragments with fragment sequence numbers 005 to 010, and can obtain a sequence number queue [005, 006, 007, 008, 009, 010 ]. When the first terminal 110 downloads the resource package fragment with the fragment sequence number of 011, the sequence number queue may be updated to [005, 006, 007, 008, 009, 010, 011 ].
The first terminal 110 may determine the sequence number of the first-ranked fragment in the sequence number queue as the head-of-queue sequence number, and determine the sequence number of the last-ranked fragment in the sequence number queue as the tail-of-queue sequence number. For example, for sequence number queue [005,006 006 … 011], the head of the queue is 005 and the tail is 011.
In the sequence number queue determined by the first terminal 110, except for the queue tail sequence number, all the fragment sequence numbers have another sequenced and consecutive fragment sequence number in the sequence number queue. For example, for sequence number queue [005,006 006 … 011], slice sequence number 005 has the next and consecutive slice sequence number 006, slice sequence number 010 has the next and consecutive slice sequence number 010, and the tail sequence number 011 has no next and consecutive slice sequence number 012.
S206, uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the first terminal; and the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced after the queue tail sequence number and is continuous with the queue tail sequence number.
The continuous transmission sequence number may be a fragment sequence number that is sequenced after the queue tail sequence number of the first terminal 110 and is consecutive to the queue tail sequence number of the first terminal 110. For example, the queue tail number of the first terminal 110 is 015, and the transfer continuation number is 016.
In a specific implementation, after obtaining the head sequence number and the tail sequence number, the first terminal 110 may upload the head sequence number and the tail sequence number to the query server 140. In practical applications, the first terminal 110 may upload the queue head sequence number and the queue tail sequence number to the query server 140 according to a preset frequency, or may generate a query request including the queue head sequence number and the queue tail sequence number when the resource packet fragment corresponding to the resume sequence number cannot be downloaded from the second terminal 120, and upload the query request to the query server 140, so as to request the query server 140 to feed back other terminals having the resource packet fragment corresponding to the resume sequence number.
Since the first terminal 110 sequentially downloads the resource packet fragments according to the sequence of the fragment sequence numbers, all the fragment sequence numbers except the tail sequence number in the sequence number queue have another sequenced and consecutive fragment sequence number in the sequence number queue. Therefore, after obtaining the first queue serial number and the last queue serial number uploaded by the first terminal 110, the query server 140 may determine the serial number queue of the first terminal 110 according to the first queue serial number and the last queue serial number, where the serial number queue may reflect the downloading progress of the first terminal 110.
For example, the first terminal 110 uploads the head-of-line sequence number 005 and the tail-of-line sequence number 015, and the query server 140 may determine that the sequence number queue of the first terminal 110 is [005, 006 … 015], that is, the downloading progress of the first terminal 110 is that a plurality of resource packet fragments with fragment sequence numbers of 005 and 006 … 015 have been downloaded.
The query server 140 may further record a sequence number queue determined according to the head sequence number and the tail sequence number uploaded by the third terminal 130.
In a specific implementation, the third terminal 130 may download the partial resource package fragments from other terminals by means of peer-to-peer transmission, or may download the partial resource package fragments from the application server by means of HTTP transmission. After downloading the multiple resource packet fragments, the third terminal 130 may determine the sequence number queue according to the fragment sequence numbers of the multiple resource packet fragments, and upload the queue head sequence number and the queue tail sequence number in the sequence number queue to the server 140. The server 140 may determine the sequence number queue of the third terminal 130 according to the sequence number queue determined by the queue head sequence number and the queue tail sequence number uploaded by the third terminal 130.
The query server 140 may determine, as the resume sequence number, the fragment sequence number that is sequenced after the queue tail sequence number uploaded by the first terminal 110 and is consecutive to the queue tail sequence number. For example, the queue tail sequence number uploaded by the first terminal 110 is 015, and the transfer sequence number is 016.
The third terminal 130 may have a plurality, and thus, the query server 140 may obtain a plurality of sequence number queues of the third terminal 130. After obtaining the resume sequence number, the query server 140 may further screen out, from the plurality of third terminals 130, the third terminal 130 whose sequence number queue includes the resume sequence number as the above-mentioned available third terminal 130.
In practical applications, after obtaining the plurality of third terminals 130 including the resume sequence numbers, the query server 140 may further match the sequence number queue of the first terminal with the sequence number queue of the candidate third terminal 130 in the plurality of third terminals 130 including the resume sequence numbers, so as to obtain the third terminal 130 whose sequence number queue matches the sequence number queue of the first terminal, which is used as the above-mentioned available third terminal 130.
For example, assuming that the retransmission sequence number is 016, candidate third terminal a and third terminal B are obtained, the sequence number queues are [001, 002 … 020] and [011, 012 … 050], and the sequence number queues both include the retransmission sequence number 016. Matching the sequence number queue [005, 006 … 015] of the first terminal 110 with the sequence number queue described above, where the sequence number queue of the third terminal a has more repeated fragment sequence numbers with the sequence number queue of the first terminal 110, and the sequence number queue of the third terminal B has less repeated fragment sequence numbers with the sequence number queue of the first terminal 110, indicating that the third terminal B has more resource packet fragments that the first terminal 110 needs to download, so that it can be determined that the sequence number queue of the third terminal B matches with the sequence number queue of the first terminal 110.
Of course, in practical applications, those skilled in the art may also use other manners to determine whether the sequence number queues of the third terminal and the first terminal are matched.
After the query server 140 determines the plurality of available third terminals 130, the terminal addresses of the plurality of available third terminals 130 may be transmitted to the first terminal 110.
And S208, after the point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal.
In a specific implementation, the first terminal 110 may first determine whether the resource packet fragment corresponding to the resume sequence number cannot be downloaded from the second terminal 120, and when the resource packet fragment corresponding to the resume sequence number cannot be downloaded from the second terminal 120, the first terminal 110 may establish a point-to-point connection with the available third terminal 130 according to the terminal address issued by the query server 140, and after the point-to-point connection is established, the first terminal 110 may download the resource packet fragment corresponding to the resume sequence number from the available third terminal 130.
For example, the current sequence number queue of the first terminal 110 is [005,006 006 … 015], the first terminal 110 downloads the resource packet fragment with fragment sequence number 016 from the second terminal 120, and if the second terminal 120 does not respond or the downloading speed is too slow, the first terminal 110 may perform a peer-to-peer connection with the available third terminal 130 according to the terminal address fed back by the query server 140, and download the resource packet fragment with fragment sequence number 016 from the third terminal 130.
After downloading the resource package fragment corresponding to the continuous transmission sequence number, the first terminal 110 may continue to download other resource package fragments from the third terminal 130, and when the first terminal 110 downloads other resource package fragments from the third terminal 130, the first terminal sequentially downloads the plurality of resource package fragments according to the sequence of the fragment sequence numbers carried by the resource package fragments. Since the process is similar to the above-described process of downloading the resource package fragments from the second terminal 120, it is not described in detail.
In practical applications, the query server 140 may issue the terminal addresses of the available third terminals 130 to the first terminal 110, and the first terminal 110 may perform point-to-point connection with the available third terminals 130 respectively according to the terminal addresses of the available third terminals 130, and download different resource package fragments from the available third terminals 130 respectively. For example, after the first terminal 110 downloads the plurality of asset package fragments with fragment numbers [016, 017 … 040] from the available third terminal a, and downloads the plurality of asset package fragments, the first terminal 110 downloads the plurality of asset package fragments with fragment numbers [041, 042 … 100] from the available third terminal B.
After the first terminal 110 obtains all the resource packet fragments, the resource packet fragments may be combined to obtain a complete resource packet, and the resource packet is used to update the application software.
It should be noted that, in order to facilitate understanding of those skilled in the art, the first terminal 110 is taken as an execution subject for the description of the present embodiment. In practical applications, the second terminal 120 and the third terminal 130 can both execute the steps executed by the first terminal 110. For example, after the third terminal 130 uploads the queue head sequence number and the queue tail sequence number to the query server 140, the query server 140 may correspondingly feed back the terminal addresses of other terminals, so that the third terminal 130 establishes a point-to-point connection with other terminals according to the terminal addresses, and downloads the required resource packet fragments from other terminals.
Similarly, the first terminal 110 may execute the steps executed by the second terminal 120 and the third terminal 130. For example, the first terminal 110 may also upload the sequence number at the head of the queue and the sequence number at the tail of the queue to the query server 140, so that the query server 140 determines the sequence number queue of the first terminal 110, and when the sequence number queue of the first terminal 110 includes the resume sequence numbers of other terminals, provide the terminal address of the first terminal 110 to the other terminals, so that the other terminals download the resource packet fragments corresponding to the resume sequence numbers from the first terminal 110.
In the above method for downloading resource packets, during the point-to-point transmission of the resource packet fragments, the resource packet fragments are downloaded according to the sequence of the fragment sequence numbers of the resource packet fragments, so that the sequence numbers of the fragments are arranged in order in the sequence number queue formed by the fragment sequence numbers of the downloaded resource packet fragments, and thus, only the sequence numbers at the head and the tail of the queue with small data volume need to be uploaded to the server, and the server can determine the sequence number queue for marking the downloading progress of each terminal without uploading the Bitmap with large data volume to the server. After obtaining the sequence number queues of the terminals, the server may provide another terminal to the terminal, so that the terminal may download the required resource packet fragments from the other terminal. Because the data volume of the queue head serial number and the queue tail serial number is small, under the condition of consuming less bandwidth resources, the terminal and the server can adopt higher frequency to carry out information synchronization, the delay of information transmission is reduced, and the terminal can synchronize the relevant information of the downloading progress to the server in time, so that other terminals can also download the required resource package fragments in time, the time for the terminal to download the resource package fragments is reduced, and the efficiency of application updating is improved.
Moreover, in the application scene of game application update, because the application scene has the characteristic of short update time, the terminal has the problem of update failure caused by the fact that the download progress of other terminals cannot be obtained in time. When the resource package downloading method is applied to the application scene of game application updating, the time required by the terminal for downloading the resource package fragments can be reduced, so that the problem of updating failure caused by the fact that the downloading progress of other terminals cannot be obtained in time can be solved.
In an embodiment, the step S204 may specifically include:
downloading a first resource package fragment from the second terminal; the fragment sequence number of the first resource packet fragment is a first fragment sequence number; determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number; downloading the resource package fragments corresponding to the second fragment sequence number from the second terminal; and taking the second fragment sequence number as a new first fragment sequence number, and returning to the step of determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number until a plurality of resource packet fragments are downloaded from the second terminal.
In a specific implementation, after the point-to-point connection is established between the first terminal 110 and the second terminal 120, a certain resource packet fragment may be downloaded from the second terminal 120 as a first resource packet fragment, and a fragment sequence number carried by the first resource packet fragment is used as the first fragment sequence number. Then, the first terminal 110 determines the fragment sequence number that is sequenced after the first fragment sequence number and is consecutive to the first fragment sequence number as a second fragment sequence number, and finally, the first terminal 110 downloads the resource packet fragment corresponding to the second fragment sequence number from the second terminal 120.
After downloading the resource packet fragment corresponding to the second fragment sequence number, the second fragment sequence number is used as a new first fragment sequence number, and the step of determining the second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number is returned until the plurality of resource packet fragments are downloaded from the second terminal 120.
In the resource package downloading method, after the first resource package fragment is downloaded, according to the first fragment sequence number of the first resource package fragment, the second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number is determined, and the resource package fragment corresponding to the second fragment sequence number is downloaded from the second terminal, so that the ordered downloading of a plurality of resource package fragments in the second terminal is ensured.
In an embodiment, there are a plurality of available third terminals 130, and the step S208 may specifically include:
determining the fragment serial number of the resource packet fragment to be downloaded according to the serial number queue, wherein the fragment serial number is the fragment serial number to be downloaded; determining the number of resource package fragments corresponding to the sequence number of the fragment to be downloaded in the available third terminal to obtain the number of downloadable fragments of a plurality of available third terminals; screening out target terminals of which the downloadable fragment quantity meets a set quantity condition from a plurality of available third terminals; downloading the resource packet fragments corresponding to the continuous transmission sequence number from the target terminal;
after the step S208, the method may further include:
and downloading the resource package fragments corresponding to the sequence numbers of the fragments to be downloaded from the target terminal until the resource package fragments with the quantity according with the quantity of the downloadable fragments of the target terminal are downloaded from the target terminal.
The sequence number of the fragment to be downloaded may be a fragment sequence number corresponding to the resource packet fragment to be downloaded by the first terminal 110.
The number of the downloadable segments may be the number of the resource package segments corresponding to the sequence number of the segment to be downloaded in the available third terminal 130.
In a specific implementation, the first terminal 110 may first determine a fragment serial number of a resource packet fragment to be downloaded according to the serial number queue, and use the determined fragment serial number as the above-mentioned fragment serial number to be downloaded.
For example, assume that there are 100 resource packet fragments, and accordingly the fragment sequence number is [1, 2 … 100 ]. The sequence number queue of the first terminal 110 is [005,006 006 … 015], and therefore, the fragment sequence numbers of the resource packet fragments to be downloaded include [001,002 002 … 004] and [016,017 017 … 100] as the above-mentioned fragment sequence numbers to be downloaded.
Then, the first terminal 110 may determine the number of the resource packet fragments corresponding to the sequence number of the fragment to be downloaded in the available third terminal 130, as the number of the downloadable fragments.
For example, the sequence number queues of the available third terminals a and B are [001, 002 … 020] and [011, 012 … 050] respectively, the available third terminal a has the resource package fragments corresponding to 10 serial numbers of the fragments to be downloaded, and the available third terminal B has the resource package fragments corresponding to 34 serial numbers of the fragments to be downloaded. Therefore, the number of downloadable segments available to the third terminal a is 10, and the number of downloadable segments available to the third terminal B is 34.
The first terminal 110 may select, from the plurality of available third terminals, a target terminal whose downloadable segment number meets a set number condition, and download the resource packet segment corresponding to the resume sequence number from the target terminal.
The setting condition may be a preset number threshold, or a sorting position where the available third terminals are sorted according to the number of the downloadable segments.
For example, the preset number threshold is 30, the number of downloadable segments available to the third terminal a is 10, so that the third terminal a does not meet the set number condition, and the number of downloadable segments available to the third terminal B is 34, so that the third terminal B meets the set number condition, and the third terminal B is the target terminal.
For another example, the available third terminals a and B are sorted according to the number of downloadable fragments, and the first available third terminal B is taken as the target terminal.
After the first terminal 110 obtains the resource package fragment corresponding to the resume sequence number from the target terminal, it may continue to download other resource package fragments corresponding to the sequence number of the fragment to be downloaded from the target terminal until the resource package fragments whose number conforms to the number of downloadable fragments of the target terminal are downloaded from the target terminal.
In the resource package downloading method, the fragment serial number of the resource package fragment to be downloaded by the first terminal is determined according to the serial number queue of the first terminal and is used as the serial number of the fragment to be downloaded, the number of the resource package fragments corresponding to the serial number of the fragment to be downloaded in the available third terminals is determined, the number of the downloadable fragments of each available third terminal is obtained, and the target terminal is screened out according to the number of the downloadable fragments, so that the first terminal can download more resource package fragments from the target terminal without frequently performing point-to-point connection with the plurality of available third terminals, and resources consumed by the terminal for downloading the resource package fragments are saved.
In an embodiment, the step S206 may specifically include:
generating a query request; the terminal query request comprises the queue head sequence number and the queue tail sequence number; sending the query request to the server; the server is used for feeding back the terminal addresses of the available third terminals aiming at the query request;
the method further comprises the following steps:
and when the resource packet fragment corresponding to the continuous transmission sequence number cannot be downloaded from the second terminal, establishing point-to-point connection with the available third terminal according to the terminal address.
In a specific implementation, the first terminal 110 may generate a query request carrying the queue head sequence number and the queue tail sequence number according to a preset frequency, and send the query request to the query server 140. When receiving the query request, the query server 140 may determine the sequence number queue of the first terminal 110 according to the sequence number at the head of the queue and the sequence number at the tail of the queue in the query request, find the corresponding terminal address of the available third terminal according to the sequence number queue of the first terminal 110, and send the terminal address to the first terminal 110. When the resource packet fragment corresponding to the resume sequence number cannot be downloaded from the second terminal 120, the first terminal 110 may establish a point-to-point connection with the available third terminal 130 by using the received terminal address, and download the resource packet fragment corresponding to the resume sequence number from the available third terminal 130.
In the resource packet downloading method, by sending the query request carrying the queue head sequence number and the queue tail sequence number to the server and receiving the terminal address fed back by the server in response to the query request, when the resource packet fragment corresponding to the resume sequence number cannot be downloaded from the second terminal, a point-to-point connection can be established with the available third terminal by using the terminal address, so as to download the resource packet fragment corresponding to the resume sequence number from the available third terminal. Therefore, even if the resource package fragment cannot be downloaded from the second terminal, downloading can be recovered from the available third terminal in time, the condition that downloading is suspended because the resource package fragment cannot be downloaded from the second terminal is avoided, and the downloading efficiency of the resource package fragment is improved.
FIG. 3 illustrates another application update system of an embodiment that further includes a resource download server 150 and a router 160. In conjunction with another application update system shown in fig. 3, as shown in fig. 4, in an embodiment, the resource package downloading method may further include the following steps:
s402, when the available third terminal does not respond, or the downloading speed of the resource packet fragment corresponding to the continuous transmission serial number downloaded from the available third terminal is lower than a preset threshold value, acquiring the server address of the resource downloading server.
In a specific implementation, after the first terminal 110 performs the peer-to-peer connection with the available third terminal 130, a problem that the available third terminal 130 does not respond or a problem that the download speed for downloading the resource packet fragment from the available third terminal 130 is too slow may occur due to an abnormality of the peer-to-peer transmission network or an abnormality of the available third terminal 130. For the above case, the first terminal 110 may establish an HTTP connection with the resource download server through a locally pre-stored server address.
S404, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the resource downloading server according to the server address.
In a specific implementation, the resource download server 150 may store all resource package fragments for synthesizing a complete resource package, and after the first terminal 110 establishes the HTTP connection with the resource download server 150, the resource package fragments corresponding to the resume sequence numbers may be downloaded from the resource download server 150 in an HTTP transmission manner.
In practical applications, the resource download server 150 may be specifically a Content Delivery Network (CDN), and the Content Delivery server performs data transmission through a Content Delivery Network.
In the above method for downloading the resource package, when the resource package fragment corresponding to the resume sequence number is downloaded, when the available third terminal does not respond, or when the download speed of the resource package fragment corresponding to the resume sequence number downloaded from the available third terminal is lower than the preset threshold, the resource package fragment corresponding to the resume sequence number can be downloaded from the resource download server by connecting the server address with the resource download server, thereby avoiding the problem that the download efficiency of the resource package fragment is affected because the download cannot be continued when the peer-to-peer transmission network is abnormal and the available third terminal is abnormal.
In an embodiment, in combination with another application update system shown in fig. 3, as shown in fig. 5, the resource package downloading method may further include the following steps:
s502, determining a connectable router; the router prestores resource package fragments pushed by a resource downloading server;
s504, after the point-to-point connection is established with the router, downloading the resource packet fragments prestored by the router.
In a specific implementation, the resource download server 150 may push the resource packet fragments to the plurality of routers 160 in advance. When the first terminal 110 detects that a new version of application software needs to be updated, it may first determine whether a connectable router 160 exists, and when the connectable router 160 exists, the first terminal 110 may establish a peer-to-peer connection with the router 160 and download a plurality of resource package fragments it has from the router 160.
According to the resource package downloading method, the resource package fragments are pushed to the router in advance by the resource downloading server, and when the terminal has a router capable of being connected, the terminal can download the resource package fragments from the router, so that the router is used as a resident node for point-to-point transmission, the terminal can download the resource package fragments from the nodes on line for a long time, the problem that the resource package fragments cannot be downloaded after the terminal nodes are off line is avoided, and the downloading efficiency of the resource package fragments is improved.
In one embodiment, before the step S202, the method further comprises:
acquiring a plurality of candidate fragment serial numbers; randomly selecting an initial fragment sequence number from the candidate fragment sequence numbers; and downloading the resource packet fragments corresponding to the starting fragment sequence number from a fourth terminal.
In a specific implementation, the first terminal 110 may request, from the application server, a plurality of candidate fragment sequence numbers of a resource packet for updating application software. The application server may divide the resource packet into a plurality of resource packet fragments in advance, and mark a fragment sequence number for each resource packet fragment. The application server may use all the fragment sequence numbers as candidate fragment sequence numbers of the resource packet, and send the candidate fragment sequence numbers to the first terminal 110, and the first terminal 110 may randomly select a certain candidate fragment sequence number from a plurality of candidate fragment sequence numbers as the initial fragment sequence number.
The first terminal 110 may request the query server 140 to query a fourth terminal having a resource packet fragment with a starting fragment sequence number, and feed back a terminal address of the fourth terminal, and after the first terminal 110 obtains the terminal address of the fourth terminal, the first terminal may establish a point-to-point connection with the fourth terminal according to the terminal address, and download the resource packet fragment corresponding to the starting fragment sequence number from the fourth terminal, thereby obtaining a first resource packet fragment by downloading.
In the resource package downloading method, the starting fragment serial number is randomly selected and the resource package fragment corresponding to the starting fragment serial number is downloaded, so that the downloading heat of the resource package fragments tends to be balanced and the problem of abnormal downloading caused by the centralized downloading of the same resource package fragment by all the terminals is solved.
In one embodiment, as shown in FIG. 6, a resource package download method is provided. The embodiment is mainly illustrated by applying the method to the first terminal 110 in fig. 1. Referring to fig. 6, the resource package downloading method specifically includes the following steps:
s602, establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
s604, downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
s606, uploading the sequence number of the head of the queue and the sequence number of the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
In a specific implementation, the first terminal 110 may establish a point-to-point connection with the second terminal 120, and sequentially download the plurality of resource packet fragments from the second terminal 120 according to the sequence of the fragment sequence numbers. The first terminal 110 may form a sequence number queue with the segment sequence numbers of the downloaded resource packet segments during the process of downloading the resource packet segments from the second terminal 120. The first terminal 110 uploads the head sequence number and the tail sequence number in the sequence number queue to the query server 140. Since the above process has been described in detail in the foregoing embodiments, it is not described herein again.
In practical application, the first terminal 110 may generate a synchronization request carrying a head sequence number and a tail sequence number to the query server 140, and after receiving the synchronization request, the query server 140 may determine and record a sequence number queue of the first terminal 110 according to the head sequence number and the tail sequence number in the synchronization request, thereby synchronizing the download progress of the first terminal 110. After the query server 140 records the sequence number queue of the first terminal 110, it may receive a query request carrying a sequence number at the head of the queue and a sequence number at the tail of the queue uploaded by the third terminal 130, and the query server 140 may determine the sequence number queue of the third terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue in the query request, and may determine that the sequence number queue of the first terminal 110 includes a continuous transmission sequence number which is sequenced after the sequence number at the tail of the queue of the third terminal 130 and is continuous with the sequence number at the tail of the queue of the third terminal 130. The query server 140 may issue the terminal address of the first terminal 110 to the third terminal 130, so that the third terminal downloads the resource packet fragment corresponding to the resume sequence number from the first terminal 110, and after downloading the resource packet fragment corresponding to the resume sequence number, the third terminal 130 may also download other resource packet fragments of the first terminal 110 from the first terminal 110, so as to download a plurality of resource packet fragments corresponding to the sequence number queue of the first terminal 110 from the first terminal 110.
In the above method for downloading resource packets, during the point-to-point transmission of the resource packet fragments, the resource packet fragments are downloaded according to the sequence of the fragment sequence numbers of the resource packet fragments, so that the sequence numbers of the fragments are arranged in order in the sequence number queue formed by the fragment sequence numbers of the downloaded resource packet fragments, and thus, only the sequence numbers at the head and the tail of the queue with small data volume need to be uploaded to the server, and the server can determine the sequence number queue for marking the downloading progress of each terminal without uploading the Bitmap with large data volume to the server. After obtaining the sequence number queues of the terminals, the server may provide another terminal to the terminal, so that the terminal may download the required resource packet fragments from the other terminal. Because the data volume of the queue head serial number and the queue tail serial number is small, under the condition of consuming less bandwidth resources, the terminal and the server can adopt higher frequency to carry out information synchronization, the delay of information transmission is reduced, and the terminal can synchronize the relevant information of the downloading progress to the server in time, so that other terminals can also download the required resource package fragments in time, the time for the terminal to download the resource package fragments is reduced, and the efficiency of application updating is improved.
In one embodiment, as shown in FIG. 7, a resource package download method is provided. This embodiment is mainly illustrated by applying the method to the query server 140 in fig. 1. Referring to fig. 7, the resource package downloading method specifically includes the following steps:
s702, receiving a queue head serial number and a queue tail serial number uploaded by a first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
s704, determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue, and determining a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
s706, determining an available third terminal in the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
and S708, issuing the terminal address of the available third terminal to the first terminal, so that the first terminal can download the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
Since the processing procedure of the query server 140 has been described in detail in the foregoing embodiments, it is not described herein again.
In the resource package downloading method, because the data volume of the queue head serial number and the queue tail serial number is small, under the condition of consuming less bandwidth resources, the terminal and the server can adopt higher frequency to carry out information synchronization, the delay of information transmission is reduced, and the terminal can synchronize the relevant information of the downloading progress to the server in time, so that other terminals can also download the required resource package fragments in time, the time for the terminal to download the resource package fragments is reduced, and the efficiency of application updating is improved.
As shown in fig. 8, in one embodiment, a system is provided comprising a first terminal 810, a second terminal 820, a third terminal 830, and a server 840; the second terminal 820 has a resource packet fragment; the resource packet fragments carry fragment serial numbers;
the first terminal 810 is configured to download, after establishing a point-to-point connection with the second terminal 820, a plurality of resource packet fragments from the second terminal 820 according to a sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to fragment sequence numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the first terminal 810 is further configured to upload the head-of-line sequence number and the tail-of-line sequence number to a server 840; the server 840 records a sequence number queue of the third terminal 830;
the server 840 is configured to determine a sequence number queue of the first terminal according to the head sequence number and the tail sequence number of the queue, and determine a continuous transmission sequence number of the first terminal 810; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
the server 840, further configured to determine an available third terminal in the third terminal 830; the third terminal 830 has a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
the server 840 is further configured to issue the terminal address of the available third terminal to the first terminal;
the first terminal 810 is further configured to download the resource packet fragment corresponding to the resume sequence number from the available third terminal after establishing the peer-to-peer connection with the available third terminal.
Since the processing procedures of the first terminal 810, the second terminal 820, the third terminal 830 and the server 840 have been described in detail in the foregoing embodiments, they are not described herein again.
In the system, because the data volume of the queue head serial number and the queue tail serial number is small, under the condition of consuming less bandwidth resources, each terminal and the server can adopt higher frequency to carry out information synchronization, the delay of information transmission is reduced, and the terminal can synchronize the relevant information of the downloading progress to the server in time, so that other terminals can also download the required resource package fragments in time, the time for the terminal to download the resource package fragments is reduced, and the efficiency of application updating is improved.
To facilitate a thorough understanding of the present application by those skilled in the art, the following description will be given with reference to specific examples. Fig. 9 is a timing diagram of a specific resource package downloading process according to an embodiment, where the resource package downloading process may specifically include the following steps:
s902, a third terminal downloads a plurality of resource packet fragments from other terminals, determines a sequence number queue according to the sequence numbers of the downloaded resource packet fragments according to a preset frequency, adds a queue head sequence number and a queue tail sequence number in the sequence number queue to a synchronization request, and sends the synchronization request to an inquiry server;
s904, the inquiry server determines a sequence number queue of the third terminal according to a queue head sequence number and a queue tail sequence number in the synchronous request uploaded by the third terminal and records the sequence number queue as the downloading progress of the third terminal;
s906, after the point-to-point connection is established between the first terminal and the second terminal, downloading a plurality of resource package fragments from the second terminal according to the sequence of the fragment serial numbers;
s908, the first terminal determines a sequence number queue according to the fragment sequence number of the downloaded resource packet fragment according to the preset frequency, adds a queue head sequence number and a queue tail sequence number in the sequence number queue to the query request, and sends the query request to the query server;
s910, the query server determines a sequence number queue of the first terminal according to a queue head sequence number and a queue tail sequence number in the query request uploaded by the first terminal and records the sequence number queue as the downloading progress of the first terminal;
s912, the query server determines a continuous transmission sequence number of the first terminal, and judges that a sequence number queue of the third terminal is matched with the sequence number queue of the first terminal and the sequence number queue of the third terminal contains a continuous transmission sequence number;
s914, the inquiry server sends the terminal address of the third terminal to the first terminal;
s916, the first terminal establishes point-to-point connection with the third terminal according to the terminal address of the third terminal, and downloads the resource packet fragments corresponding to the continuous transmission serial numbers from the third terminal;
s918, when the third terminal does not respond or the downloading speed of the third terminal is lower than a preset threshold value, performing HTTP connection with the content distribution server;
s920, downloading the resource package fragment from the content distribution server in an HTTP transmission mode.
It should be understood that, although the steps in the flowcharts of fig. 2, 4 to 9 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 4 through 9 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
As shown in fig. 10, in one embodiment, there is provided a resource package downloading apparatus 1000, including:
a connection module 1002, configured to establish a point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
a first downloading module 1004, configured to download the multiple resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the multiple resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
an upload module 1006, configured to upload the head sequence number and the tail sequence number to a server; the server is used for determining a sequence number queue of the resource packet downloading device according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the resource package downloading device; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
a second downloading module 1008, configured to download, from the available third terminal, the resource packet fragment corresponding to the continuous transmission sequence number after establishing the point-to-point connection with the available third terminal.
In an embodiment, the first downloading module 1004 is specifically configured to:
downloading a first resource package fragment from the second terminal; the fragment sequence number of the first resource packet fragment is a first fragment sequence number; determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number; downloading the resource package fragments corresponding to the second fragment sequence number from the second terminal; and taking the second fragment sequence number as a new first fragment sequence number, and returning to the step of determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number until a plurality of resource packet fragments are downloaded from the second terminal.
In an embodiment, the available third terminal has a plurality of available third terminals, and the second downloading module 1008 is specifically configured to:
determining the fragment serial number of the resource packet fragment to be downloaded according to the serial number queue, wherein the fragment serial number is the fragment serial number to be downloaded; determining the number of resource package fragments corresponding to the sequence number of the fragment to be downloaded in the available third terminal to obtain the number of downloadable fragments of a plurality of available third terminals; screening out target terminals of which the downloadable fragment quantity meets a set quantity condition from a plurality of available third terminals; downloading the resource packet fragments corresponding to the continuous transmission sequence number from the target terminal;
the resource package downloading device 1000 is further specifically configured to: and downloading the resource package fragments corresponding to the sequence numbers of the fragments to be downloaded from the target terminal until the resource package fragments with the quantity according with the quantity of the downloadable fragments of the target terminal are downloaded from the target terminal.
In an embodiment, the upload module 1006 is specifically configured to:
generating a query request; the terminal query request comprises the queue head sequence number and the queue tail sequence number; sending the query request to the server; the server is used for feeding back the terminal addresses of the available third terminals aiming at the query request;
the resource package downloading device 1000 is further specifically configured to: and when the resource packet fragment corresponding to the continuous transmission sequence number cannot be downloaded from the second terminal, establishing point-to-point connection with the available third terminal according to the terminal address.
In one embodiment, the resource package downloading apparatus 1000 is further configured to:
when the available third terminal does not respond or the downloading speed of the resource packet fragment corresponding to the continuous transmission serial number downloaded from the available third terminal is lower than a preset threshold value, acquiring a server address of a resource downloading server; and downloading the resource packet fragments corresponding to the continuous transmission sequence number from the resource downloading server according to the server address.
In one embodiment, the resource package downloading apparatus 1000 is further configured to:
determining a connectable router; the router prestores resource package fragments pushed by a resource downloading server; downloading the resource package fragments prestored by the router after establishing the point-to-point connection with the router.
In one embodiment, the resource package downloading apparatus 1000 is further configured to:
acquiring a plurality of candidate fragment serial numbers; randomly selecting an initial fragment sequence number from the candidate fragment sequence numbers; and downloading the resource packet fragments corresponding to the starting fragment sequence number from a fourth terminal.
As shown in fig. 11, in one embodiment, there is provided a resource package downloading apparatus 1100, including:
a connection module 1102, configured to establish a point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
a downloading module 1104, configured to download the multiple resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to fragment sequence numbers of the multiple resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
an upload module 1106, configured to upload the head of queue sequence number and the tail of queue sequence number to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
As shown in fig. 12, in one embodiment, there is provided a resource package downloading apparatus 1200, including:
a receiving module 1202, configured to receive a head sequence number and a tail sequence number uploaded by a first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
a sequence number determining module 1204, configured to determine a sequence number queue of the first terminal according to the head sequence number and the tail sequence number of the queue, and determine a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
a terminal determining module 1206 for determining an available third terminal among the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
an issuing module 1208, configured to issue the terminal address of the available third terminal to the first terminal, so that the first terminal downloads the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
For the specific limitation of the resource package downloading device, reference may be made to the above limitation on the resource package downloading method, which is not described herein again. The modules in the resource package downloading device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The resource package downloading device provided by the above can be used for executing the resource package downloading method provided by any of the above embodiments, and has corresponding functions and beneficial effects.
FIG. 13 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may be specifically the first terminal 110, the second terminal 120, the third terminal 130 or the server 140 in fig. 1. As shown in fig. 13, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the resource package download method. The internal memory may also have a computer program stored therein, which when executed by the processor, causes the processor to perform the resource package downloading method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 13 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the resource package downloading apparatus provided in the present application may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in fig. 13. The memory of the computer device may store various program modules constituting the resource package downloading apparatus, such as the connection module 1002, the first downloading module 1004, the uploading module 1006, and the second downloading module 1008 shown in fig. 10. The computer program constituted by the respective program modules causes the processor to execute the steps in the resource package downloading method of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 13 may perform the step of establishing a point-to-point connection with the second terminal through the connection module 1002 in the resource package downloading apparatus shown in fig. 10.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above-described resource package downloading method. Here, the steps of the resource package downloading method may be steps in the resource package downloading methods of the above embodiments.
In one embodiment, a computer readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of the above-described resource package downloading method. Here, the steps of the resource package downloading method may be steps in the resource package downloading methods of the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A resource package downloading method is applied to a first terminal, and comprises the following steps:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the first terminal; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and after point-to-point connection is established with the available third terminal, downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal.
2. The method according to claim 1, wherein said downloading a plurality of said resource packet fragments from said second terminal in the order of fragment sequence numbers carried by said resource packet fragments comprises:
downloading a first resource package fragment from the second terminal; the fragment sequence number of the first resource packet fragment is a first fragment sequence number;
determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number;
downloading the resource package fragments corresponding to the second fragment sequence number from the second terminal;
and taking the second fragment sequence number as a new first fragment sequence number, and returning to the step of determining a second fragment sequence number which is sequenced after the first fragment sequence number and is continuous with the first fragment sequence number until a plurality of resource packet fragments are downloaded from the second terminal.
3. The method of claim 1, wherein the plurality of available third terminals are provided, and the downloading the resource packet fragment corresponding to the resume sequence number from the available third terminals comprises:
determining the fragment serial number of the resource packet fragment to be downloaded according to the serial number queue, wherein the fragment serial number is the fragment serial number to be downloaded;
determining the number of resource package fragments corresponding to the sequence number of the fragment to be downloaded in the available third terminal to obtain the number of downloadable fragments of a plurality of available third terminals;
screening out target terminals of which the downloadable fragment quantity meets a set quantity condition from a plurality of available third terminals;
downloading the resource packet fragments corresponding to the continuous transmission sequence number from the target terminal;
the method further comprises the following steps:
and downloading the resource package fragments corresponding to the sequence numbers of the fragments to be downloaded from the target terminal until the resource package fragments with the quantity according with the quantity of the downloadable fragments of the target terminal are downloaded from the target terminal.
4. The method of claim 1, wherein uploading the head of queue sequence number and the tail of queue sequence number to a server comprises:
generating a query request; the terminal query request comprises the queue head sequence number and the queue tail sequence number;
sending the query request to the server; the server is used for feeding back the terminal addresses of the available third terminals aiming at the query request;
the method further comprises the following steps:
and when the resource packet fragment corresponding to the continuous transmission sequence number cannot be downloaded from the second terminal, establishing point-to-point connection with the available third terminal according to the terminal address.
5. The method of claim 1, further comprising:
when the available third terminal does not respond or the downloading speed of the resource packet fragment corresponding to the continuous transmission serial number downloaded from the available third terminal is lower than a preset threshold value, acquiring a server address of a resource downloading server;
and downloading the resource packet fragments corresponding to the continuous transmission sequence number from the resource downloading server according to the server address.
6. The method of claim 1, wherein prior to said establishing the point-to-point connection with the second terminal, the method further comprises:
determining a connectable router; the router prestores resource package fragments pushed by a resource downloading server;
downloading the resource package fragments prestored by the router after establishing the point-to-point connection with the router.
7. The method of claim 1, wherein prior to said establishing the point-to-point connection with the second terminal, the method further comprises:
acquiring a plurality of candidate fragment serial numbers;
randomly selecting an initial fragment sequence number from the candidate fragment sequence numbers;
and downloading the resource packet fragments corresponding to the starting fragment sequence number from a fourth terminal.
8. A resource package downloading method is applied to a first terminal, and comprises the following steps:
establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
uploading the sequence number at the head of the queue and the sequence number at the tail of the queue to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
9. A resource package downloading method comprises the following steps:
receiving a queue head serial number and a queue tail serial number uploaded by a first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue, and determining a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
determining available third terminals among the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
and issuing the terminal address of the available third terminal to the first terminal, so that the first terminal downloads the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
10. A system, comprising:
the system comprises a first terminal, a second terminal, a third terminal and a server; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the first terminal is used for downloading a plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments after establishing point-to-point connection with the second terminal, and determining a sequence number queue according to the fragment sequence numbers of the resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the first terminal is further used for uploading the queue head sequence number and the queue tail sequence number to a server; the server records a sequence number queue of the third terminal;
the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue, and determining a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
the server is further used for determining an available third terminal in the third terminal; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
the server is also used for sending the terminal address of the available third terminal to the first terminal;
and the first terminal is further used for downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal after the point-to-point connection is established with the available third terminal.
11. A resource package downloading apparatus, comprising:
the connection module is used for establishing point-to-point connection with the second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the first downloading module is used for downloading the plurality of resource packet fragments from the second terminal according to the sequence of the fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the plurality of resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the uploading module is used for uploading the queue head serial number and the queue tail serial number to a server; the server is used for determining a sequence number queue of the resource packet downloading device according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server records a sequence number queue of the third terminal; the server is used for providing an available third terminal for the resource package downloading device; the sequence number queue of the available third terminal comprises a continuous transmission sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
and the second downloading module is used for downloading the resource packet fragments corresponding to the continuous transmission sequence number from the available third terminal after the point-to-point connection is established with the available third terminal.
12. A resource package downloading apparatus, comprising:
the connection module is used for establishing point-to-point connection with the second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers;
the downloading module is used for downloading the plurality of resource packet fragments from the second terminal according to the sequence of the fragment serial numbers carried by the resource packet fragments, and determining a serial number queue according to the fragment serial numbers of the plurality of resource packet fragments; the sequence number queue comprises a queue head sequence number and a queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
the uploading module is used for uploading the queue head serial number and the queue tail serial number to a server; the server is used for determining a sequence number queue of the first terminal according to the sequence number at the head of the queue and the sequence number at the tail of the queue; the server is also used for providing a terminal address of the first terminal for a third terminal according to the sequence number queue of the first terminal; and the third terminal is used for downloading the resource packet fragments corresponding to the sequence number queue of the first terminal from the first terminal.
13. A resource package downloading apparatus, comprising:
the receiving module is used for receiving a queue head serial number and a queue tail serial number uploaded by the first terminal; the first terminal is used for establishing point-to-point connection with a second terminal; the second terminal has resource packet fragments; the resource packet fragments carry fragment serial numbers; the first terminal is further configured to download the plurality of resource packet fragments from the second terminal according to the sequence of fragment sequence numbers carried by the resource packet fragments, and determine a sequence number queue according to the fragment sequence numbers of the plurality of resource packet fragments; the sequence number queue comprises the queue head sequence number and the queue tail sequence number; the sequence numbers of the fragments except the tail sequence number in the sequence number queue have another continuous fragment sequence number in the sequence number queue;
a sequence number determining module, configured to determine a sequence number queue of the first terminal according to the head sequence number and the tail sequence number of the queue, and determine a continuous transmission sequence number of the first terminal; the continuous transmission sequence number is a fragment sequence number which is sequenced behind the queue tail sequence number and is continuous with the queue tail sequence number;
a terminal determining module for determining an available third terminal among the plurality of third terminals; the third terminal is provided with a corresponding sequence number queue; the sequence number queue of the available third terminal comprises the continuous transmission sequence number;
and the issuing module is used for issuing the terminal address of the available third terminal to the first terminal so that the first terminal can download the resource packet fragment corresponding to the continuous transmission sequence number from the available third terminal.
14. A computer-readable storage medium, storing a computer program which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 9.
15. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 9.
CN201911291548.5A 2019-12-16 2019-12-16 Resource package downloading method, device and system Active CN111064785B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911291548.5A CN111064785B (en) 2019-12-16 2019-12-16 Resource package downloading method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911291548.5A CN111064785B (en) 2019-12-16 2019-12-16 Resource package downloading method, device and system

Publications (2)

Publication Number Publication Date
CN111064785A true CN111064785A (en) 2020-04-24
CN111064785B CN111064785B (en) 2021-12-14

Family

ID=70301934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911291548.5A Active CN111064785B (en) 2019-12-16 2019-12-16 Resource package downloading method, device and system

Country Status (1)

Country Link
CN (1) CN111064785B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422800A (en) * 2021-05-12 2021-09-21 北京达佳互联信息技术有限公司 Resource processing method, device, system, electronic equipment and storage medium
WO2024036889A1 (en) * 2022-08-18 2024-02-22 网易(杭州)网络有限公司 Mirror image distribution method, system, and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101056207A (en) * 2007-05-31 2007-10-17 华为技术有限公司 Software loading method for communication device and communication network system
EP1914959A1 (en) * 2006-10-19 2008-04-23 Motorola, Inc., A Corporation of the State of Delaware; Method and apparatus for recovery from network disconnections in a peer-peer network
CN101222509A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Data protection transmission method of P2P network
CN105933796A (en) * 2016-04-20 2016-09-07 乐视控股(北京)有限公司 HTTP real-time streaming-based multimedia content providing method and device, and terminal device
CN106657383A (en) * 2017-01-12 2017-05-10 腾讯科技(深圳)有限公司 Data downloading method and relevant equipment
CN106959819A (en) * 2016-01-08 2017-07-18 广州市动景计算机科技有限公司 Date storage method, device and system and portable electric appts
CN109600324A (en) * 2018-11-23 2019-04-09 平安科技(深圳)有限公司 Video communication method, device, computer equipment and storage medium
CN109831481A (en) * 2018-12-21 2019-05-31 厦门市美亚柏科信息股份有限公司 A kind of method, apparatus and storage medium of big file declustering transmission

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1914959A1 (en) * 2006-10-19 2008-04-23 Motorola, Inc., A Corporation of the State of Delaware; Method and apparatus for recovery from network disconnections in a peer-peer network
CN101056207A (en) * 2007-05-31 2007-10-17 华为技术有限公司 Software loading method for communication device and communication network system
CN101222509A (en) * 2008-01-22 2008-07-16 中兴通讯股份有限公司 Data protection transmission method of P2P network
CN106959819A (en) * 2016-01-08 2017-07-18 广州市动景计算机科技有限公司 Date storage method, device and system and portable electric appts
CN105933796A (en) * 2016-04-20 2016-09-07 乐视控股(北京)有限公司 HTTP real-time streaming-based multimedia content providing method and device, and terminal device
CN106657383A (en) * 2017-01-12 2017-05-10 腾讯科技(深圳)有限公司 Data downloading method and relevant equipment
CN109600324A (en) * 2018-11-23 2019-04-09 平安科技(深圳)有限公司 Video communication method, device, computer equipment and storage medium
CN109831481A (en) * 2018-12-21 2019-05-31 厦门市美亚柏科信息股份有限公司 A kind of method, apparatus and storage medium of big file declustering transmission

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422800A (en) * 2021-05-12 2021-09-21 北京达佳互联信息技术有限公司 Resource processing method, device, system, electronic equipment and storage medium
CN113422800B (en) * 2021-05-12 2022-09-09 北京达佳互联信息技术有限公司 Resource processing method, device, system, electronic equipment and storage medium
WO2024036889A1 (en) * 2022-08-18 2024-02-22 网易(杭州)网络有限公司 Mirror image distribution method, system, and device

Also Published As

Publication number Publication date
CN111064785B (en) 2021-12-14

Similar Documents

Publication Publication Date Title
CN107819828B (en) Data transmission method and device, computer equipment and storage medium
CN111625593B (en) Block chain-based data processing method and device and computer equipment
CN101409706B (en) Method, system and relevant equipment for distributing data of edge network
CN108256114B (en) Document online preview method and device, computer equipment and storage medium
CN113055451B (en) Resource downloading method and device, electronic equipment and storage medium
CN108683668B (en) Resource checking method, device, storage medium and equipment in content distribution network
CN111191294B (en) Single-node accounting method, system, equipment and storage medium based on block chain
CN110022329B (en) File transmission method and device, computer readable storage medium and computer equipment
CN111064785B (en) Resource package downloading method, device and system
CN107707584B (en) Application loading method, terminal and platform server
CN111522874B (en) Block chain consensus method, apparatus, computer device and storage medium
CN108023941B (en) Voice control method and device and electronic equipment
CN110401843A (en) List data-updating method, device, equipment and medium in platform is broadcast live
CN112954406B (en) Data downloading method and device, computer equipment and storage medium
CN106453460B (en) File distribution method, device and system
CN113709530B (en) Resource downloading method, system, electronic equipment and storage medium
CN112650721A (en) File storage method, device, system and equipment
WO2022141021A1 (en) File storage method, apparatus, system and device
CN111083204B (en) File transmission method, device and storage medium
CN110597820B (en) Information processing method, device, storage medium and equipment based on block chain
CN110598452B (en) Evidence information processing method, device, storage medium and equipment based on blockchain
CN111432009A (en) Method and device for synchronizing block chain data, electronic equipment and storage medium
WO2021248466A1 (en) File distribution method and apparatus, and electronic device and computer readable storage medium
CN112532740A (en) File uploading method and device and file checking method and device
CN114157435A (en) Document processing method and device based on block chain technology and client

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40021971

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant