CN115766704A - File transmission method, equipment and storage medium - Google Patents

File transmission method, equipment and storage medium Download PDF

Info

Publication number
CN115766704A
CN115766704A CN202211366093.0A CN202211366093A CN115766704A CN 115766704 A CN115766704 A CN 115766704A CN 202211366093 A CN202211366093 A CN 202211366093A CN 115766704 A CN115766704 A CN 115766704A
Authority
CN
China
Prior art keywords
transmission
file
transmitted
task
executing
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
CN202211366093.0A
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.)
Shenzhen Kaihong Digital Industry Development Co Ltd
Original Assignee
Shenzhen Kaihong Digital Industry Development 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 Shenzhen Kaihong Digital Industry Development Co Ltd filed Critical Shenzhen Kaihong Digital Industry Development Co Ltd
Priority to CN202211366093.0A priority Critical patent/CN115766704A/en
Publication of CN115766704A publication Critical patent/CN115766704A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a file transmission method, a device and a storage medium, wherein the file transmission method comprises the following steps: acquiring transmission parameters of an application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program; acquiring a transmission request initiated by an application program through a transmission interface, wherein the transmission request comprises transmission information and transmission protocol information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted; calling a function corresponding to a transmission interface to obtain a transmission parameter of the application program, and determining a transmission protocol corresponding to the application program according to a transmission protocol information parameter; and generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted. The file transmission method provided by the application realizes the communication between the application program and the operating system framework layer, can identify the adaptive transmission protocol based on different application programs, generates the corresponding transmission task transmission file, and greatly simplifies the file transmission process.

Description

File transmission method, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a file transmission method, device, and storage medium.
Background
With the development of science and technology and the wide popularization of the internet, people have higher and higher requirements on information uploading/downloading, today's network information files reach the scale of Gigabytes (GB), the existing File transmission method is realized on the application level through the transmission protocols such as hypertext Transfer Protocol (HTTP), file Transfer Protocol (FTP), and the like, a user needs to download and install a software tool with a File transmission function, the use cost is relatively high and the method has no universality, and as the software implementation modes are different, various performances have certain differences, certain troubles can be caused to the selection and use of the user in various scenes, and the user cannot independently select the File transmission tool in specific scenes.
Disclosure of Invention
The application discloses a file transmission method, file transmission equipment and a storage medium, which solve the problem that a specific software tool needs to be downloaded in the existing file transmission method.
In a first aspect, the present application provides a file transmission method, including:
acquiring transmission parameters of the application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program;
acquiring a transmission request initiated by the application program through the transmission interface, wherein the transmission request comprises transmission information and transmission protocol information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted;
calling a function corresponding to the transmission interface to obtain a transmission parameter of the application program, and determining a transmission protocol corresponding to the application program according to the transmission protocol information parameter;
and generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted.
In a second aspect, the present application provides a computer device, which includes a processor, a memory, and a computer program stored on the memory and executable by the processor, where the memory stores a policy model, and the computer program implements the file transfer method as described above when executed by the processor.
In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used for storing a computer program, and when the computer program is executed by a processor, the processor is caused to implement the file transmission method as described above.
The embodiment of the application provides a file transmission method, equipment and a storage medium, the file transmission method configures a transmission interface corresponding to an application program according to transmission parameters of the application program on an interface layer of an operating system, a framework layer of the operating system determines a transmission protocol corresponding to the application program by calling a function corresponding to the transmission interface, a transmission task is generated according to transmission information and the transmission protocol, and the transmission task is executed to transmit a file to be transmitted. By adopting the file transmission method provided by the application, the communication between the application program and the operating system framework layer is realized, the adaptive transmission protocol can be identified based on different application programs, the corresponding transmission task transmission file is generated, and the file transmission flow is greatly simplified.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of a file transfer method according to an embodiment of the present application;
fig. 2 is a schematic view of a file breakpoint transmission scenario provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps of a method for breakpoint transmission of a file according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of an upload method provided by an embodiment of the present application;
fig. 5 is a schematic diagram of a breakpoint uploading method based on an HTTP protocol according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating a breakpoint uploading method based on an FTP protocol according to an embodiment of the present application;
fig. 7 is a schematic block diagram of a downloading method provided in an embodiment of the present application;
fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present application.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The flowcharts shown in the figures are illustrative only and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that, for the convenience of clearly describing the technical solutions of the embodiments of the present application, the words "first", "second", and the like are used in the embodiments of the present application to distinguish the same items or similar items with basically the same functions and actions. For example, the first recognition model and the second recognition model are only used for distinguishing different callback functions, and the sequence order of the callback functions is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
For the purpose of facilitating understanding of the embodiments of the present application, some terms referred to in the embodiments of the present application will be briefly described below.
1. Operating the system: an Operating System (OS) is a computer program for managing and controlling hardware and software resources of a computer, and is the most basic system software directly running on a "bare computer", and any other software must be run under the support of the OS.
The operating system is located as an interface between the user and the computer, as well as between the computer hardware and other software. The operating system functions to manage hardware, software and data resources of the computer system, control program operation, improve human-computer interface, provide support for other application software, etc., so that all resources of the computer system function to the maximum extent, provide various forms of user interfaces, provide a good working environment for users, and provide necessary services and corresponding interfaces for the development of other software.
The variety of operating systems is quite large, and the operating systems installed in various devices can be classified into a smart card operating system, a real-time operating system, a sensor node operating system, an embedded operating system, a personal computer operating system, a multiprocessor operating system, a network operating system, and a mainframe operating system from simple to complex. There are three main categories according to the application area: a desktop operating system, a server operating system, and an embedded operating system.
2. File transmission: file Transfer (File Transfer) is the Transfer of a File or a portion thereof from one computer system to another. A file or a portion thereof is transferred from one computer system to another. It may transfer the file to another computer for storage, or to access the file on a remote computer, or to another computer for execution (as a program) or processing (as data), or to a printer for printing. Since the File systems of the computers in the network are often different, a File Transfer Protocol (FTP) is established as a File Transfer Protocol (File Transfer Protocol) rule common to all networks.
3. Hypertext transfer protocol: the HyperText Transfer Protocol (HTTP) is one of the most widely used network protocols on the internet. All World Wide Web (WWW) documents must comply with this standard. The initial purpose of designing HyperText transfer protocol was to provide a method of publishing and receiving HyperText Markup Language (HTML) pages. In 1960, the american Ted Nelson conceived a method for processing text information by a computer, and called HyperText (HyperText), which became the root of development of the standard architecture of the HyperText transfer protocol.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
At present, file-based transmission is generally realized by downloading a software tool with a file transmission function through a transmission protocol such as HTTP and FTP on an application level of an operating system, so that the use cost is relatively high, the universality is not high, certain troubles are caused to the selection and use of a user in various scenes, and the user cannot independently select a file transmission tool in a specific scene.
Specifically, the operating system may be any OS system, and the specific category is not limited by this embodiment and the drawings, and the following description takes kaihong OS as an example.
In order to solve the above problem, embodiments of the present application provide a file transmission method, device, and storage medium, which can implement communication between an application program and an operating system framework layer, and can identify an adapted transmission protocol based on different application programs, generate a corresponding transmission task transmission file, and greatly simplify a file transmission flow.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a file transmission method according to an embodiment of the present disclosure.
As shown in fig. 1, the file transfer method specifically includes steps S101 to S104.
S101, acquiring transmission parameters of the application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program.
Specifically, according to the transmission parameters of the application program, the uploading/downloading related functions of the program transmission related library in the interface layer of the operating system are redefined, so that a file transmission interface is provided for the application program, the application program can realize communication through the transmission interface, and the data transmission and the transmission function execution can be realized by calling the redefined functions.
In the embodiment of the present application, the program transmission related library includes any one of ctrl, wget, and HTTPie, and the specific category is not limited by the embodiment and the drawings, and is described below by taking ctrl as an example.
The method comprises the steps of packaging a Curl library in a Request service of an operating system, setting a path required by file transmission, url of a server, sha256 information of file integrity check and the like to corresponding parameters of the Curl, and realizing communication between an application program and an operating system framework layer through packaging the Curl library.
S102, a transmission request initiated by the application program is obtained through the transmission interface, the transmission request comprises transmission information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted.
Specifically, an application program sends a transmission request to a framework layer of an operating system through a transmission interface so as to request to upload/download a file to be transmitted, and when the application program requests to upload the file to be transmitted, the transmission request is that the application program initiates a request to the operating system to upload data content of the file to be transmitted to a server; when the application program requests to download the file to be transmitted, the transmission request is that the application program sends a request to the operating system to download the data content of the file to be transmitted from the server. The transmission request at least comprises information such as the address of the file to be transmitted and the data size of the file to be transmitted.
S103, calling a function corresponding to the transmission interface to obtain the transmission parameter of the application program, and determining the transmission protocol corresponding to the application program according to the transmission parameter.
Specifically, a framework layer of an operating system can identify a transmission protocol supported by an application program by calling application program related parameters configured by an interface layer, and an existing file transmission method is to download transmission software based on a specific protocol, and when the transmission protocol supported by the application program changes, the transmission software supporting a new transmission protocol needs to be downloaded to complete transmission.
For example, a function of identifying a protocol is built in a curl adaptation module, and the protocol can be determined, in some embodiments, the transmission protocol is an HTTP protocol, in some embodiments, the transmission protocol is an FTP protocol, and the file transmission method provided in the embodiment of the present application can perform a corresponding transmission method according to different protocol types, and the type of the transmission protocol is not limited herein.
And S104, generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted.
Specifically, the operating system framework layer determines the address and the size of transmission data of a file to be transmitted according to transmission information, the transmission protocol determines the transmission step flow, corresponding transmission tasks can be generated through the transmission information and the transmission protocol, and the framework layer executes the transmission tasks to complete transmission of the file to be transmitted in the server.
In some embodiments, as shown in fig. 2, fig. 2 is a scene schematic diagram of file breakpoint transmission provided in an embodiment of the present application, in the process of executing step S104, if a transmission task is executed to transmit a file to be transmitted, a position where the transmission of the file to be transmitted and the transmission of the application program are interrupted is obtained, a pointer is added to the interrupted position, the pointer of the file to be transmitted is obtained, the transmission task is executed to transmit the file to be transmitted according to the pointer as a starting point, and by adding a pointer to the interrupted position, breakpoint transmission and breakpoint continuous transmission based on an operating system framework layer can be implemented, so that time and resource loss caused by the transmission interruption are reduced.
It should be noted that, if the application requests to download the data content of the file to be transmitted to the designated folder, when the transmission is resumed after the transmission is interrupted, the framework layer of the operating system will continue to download the subsequent data content from the server to the designated folder according to the pointer position; if the application program requests to upload the data content of the file to be transmitted to the designated folder, when the transmission is resumed after the transmission interruption occurs, the framework layer of the operating system continues to upload the subsequent data content from the application program to the designated folder according to the pointer position.
Exemplarily, as shown in fig. 3, fig. 3 is a flowchart illustrating steps of a method for breakpoint transmission of a file according to an embodiment of the present application.
As shown in fig. 3, the file transfer method specifically includes steps S104a to S104c.
S104a, judging whether the data content of the file to be transmitted before the pointer is transmitted or not.
And S104b, if the data content of the file to be transmitted before the pointer is transmitted, executing the transmission task to transmit the file to be transmitted according to the pointer serving as a starting point.
S104c, if the data content of the file to be transmitted before the pointer is not transmitted completely, executing the transmission task to transmit the file to be transmitted from the starting point of the file to be transmitted.
Specifically, whether data content before a pointer of a file to be transmitted is checked, and if the data content before the pointer of the file to be transmitted is transmitted, the pointer in the file to be transmitted is used as a starting point to execute the transmission task to transmit the file to be transmitted; and if the data content before the pointer of the file to be transmitted is not transmitted, executing the transmission task from the starting point of the file to be transmitted to transmit the file to be transmitted.
It should be noted that, in some embodiments, it is checked whether the data content before the pointer of the file to be transmitted has been transmitted, and the data content before the pointer of the file to be transmitted may be compared with the data content size of the target folder, and if the data content before the pointer of the file to be transmitted is larger than the data content size of the target folder, it is determined that the data content before the pointer of the file to be transmitted is not transmitted to the target folder; and if the data content size before the pointer of the file to be transmitted is smaller than that of the target folder, the data content before the pointer of the file to be transmitted is considered to be transmitted to the target folder. In some embodiments, whether the transmission history record comprises data content before the pointer of the file to be transmitted is inquired in the operating system framework layer, and if the transmission history record comprises the data content before the pointer of the file to be transmitted, the data content before the pointer of the file to be transmitted is considered to be transmitted to the target folder; and if the data content size before the pointer of the file to be transmitted is larger than the data content size of the target folder, determining that the data content before the pointer of the file to be transmitted is not transmitted to the target folder. By determining whether the data content before the pointer of the file to be transmitted is transmitted or not, incomplete transmission of the file to be transmitted caused by errors of the pointed position can be avoided.
In some embodiments, when the transmission request is used for requesting to upload the file to be transmitted, the transmission task is executed to transmit the file to be transmitted, including acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to an upload task queue; and generating a transmission task according to the uploading task queue and the transmission protocol, and executing transmission information of the file to be transmitted uploaded on the transmission task. The file uploading is realized through the framework layer based on the operating system, and the file uploading step can be greatly simplified.
For example, as shown in fig. 4, fig. 4 is a schematic block diagram of an uploading method provided in an embodiment of the present application, an APP client sends an upload request through a transmission interface with a framework layer, the interface layer enables the APP client to upload a file to be transmitted by calling a transmission interface of an operating system after receiving the upload request, the interface layer requests the framework layer to start an upload task and add the file to be transmitted into an upload queue, the framework layer of the operating system starts the upload task and obtains the upload queue after receiving the request, a curl module is called to upload the file in the upload queue, the curl adaptation module determines a type of a protocol adapted to an application program, obtains a corresponding transmission protocol, and finally generates a download task to upload data content of the file to be transmitted to a cloud server.
It should be noted that, in some embodiments, the transmission information of the file to be transmitted includes an upload target address of the file to be transmitted, and the executing of the transmission task to upload the transmission information of the file to be transmitted includes: determining a first folder according to the uploading target address, and executing the transmission task to upload the file to be transmitted to the first folder;
and if the first folder cannot be determined according to the uploading target address, establishing a second folder at the uploading target address, executing the transmission task, and uploading the file to be transmitted to the second folder. When the first file with the file address as the uploading target address cannot be acquired, the transmission of the file content cannot be influenced by creating the second file at the uploading target address, and the process of acquiring the corresponding content by the user cannot be influenced because the address of the second file is consistent with the address of the file to be transmitted.
In the file uploading process, the cloud server searches for the first file according to the uploading target address, if the first file cannot be searched, the second file is newly built at the uploading target address, and if the first file at the uploading target address continues to upload the data content uploaded by the operating system interface to the current position of the first file.
For example, as shown in fig. 5, fig. 5 is a schematic view of a breakpoint uploading method based on an HTTP protocol according to an embodiment of the present application, where a file pointer position is read by opening a file fault, the file is uploaded to a cloud server according to the size of a file to be transmitted and a protocol format, and if the file is successfully sent, the pointer is moved, and subsequent content is continuously read and uploaded to the cloud server. If the uploading process is interrupted, the file pointer still points to the content position transmitted when the transmission is disconnected, data are continuously read from the current position of the file to be transmitted when the file is transmitted next time, and the data are continuously transmitted to the cloud server from the pointer.
For example, as shown in fig. 6, fig. 6 is a schematic diagram of a breakpoint uploading method based on an FTP protocol according to an embodiment of the present application, where a file pointer, a size to be transmitted, and a protocol-related parameter are transmitted into a curl function, and then a file to be transmitted is uploaded according to a transmission protocol and transmitted to a cloud server, and if the file is successfully transmitted, data content of the file to be transmitted continues to be transmitted. And if the transmission is disconnected, opening a file reading pointer of the file to be transmitted when the file is sent next time, and continuously transmitting the file to the cloud server from the file pointer.
It should be noted that, due to the characteristics of the protocol itself, the FTP protocol uses two TCP connections, one is a command link for transmitting commands between the FTP client and the server; the other is a data link for uploading or downloading data, resulting in more complicated transfer steps for the FTP protocol than for the HTTP protocol.
In some embodiments, when the transmission request is used for requesting to download the file to be transmitted, the transmission task is executed to transmit the file to be transmitted, including acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to a download task queue; and generating a transmission task according to the download task queue and the transmission protocol, and executing the transmission task to download the transmission information of the file to be transmitted. The file downloading is realized through the framework layer based on the operating system, and the steps of the file downloading can be greatly simplified.
For example, as shown in fig. 7, fig. 7 is a schematic block diagram of a downloading method provided in an embodiment of the present application, an APP client sends a downloading request through a transmission interface with a framework layer, the interface layer enables the APP client to receive a file to be transmitted by calling the transmission interface of an operating system after receiving the downloading request, the interface layer calls a function corresponding to the framework layer to request the framework layer to start a downloading task and start downloading management to add the file to be transmitted into a downloading queue, after receiving the request, the framework layer of the operating system determines that the request is the downloading request, calls downloading data management, starts the downloading task, starts the downloading data management to obtain downloading information and protocol information, and finally generates a downloading task to download the data content of the file to be transmitted from a cloud server.
In some embodiments, a transmission task is generated according to the transmission information and the transmission protocol, the method further comprises dividing the file to be transmitted into a plurality of subfiles to be transmitted, and executing the transmission task to transmit one subfile to be transmitted; and sequentially transmitting the plurality of sub files to be transmitted. The method for transmitting the files in the fragments can reduce the instantaneous memory pressure of the server, the same file can be continuously transmitted from the fragment position successfully uploaded after being uploaded unsuccessfully, the file is uploaded again after being uploaded successfully without waiting for the effect of second transmission, and the interaction experience of a user is optimized.
It should be noted that, in the process of transmitting the fragments, if a small file is not successfully transmitted, the small file needs to be uploaded again.
Illustratively, after dividing the file to be transmitted into a plurality of sub files to be transmitted, the method further comprises executing a transmission task to simultaneously transmit the plurality of sub files to be transmitted. The resource utilization rate of the operating system is improved to a certain extent by adopting a multithread transmission method.
The embodiment of the application provides a file transmission method, a transmission interface corresponding to an application program is configured according to transmission parameters of the application program on an interface layer of an operating system, a transmission protocol corresponding to the application program is determined by calling a function corresponding to the transmission interface on an operating system framework layer, a transmission task is generated according to transmission information and the transmission protocol, and the transmission task is executed to transmit a file to be transmitted. By adopting the file transmission method provided by the application, the communication between the application program and the framework layer of the operating system is realized, and the adaptive transmission protocol can be identified based on different application programs, so that the corresponding transmission task transmission file is generated, and the file transmission flow is greatly simplified.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present disclosure.
As shown in fig. 8, the computer device may include a processor, a memory, and a network interface. The processor, memory, and network interface are connected by a system bus, such as an I2C (Inter-integrated Circuit) bus.
Specifically, the Processor may be a Micro-controller Unit (MCU), a Central Processing Unit (CPU), a Digital Signal Processor (DSP), or the like.
Specifically, the Memory may be a Flash chip, a Read-Only Memory (ROM) magnetic disk, an optical disk, a usb disk, or a removable hard disk.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 8 is a block diagram of only a portion of the architecture associated with the disclosed aspects and does not constitute a limitation on the servers to which the disclosed aspects apply, as particular servers may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
Wherein the processor is configured to run a computer program stored in the memory and to implement the following steps when executing the computer program:
acquiring transmission parameters of the application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program;
acquiring a transmission request initiated by the application program through the transmission interface, wherein the transmission request comprises transmission information and transmission protocol information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted;
calling a function corresponding to the transmission interface to obtain a transmission parameter of the application program, and determining a transmission protocol corresponding to the application program according to the transmission protocol information parameter;
and generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted.
In some embodiments, if an interruption occurs in the process of executing the transmission task to transmit the file to be transmitted, acquiring a position where the transmission of the file to be transmitted and the application program is interrupted, and adding a pointer at the position where the transmission is interrupted; the processor executes the transmission task to transmit the file to be transmitted, and the specific implementation is as follows: and acquiring a pointer of the file to be transmitted, and executing the transmission task to transmit the file to be transmitted according to the pointer as a starting point.
In some embodiments, the processor executes the transmission task to transmit the file to be transmitted, specifically implementing: judging whether the data content of the file to be transmitted before the pointer is transmitted or not; if the data content of the file to be transmitted before the pointer is transmitted, executing the transmission task to transmit the file to be transmitted according to the pointer as a starting point; and if the data content of the file to be transmitted before the pointer is not transmitted completely, executing the transmission task to transmit the file to be transmitted from the starting point of the file to be transmitted.
In some embodiments, when the transmission request is used to request to upload the file to be transmitted, the processor executes the transmission task to transmit the file to be transmitted, specifically implementing: acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to an uploading task queue; and generating the transmission task according to the uploading task queue and the transmission protocol, and executing the transmission task to upload the transmission information of the file to be transmitted.
In some embodiments, the transmission information of the file to be transmitted includes a file address of the file to be transmitted, and the processor executes the transmission task to transmit the transmission information of the file to be transmitted, specifically implementing: searching a first file consistent with the file address of the file to be transmitted, and executing the transmission task to upload the file to be transmitted to the first file; and if the first file which is consistent with the file address of the file to be transmitted cannot be searched, creating a second file, wherein the file address of the second file is the file address of the file to be transmitted, and executing the transmission task to upload the transmission information of the file to be transmitted.
In some embodiments, when the transmission request is for requesting to download the file to be transmitted, the processor executes the transmission task to transmit the file to be transmitted, specifically implementing: acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to a download task queue; and generating the transmission task according to the download task queue and the transmission protocol, and executing the transmission task to download the transmission information of the file to be transmitted.
In some embodiments, the processor generates a transmission task according to the transmission information and the transmission protocol, and specifically implements: dividing the file to be transmitted into a plurality of sub files to be transmitted, and executing the transmission task to transmit one sub file to be transmitted; and sequentially transmitting the plurality of sub files to be transmitted.
In some embodiments, the processor, after the dividing the file to be transmitted into a plurality of sub-files to be transmitted, further implements: and executing the transmission task and simultaneously transmitting a plurality of sub files to be transmitted.
It should be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the server described above may refer to the corresponding process in the foregoing embodiment of the file transmission method, and is not described herein again.
In an embodiment of the present application, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and the processor executes the program instructions to implement the steps of the file transmission method provided in the foregoing embodiment. For example, the computer program is loaded by a processor and may perform the following steps:
acquiring transmission parameters of the application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program;
acquiring a transmission request initiated by the application program through the transmission interface, wherein the transmission request comprises transmission information and transmission protocol information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted;
calling a function corresponding to the transmission interface to obtain a transmission parameter of the application program, and determining a transmission protocol corresponding to the application program according to the transmission protocol information parameter;
and generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The computer readable storage medium may be an internal storage unit of the server of the foregoing embodiment, for example, a hard disk or a memory of the server. The computer readable storage medium may also be an external storage device of the server, such as a plug-in hard disk provided on the server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like.
Since the computer program stored in the computer-readable storage medium can execute any file transmission method provided in the embodiments of the present application, beneficial effects that can be achieved by any file transmission method provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the foregoing embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and various equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A file transmission method is characterized in that a terminal device is applied, an operating system is installed on the terminal device, and a plurality of application programs run on the operating system, and the method comprises the following steps:
acquiring transmission parameters of the application program, and configuring a transmission interface corresponding to the application program according to the transmission parameters of the application program;
acquiring a transmission request initiated by the application program through the transmission interface, wherein the transmission request comprises transmission information of a file to be transmitted, and the transmission request is used for requesting to upload or download the file to be transmitted;
calling a function corresponding to the transmission interface to obtain a transmission parameter of the application program, and determining a transmission protocol corresponding to the application program according to the transmission parameter;
and generating a transmission task according to the transmission information and the transmission protocol, and executing the transmission task to transmit the file to be transmitted.
2. The file transfer method according to claim 1, wherein the method further comprises: if the transmission task is executed and the transmission of the file to be transmitted is interrupted, acquiring the position of the file to be transmitted and the application program, where the transmission is interrupted, and adding a pointer at the position of the interruption;
the executing the transmission task to transmit the file to be transmitted comprises the following steps: and acquiring a pointer of the file to be transmitted, and executing the transmission task to transmit the file to be transmitted according to the pointer as a starting point.
3. The file transmission method according to claim 2, wherein the executing the transmission task to transmit the file to be transmitted according to the pointer as a starting point comprises:
judging whether the data content of the file to be transmitted before the pointer is transmitted or not;
if the data content of the file to be transmitted before the pointer is transmitted, executing the transmission task to transmit the file to be transmitted according to the pointer as a starting point;
and if the data content of the file to be transmitted before the pointer is not transmitted completely, executing the transmission task to transmit the file to be transmitted from the starting point of the file to be transmitted.
4. The file transmission method according to claim 1, wherein when the transmission request is used to request the file to be transmitted to be uploaded, the executing the transmission task transmits the file to be transmitted, including:
acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to an uploading task queue;
and generating the transmission task according to the uploading task queue and the transmission protocol, and executing the transmission task to upload the transmission information of the file to be transmitted.
5. The file transmission method according to claim 4, wherein the transmission information of the file to be transmitted includes an upload destination address of the file to be transmitted, and the executing of the transmission task to upload the transmission information of the file to be transmitted includes:
determining a first folder according to the uploading target address, and executing the transmission task to upload the file to be transmitted to the first folder;
and if the first folder cannot be determined according to the uploading target address, creating a second folder at the uploading target address, executing the transmission task, and uploading the file to be transmitted to the second folder.
6. The file transmission method according to claim 1, wherein when the transmission request is for requesting downloading of the file to be transmitted, the executing of the transmission task transmits the file to be transmitted, including:
acquiring transmission information of the file to be transmitted according to the transmission request, and adding the transmission information of the file to be transmitted to a download task queue;
and generating the transmission task according to the download task queue and the transmission protocol, and executing the transmission task to download the transmission information of the file to be transmitted.
7. The file transmission method according to claim 1, wherein the generating a transmission task according to the transmission information and the transmission protocol comprises:
dividing the file to be transmitted into a plurality of sub-files to be transmitted, and executing the transmission task to transmit one sub-file to be transmitted;
and sequentially transmitting the plurality of sub files to be transmitted.
8. The file transmission method according to claim 7, wherein after the dividing the file to be transmitted into a plurality of sub-files to be transmitted, the method further comprises:
and executing the transmission task and simultaneously transmitting a plurality of sub files to be transmitted.
9. A computer device, characterized in that the computer device comprises:
a memory and a processor;
wherein the memory is connected with the processor and used for storing programs;
the processor is configured to implement the steps of the file transfer method according to any one of claims 1 to 8 by executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the steps of the file transfer method according to any one of claims 1 to 8.
CN202211366093.0A 2022-10-31 2022-10-31 File transmission method, equipment and storage medium Pending CN115766704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211366093.0A CN115766704A (en) 2022-10-31 2022-10-31 File transmission method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211366093.0A CN115766704A (en) 2022-10-31 2022-10-31 File transmission method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115766704A true CN115766704A (en) 2023-03-07

Family

ID=85356080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211366093.0A Pending CN115766704A (en) 2022-10-31 2022-10-31 File transmission method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115766704A (en)

Similar Documents

Publication Publication Date Title
WO2019184750A1 (en) Deep learning task scheduling method and system and related apparatus
US8296338B2 (en) Method for a cloud-based meta-file system to virtually unify remote and local files across a range of devices' local file systems
EP2284725B1 (en) Client, brokerage server and method for providing cloud storage
RU2689439C2 (en) Improved performance of web access
CN110557284B (en) Data aggregation method and device based on client gateway
CN108681777B (en) Method and device for running machine learning program based on distributed system
US8930401B2 (en) Accessing and providing access to computer files over a computer network
CN108028833A (en) A kind of method, system and the relevant device of NAS data accesses
US9529578B2 (en) Automated service version upgrading
CN107689976B (en) File transmission method and device
JP2010128877A (en) Web system and method of collecting processing record
CN110784528B (en) File downloading method and device and storage medium
US20180234517A1 (en) Redirecting scanners and printers over a wan
CN109002504A (en) A kind of document code-transferring method based on Docker mirror image
CN115766704A (en) File transmission method, equipment and storage medium
CN115987974A (en) Lightweight FTP service method and system
US7827194B2 (en) Access to shared disk device on storage area network
CN114827249A (en) Method and device for extending grid agent
US8499023B1 (en) Servlet-based grid computing environment using grid engines and switches to manage resources
CN112988126A (en) CDN service customization method and system
CN113641641A (en) Switching method, switching system, equipment and storage medium of file storage service
CN112487218A (en) Content processing method, system, device, computing equipment and storage medium
US20080140687A1 (en) Socket structure simultaneously supporting both toe and ethernet network interface card and method of forming the socket structure
CN107766093B (en) Function module sharing method and client
US20080256178A1 (en) Method and Apparatus for Providing Software by Functional Units in a Software Streaming System

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