CN112911023B - File transmission method, file transmission device and file transmission system - Google Patents
File transmission method, file transmission device and file transmission system Download PDFInfo
- Publication number
- CN112911023B CN112911023B CN202110427000.XA CN202110427000A CN112911023B CN 112911023 B CN112911023 B CN 112911023B CN 202110427000 A CN202110427000 A CN 202110427000A CN 112911023 B CN112911023 B CN 112911023B
- Authority
- CN
- China
- Prior art keywords
- file
- splitting
- content
- information
- target file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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 application provides a file transmission method, a file transmission device and a file transmission system, wherein the file transmission method comprises the following steps: an acquisition step of acquiring a target file; splitting, namely splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file; and a sending step, sending the split information to the server. According to the method, the content of the target file is split to obtain a plurality of split files with the same file format as the target file, and split information is sent to the server, so that when a user downloads a plurality of split files corresponding to the target file from the server, the user can download the split files and read the downloaded split files, and the transmission efficiency of the target file is guaranteed to be higher.
Description
Technical Field
The present invention relates to the field of file transmission, and in particular, to a file transmission method, a file transmission device, a computer readable storage medium, a processor, and a file transmission system.
Background
In a large-scale and changeable micro-service environment, with more and more service systems and frequent file sending and receiving among the service systems, the daily data transmission amount is abnormally huge. For large file transmission, we currently adopt a form of unordered slicing, a large file is cut into a plurality of small files, then all the sliced files are transmitted to a receiver, at this time, the receiver cannot use the sliced files, and the receiver can identify the files after the sliced files are combined into a complete large file. The inconvenience of the transmission process is that the receiver can use the file after the transmission is finished, the time for guiding is too long, and the efficiency is low.
Therefore, a method is needed to solve the problem of low transmission efficiency caused by the fact that the slice file cannot be read before a complete large file is synthesized in the prior art.
The above information disclosed in the background section is only for enhancement of understanding of the background art from the technology described herein and, therefore, may contain some information that does not form the prior art that is already known in the country to a person of ordinary skill in the art.
Disclosure of Invention
The main objective of the present application is to provide a file transmission method, a transmission device, a computer readable storage medium, a processor and a file transmission system, so as to solve the problem in the prior art that a slice file cannot be read before a complete large file is synthesized, resulting in lower transmission efficiency.
According to an aspect of an embodiment of the present invention, there is provided a method for transmitting a file, including: an acquisition step of acquiring a target file; splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file; and a sending step, sending the split information to a server.
Optionally, the acquiring step includes: receiving first request information sent by a first terminal, wherein the first request information is information for requesting to access a storage path of the target file; and acquiring the target file according to the storage path.
Optionally, the splitting step includes: analyzing the target file to obtain an analysis result, wherein the analysis result comprises a file format and file content of the target file; splitting the file content into a plurality of sub-contents of predetermined capacity; invoking a preset template corresponding to the file format to store the sub-content, so as to obtain a plurality of split files; and configuring the corresponding ID information for each split file.
Optionally, in a case that the file format of the target file is determined to be XLSX format, splitting the file content into a plurality of sub-contents of predetermined capacity includes: acquiring a first part of content and a second part of content of the target file, wherein the second part of content is title bar content of the target file, and the first part of content is content except the second part of content in the file content; splitting the first part of content according to a first capacity to obtain a plurality of first preset contents, wherein the first preset contents and a second preset content form the sub-content, the first capacity is smaller than the preset capacity, and the second preset content is the content corresponding to the first preset content in the second part of content.
Optionally, the parsing result further includes a first file check value of the target file, and the sending step includes: and sending the split files, the ID information and the first file check value to the server.
Optionally, after the transmitting step, the method further comprises: and under the condition that the error information sent by the server is received, the splitting step and the sending step are sequentially executed at least once until the error information is not received any more, wherein the error information has information representing the splitting error of the target file.
According to another aspect of the embodiment of the present invention, there is also provided a method for transmitting a file, including: receiving splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files; and responding to second request information, and sending a plurality of split files to a second terminal, wherein the second request information is information for requesting to download the target file, and the split files have the same file format as the target file.
Optionally, after receiving the split information, before transmitting a plurality of split files to the second terminal in response to the second request information, the method further includes: receiving a first file check value of the target file; obtaining second file check values corresponding to a plurality of split files; and according to the plurality of second file check values and the first file check values, carrying out file check on the plurality of split files, determining whether the split information is correct, and determining that the split information is correct under the condition that the plurality of split files are consistent with the target file.
Optionally, in response to the second request information, sending a plurality of split files to the second terminal, including: and in the case that the split information is correct, responding to the second request information and transmitting a plurality of split files to the second terminal.
Optionally, in the case that the split information is incorrect, the method further comprises: and sending error information to the control terminal.
According to still another aspect of the embodiment of the present invention, there is further provided a file transmission device, including a first obtaining unit, a splitting unit, and a first sending unit, where the first obtaining unit is configured to obtain a target file; the splitting unit is used for splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file; the first sending unit is used for sending the split information to a server.
According to still another aspect of the embodiment of the present invention, there is further provided a file transmission device, including a first receiving unit and a second sending unit, where the first receiving unit is configured to receive splitting information, where the splitting information includes a plurality of splitting files obtained by splitting a content of a target file and ID information corresponding to the splitting files; the second sending unit is configured to send, in response to second request information, a plurality of split files to a second terminal, where the second request information is information for requesting to download the target file, and the split file has a file format identical to that of the target file.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium including a stored program, wherein the program performs any one of the methods.
According to yet another aspect of an embodiment of the present invention, there is further provided a processor, where the processor is configured to execute a program, and where the program executes any of the methods.
According to still another aspect of the embodiment of the present invention, there is further provided a file transfer system, including a control end, a service end, and a second terminal, where the control end is configured to perform any one of the methods; the server is in communication connection with the control end, and the server is configured to execute any one of the methods; the second terminal is in communication connection with the server, and is used for sending second request information to the server, wherein the second request information is information for requesting to download the target file.
Optionally, the system further includes a first terminal, where the first terminal is in communication connection with the control end, and the first terminal is configured to send first request information to the control end, where the first request information is information that requests access to a storage path of the target file.
The file transmission method includes the steps that firstly, a target file is obtained; then, splitting the content of the target file to obtain a plurality of split files and splitting information such as ID information corresponding to the split files, wherein the file format of the split files is the same as that of the target file; and finally, sending the split files and the corresponding ID information to a server. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 shows a flow diagram generated by a method of transmitting files according to one embodiment of the present application;
FIG. 2 shows a flow diagram generated by a method of transmitting files according to another embodiment of the present application;
FIG. 3 shows a schematic diagram of a file transfer device according to one embodiment of the present application;
fig. 4 shows a schematic diagram of a file transfer device according to another embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be understood that when an element such as a layer, film, region, or substrate is referred to as being "on" another element, it can be directly on the other element or intervening elements may also be present. Furthermore, in the description and in the claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element or "connected" to the other element through a third element.
As described in the background art, the slice file in the prior art cannot be read before a complete large file is synthesized, resulting in low transmission efficiency.
According to an exemplary embodiment of the present application, a method for transmitting a file is provided. The file transmission method can be applied to a control end.
Fig. 1 is a flowchart of a file transmission method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, an acquisition step, namely acquiring a target file;
step S102, splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file;
step S103, a sending step, which is to send the split information to a server.
The file transmission method comprises the steps of firstly, obtaining a target file; then, splitting the content of the target file to obtain a plurality of split files and splitting information such as ID information corresponding to the split files, wherein the file format of the split files is the same as that of the target file; and finally, sending the split files and the corresponding ID information to a server. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
In the actual application process, the target file is a document file.
According to a specific embodiment of the present application, the step of obtaining includes: receiving first request information sent by a first terminal, wherein the first request information is information for requesting to access a storage path of the target file; and acquiring the target file according to the storage path. According to the method, the target file is acquired by receiving the information of the storage path of the target file, which is sent by the first terminal and is requested to be accessed, so that the target file is ensured to be acquired simply and quickly, and the target file is convenient to split subsequently.
In order to further ensure that the split file of the target file can be read while being downloaded, thereby further ensuring that the transmission efficiency of the target file is higher, according to another specific embodiment of the present application, the splitting step includes: analyzing the target file to obtain an analysis result, wherein the analysis result comprises a file format and file content of the target file; splitting the file content into a plurality of sub-contents with preset capacity; calling a preset template corresponding to the file format to store the sub-content, namely, the format of the preset template is the file format, so as to obtain a plurality of split files; and configuring the corresponding ID information for each split file. Therefore, the content of the target file can be simply and efficiently split into a plurality of split files with the same file format, and the condition that the second terminal can download and read at the same time when downloading a plurality of split files from the server is further ensured.
In a specific embodiment of the present application, when the file format of the target file obtained by parsing is an XLM format, a predetermined template in the XLM format is called to store the sub-content; when the file format of the target file obtained by analysis is the DOC format, a predetermined template of the DOC format is called to store the sub-content, and of course, the file format of the target file is not limited to the XLM format and the DOC format, and may be any file format in the prior art.
In order to further ensure that a user can easily read split content, in an actual application process, under the condition that the file format of the target file is determined to be XLSX format, splitting the file content into a plurality of sub-contents with preset capacity, wherein the sub-contents comprise: acquiring a first part of content and a second part of content of the target file, wherein the second part of content is title bar content of the target file, and the first part of content is content except the second part of content in the file content; splitting the first part of content according to a first capacity to obtain a plurality of first preset contents, wherein the first preset contents and a second preset content form the sub-content, the first capacity is smaller than the preset capacity, and the second preset content is the content corresponding to the first preset content in the second part of content, namely, the second preset content and the title bar content corresponding to the first preset content in the title bar content. According to the method, the part of the title bar content and the first part of the content corresponding to the part of the title bar content are put into one split file, so that a user can understand the first part of the content according to the title bar content conveniently.
In a specific embodiment, the object file in XLSX format includes five header column contents in a first row and data column contents in a first column to a fifth column in a second row, that is, the first portion of the contents are the data column contents, and the method further facilitates the user to read the contents of the split file by splitting the data column contents into four first predetermined contents in a lateral direction, that is, each of the first predetermined contents includes five rows of the data column contents, the second predetermined contents are the header column contents, and the header column contents and the five rows of the data column contents form the sub-contents. Of course, the first part of content is not limited to the data field content, and may be text or the like; the format of the target file is not limited to the XLSX format, and the splitting method is not limited to the method described in this embodiment, so that a person skilled in the art can flexibly set the splitting method, and it is ensured that a user can conveniently read the split file.
According to still another specific embodiment of the present application, the file format of the target file is an XML format, and at this time, the contents between < node > nodes in the target file need to be read, the contents between < node > nodes are split, and the split contents are stored in a predetermined template in the XML format, so as to obtain a plurality of split files.
In still another specific embodiment of the present application, the parsing result further includes a first file check value of the target file, and the sending step includes: and transmitting the split files, the ID information and the first file check value to the server. By acquiring the first file check value of the target file, whether a plurality of split files are complete or not and whether a plurality of split files are consistent with the target file or not are conveniently determined according to the first file check value, and therefore accuracy of a split result and good split effect can be further guaranteed.
In the actual application process, the first file check value may be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, which is not limited to the above check value, but may be other file check values in the prior art.
According to another specific embodiment of the present application, after the transmitting step, the method further includes: and under the condition that the error information sent by the server is received, the splitting step and the sending step are sequentially executed at least once until the error information is not received any more, wherein the error information has information representing the splitting error of the target file.
According to another exemplary embodiment of the present application, a method for transmitting a file is provided. The file transmission method can be applied to a server.
Fig. 2 is a flowchart of a method of transmitting a file according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
step S201, receiving splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files;
step S202, a plurality of split files are sent to a second terminal in response to second request information, wherein the second request information is information for requesting to download the target file, and the split files have the same file format as the target file.
The file transmission method includes the steps that split information is received firstly, the split information comprises a plurality of split files obtained by splitting the content of a target file and ID information corresponding to the split files, and the split files are identical to the target file in file format; and then transmitting a plurality of split files to a second terminal in response to second request information requesting to download the target file. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
In the actual application process, when the second terminal downloads all the split files, the second terminal may synthesize the plurality of split files into the target file according to the ID information.
According to a specific embodiment of the present application, after receiving the split information, before sending the plurality of split files to the second terminal in response to the second request information, the method further includes: receiving a first file check value of the target file; obtaining second file check values corresponding to a plurality of split files; and performing file verification on the split files according to the second file verification values and the first file verification values to determine whether the split information is correct, and determining that the split information is correct when the split files are consistent with the target file. According to the method, whether the splitting information is correct or not is determined by receiving the second file check values of the splitting files and carrying out file check on the splitting files according to the second file check values and the first file check values, so that the splitting result can be further ensured to be accurate and the splitting effect is good.
In an actual application process, the first file check value may be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, and the second file check value may also be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, which are not limited to the check values, but may be other file check values in the prior art, so long as the same types of the first file check value and the second file check value are ensured. In a specific embodiment, the first file check value is an MD5 value, and the second file check value is an MD5 value.
In the practical application process, the method can also synthesize a plurality of split files according to a plurality of ID information to obtain a synthesized file, obtain a third file check value of the synthesized file, and determine whether the split files are complete and consistent with the target file by comparing the first file check value and the third file check value.
In order to further ensure that the splitting result is accurate and the splitting effect is good, according to another specific embodiment of the present application, in response to the second request information, sending a plurality of splitting files to the second terminal includes: and when the split information is correct, transmitting a plurality of split files to the second terminal in response to the second request information.
In still another specific embodiment of the present application, in a case where the splitting information is incorrect, the method further includes: and sending error information to the control terminal. By sending error information to the control end, the control end can conveniently split the target file again according to the error information, and therefore the accuracy of the splitting result is further ensured.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a file transmission device, and it should be noted that the file transmission device of the embodiment of the application can be used for executing the file transmission method applied to the control end. The following describes a file transmission device provided in an embodiment of the present application.
Fig. 3 is a schematic diagram of a file transfer device according to an embodiment of the present application. As shown in fig. 3, the apparatus includes a first obtaining unit 10, a splitting unit 20, and a first sending unit 30, where the first obtaining unit 10 is configured to obtain a target file in an obtaining step; the splitting unit 20 is configured to split the content of the target file to obtain splitting information, where the splitting information includes a plurality of split files obtained by splitting and ID information corresponding to the split files, and the file formats of the split files are the same as those of the target file; the first sending unit 30 is configured to send the split information to a server in a sending step.
The file transmission device acquires the target file through the first acquisition unit; splitting the content of the target file through the splitting unit to obtain a plurality of split files and splitting information such as ID information corresponding to the split files, wherein the file format of the split files is the same as that of the target file; and transmitting the split files and the corresponding ID information to a server through the first transmitting unit. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
In the actual application process, the target file is a document file.
According to a specific embodiment of the present application, the first obtaining unit includes a first receiving module and an obtaining module, where the first receiving module is configured to receive first request information sent by a first terminal, where the first request information is information that requests access to a storage path of the target file; the acquisition module is used for acquiring the target file according to the storage path. The device acquires the target file by receiving the information of the storage path of the target file, which is sent by the first terminal and is requested to access, ensures that the target file is simply and quickly acquired, and facilitates the subsequent splitting of the target file.
In order to further ensure that the split file of the target file can be read while being downloaded, thereby further ensuring that the transmission efficiency of the target file is higher, according to another specific embodiment of the application, the split unit comprises an analysis module, a split module, a calling module and a configuration module, wherein the analysis module is used for analyzing the target file to obtain an analysis result, and the analysis result comprises a file format and file content of the target file; the splitting module is used for splitting the file content into a plurality of sub-contents with preset capacity; the calling module is used for calling a preset template corresponding to the file format to store the sub-content, that is, the format of the preset template is the file format, so as to obtain a plurality of split files; the configuration module is used for configuring the corresponding ID information for each split file. Therefore, the content of the target file can be simply and efficiently split into a plurality of split files with the same file format, and the condition that the second terminal can download and read at the same time when downloading a plurality of split files from the server is further ensured.
In a specific embodiment of the present application, when the file format of the target file obtained by parsing is an XLM format, a predetermined template in the XLM format is called to store the sub-content; when the file format of the target file obtained by analysis is DOC format, the predetermined template of DOC format is called to store the sub-content, and of course, the file format of the target file is not limited to XLM format and DOC format, and may be any file format in the prior art, and the device stores a plurality of sub-content by calling the predetermined template corresponding to the file format to obtain a plurality of split files, so that it is further ensured that the second terminal can read the content of the split file without synthesizing the target file when downloading the split file through the server.
In order to further ensure that a user can easily read split content, in an actual application process, the split module comprises an acquisition sub-module and a split sub-module, wherein the acquisition sub-module is used for acquiring a first part of content and a second part of content of the target file under the condition that the file format of the target file is determined to be XLSX format, wherein the second part of content is title column content of the target file, and the first part of content is content except the second part of content in the file content; the splitting submodule is used for splitting the first part of content according to a first capacity to obtain a plurality of first scheduled contents, the first scheduled contents and second scheduled contents form the sub-content, the first capacity is smaller than the scheduled capacity, and the second scheduled contents are contents corresponding to the first scheduled contents in the second part of content, namely, title bar contents corresponding to the first scheduled contents in the second scheduled contents and the title bar contents. The device further facilitates the user to understand the first part of content according to the title bar content by placing the part of the title bar content and the first part of content corresponding to the part of the title bar content into a split file.
In a specific embodiment, the object file in XLSX format includes five header column contents in a first row and data column contents in a first column to a fifth column in a second row, that is, the first portion of the contents are the data column contents, and the device splits the data column contents into four first predetermined contents in a lateral direction, that is, each of the first predetermined contents includes five rows of the data column contents, the second predetermined contents are the header column contents, and the header column contents and the five rows of the data column contents form the sub-contents, so that a user can further conveniently read the contents of the split file. Of course, the first part of content is not limited to the data field content, and may be text or the like; the format of the target file is not limited to the XLSX format, and the splitting device is not limited to the device described in this embodiment, so that a person skilled in the art can flexibly set the splitting device, and it is only necessary to ensure that a user can conveniently read the split file.
According to still another specific embodiment of the present application, the file format of the target file is an XML format, and at this time, the contents between < node > nodes in the target file need to be read, the contents between < node > nodes are split, and the split contents are stored in a predetermined template in the XML format, so as to obtain a plurality of split files.
In still another specific embodiment of the present application, the analysis result further includes a first file check value of the target file, and the first sending unit includes a first sending module, where the first sending module is configured to send the split files, the ID information, and the first file check value to the server. By acquiring the first file check value of the target file, whether a plurality of split files are complete or not and whether a plurality of split files are consistent with the target file or not are conveniently determined according to the first file check value, and therefore accuracy of a split result and good split effect can be further guaranteed.
In the actual application process, the first file check value may be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, which is not limited to the above check value, but may be other file check values in the prior art.
According to another specific embodiment of the present application, the apparatus further includes an execution unit, where the execution unit is configured to, after the sending step, sequentially execute the splitting step and the sending step at least once when receiving the error information sent by the server, until the error information is no longer received, where the error information has information indicating that the target file is split into an error.
The embodiment of the application also provides a file transmission device, and it should be noted that the file transmission device of the embodiment of the application can be used for executing the file transmission method applied to the server side. The following describes a file transmission device provided in an embodiment of the present application.
Fig. 4 is a schematic diagram of a file transfer device according to an embodiment of the present application. As shown in fig. 4, the apparatus includes a first receiving unit 40 and a second sending unit 50, where the first receiving unit 40 is configured to receive splitting information, where the splitting information includes a plurality of splitting files obtained by splitting a content of a target file and ID information corresponding to the splitting files; the second sending unit 50 is configured to send the plurality of split files to a second terminal in response to second request information, where the second request information is information for requesting downloading of the target file, and the split file has the same file format as the target file.
The file transmission device firstly receives splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file; and then transmitting a plurality of split files to a second terminal in response to second request information requesting to download the target file. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
In the actual application process, when the second terminal downloads all the split files, the second terminal may synthesize the plurality of split files into the target file according to the ID information.
According to a specific embodiment of the present application, the apparatus further includes a second receiving unit, a second obtaining unit, and a determining unit, where the second receiving unit is configured to receive, after receiving the split information, a first file check value of the target file before sending, in response to the second request information, a plurality of split files to the second terminal; the second obtaining unit is configured to obtain second file check values corresponding to the plurality of split files; the determining unit is configured to perform file verification on the split files according to the second file verification values and the first file verification values, determine whether the split information is correct, and determine that the split information is correct when the split files are identical to the target file. The device determines whether the splitting information is correct or not by receiving the second file check values of the splitting files and carrying out file check on the splitting files according to the second file check values and the first file check values, so that the splitting result can be further ensured to be accurate and the splitting effect is good.
In an actual application process, the first file check value may be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, and the second file check value may also be an MD2 value, an MD4 value, an MD5 value, an SHA1 value, or a CRC32 value of the target file, which are not limited to the check values, but may be other file check values in the prior art, so long as the same types of the first file check value and the second file check value are ensured. In a specific embodiment, the first file check value is an MD5 value, and the second file check value is an MD5 value.
In the actual application process, the device may further synthesize the split files according to the ID information to obtain a synthesized file, obtain a third file check value of the synthesized file, and determine whether the split files are complete and consistent with the target file by comparing the first file check value and the third file check value.
In order to further ensure that the splitting result is accurate and the splitting effect is good, according to another specific embodiment of the present application, the second sending unit includes a second sending module, where the second sending module is configured to send, in response to the second request information, a plurality of splitting files to the second terminal when the splitting information is correct.
In still another specific embodiment of the present application, the apparatus further includes a third sending unit, where the third sending unit is configured to send an error message to the control end when the split information is incorrect. By sending error information to the control end, the control end can conveniently split the target file again according to the error information, and therefore the accuracy of the splitting result is further ensured.
The file transmission device comprises a processor and a memory, wherein the first acquisition unit, the splitting unit, the first sending unit, the first receiving unit, the second sending unit and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and the problem that the transmission efficiency is low because the slice file cannot be read before a complete large file is synthesized in the prior art is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements a method of transferring files as described above.
The embodiment of the invention provides a processor, which is used for running a program, wherein the transmission method of the file is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes at least the following steps when executing the program:
step S101, an acquisition step, namely acquiring a target file;
step S102, splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file;
step S103, a transmitting step, transmitting the split information to a server,
alternatively, the processor, when executing the program, performs at least the following steps:
step S201, receiving splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files;
Step S202, a plurality of split files are sent to a second terminal in response to second request information, wherein the second request information is information for requesting to download the target file, and the split files have the same file format as the target file.
The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform a program initialized with at least the following method steps when executed on a data processing device:
step S101, an acquisition step, namely acquiring a target file;
step S102, splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file;
step S103, a transmitting step, transmitting the split information to a server,
alternatively, a program adapted to perform an initialization having at least the following method steps:
step S201, receiving splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files;
Step S202, a plurality of split files are sent to a second terminal in response to second request information, wherein the second request information is information for requesting to download the target file, and the split files have the same file format as the target file.
According to still another aspect of the embodiment of the present invention, there is further provided a file transmission system, including a control end, a server end, and a second terminal, where the control end is configured to execute any one of transmission methods applied to files of the control end; the server is in communication connection with the control end, and the server is configured to execute any file transmission method applied to the server; the second terminal is in communication connection with the server, and is used for sending second request information to the server, wherein the second request information is information for requesting to download the target file.
The file transmission system comprises a control end, a service end and a second terminal, wherein the service end is in communication connection with the control end, the second terminal is in communication connection with the service end, the control end is configured to execute any file transmission method applied to the control end, the service end is configured to execute any file transmission method applied to the service end, and the second terminal is used for sending second request information for requesting to download a target file to the service end. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
In an actual application process, the system further comprises a first terminal, wherein the first terminal is in communication connection with the control end, the first terminal is used for sending first request information to the control end, and the first request information is information for requesting to access a storage path of the target file.
In a specific embodiment of the present application, the server is a Hadoop (sea Du Pu) storage architecture, where the Hadoop storage architecture includes a plurality of data blocks, and a storage capacity of the data blocks is greater than or equal to a size of the split file. In a specific embodiment, the storage capacity of the data block is equal to the size of the split file, so that the storage space of hadoop is not wasted.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units may be a logic function division, and there may be another division manner when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
1) According to the file transmission method, the target file is acquired first; then, splitting the content of the target file to obtain a plurality of split files and splitting information such as ID information corresponding to the split files, wherein the file format of the split files is the same as that of the target file; and finally, sending the split files and the corresponding ID information to a server. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
2) The file transmission method includes the steps that split information is received firstly, the split information comprises a plurality of split files obtained by splitting the content of a target file and ID information corresponding to the split files, and the split files are identical to the target file in file format; and then transmitting a plurality of split files to a second terminal in response to second request information requesting to download the target file. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
3) The file transmission device acquires the target file through the first acquisition unit; splitting the content of the target file through the splitting unit to obtain a plurality of split files and splitting information such as ID information corresponding to the split files, wherein the file format of the split files is the same as that of the target file; and transmitting the split files and the corresponding ID information to a server through the first transmitting unit. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
4) The file transmission device firstly receives splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting the content of a target file and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file; and then transmitting a plurality of split files to a second terminal in response to second request information requesting to download the target file. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
5) The file transmission system comprises a control end, a service end and a second terminal, wherein the service end is in communication connection with the control end, the second terminal is in communication connection with the service end, the control end is configured to execute any file transmission method applied to the control end, the service end is configured to execute any file transmission method applied to the service end, and the second terminal is used for sending second request information for requesting to download a target file to the service end. Compared with the prior art, a large file is cut into a plurality of small files, a receiver can read file contents only after downloading all the small files and synthesizing all the small files into the large file, so that the problem of lower file transmission efficiency is solved.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims (8)
1. A method for transferring a file, comprising:
an acquisition step of acquiring a target file;
splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file;
a sending step of sending the split information to a server,
the splitting step comprises the following steps:
analyzing the target file to obtain an analysis result, wherein the analysis result comprises a file format and file content of the target file;
splitting the file content into a plurality of sub-contents of predetermined capacity;
invoking a preset template corresponding to the file format to store the sub-content, so as to obtain a plurality of split files;
Configuring the corresponding ID information for each split file,
in the case that the file format of the target file is determined to be XLSX format, splitting the file content into a plurality of sub-contents of predetermined capacity, including:
acquiring a first part of content and a second part of content of the target file, wherein the second part of content is title bar content of the target file, and the first part of content is content except the second part of content in the file content;
splitting the first part of content according to a first capacity to obtain a plurality of first preset contents, wherein the first preset contents and a second preset content form the sub-content, the first capacity is smaller than the preset capacity, the second preset content is the content corresponding to the first preset content in the second part of content,
the parsing result further includes a first file check value of the target file, and the sending step includes:
and sending the split files, the ID information and the first file check value to the server.
2. The method of claim 1, wherein the step of obtaining comprises:
Receiving first request information sent by a first terminal, wherein the first request information is information for requesting to access a storage path of the target file;
and acquiring the target file according to the storage path.
3. The method of claim 1, wherein after the step of transmitting, the method further comprises:
and under the condition that the error information sent by the server is received, the splitting step and the sending step are sequentially executed at least once until the error information is not received any more, wherein the error information has information representing the splitting error of the target file.
4. A document transfer apparatus, comprising:
the first acquisition unit is used for acquiring the target file;
the splitting unit is used for splitting the content of the target file to obtain splitting information, wherein the splitting information comprises a plurality of splitting files obtained by splitting and ID information corresponding to the splitting files, and the splitting files have the same file format as the target file;
a first sending unit, configured to send the split information to a server,
the splitting unit comprises an analyzing module, a splitting module, a calling module and a configuration module, wherein the analyzing module is used for analyzing the target file to obtain an analyzing result, and the analyzing result comprises a file format and file content of the target file; the splitting module is used for splitting the file content into a plurality of sub-contents with preset capacity; the calling module is used for calling a preset template corresponding to the file format to store the sub-content, the configuration module is used for configuring the corresponding ID information for each split file,
The splitting module comprises an acquisition sub-module and a splitting sub-module, wherein the acquisition sub-module is used for acquiring a first part of content and a second part of content of the target file under the condition that the file format of the target file is determined to be XLSX format, the second part of content is title bar content of the target file, and the first part of content is content except the second part of content in the file content; the splitting submodule is used for splitting the first part of content according to a first capacity to obtain a plurality of first preset contents, the first preset contents and a second preset content form the sub-content, the first capacity is smaller than the preset capacity, the second preset content is the content corresponding to the first preset content in the second part of content,
the analysis result further comprises a first file check value of the target file, the first sending unit comprises a first sending module, and the first sending module is used for sending a plurality of split files, a plurality of ID information and the first file check value to the server.
5. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program performs the method of any one of claims 1 to 3.
6. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 3.
7. A file transfer system, comprising:
a control terminal configured to perform the method of any one of claims 1 to 3;
the server is in communication connection with the control end;
the second terminal is in communication connection with the server, and is used for sending second request information to the server, wherein the second request information is information for requesting to download the target file.
8. The system of claim 7, wherein the system further comprises:
the first terminal is in communication connection with the control end and is used for sending first request information to the control end, wherein the first request information is information for requesting to access a storage path of the target file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110427000.XA CN112911023B (en) | 2021-04-20 | 2021-04-20 | File transmission method, file transmission device and file transmission system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110427000.XA CN112911023B (en) | 2021-04-20 | 2021-04-20 | File transmission method, file transmission device and file transmission system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112911023A CN112911023A (en) | 2021-06-04 |
CN112911023B true CN112911023B (en) | 2023-06-06 |
Family
ID=76110539
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110427000.XA Active CN112911023B (en) | 2021-04-20 | 2021-04-20 | File transmission method, file transmission device and file transmission system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112911023B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102056094A (en) * | 2009-11-10 | 2011-05-11 | 酷手机多媒体股份有限公司 | System for transmitting file using multimedia message and method thereof |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20160030133A (en) * | 2013-07-05 | 2016-03-16 | 엘지전자 주식회사 | Method and apparatus for transmitting/receiving media broadcasting signal in real time transport protocol-based broadcasting system |
-
2021
- 2021-04-20 CN CN202110427000.XA patent/CN112911023B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102056094A (en) * | 2009-11-10 | 2011-05-11 | 酷手机多媒体股份有限公司 | System for transmitting file using multimedia message and method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN112911023A (en) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111984356B (en) | Page jump method, device, computer equipment and storage medium | |
CN104301443B (en) | A kind of method and system that end ability interface is called on web page | |
US20140359066A1 (en) | System, method and device for offline downloading resource and computer storage medium | |
CN113411404A (en) | File downloading method, device, server and storage medium | |
CN109656572A (en) | Packaging method and device, computer equipment, the storage medium of installation kit | |
CN103002011A (en) | Server-based data update method and server | |
CN109951514A (en) | Document handling method, system and computer equipment based on cloud storage | |
CN111803917B (en) | Resource processing method and device | |
US20100268736A1 (en) | Efficient creation, storage, and provision of web-viewable documents | |
CN112911023B (en) | File transmission method, file transmission device and file transmission system | |
CN113342400A (en) | Off-line package packing method and device and computer equipment | |
CN107704464B (en) | Method and device for analyzing path of static resource | |
CN116304458B (en) | Method, device, equipment and medium for web page real-time notification update | |
CN113485921B (en) | File system testing method, device, equipment and storage medium | |
CN111159244B (en) | Data query method and device | |
CN112491939B (en) | Multimedia resource scheduling method and system | |
CN106487855B (en) | File uploading method, file accessing method, file uploading device, file accessing device and equipment | |
CN111459819B (en) | Software testing method and device, electronic equipment and computer readable medium | |
CN110474954A (en) | Sharing files method, apparatus, computer equipment and readable storage medium storing program for executing based on block chain | |
CN113553473A (en) | Cloud playing method, system and device for bag file | |
CN112688980B (en) | Resource distribution method and device, and computer equipment | |
EP3729761B1 (en) | Smart delivery node | |
CN109960552B (en) | Webpage interface differential rendering method and device | |
CN114745382B (en) | Task slicing method, task slicing device and service system | |
CN112788077A (en) | Data acquisition method and device, computer equipment and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |