CN115941663A - Breakpoint continuous transmission method and system - Google Patents

Breakpoint continuous transmission method and system Download PDF

Info

Publication number
CN115941663A
CN115941663A CN202211280867.8A CN202211280867A CN115941663A CN 115941663 A CN115941663 A CN 115941663A CN 202211280867 A CN202211280867 A CN 202211280867A CN 115941663 A CN115941663 A CN 115941663A
Authority
CN
China
Prior art keywords
file
temporary
breakpoint
download information
local download
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211280867.8A
Other languages
Chinese (zh)
Inventor
杜伟
王佳颖
杨国柱
吴建雄
李玉容
张嘉琳
刘嵩
李源源
张伟
占丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Power Space Technology Co ltd
Original Assignee
State Grid Power Space Technology 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 State Grid Power Space Technology Co ltd filed Critical State Grid Power Space Technology Co ltd
Priority to CN202211280867.8A priority Critical patent/CN115941663A/en
Publication of CN115941663A publication Critical patent/CN115941663A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a breakpoint continuous transmission method and a breakpoint continuous transmission system. The method comprises the following steps: when the multithreading file is interrupted in the transmission process, recording the breakpoint position, storing local download information, and establishing a temporary file to store the local download information, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file; after receiving the continuous transmission instruction, establishing connection and judging whether the temporary file has local downloading information or not; and if the local download information exists, reading the downloaded local download information, positioning a file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the data of the rest part of each thread from the breakpoint position. The breakpoint continuous transmission based on the block uploading breaks through the limitation of a browser end on the file uploading size, files of any size can be uploaded, a new thought is provided for realizing the breakpoint continuous transmission of the files, and various limitations of the current file uploading are broken through.

Description

Breakpoint continuous transmission method and system
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a breakpoint resuming method and system.
Background
At present, the JLS protocol and the ZLLS protocol are utilized to realize file breakpoint continuous transmission, the method is suitable for downloading files based on a Web site browser mode or a file downloading tool mode, and large file uploading fails due to overlarge files or midway network interruption.
Disclosure of Invention
According to the invention, the breakpoint resume method and the breakpoint resume system are provided to solve the technical problem that the uploading of a large file fails due to the fact that the file is too large or the network is interrupted midway.
According to a first aspect of the present invention, there is provided a breakpoint resuming method, including:
when the multithreading file is interrupted in the transmission process, recording the breakpoint position, storing local download information, and establishing a temporary file to store the local download information, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file;
after receiving the continuous transmission instruction, establishing connection and judging whether the temporary file has local downloading information or not;
and if the local download information exists, reading the downloaded local download information, positioning a file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the data of the rest part of each thread from the breakpoint position.
Optionally, when the transmission is interrupted, before recording the breakpoint position, the method further includes:
and judging whether the multithreading file is interrupted during transmission.
Optionally, the method further comprises:
and transmitting the multithreading file fragment.
Optionally, the transmitting the multi-thread file fragment includes:
writing a newly-built temporary file every time a file fragment is received;
and after receiving the file merging request, merging all the temporary files into one file according to the sequence and deleting the original fragmented temporary file.
Optionally, comprising: transmitting the multithreading file fragment, including:
after a file uploading starting request is received, a temporary file is established;
and when a request for finishing file sending is received, the file is uploaded successfully.
According to another aspect of the present invention, there is also provided a breakpoint resuming system, including:
the temporary file folder establishing module is used for recording the breakpoint position, storing local download information and establishing a temporary file to store the local download information when the multithread file is interrupted in the transmission process, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file;
the local download information judging module is used for establishing connection after receiving the continuous transmission instruction and judging whether the temporary file has local download information or not;
and the residual part data transmission module is used for reading the downloaded local download information if the local download information exists, positioning a file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the residual part data of each thread from the breakpoint position.
Optionally, the creating a temporary folder module further includes:
and the interruption judgment submodule is used for judging whether the multithreading file is interrupted during transmission.
Optionally, the system further comprises:
and the fragment transmission module is used for transmitting the multithreading file fragments.
Optionally, the sliced transmission module includes:
the write-in temporary file submodule is used for writing a newly-built temporary file every time a file fragment is received;
and the temporary file merging submodule is used for merging all the temporary files into one file according to the sequence and deleting the original fragmented temporary file after receiving the file merging request.
Optionally, the sliced transmission module includes:
the temporary file establishing submodule is used for establishing a temporary file after receiving a file uploading starting request;
and the file fragment adding submodule is used for adding fragment contents to the tail of the temporary file every time a file fragment is received, and the file is successfully uploaded after a request for finishing file sending is received.
Therefore, the breakpoint resume function of the file can be realized. The breakpoint continuous transmission based on the block uploading breaks through the limitation of a browser end on the file uploading size, files of any size can be uploaded, a new thought is provided for realizing the breakpoint continuous transmission of the files, and various limitations of the current file uploading are broken through. The problem that the uploading of large files fails due to overlarge files or network interruption in midway is solved.
Drawings
A more complete understanding of exemplary embodiments of the present invention may be had by reference to the following drawings in which:
fig. 1 is a schematic flow chart of a breakpoint resuming method according to this embodiment;
fig. 2 is a schematic flow chart of an implementation of the breakpoint resuming method according to this embodiment;
fig. 3 is a schematic diagram of a breakpoint resuming system according to this embodiment.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for complete and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, the same units/elements are denoted by the same reference numerals.
Unless otherwise defined, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Further, it will be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
According to a first aspect of the present invention, there is provided a breakpoint resuming method 100, as shown in fig. 1, where the method 100 includes:
s101, when a multithread file is interrupted in the transmission process, recording the position of a breakpoint, storing local download information, and establishing a temporary file to store the local download information, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file;
s102, after receiving the continuous transmission instruction, establishing connection and judging whether the temporary file has local downloading information;
and S103, if the local download information exists, reading the downloaded local download information, positioning a file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the data of the rest part of each thread from the breakpoint position.
Specifically, referring to fig. 2, the essence of the breakpoint resuming is to record the position where the thread was last downloaded and disconnected, and to resume transmission directly from the position where the last transmission was interrupted after the connection is established next time. The key problem of breakpoint continuous transmission is two points: when transmission is interrupted, a breakpoint is recorded, local download information is stored, a temporary file needs to be established to store the local download information, and the multithread download information comprises information such as the number of bytes downloaded by each thread, a pointer of the file, the size of the file and the like. When the transmission is interrupted, the downloading information of the thread breakpoints is recorded in the temporary file, and the file pointer points to the end of the downloaded file. And resuming transmission, namely after the task is connected again, checking local download information by the system, firstly judging whether the downloaded file exists locally, if so, reading the download information of the downloaded file, automatically positioning a pointer at the breakpoint position of an unfinished thread by the system according to the recorded breakpoint position, and automatically transmitting the data of the rest part of each thread from the breakpoint position, wherein a request needs to be sent to a server at a client.
In the front-end fragment transmission process, the fragment size is fixed, and the smaller the fragment is, the more the requests are, and the higher the overhead is; the larger the fragment is, the smaller the flexibility is, and the less obvious the advantages of fragment uploading are. Therefore, the slice size can be set to an appropriate value according to actual conditions.
At the server side, there are 2 strategies for merging file fragments. One is to merge the files together after the transmission is finished, that is, a new temporary file is written into the server end every time a file fragment is received, and after a file merging request is received, all the temporary files are merged into one file in sequence and the original fragmented temporary file is deleted. Another strategy is to merge while uploading, that is, after receiving a file start uploading request at the server, a temporary file is established, the server appends the fragment content to the end of the temporary file each time it receives a file fragment, and when receiving a request for completing file transmission, the file is uploaded successfully. The method solves the problem that the waiting time of the Web end is too long, but redundant data can be stored in the temporary file in the file continuous transmission process to form a junk file. The buffer area is arranged at the server side, the problem that the waiting response time of a user is too long is solved by using a file real-time combination mode, and meanwhile, the correctness of the finally combined file is ensured by using file verification, so that the user experience of breakpoint continuous transmission of the large file at the Web side is improved.
Therefore, the breakpoint resume function of the file can be realized. The breakpoint continuous transmission based on the block uploading breaks through the limitation of a browser end on the file uploading size, files of any size can be uploaded, a new thought is provided for realizing the breakpoint continuous transmission of the files, and various limitations of the current file uploading are broken through. The problem that the uploading of large files fails due to overlarge files or network interruption in midway is solved.
Optionally, when the transmission is interrupted, before recording the breakpoint position, the method further includes:
and judging whether the multithreading file is interrupted during transmission.
Optionally, the method further comprises:
and transmitting the multithreading file fragment.
Optionally, the transmitting the multi-thread file fragment includes:
writing a newly-built temporary file every time a file fragment is received;
and after receiving a file merging request, merging all the temporary files into one file according to the sequence and deleting the original fragment temporary file.
Optionally, comprising: transmitting the multi-threaded file fragment, comprising:
after a file uploading starting request is received, a temporary file is established;
and adding the fragment content to the end of the temporary file every time a file fragment is received, and uploading the file successfully after a request for finishing file sending is received.
Therefore, the breakpoint resume function of the file can be realized. The breakpoint continuous transmission based on the block uploading breaks through the limitation of a browser end on the file uploading size, files of any size can be uploaded, a new thought is provided for realizing the breakpoint continuous transmission of the files, and various limitations of the current file uploading are broken through. The problem that the uploading of large files fails due to overlarge files or network interruption in the midway is solved.
According to another aspect of the present invention, there is also provided a breakpoint resuming system 300, as shown in fig. 3, where the system 300 includes:
a temporary folder establishing module 310, configured to record a breakpoint position when the multithread file is interrupted in the transmission process, store local download information, and establish a temporary file to store the local download information, where the local download information includes information about the number of bytes downloaded by each thread, a pointer of the file, and a size of the file;
a local download information determining module 320, configured to establish a connection after receiving the transmission continuation instruction, and determine whether the temporary file has local download information;
and a remaining part data transmission module 330, configured to read the downloaded local download information if the local download information exists, locate the file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmit the remaining part data of each thread from the breakpoint.
Optionally, the module for creating a temporary folder 310 further includes:
and the interruption judgment sub-module is used for judging whether the multithreading file is interrupted during transmission.
Optionally, the system further comprises:
and the fragment transmission module is used for transmitting the multithreading file fragments.
Optionally, the sliced transmission module includes:
the write-in temporary file submodule is used for writing a newly-built temporary file every time a file fragment is received;
and the temporary file merging submodule is used for merging all the temporary files into one file according to the sequence and deleting the original fragment temporary file after receiving the file merging request.
Optionally, the sliced transmission module includes:
the temporary file establishing submodule is used for establishing a temporary file after receiving a file uploading starting request;
and the file fragment adding submodule is used for adding fragment contents to the tail of the temporary file every time a file fragment is received, and the file is successfully uploaded after a request for finishing file sending is received.
The breakpoint resuming system 300 according to the embodiment of the present invention corresponds to the breakpoint resuming method 100 according to another embodiment of the present invention, and is not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein. The scheme in the embodiment of the application can be implemented by adopting various computer languages, such as object-oriented programming language Java and transliterated scripting language JavaScript.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A breakpoint resume method, comprising:
when the multithreading file is interrupted in the transmission process, recording the breakpoint position, storing local download information, and establishing a temporary file to store the local download information, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file;
after receiving the continuous transmission instruction, establishing connection and judging whether the temporary file has local downloading information or not;
and if the local download information exists, reading the downloaded local download information, positioning a file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the data of the rest part of each thread from the breakpoint position.
2. The method of claim 1, wherein recording the location of the breakpoint precedes the time the transmission of the interrupt occurs, further comprising:
and judging whether the multithreading file is interrupted during transmission.
3. The method of claim 1, further comprising:
and transmitting the multithreading file fragment.
4. The method of claim 3, wherein fragmenting the multi-threaded file for transmission comprises:
writing a newly-built temporary file every time a file fragment is received;
and after receiving the file merging request, merging all the temporary files into one file according to the sequence and deleting the original fragmented temporary file.
5. The method of claim 3, comprising: transmitting the multi-threaded file fragment, comprising:
after a file uploading starting request is received, a temporary file is established;
and when a request for finishing file sending is received, the file is uploaded successfully.
6. A breakpoint resume system, comprising:
the temporary file folder establishing module is used for recording the breakpoint position, storing local download information and establishing a temporary file to store the local download information when the multithread file is interrupted in the transmission process, wherein the local download information comprises the number of bytes downloaded by each thread, a pointer of the file and the size information of the file;
the local download information judging module is used for establishing connection after receiving the continuous transmission instruction and judging whether the temporary file has local download information or not;
and the residual part data transmission module is used for reading the downloaded local download information if the local download information exists, positioning the file pointer at the breakpoint position of the uncompleted thread according to the recorded breakpoint position, and transmitting the residual part data of each thread from the breakpoint position.
7. The system of claim 6, wherein the create temporary folder module further comprises:
and the interruption judgment submodule is used for judging whether the multithreading file is interrupted during transmission.
8. The system of claim 7, comprising:
and the fragment transmission module is used for transmitting the multithreading file fragments.
9. The system of claim 8, wherein the sliced transmission module comprises:
the write-in temporary file submodule is used for writing a newly-built temporary file every time a file fragment is received;
and the temporary file merging submodule is used for merging all the temporary files into one file according to the sequence and deleting the original fragmented temporary file after receiving the file merging request.
10. The system of claim 6, wherein the sliced transmission module comprises:
the temporary file establishing submodule is used for establishing a temporary file after receiving a file uploading starting request;
and the file fragment adding submodule is used for adding fragment contents to the tail of the temporary file every time a file fragment is received, and the file is successfully uploaded after a request for finishing file sending is received.
CN202211280867.8A 2022-10-19 2022-10-19 Breakpoint continuous transmission method and system Pending CN115941663A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211280867.8A CN115941663A (en) 2022-10-19 2022-10-19 Breakpoint continuous transmission method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211280867.8A CN115941663A (en) 2022-10-19 2022-10-19 Breakpoint continuous transmission method and system

Publications (1)

Publication Number Publication Date
CN115941663A true CN115941663A (en) 2023-04-07

Family

ID=86554899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211280867.8A Pending CN115941663A (en) 2022-10-19 2022-10-19 Breakpoint continuous transmission method and system

Country Status (1)

Country Link
CN (1) CN115941663A (en)

Similar Documents

Publication Publication Date Title
US5606681A (en) Method and device implementing software virtual disk in computer RAM that uses a cache of IRPs to increase system performance
US9063894B2 (en) Cascade ordering
EP2543963A1 (en) Method of updating a database of a navigation device and navigation device associated thereto
JP4502469B2 (en) Throttler for high-speed start of broadcast automation system
US7877561B2 (en) Method and system for copying the data contents of a computer system memory during application program run-time
US9298593B2 (en) Testing a software interface for a streaming hardware device
EP3812890B1 (en) Software update agent apparatus and patch method using same
CN111291023A (en) Data migration method, system, device and medium
CN111062723B (en) Virtual account transfer method, device, system and storage medium
CN112153132A (en) File uploading method, device and equipment based on virtualization management platform
US7213245B2 (en) Software on demand system
CN115941663A (en) Breakpoint continuous transmission method and system
US7793159B2 (en) Method, computer program product, and computer system for detecting a corruption in a data block stored by a tape recording apparatus
US7010650B2 (en) Multiple data management method, computer and storage device therefor
US10514850B2 (en) Information processing system, server device, Information processing method, and computer program product
US20020161789A1 (en) Parallel replication mechanism for state information produced by serialized processing
CN110737635B (en) Data blocking method
CN108345431B (en) Data reading method and device
CN110597766A (en) Data transmission method and device
US20240119044A1 (en) System and method for facilitating optimization of file upload operations via transaction transformation
KR102541439B1 (en) Method and apparatus for management control of vehicle ota update
JP2005526328A (en) Automatic data import
EP1244015A2 (en) Parallel replication mechanism for state information produced by serialized processing
CN117331888A (en) File processing method, device, equipment and storage medium
KR100764621B1 (en) Method and system for pooling data

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