CN106341480B - Data packet uploading method and device - Google Patents

Data packet uploading method and device Download PDF

Info

Publication number
CN106341480B
CN106341480B CN201610835815.0A CN201610835815A CN106341480B CN 106341480 B CN106341480 B CN 106341480B CN 201610835815 A CN201610835815 A CN 201610835815A CN 106341480 B CN106341480 B CN 106341480B
Authority
CN
China
Prior art keywords
subfile
meta
data packet
target
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610835815.0A
Other languages
Chinese (zh)
Other versions
CN106341480A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610835815.0A priority Critical patent/CN106341480B/en
Publication of CN106341480A publication Critical patent/CN106341480A/en
Application granted granted Critical
Publication of CN106341480B publication Critical patent/CN106341480B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data packet uploading method and device. The method comprises the following steps: acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile; sending the identification information of the data packet and the identification information of each subfile to a server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client; and receiving the identification information of the target subfile, and uploading the target subfile according to the identification information of the target subfile. According to the technical scheme, only the target subfile is uploaded, so that repeated uploading of data stored in the client is avoided, network bandwidth is saved, and the success rate of uploading the data packet is improved.

Description

Data packet uploading method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for uploading a data packet.
Background
In the prior art, when a client uploads a data packet, the data packet is generally fragmented according to a fixed size, and then uploaded piece by piece. Specifically, when a plurality of clients upload data packets simultaneously, in order to save bandwidth, only one fragment is allowed to be uploaded at the same time, each client searches for a fragment to be uploaded through token service before uploading, and then searches for the next fragment to be uploaded after the fragment uploading is completed, so that each fragment is ensured to be uploaded by only one client, and the purpose of saving bandwidth is achieved. However, for a program installation package or a file compression package on a mobile phone, the above-mentioned manner of fragment uploading a data package cannot achieve a good effect, and especially under the condition that a signal of the mobile phone is not good or the signal is interrupted, a package packet failure is easily caused, thereby causing a data package uploading failure. In addition, because the difference between different versions of the same program installation package is actually very small, if the above-mentioned fragmented data packet uploading mode is adopted, data in the data packet will be repeatedly uploaded, which causes waste of storage space and network resources.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a method and apparatus for uploading a data packet that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method for uploading a data packet, which is applied to a client, and the method includes:
acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
sending the identification information of the data packet and the identification information of each subfile to a server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
and receiving the identification information of the target subfile, and uploading the target subfile according to the identification information of the target subfile.
Optionally, the identification information includes a secure hash algorithm SHA1 value.
Optionally, the data packet further includes meta information meta of each subfile and meta information meta of the data packet, where the meta information meta carries attribute information of each subfile or the data packet; the uploading the target subfile according to the identification information of the target subfile includes:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
Optionally, when there are at least two target subfiles, the uploading the target subfiles includes:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
Optionally, the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
Optionally, after the obtaining the data packet, the method further includes:
and segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile.
Optionally, the data package is a program installation package APK or a file compression package ZIP package.
According to another aspect of the present invention, there is provided an apparatus for uploading a data packet, which is applied to a client, the apparatus including:
the acquisition module is suitable for acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
the sending module is suitable for sending the identification information of the data packet and the identification information of each subfile to a server so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
and the uploading module is suitable for receiving the identification information of the target subfile and uploading the target subfile according to the identification information of the target subfile.
Optionally, the identification information includes a secure hash algorithm SHA1 value.
Optionally, the data packet further includes meta information meta of each subfile and meta information meta of the data packet, where the meta information meta carries attribute information of each subfile or the data packet; the upload module is further adapted to:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
Optionally, the upload module is further adapted to:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
Optionally, the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
Optionally, the apparatus further comprises:
and the segmenting module is suitable for segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile after the data packet is obtained.
Optionally, the data package is a program installation package APK or a file compression package ZIP package.
By adopting the technical scheme provided by the embodiment of the invention, after the data packet is obtained, the identification information of the data packet and the identification information of each subfile in the data packet can be sent to the server, so that the server determines the target subfile to be uploaded according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client, so that the client can upload the target subfile according to the identification information of the target subfile instead of uploading all the subfiles in the data packet. Because partial repeated data can exist between different versions of the data package (such as the program installation package APK), the invention avoids repeated uploading of data stored in the client by only uploading the target subfile, thereby saving network bandwidth. In addition, because the sub-files in the data packet are uploaded as the granularity, the packaging process after uploading is not influenced by network signals, and the success rate of uploading the data packet is greatly improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart of a method for uploading a data packet according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for uploading a data packet according to another embodiment of the present invention;
fig. 3 is a schematic block diagram of an apparatus for uploading a data packet according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of an apparatus for uploading a data packet according to another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic flow chart of a method for uploading a data packet according to an embodiment of the present invention. As shown in fig. 1, the method is applied to a client, and may generally include the following steps S101-S103:
step S101, a data packet is obtained, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile.
The data package may be a program installation package APK, a file compression package ZIP, or any other data package including a plurality of subfiles, which is not limited in this embodiment.
Step S102, the identification information of the data packet and the identification information of each subfile are sent to a server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and the identification information of the target subfile is sent to a client.
Wherein the target subfile refers to a subfile that is not stored by the client. The server may determine the target subfile by: the server firstly searches a data packet to be uploaded by the client according to the identification information of the received data packet, then compares the identification information of each received subfile with each subfile in the searched data packet, and determines which subfiles are successfully uploaded by the client and which subfiles are not uploaded by the client, wherein the subfiles which are not uploaded by the client are target subfiles to be determined by the server.
And step S103, receiving the identification information of the target subfile, and uploading the target subfile according to the identification information of the target subfile.
By adopting the technical scheme provided by the embodiment of the invention, after the data packet is obtained, the identification information of the data packet and the identification information of each subfile in the data packet can be sent to the server, so that the server determines the target subfile to be uploaded according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client, so that the client can upload the target subfile according to the identification information of the target subfile instead of uploading all the subfiles in the data packet. Because partial repeated data can exist between different versions of the data package (such as the program installation package APK), the invention avoids repeated uploading of data stored in the client by only uploading the target subfile, thereby saving network bandwidth. In addition, because the sub-files in the data packet are uploaded as the granularity, the packaging process after uploading is not influenced by network signals, and the success rate of uploading the data packet is greatly improved.
In one embodiment, the identification information includes a Secure Hash Algorithm SHA1(Secure Hash Algorithm) value. There is a special file in the package, namely a manifest file, for holding the SHA1 values of the package and the SHA1 values of the subfiles. Thus, step S102 may be performed as the following steps: and sending the SHA1 value of the data packet and the SHA1 value of each subfile to the server. Because the value of the SHA1 has uniqueness, like the fingerprint of a person, each person has own unique fingerprint, and each file also corresponds to the unique SHA1 value, the server can accurately determine the target subfile to be uploaded in the data packet according to the SHA1 value of the data packet and the SHA1 value of each subfile, and send the SHA1 value of the target subfile to the client.
After receiving the SHA1 value of the target subfile, the client correspondingly finds the target subfile in the data packet according to the SHA1 value of the target subfile, and then uploads the target subfile.
In one embodiment, the data packet further includes meta-information meta of each subfile and meta-information meta of the data packet, where the meta-information meta carries attribute information of each subfile or data packet. Since each subfile corresponds to the respective meta information meta, the number of subfiles in the data package is consistent with the number of meta information meta.
Specifically, the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block, and the check code corresponding to each subfile. Wherein the offset of each subfile in the file data block is used to accurately locate the subfile in the file data block.
The meta information meta of the data packet includes at least one of: the offset of the file data block in the data packet, the offset of the meta-information meta of each subfile in the data packet, and the offset of the meta-information meta of the data packet in the data packet. The offset of the file data block in the data packet is used for accurately positioning the file data block in the data packet, the offset of the meta-information meta of each subfile in the data packet is used for accurately positioning the meta-information meta of each subfile in the data packet, and the offset of the meta-information meta of the data packet in the data packet is used for accurately positioning the meta-information meta of the data packet in the data packet.
Based on the above-mentioned packet composition manner in the embodiment, the step S103 can be executed as the following steps a1-a 2: step A1, uploading a target subfile; step a2, the meta information meta of the target subfile and the meta information meta of the data packet are combined into a meta data block, and the meta data block is uploaded. Since the metadata meta of the target subfile and the metadata meta of the data packet are small in size, they can be uploaded as a whole, and the size of the combined meta data block is usually only about 1K. In specific execution, the present embodiment does not limit the execution sequence of step a1 and step a2. In one embodiment, the target subfile may be uploaded first, followed by the meta data block. After the client finishes the uploading process of the target subfile, the client performs a packaging operation on the target subfile, in the packaging process, the client needs to perform packaging of the target subfile according to the meta data block in a polling mode, and if the method of uploading the target subfile first and then uploading the meta data block is adopted, the client does not upload the meta data block yet during packaging, so that the uploading mode in the embodiment can reduce the polling times during packaging. In another embodiment, the meta data block may be uploaded first, followed by the target subfile. The uploading mode has the advantages that the client uploads the meta data block first, so that each target subfile can be combined in sequence according to the information in the meta data block in the subsequent packaging process, and the packaging success rate is greatly improved.
When there are at least two target subfiles, the above step a1 can be executed as the following steps: firstly, generating a sequence table of at least two target subfiles according to a preset rule; and secondly, sequentially uploading at least two target subfiles according to the sequence table. The preset rule may be that the client generates an order table of at least two target subfiles according to a predetermined order, for example, an original order of each subfile in the file data block, or the client randomly generates the order table of at least two target subfiles.
In one embodiment, after acquiring the data packet, the method further includes the following steps: and segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile. The meta-information meta of each subfile comprises the offset of each subfile in the file data block, and the client can accurately position the position information of each subfile in the file data block according to the offset of each subfile in the file data block, and then segments the file data block into a plurality of subfiles according to the position information of each subfile in the file data block. In a specific implementation, the time for segmenting the file data block is not limited, for example, the client may directly segment the file data block after obtaining the data packet, and may further segment the file data packet after the server returns the identification information of the target subfile.
In one embodiment, when step S102 is implemented, that is, when the identification information of the data packet and the identification information of each subfile are sent to the server, to ensure the accuracy of the sent data, the number of the subfiles in the data packet may also be sent to the server together, so that the server can verify whether the data sent by the client is correct according to the number of the subfiles. For example, when the number of the sub-files is inconsistent with the number of the identification information of each sub-file, it is determined that the data sent by the client is erroneous, and there is a possibility that the data is lost during transmission.
Fig. 2 is a schematic flow chart of a method for uploading a data packet according to an embodiment of the present invention. In this embodiment, the uploading of the program installation package APK is taken as an example, and the uploading process involves the interaction between the client and the server. As shown in fig. 2, the method comprises the following steps S201-S209:
in step S201, the client acquires an APK, where the APK includes a file data block composed of a plurality of subfiles, meta information meta of each subfile, and meta information meta of the APK. In addition, the APK also includes a special file (i.e. manifest file) for storing SHA1 values of the APK and SHA1 values of the respective subfiles.
Step S202, the client divides the file data blocks in the APK by taking the subfiles as the granularity to obtain a plurality of subfiles.
In step S203, the client transmits the SHA1 value of the APK and the SHA1 value of each subfile to the server.
In step S204, the server determines the target subfile to be uploaded in the APK according to the SHA1 value of the APK and the SHA1 value of each subfile. Specifically, the server finds out the APK to be uploaded by the client according to the SHA1 value of the APK, and compares the SHA1 value of each subfile with the found APK, so as to determine which subfiles have been successfully uploaded by the client, which subfiles have not been uploaded by the client, and the subfiles which have not been uploaded by the client are the target subfiles to be determined by the server.
In step S205, the server sends the SHA1 value of the target subfile to the client.
In step S206, the client determines the target subfile corresponding to the SHA1 value returned by the server according to the corresponding relationship between each subfile and the SHA1 value.
Step S207, the client generates an order table of the target subfiles according to a predetermined rule, and uploads the target subfiles in sequence according to the order table. The preset rule may be that the client generates an order table of at least two target subfiles according to a predetermined order, for example, an original order of each subfile in the file data block, or the client randomly generates the order table of at least two target subfiles.
In step S208, the client combines the meta information meta of the target subfile and the meta information meta of the APK into a meta data block, and uploads the meta data block.
In step S209, the client packages the uploaded target subfiles. When the client packages the target subfile, packaging according to the original position information of the target subfile in the file data block.
In this embodiment, the execution sequence of step S202 is not limited, for example, the client may directly segment the file data block in the APK after acquiring the APK, and may further segment the file data packet after the server returns the SHA1 value of the target subfile.
In this embodiment, the execution sequence of step S207 and step S208 is not limited, in this embodiment, the uploading sequence of uploading the target subfile first and then uploading the meta data block is adopted, however, in another embodiment, the uploading sequence of uploading the meta data block first and then uploading the target subfile may also be adopted.
As can be seen from this embodiment, with the technical solution provided by this specific embodiment, after obtaining the APK, the SHA1 value of the APK and the SHA1 value of each subfile in the APK can be sent to the server, so that the server determines a target subfile to be uploaded according to the SHA1 value of the APK and the SHA1 value of each subfile, and sends the SHA1 value of the target subfile to the client, so that the client can upload the target subfile according to the SHA1 value of the target subfile, instead of uploading all subfiles in the APK. Because partial repeated data may exist between different versions of the APK, the present embodiment avoids repeatedly uploading data stored in the client by only uploading the target subfile, thereby saving network bandwidth. In addition, in the embodiment, the sub-files in the APK are uploaded as the granularity, so that the package process after uploading is not influenced by network signals, and the success rate of uploading the APK is greatly improved.
Fig. 3 is a schematic block diagram of an apparatus for uploading a data packet according to an embodiment of the present invention. As shown in fig. 3, the apparatus for uploading a data packet is applied to a client, and includes:
the obtaining module 310 is adapted to obtain a data packet, where the data packet includes a file data block composed of a plurality of subfiles, identification information of the data packet, and identification information of each subfile;
a sending module 320, coupled to the obtaining module 310, adapted to send the identification information of the data packet and the identification information of each subfile to the server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client; the target subfile refers to a subfile which is not stored by the client;
the uploading module 330, coupled to the sending module 320, is adapted to receive the identification information of the target subfile and upload the target subfile according to the identification information of the target subfile.
In one embodiment, the identification information includes a secure hash algorithm SHA1 value.
In one embodiment, the data packet further includes meta-information meta of each subfile and meta-information meta of the data packet, where the meta-information meta carries attribute information of each subfile or data packet; the upload module 330 is further adapted to:
uploading a target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
In one embodiment, the upload module 330 is further adapted to:
generating an order table of at least two target subfiles according to a preset rule;
and sequentially uploading at least two target subfiles according to the sequence table.
In one embodiment, the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: the offset of the file data block in the data packet, the offset of the meta-information meta of each subfile in the data packet, and the offset of the meta-information meta of the data packet in the data packet.
In one embodiment, as shown in fig. 4, the apparatus further comprises:
the segmenting module 340 is coupled to the obtaining module 310 and adapted to segment the file data block into a plurality of subfiles according to the meta information meta of each subfile after obtaining the data packet.
In one embodiment, the data package is a program installation package (APK) or a file compression package (ZIP) package.
By adopting the device provided by the embodiment of the invention, after the data packet is obtained, the identification information of the data packet and the identification information of each subfile in the data packet can be sent to the server, so that the server determines the target subfile to be uploaded according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client, so that the client can upload the target subfile according to the identification information of the target subfile instead of uploading all the subfiles in the data packet. Because partial repeated data can exist between different versions of the data package (such as the program installation package APK), the invention avoids repeated uploading of data stored in the client by only uploading the target subfile, thereby saving network bandwidth. In addition, because the sub-files in the data packet are uploaded as the granularity, the packaging process after uploading is not influenced by network signals, and the success rate of uploading the data packet is greatly improved.
Those skilled in the art will understand that the packet uploading apparatus in fig. 3 and 4 can be used to implement the foregoing packet uploading scheme, and the detailed description thereof should be similar to the description of the method, and is not repeated herein to avoid complexity.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a packet uploading apparatus according to embodiments of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.
The embodiment of the invention discloses A1. a data packet uploading method, which is applied to a client and comprises the following steps:
acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
sending the identification information of the data packet and the identification information of each subfile to a server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
and receiving the identification information of the target subfile, and uploading the target subfile according to the identification information of the target subfile.
A2. The method of a1, wherein the identifying information includes a secure hash algorithm SHA1 value.
A3. The method according to a1 or a2, wherein the data package further includes meta-information meta of the subfiles and meta-information meta of the data package, the meta-information meta carrying attribute information of the subfiles or the data package; the uploading the target subfile according to the identification information of the target subfile includes:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
A4. The method of a3, wherein when there are at least two target subfiles, the uploading the target subfiles comprises:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
A5. The method of A3 or a4, wherein the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
A6. The method of any of A3-a5, wherein, after the obtaining the data packet, the method further comprises:
and segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile.
A7. The method according to any one of A1-A6, wherein the data package is a program installation package (APK) or a file compression package (ZIP) package.
The embodiment of the invention also discloses B8. a data packet uploading device, which is applied to a client, and the device comprises:
the acquisition module is suitable for acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
the sending module is suitable for sending the identification information of the data packet and the identification information of each subfile to a server so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
and the uploading module is suitable for receiving the identification information of the target subfile and uploading the target subfile according to the identification information of the target subfile.
B9. The apparatus of B8, wherein the identification information includes a secure hash algorithm SHA1 value.
B10. The apparatus according to B8 or B9, wherein the data packet further includes meta-information meta of the respective subfile and meta-information meta of the data packet, the meta-information meta carrying attribute information of the respective subfile or the data packet; the upload module is further adapted to:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
B11. The apparatus of B10, wherein the upload module is further adapted to:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
B12. The apparatus of B10 or B11, wherein the meta information meta of each subfile includes at least one of: the file name of each subfile, the offset of each subfile in the file data block and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
B13. The apparatus of any one of B10-B12, wherein the apparatus further comprises:
and the segmenting module is suitable for segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile after the data packet is obtained.
B14. The device according to any one of B8-B13, wherein the data package is a program installation package (APK) or a file compression package (ZIP) package.

Claims (10)

1. A data packet uploading method is applied to a client, and comprises the following steps:
acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
sending the identification information of the data packet and the identification information of each subfile to a server, so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile, and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
receiving the identification information of the target subfile, and uploading the target subfile according to the identification information of the target subfile;
the data packet further comprises meta-information meta of each subfile and meta-information meta of the data packet, wherein the meta-information meta carries attribute information of each subfile or the data packet;
the meta information meta of each subfile includes an offset of each subfile in the file data block;
after the acquiring the data packet, the method further comprises:
segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile;
the uploading the target subfile according to the identification information of the target subfile includes:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
2. The method of claim 1, wherein the identification information comprises a secure hash algorithm SHA1 value.
3. The method of claim 1, wherein the uploading the target subfile when there are at least two target subfiles comprises:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
4. The method according to claim 1, wherein the meta information meta of each subfile further includes at least one of: the file name of each subfile and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
5. The method according to any one of claims 1-4, wherein the data package is a program installation package (APK) or a file compression package (ZIP) package.
6. An uploading device of data packets, which is applied to a client, the device comprising:
the acquisition module is suitable for acquiring a data packet, wherein the data packet comprises a file data block consisting of a plurality of subfiles, identification information of the data packet and identification information of each subfile;
the sending module is suitable for sending the identification information of the data packet and the identification information of each subfile to a server so that the server determines a target subfile to be uploaded in the data packet according to the identification information of the data packet and the identification information of each subfile and sends the identification information of the target subfile to the client; wherein the target subfile refers to a subfile not stored by the client;
the uploading module is suitable for receiving the identification information of the target subfile and uploading the target subfile according to the identification information of the target subfile;
the data packet further includes meta-information meta of each subfile and meta-information meta of the data packet, where the meta-information meta carries attribute information of each subfile or the data packet;
the meta information meta of each subfile includes an offset of each subfile in the file data block;
the device further comprises:
the segmentation module is suitable for segmenting the file data block into a plurality of subfiles according to the meta information meta of each subfile after the acquisition module acquires the data packet;
the upload module is further adapted to:
uploading the target subfile;
and combining the meta information meta of the target subfile and the meta information meta of the data packet into a meta data block, and uploading the meta data block.
7. The apparatus of claim 6, wherein the identification information comprises a secure hash algorithm SHA1 value.
8. The apparatus of claim 6, wherein the upload module is further adapted to:
generating a sequence table of the at least two target subfiles according to a preset rule;
and uploading the at least two target subfiles in sequence according to the sequence table.
9. The apparatus of claim 6, wherein the meta information meta of each subfile further includes at least one of: the file name of each subfile and the check code corresponding to each subfile;
the meta information meta of the data packet includes at least one of: an offset of the file data block in the data packet, an offset of the meta-information meta of each subfile in the data packet, and an offset of the meta-information meta of the data packet in the data packet.
10. The apparatus according to any one of claims 6-9, wherein the data package is a program installation package (APK) or a file compression package (ZIP) package.
CN201610835815.0A 2016-09-20 2016-09-20 Data packet uploading method and device Active CN106341480B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610835815.0A CN106341480B (en) 2016-09-20 2016-09-20 Data packet uploading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610835815.0A CN106341480B (en) 2016-09-20 2016-09-20 Data packet uploading method and device

Publications (2)

Publication Number Publication Date
CN106341480A CN106341480A (en) 2017-01-18
CN106341480B true CN106341480B (en) 2019-12-20

Family

ID=57840047

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610835815.0A Active CN106341480B (en) 2016-09-20 2016-09-20 Data packet uploading method and device

Country Status (1)

Country Link
CN (1) CN106341480B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286974A (en) * 2020-12-24 2021-01-29 北京邮电大学 APK compression storage, reduction and retrieval method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571709A (en) * 2010-12-16 2012-07-11 腾讯科技(北京)有限公司 Method for uploading file, client, server and system
CN102739791A (en) * 2012-06-28 2012-10-17 奇智软件(北京)有限公司 File downloading and uploading method and device
CN103414759A (en) * 2013-07-22 2013-11-27 华为技术有限公司 Network disc file transmission method and network disc file transmission device
CN105872036A (en) * 2016-03-28 2016-08-17 联想(北京)有限公司 Data uploading, downloading method, electronic equipment and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101447677B1 (en) * 2012-05-09 2014-10-07 주식회사 윈스 Apparatus of detecting and controlling infected mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571709A (en) * 2010-12-16 2012-07-11 腾讯科技(北京)有限公司 Method for uploading file, client, server and system
CN102739791A (en) * 2012-06-28 2012-10-17 奇智软件(北京)有限公司 File downloading and uploading method and device
CN103414759A (en) * 2013-07-22 2013-11-27 华为技术有限公司 Network disc file transmission method and network disc file transmission device
CN105872036A (en) * 2016-03-28 2016-08-17 联想(北京)有限公司 Data uploading, downloading method, electronic equipment and server

Also Published As

Publication number Publication date
CN106341480A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
US11233819B2 (en) Method and apparatus for analyzing cyberattack
CN106933854B (en) Short link processing method and device and server
CN113766035A (en) Method and device for service acceptance and consensus
CN105718276B (en) Method and device for providing APK download and NGINX server
US10645001B2 (en) Information transmission method and apparatus, device and storage medium
CN105554137B (en) A kind of standby system and method
CN107566477B (en) Method and device for acquiring files in distributed file system cluster
TW201510761A (en) Method and apparatus of downloading and installing a client
CN103152391B (en) A kind of log-output method and device
CN108228799B (en) Object index information storage method and device
CN110661829A (en) File downloading method and device, client and computer readable storage medium
SG190757A1 (en) Method and system of evidence preservation for digital documents
US20150341351A1 (en) Secure data processing method and system
CN112839003A (en) Data verification method and system
CN104754374A (en) Audio-video file detection management method and device
CN106446138B (en) Data packet storage method and device
CN105592083B (en) Method and device for terminal to access server by using token
CN106897052B (en) APK file compression method and device
CN109597566B (en) Data reading and storing method and device
CN104283955A (en) Browser, server, downloading system and downloading method
CN113535226B (en) Application downloading method, terminal, server, computer device and storage medium
CN114218165A (en) File downloading method and device, computer equipment and medium
CN111176706A (en) Terminal upgrading method and device, electronic equipment and storage medium
CN106341480B (en) Data packet uploading method and device
CN106210159B (en) Domain name resolution method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220715

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.