CN115002100B - File transmission method and device, electronic equipment and storage medium - Google Patents

File transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115002100B
CN115002100B CN202210592939.6A CN202210592939A CN115002100B CN 115002100 B CN115002100 B CN 115002100B CN 202210592939 A CN202210592939 A CN 202210592939A CN 115002100 B CN115002100 B CN 115002100B
Authority
CN
China
Prior art keywords
file
fragmented
transmission
files
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210592939.6A
Other languages
Chinese (zh)
Other versions
CN115002100A (en
Inventor
曾日东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hebei Yanming Technology Co ltd
Original Assignee
Hebei Yanming Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hebei Yanming Technology Co ltd filed Critical Hebei Yanming Technology Co ltd
Priority to CN202210592939.6A priority Critical patent/CN115002100B/en
Publication of CN115002100A publication Critical patent/CN115002100A/en
Application granted granted Critical
Publication of CN115002100B publication Critical patent/CN115002100B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments

Abstract

The invention relates to a data processing technology, and discloses a file transmission method, which comprises the following steps: extracting a transmission file identifier in the file transmission request; screening files in a preset file set according to the transmission file identification to obtain files to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set; constructing a fragment transmission identifier for each fragment file; calculating a file signature of the fragmented file; inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and transmitting the fragmented file according to an inquiry result; and transmitting all the undelivered fragmented files to the file receiving end. The invention also relates to a blockchain technique, and the sharded file can be stored in a blockchain node. The invention also provides a file transmission device, equipment and a medium. The invention can improve the efficiency of file transmission.

Description

File transmission method and device, electronic equipment and storage medium
Technical Field
The present invention relates to data processing technologies, and in particular, to a method and apparatus for file transfer, an electronic device, and a storage medium.
Background
With the gradual development of big data, the transmission of various data files is becoming more common, and with the larger and larger volume of the transmitted files, the time spent for data transmission is longer and longer.
However, the existing file transmission method directly transmits the whole file, if transmission is interrupted, retransmission is needed, and the file transmission efficiency is low.
Disclosure of Invention
The invention provides a file transmission method, a file transmission device, electronic equipment and a storage medium, and mainly aims to improve file transmission efficiency.
Acquiring a file transmission request, and extracting a transmission file identifier in the file transmission request;
screening files in a preset file set according to the transmission file identification to obtain files to be transmitted;
sequentially segmenting the files to be transmitted to obtain a segmented file set;
constructing a fragmented transmission identifier for each fragmented file according to the transmission file identifiers, the number of the fragmented files in the fragmented file set and the sequence of the fragmented file segmentation;
calculating a file signature of the fragmented file;
inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files;
and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file.
Optionally, the sequentially splitting the files to be transmitted to obtain a set of fragmented files includes:
splitting a file with a preset splitting threshold value from the file to be transmitted to obtain a splitting file;
judging whether the size of the segmented file to be transmitted is larger than the segmentation threshold value or not;
when the size of the segmented file to be transmitted is larger than the segmentation threshold value, determining the segmented file to be transmitted as an updated file to be transmitted, and returning to the step of segmenting the file with the size of the preset segmentation threshold value from the file to be transmitted;
and when the size of the segmented file to be transmitted is not greater than the segmentation threshold, determining the segmented file to be transmitted as a segmented file, and summarizing all the segmented files to obtain the segmented file set.
Optionally, the querying whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature includes:
inquiring whether a file with a file name of the fragment transmission identifier exists in the file receiving end;
when the file name of the file which is the fragmented transmission identifier does not exist in the file receiving end, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end;
when the file name of the file exists in the file receiving end as the file of the fragment transmission identifier;
determining a file with the file name of the file receiving end as the fragmented transmission identifier as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragmented transmission identifier is consistent with the file signature of the fragmented file corresponding to the fragmented transmission identifier of the file;
when the comparison result is consistent, the fragmented files corresponding to the fragmented transmission identifiers exist in the file receiving end;
and if the comparison result is inconsistent, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end.
Optionally, the marking the transmitted label or the untransmitted label with the fragmented file according to the query result includes:
when the query result of the fragmented file is that the fragmented file exists, marking the transmitted label of the fragmented file;
and when the query result of the segmented file is nonexistent, marking the segmented file with a non-transmission label.
Optionally, the filtering the files in the preset file set according to the transmission file identifier to obtain the file to be transmitted includes:
acquiring a file identifier of each file in the file set, wherein the file identifier is the same as the transmission file identifier in type;
and determining the file with the same file identification as the transmission file identification as the file to be transmitted.
Optionally, the calculating the file signature of the fragmented file includes:
acquiring a pre-constructed signature function;
converting the fragmented file into binary data;
and calculating the binary data as the variable parameter of the signature function to obtain the file signature.
In order to solve the above problems, the present invention also provides a file transfer apparatus, including:
the file splitting module is used for acquiring a file transmission request and extracting a transmission file identifier in the file transmission request; screening files in a preset file set according to the transmission file identification to obtain files to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the tag marking module is used for constructing a fragmented transmission identifier for each fragmented file according to the transmission file identifiers, the number of fragmented files in the fragmented file set and the sequence of the fragmented file segmentation; calculating a file signature of the fragmented file; inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
the file transmission module is used for determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files; and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file.
Optionally, the querying whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature includes:
inquiring whether a file with a file name of the fragment transmission identifier exists in the file receiving end;
when the file name of the file which is the fragmented transmission identifier does not exist in the file receiving end, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end;
when the file name of the file exists in the file receiving end as the file of the fragment transmission identifier;
determining a file with the file name of the file receiving end as the fragmented transmission identifier as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragmented transmission identifier is consistent with the file signature of the fragmented file corresponding to the fragmented transmission identifier of the file;
when the comparison result is consistent, the fragmented files corresponding to the fragmented transmission identifiers exist in the file receiving end;
and if the comparison result is inconsistent, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one computer program; and
And a processor executing the computer program stored in the memory to implement the file transfer method described above.
In order to solve the above-described problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-described file transfer method.
According to the embodiment of the invention, whether the fragmented file exists in a preset file receiving end is inquired according to the fragmented transmission identifier and the file signature, and the fragmented file is marked with a transmitted label or a non-transmitted label according to an inquiry result; determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files; and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file. The files are segmented, and the segmented files are compared with the files in the file receiving end, so that the non-transmitted segmented files are screened out for transmission, all segmented files do not need to be transmitted, and the file transmission efficiency is improved. Therefore, the file transmission method, the file transmission device, the electronic equipment and the readable storage medium provided by the embodiment of the invention improve the file transmission efficiency.
Drawings
FIG. 1 is a flowchart illustrating a method for file transfer according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of a file transfer device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing a file transfer method according to an embodiment of the present invention;
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a file transmission method. The execution body of the file transmission method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the file transfer method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: the server can be an independent server, or can be a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
Referring to fig. 1, a flowchart of a file transfer method according to an embodiment of the present invention is shown, where in an embodiment of the present invention, the file transfer method includes:
s1, acquiring a file transmission request, and extracting a transmission file identifier in the file transmission request;
in the embodiment of the present invention, the file transmission request is a request for transmitting a certain file to a preset file receiving end, and the transmission file identifier is an identifier for identifying a file to be transmitted, which has uniqueness, for example: file name, file address. In the embodiment of the invention, the transmission file identification is not particularly limited.
S2, screening files in a preset file set according to the transmission file identification to obtain files to be transmitted;
in order to determine a file to be transmitted in the embodiment of the present invention, filtering a file in a preset file set according to the transmission file identifier to obtain a file to be transmitted, including:
acquiring a file identifier of each file in the file set, wherein the file identifier is the same as the transmission file identifier in type;
and determining the file with the same file identification as the transmission file identification as the file to be transmitted.
In the embodiment of the invention, in order to find the file to be transmitted as soon as possible, the file identification of each file in the file set is acquired, the file identification is compared with the transmission file identification, and the file which is identical to the file identification and the transmission file identification is determined as the transmission file.
Further, in the embodiment of the present invention, the file has multiple types of file identifiers, so in order to improve the comparison speed between the file identifier and the transmission file identifier, the type of the file identifier needs to be the same as the type of the transmission file identifier, for example: the transmission file is identified as a file name, then the file identification should be the file name of the file.
S3, sequentially segmenting the files to be transmitted to obtain a segmented file set;
in the embodiment of the invention, in order to increase the transmission speed of the file to be transmitted, the file to be transmitted is sequentially segmented to obtain the segmented file set.
In detail, in the embodiment of the present invention, the file to be transmitted is sequentially segmented to obtain a segmented file set, which includes:
splitting a file with a preset splitting threshold value from the file to be transmitted to obtain a splitting file;
for example: and the size of the file to be transmitted is 5kb, and the splitting threshold value is 1kb, so that the file with the size of 1kb is split from the file to be transmitted as a split file, and the size of the split file to be transmitted is 4kb.
Judging whether the size of the segmented file to be transmitted is larger than the segmentation threshold value or not;
when the size of the segmented file to be transmitted is larger than the segmentation threshold value, determining the segmented file to be transmitted as an updated file to be transmitted, and returning to the step of segmenting the file with the size of the preset segmentation threshold value from the file to be transmitted;
and when the size of the segmented file to be transmitted is not greater than the segmentation threshold, determining the segmented file to be transmitted as a segmented file, and summarizing all the segmented files to obtain the segmented file set.
In another embodiment of the present invention, the fragmented file may be stored in a blockchain node, and the efficiency of file access is improved by using the high throughput characteristic of the blockchain node.
S4, constructing a fragmented transmission identifier for each fragmented file according to the transmission file identifiers, the number of the fragmented files in the fragmented file set and the sequence of the fragmented file segmentation;
in order to better perform identification transmission on each segmented file in the embodiment of the present invention, according to the transmission file identification, the number of segmented files in the segmented file set, and the sequence of the segmented files, a segmented transmission identification is constructed for each segmented file, including:
determining the segmentation sequence of each segmented file as the segmentation sequence number of the segmented file;
for example: the slicing files are obtained by first slicing the files to be transmitted, the slicing sequence of the slicing files is 1, and the corresponding slicing sequence numbers are also 1.
Connecting the transmission file identifiers with the number of the segmented files in the segmented file set by using a preset first connection symbol to obtain basic transmission identifiers;
and connecting the slicing serial numbers corresponding to the slicing files with the basic transmission identifiers by using preset second connection symbols to obtain the slicing transmission identifiers corresponding to the slicing files. The connection symbol is not limited in the embodiment of the invention.
Further, in the embodiment of the present invention, the file name of the fragmented file is identified by the fragmented transmission identifier of the fragmented file.
S5, calculating a file signature of the fragmented file;
in the embodiment of the invention, in order to judge the integrity verification of each transmitted fragmented file, the file signature of the fragmented file needs to be utilized for verification, so that the file signature of the fragmented file is calculated.
In detail, in the embodiment of the present invention, the file signature of the fragmented file includes:
acquiring a pre-constructed signature function;
converting the fragmented file into binary data;
and calculating the binary data as the variable parameter of the signature function to obtain the file signature.
The signature function in the embodiment of the invention comprises, but is not limited to, an MD5 signature function and a hash signature function.
S6, inquiring whether the segmented file exists in a preset file receiving end according to the segmented transmission identifier and the file signature, and marking the segmented file with a transmitted label or a non-transmitted label according to an inquiry result;
in the embodiment of the invention, in order to judge whether the fragmented file is transmitted or not, the repeated transmission of the fragmented file is avoided, so that whether each fragmented file exists in a preset file receiving end or not is inquired according to the fragmented transmission identification and the file signature, and the fragmented file is marked with a transmitted label or a non-transmitted label according to the inquired result. The file receiving end is a terminal device with a data transmission function and a data storage function, and includes but is not limited to: a mobile phone, a computer, a server, etc.
Specifically, in the embodiment of the present invention, according to the fragment transmission identifier and the file signature, inquiring whether each fragment file exists in a preset file receiving end includes:
inquiring whether a file with a file name of the fragment transmission identifier exists in the file receiving end;
in this distributing embodiment, when the file receiving end receives the first fragmented file of the file to be transmitted, the file receiving end creates a folder named as the identifier of the transmitted file, then stores the received fragmented file in the created folder, and other subsequently received fragmented files of the file to be transmitted are also stored in the folder.
When the file name of the file which is the fragmented transmission identifier does not exist in the file receiving end, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end;
when the file name of the file exists in the file receiving end as the file of the fragment transmission identifier;
determining a file with the file name of the file receiving end as the fragmented transmission identifier as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragmented transmission identifier is consistent with the file signature of the fragmented file corresponding to the fragmented transmission identifier of the file;
when the comparison result is consistent, the fragmented files corresponding to the fragmented transmission identifiers exist in the file receiving end;
and if the comparison result is inconsistent, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end.
According to the embodiment of the invention, when the comparison result is inconsistent, the transmitted file corresponding to the fragmented transmission identifier is deleted from the file receiving end, so that the influence on the subsequent merging of the received fragmented files is avoided.
Further, in the embodiment of the present invention, marking the transmitted label or the untransmitted label with the fragmented file according to the query result includes:
when the query result of the fragmented file is that the fragmented file exists, marking the transmitted label of the fragmented file;
in the embodiment of the invention, when the query result of the segmented file is existing, the fact that the same segmented file exists at the file receiving end indicates that the segmented file is transmitted, so that the segmented file is marked with the transmitted label to identify that the segmented file is transmitted without repeated transmission.
And when the query result of the segmented file is nonexistent, marking the segmented file with a non-transmission label.
In the embodiment of the invention, when the query result of the segmented file is not present, the fact that the same segmented file does not exist at the file receiving end, that is, the segmented file is not transmitted, so that the segmented file is marked with a non-transmission tag for identifying that the segmented file is not transmitted and needs to be transmitted.
S7, determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files;
in the embodiment of the invention, the fragmented files marked with the transmitted labels represent that the same fragmented files exist at the file receiving end, and the corresponding fragmented files are transmitted; the fragmented files marked with the undelivered labels identify that the same fragmented files do not exist at the file receiving end and are required to be transmitted, so that the fragmented files marked with the undelivered labels in all the fragmented files are determined to be target transmission files.
And S8, transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing at the file receiving end to obtain a received file.
In the embodiment of the invention, all the target transmission files are transmitted to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain the received file.
Specifically, in the embodiment of the present invention, transmitting all the target transmission files to the file receiving end includes:
and acquiring the address of the file receiving end, constructing a transmission path according to the address, and transmitting all the target transmission files to the file receiving end according to the transmission path.
Further, after the transmission is completed in the embodiment of the present invention, the file receiving end extracts all characters on the left of the first connector in the file name of the target transmission file, so as to obtain the name of the target folder; determining a folder named as the target folder name in the file receiving end as a receiving folder; and merging all the files in the receiving folder to obtain the receiving file. Specifically, in the embodiment of the present invention, all files in the receiving folder are sequentially combined according to the number size on the right of the second connector in each file name, so as to obtain the receiving file, and the target folder is deleted.
As shown in fig. 2, a functional block diagram of the file transfer device of the present invention is shown.
The file transfer device 100 of the present invention may be installed in an electronic apparatus. Depending on the functions implemented, the file transfer device may include a file splitting module 101, a tag marking module 102, and a file transfer module 103, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and are stored in a memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the file splitting module 101 is configured to obtain a file transmission request, and extract a transmission file identifier in the file transmission request; screening files in a preset file set according to the transmission file identification to obtain files to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the tag marking module 102 is configured to construct a fragmented transmission identifier for each fragmented file according to the transmission file identifier, the number of fragmented files in the fragmented file set, and the sequence of splitting the fragmented files; calculating a file signature of the fragmented file; inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
the file transmission module 103 is configured to determine, as a target transmission file, a fragmented file marked with an undelivered tag in all the fragmented files; and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file.
In detail, each module in the file transmission device 100 in the embodiment of the present invention adopts the same technical means as the file transmission method described in fig. 1 and can produce the same technical effects when in use, and will not be described herein.
Fig. 3 is a schematic structural diagram of an electronic device for implementing the file transfer method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a file transfer program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may in other embodiments also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various types of data, such as codes of file transfer programs, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (e.g., file transfer programs, etc.) stored in the memory 11, and calling data stored in the memory 11.
The communication bus 12 may be a peripheral component interconnect standard (perIPheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure classification circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
Optionally, the communication interface 13 may comprise a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The file transfer program stored in the memory 11 in the electronic device is a combination of a plurality of computer programs, which when run in the processor 10, can realize:
acquiring a file transmission request, and extracting a transmission file identifier in the file transmission request;
screening files in a preset file set according to the transmission file identification to obtain files to be transmitted;
sequentially segmenting the files to be transmitted to obtain a segmented file set;
constructing a fragmented transmission identifier for each fragmented file according to the transmission file identifiers, the number of the fragmented files in the fragmented file set and the sequence of the fragmented file segmentation;
calculating a file signature of the fragmented file;
inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files;
and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file.
In particular, the specific implementation method of the processor 10 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the electronic device integrated modules/units, 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. The computer readable medium may be non-volatile or volatile. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a file transmission request, and extracting a transmission file identifier in the file transmission request;
screening files in a preset file set according to the transmission file identification to obtain files to be transmitted;
sequentially segmenting the files to be transmitted to obtain a segmented file set;
constructing a fragmented transmission identifier for each fragmented file according to the transmission file identifiers, the number of the fragmented files in the fragmented file set and the sequence of the fragmented file segmentation;
calculating a file signature of the fragmented file;
inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files;
and transmitting all the target transmission files to the file receiving end so that the file receiving end combines all the received target transmission files with all the fragmented files existing in the file receiving end to obtain a received file.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
In addition, each functional module 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 can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. A method of file transfer, the method comprising:
acquiring a file transmission request, and extracting a transmission file identifier in the file transmission request, wherein the transmission file identifier comprises a file name and a file address;
screening files in a preset file set according to the transmission file identification to obtain files to be transmitted;
sequentially segmenting the files to be transmitted to obtain a segmented file set;
determining the segmentation sequence of each segmented file as the segmentation sequence number of the segmented file, connecting the transmission file identifier with the number of segmented files in the segmented file set by using a preset first connection symbol to obtain a basic transmission identifier, and connecting the segmentation sequence number corresponding to the segmented file with the basic transmission identifier by using a preset second connection symbol to obtain a segmented transmission identifier corresponding to the segmented file;
obtaining a pre-constructed signature function, converting the fragmented file into binary data, and calculating the binary data as variable parameters of the signature function to obtain a file signature;
inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files;
transmitting all the target transmission files to the file receiving end, extracting all characters on the left of a first connector in the file names of all the target transmission files to obtain target folder names, determining a folder named as the target folder name in the file receiving end as a receiving folder, and merging all files in the receiving folder to obtain the receiving file.
2. The method for transmitting files according to claim 1, wherein the sequentially splitting the files to be transmitted to obtain a set of fragmented files includes:
splitting a file with a preset splitting threshold value from the file to be transmitted to obtain a splitting file;
judging whether the size of the segmented file to be transmitted is larger than the segmentation threshold value or not;
when the size of the segmented file to be transmitted is larger than the segmentation threshold value, determining the segmented file to be transmitted as an updated file to be transmitted, and returning to the step of segmenting the file with the size of the preset segmentation threshold value from the file to be transmitted;
and when the size of the segmented file to be transmitted is not greater than the segmentation threshold, determining the segmented file to be transmitted as a segmented file, and summarizing all the segmented files to obtain the segmented file set.
3. The method for transmitting files according to claim 1, wherein said querying whether the fragmented file exists in a preset file receiving terminal according to the fragmented transmission identifier and the file signature comprises:
inquiring whether a file with a file name of the fragment transmission identifier exists in the file receiving end;
when the file name of the file which is the fragmented transmission identifier does not exist in the file receiving end, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end;
when the file name of the file exists in the file receiving end as the file of the fragment transmission identifier;
determining a file with the file name of the file receiving end as the fragmented transmission identifier as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragmented transmission identifier is consistent with the file signature of the fragmented file corresponding to the fragmented transmission identifier of the file;
when the comparison result is consistent, the fragmented files corresponding to the fragmented transmission identifiers exist in the file receiving end;
and if the comparison result is inconsistent, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end.
4. The file transfer method as claimed in claim 1, wherein the marking the fragmented file with the transferred tag or the untransmitted tag according to the query result comprises:
when the query result of the fragmented file is that the fragmented file exists, marking the transmitted label of the fragmented file;
and when the query result of the segmented file is nonexistent, marking the segmented file with a non-transmission label.
5. The method for transmitting files according to claim 1, wherein said filtering files in a preset file set according to said transmission file identifier to obtain files to be transmitted comprises:
acquiring a file identifier of each file in the file set, wherein the file identifier is the same as the transmission file identifier in type;
and determining the file with the same file identification as the transmission file identification as the file to be transmitted.
6. A document transfer apparatus, comprising:
the file splitting module is used for acquiring a file transmission request and extracting a transmission file identifier in the file transmission request, wherein the transmission file identifier comprises a file name and a file address; screening files in a preset file set according to the transmission file identification to obtain files to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the label marking module is used for determining the segmentation sequence of each segmented file as the segmented sequence number of the segmented file, connecting the transmission file identifiers with the number of segmented files in the segmented file set by using a preset first connection symbol to obtain a basic transmission identifier, and connecting the segmented sequence number corresponding to the segmented file with the basic transmission identifier by using a preset second connection symbol to obtain a segmented transmission identifier corresponding to the segmented file; obtaining a pre-constructed signature function, converting the fragmented file into binary data, and calculating the binary data as variable parameters of the signature function to obtain a file signature; inquiring whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature, and marking the fragmented file with a transmitted label or a non-transmitted label according to an inquiry result;
the file transmission module is used for determining all the fragmented files marked with the undelivered labels in the fragmented files as target transmission files; transmitting all the target transmission files to the file receiving end, extracting all characters on the left of a first connector in the file names of all the target transmission files to obtain target folder names, determining a folder named as the target folder name in the file receiving end as a receiving folder, and merging all files in the receiving folder to obtain the receiving file.
7. The file transmission device according to claim 6, wherein the querying whether the fragmented file exists in a preset file receiving terminal according to the fragmented transmission identifier and the file signature includes:
inquiring whether a file with a file name of the fragment transmission identifier exists in the file receiving end;
when the file name of the file which is the fragmented transmission identifier does not exist in the file receiving end, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end;
when the file name of the file exists in the file receiving end as the file of the fragment transmission identifier;
determining a file with the file name of the file receiving end as the fragmented transmission identifier as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragmented transmission identifier is consistent with the file signature of the fragmented file corresponding to the fragmented transmission identifier of the file;
when the comparison result is consistent, the fragmented files corresponding to the fragmented transmission identifiers exist in the file receiving end;
and if the comparison result is inconsistent, the fragmented file corresponding to the fragmented transmission identifier does not exist in the file receiving end.
8. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file transfer method of any one of claims 1 to 5.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the file transfer method according to any one of claims 1 to 5.
CN202210592939.6A 2022-05-27 2022-05-27 File transmission method and device, electronic equipment and storage medium Active CN115002100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210592939.6A CN115002100B (en) 2022-05-27 2022-05-27 File transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210592939.6A CN115002100B (en) 2022-05-27 2022-05-27 File transmission method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115002100A CN115002100A (en) 2022-09-02
CN115002100B true CN115002100B (en) 2024-03-08

Family

ID=83029712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210592939.6A Active CN115002100B (en) 2022-05-27 2022-05-27 File transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115002100B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361754A (en) * 2018-11-05 2019-02-19 中国广核电力股份有限公司 A kind of document transmission method and device based on browser
CN109831506A (en) * 2019-01-31 2019-05-31 百度在线网络技术(北京)有限公司 File uploading method, device, terminal, server and readable storage medium storing program for executing
CN111935227A (en) * 2020-07-10 2020-11-13 上海淇毓信息科技有限公司 Method for uploading file through browser, browser and electronic equipment
CN112347042A (en) * 2020-11-05 2021-02-09 中国平安人寿保险股份有限公司 File uploading method and device, electronic equipment and storage medium
WO2021164178A1 (en) * 2020-02-21 2021-08-26 平安科技(深圳)有限公司 Cloud technology-based file fragment uploading method and apparatus, and device and storage medium
CN114338651A (en) * 2021-12-27 2022-04-12 中电金信软件有限公司 File transmission method and device, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9305069B2 (en) * 2010-02-09 2016-04-05 Google Inc. Method and system for uploading data into a distributed storage system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361754A (en) * 2018-11-05 2019-02-19 中国广核电力股份有限公司 A kind of document transmission method and device based on browser
CN109831506A (en) * 2019-01-31 2019-05-31 百度在线网络技术(北京)有限公司 File uploading method, device, terminal, server and readable storage medium storing program for executing
WO2021164178A1 (en) * 2020-02-21 2021-08-26 平安科技(深圳)有限公司 Cloud technology-based file fragment uploading method and apparatus, and device and storage medium
CN111935227A (en) * 2020-07-10 2020-11-13 上海淇毓信息科技有限公司 Method for uploading file through browser, browser and electronic equipment
CN112347042A (en) * 2020-11-05 2021-02-09 中国平安人寿保险股份有限公司 File uploading method and device, electronic equipment and storage medium
CN114338651A (en) * 2021-12-27 2022-04-12 中电金信软件有限公司 File transmission method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN115002100A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN113157927B (en) Text classification method, apparatus, electronic device and readable storage medium
CN112347042A (en) File uploading method and device, electronic equipment and storage medium
CN112653760A (en) Cross-server file transmission method and device, electronic equipment and storage medium
CN112418798A (en) Information auditing method and device, electronic equipment and storage medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN115002100B (en) File transmission method and device, electronic equipment and storage medium
CN115002062B (en) Message processing method, device, equipment and readable storage medium
CN114201466B (en) Anti-cache breakdown method, device, equipment and readable storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN113626605B (en) Information classification method, device, electronic equipment and readable storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN113656466A (en) Policy data query method, device, equipment and storage medium
CN114723400B (en) Service authorization management method, device, equipment and storage medium
CN113452703B (en) Combined communication request response method and device, electronic equipment and readable storage medium
CN114723488B (en) Course recommendation method and device, electronic equipment and storage medium
CN115174555A (en) File transmission method and device, electronic equipment and storage medium
CN113438221B (en) Local end file loading method and device, electronic equipment and medium
CN116339882B (en) Office system collaborative display method, device, equipment and medium based on Internet of things
CN113868285A (en) Data reading method and device, electronic equipment and storage medium
CN114942855A (en) Interface calling method and device, electronic equipment and storage medium
CN114006877A (en) Message transmission method and device, electronic equipment and storage medium
CN117294768A (en) Flow control method, device, equipment and medium based on application node grouping
CN115033605A (en) Data query method and device, electronic equipment and 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
TA01 Transfer of patent application right

Effective date of registration: 20240206

Address after: Room 1901, 19th Floor, Yanzhao Financial Center, No. 45 South Second Ring West Road, Shijiazhuang City, Hebei Province, 050093

Applicant after: Hebei Yanming Technology Co.,Ltd.

Country or region after: China

Address before: 518000 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant