CN115002100A - 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
CN115002100A
CN115002100A CN202210592939.6A CN202210592939A CN115002100A CN 115002100 A CN115002100 A CN 115002100A CN 202210592939 A CN202210592939 A CN 202210592939A CN 115002100 A CN115002100 A CN 115002100A
Authority
CN
China
Prior art keywords
file
fragment
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.)
Granted
Application number
CN202210592939.6A
Other languages
Chinese (zh)
Other versions
CN115002100B (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
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management 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

Images

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 a file 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 fragment file; inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and judging whether the fragment file is transmitted or not according to an inquiry result; and transmitting all the untransmitted fragmented files to the file receiving end. The invention also relates to a blockchain technology, and the fragment 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 file transmission method and apparatus, an electronic device, and a storage medium.
Background
With the gradual development of large data, the transmission of various data files becomes more and more common, and with the larger and larger volume of the transmitted files, the transmission of data takes longer and longer.
However, the existing file transmission method directly transmits the whole file, if the transmission is interrupted, the file needs to be retransmitted, and the efficiency of file transmission 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 the 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 a file 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 according to the transmission file identifier, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files;
calculating a file signature of the fragment file;
inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
determining the fragment files marked with the non-transmission labels in all the fragment files as target transmission files;
and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
Optionally, the sequentially segmenting the files to be transmitted to obtain a fragmented file set, including:
cutting out files with the size of a preset cutting threshold value from the files to be transmitted to obtain sliced files;
judging whether the size of the file to be transmitted after segmentation is larger than the segmentation threshold value or not;
when the size of the file to be transmitted after segmentation is larger than the segmentation threshold value, determining the file to be transmitted after segmentation as an updated file to be transmitted, and returning to the step of segmenting the file with the size of a preset segmentation threshold value from the file to be transmitted;
and when the size of the file to be transmitted after segmentation is not larger than the segmentation threshold value, determining the file to be transmitted after segmentation as a fragmented file, and summarizing all the fragmented files to obtain the fragmented file set.
Optionally, the querying whether the fragment file exists in a preset file receiving end according to the fragment transmission identifier and the file signature includes:
inquiring whether a file with a file name as the fragment transmission identification exists in the file receiving end;
when the file with the file name as the fragment transmission identifier does not exist in the file receiving terminal, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving terminal;
when a file with the file name as the fragment transmission identifier exists in the file receiving end;
determining the file with the file name as the fragment transmission identifier in the file receiving end as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragment transmission identifier is consistent with the file signature of the fragment file corresponding to the fragment transmission identifier of the file;
when the comparison result is consistent, the fragment file corresponding to the fragment transmission identifier exists in the file receiving end;
and when the comparison result is inconsistent, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end.
Optionally, the marking the fragmented file with a transmitted label or a non-transmitted label according to the query result includes:
when the query result of the fragment file is present, marking the fragment file with a transmitted label;
and when the query result of the fragment file does not exist, marking the fragment file with a non-transmission label.
Optionally, the screening, according to the file transmission identifier, files in a preset file set to obtain a 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 type of the transmission file identifier;
and determining the file with the file identification being the same as the transmission file identification as the file to be transmitted.
Optionally, the calculating a file signature of the fragmented file includes:
acquiring a pre-constructed signature function;
converting the fragmented file into binary data;
and calculating by taking the binary data as a variable parameter of the signature function to obtain the file signature.
In order to solve the above problem, the present invention also provides a file transfer apparatus, including:
the file fragmentation 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 a file to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the label marking module is used for constructing a fragment transmission identifier for each fragment file according to the transmission file identifier, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files; calculating a file signature of the fragment file; inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
the file transmission module is used for determining the fragment files marked with the untransmitted labels in all the fragment files as target transmission files; and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
Optionally, the querying whether the fragment file exists in a preset file receiving end according to the fragment transmission identifier and the file signature includes:
inquiring whether a file with a file name as the fragment transmission identification exists in the file receiving end;
when the file with the file name as the fragment transmission identifier does not exist in the file receiving terminal, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving terminal;
when a file with the file name as the fragment transmission identifier exists in the file receiving end;
determining the file with the file name as the fragment transmission identifier in the file receiving end as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragment transmission identifier is consistent with the file signature of the fragment file corresponding to the fragment transmission identifier of the file;
if the comparison result is consistent, the fragment file corresponding to the fragment transmission identifier exists in the file receiving end;
and when the comparison result is inconsistent, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the file transmission method.
In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the file transfer method described above.
According to the embodiment of the invention, whether the fragment file exists in a preset file receiving end is inquired according to the fragment transmission identification and the file signature, and the fragment file is marked with a transmitted label or a non-transmitted label according to the inquiry result; determining the fragment files marked with the non-transmission labels in all the fragment files as target transmission files; and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files. By segmenting the file, the segmented file is compared with the file in the file receiving end, so that the non-transmitted segmented file is screened out for transmission, all the 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 schematic flowchart of a file transmission method 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 internal structural diagram of an electronic device implementing a file transmission method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a file transmission method. The executing body of the file transmission method includes, but is not limited to, at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the file transfer method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: the cloud server can be an independent server, or can be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, which is a schematic flow diagram of a file transmission method according to an embodiment of the present invention, in an embodiment of the present invention, the file transmission 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, and has uniqueness, for example: file name, file address. The transmission file identifier in the embodiment of the present invention 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 the embodiment of the present invention, in order to determine a file to be transmitted, screening files in a preset file set according to the transmission file identifier to obtain a file to be transmitted, the method includes:
acquiring a file identifier of each file in the file set, wherein the file identifier is the same as the type of the transmission file identifier;
and determining the file with the file identification being the same 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 identifier of each file in the file set is obtained, the file identifier is compared with the transmission file identifier, and the file which is the same as the file identifier and the transmission file identifier is determined as the transmission file.
Further, in the embodiment of the present invention, the file has multiple types of file identifiers, and in order to increase 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 identifier is a file name, and then the file identifier 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 improve the transmission speed of the file to be transmitted, the file to be transmitted is sequentially segmented to obtain the fragmented file set.
In detail, in the embodiment of the present invention, sequentially segmenting the files to be transmitted to obtain a fragmented file set, including:
cutting out files with the size of a preset cutting threshold value from the files to be transmitted to obtain sliced files;
for example: the size of the file to be transmitted is 5kb, the segmentation threshold is 1kb, then the file with the size of 1kb is segmented from the file to be transmitted to serve as a segmented file, and the size of the segmented file to be transmitted is 4 kb.
Judging whether the size of the file to be transmitted after segmentation is larger than the segmentation threshold value or not;
when the size of the file to be transmitted after segmentation is larger than the segmentation threshold, determining the file to be transmitted after segmentation as an updated file to be transmitted, and returning to the step of segmenting the file with the size of a preset segmentation threshold from the file to be transmitted;
and when the size of the segmented file to be transmitted is not larger than the segmentation threshold value, determining the segmented file to be transmitted as a fragmented file, and summarizing all the fragmented files to obtain the fragmented file set.
In another embodiment of the invention, the fragment file can be stored in a block chain node, and the file taking efficiency is improved by using the characteristic of high throughput of the block chain node.
S4, constructing fragment transmission identifiers for each fragment file according to the transmission file identifiers, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files;
in order to better perform identifier transmission on each fragmented file, in the embodiment of the present invention, a fragment transmission identifier is constructed for each fragmented file according to the transmission file identifier, the number of fragmented files in the fragmented file set, and the sequence of the fragmented file fragments, and includes:
determining the segmentation sequence of each fragment file as the fragment sequence number of the fragment file;
for example: the fragmented files are obtained by first segmenting the file to be transmitted, the segmentation sequence of the fragmented files is 1, and the corresponding fragmentation sequence number is 1.
Connecting the transmission file identification with the number of the fragment files in the fragment file set by using a preset first connecting symbol to obtain a basic transmission identification;
and connecting the fragment serial number corresponding to the fragment file with the basic transmission identifier by using a preset second connection symbol to obtain the fragment transmission identifier corresponding to the fragment file. The connection symbol is not limited in the embodiment of the present invention.
Further, in the embodiment of the present invention, the fragment transmission identifier of the fragment file is a file name of the fragment file.
S5, calculating the file signature of the fragment file;
in the embodiment of the invention, in order to judge that each fragmented file after transmission is ensured to carry out integrity verification, the file signature of the fragmented file is required to be used for verification, so that the file signature of the fragmented file is calculated.
In detail, in the embodiment of the present invention, calculating the file signature of the fragmented file includes:
acquiring a pre-constructed signature function;
converting the fragmented file into binary data;
and calculating by taking the binary data as a variable parameter of the signature function to obtain the file signature.
The signature function in the embodiment of the present invention includes, but is not limited to, an MD5 signature function and a hash signature function.
S6, inquiring whether the fragment file exists in a preset file receiving end according to the fragment transmission identification and the file signature, and marking the fragment 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 fragment files are transmitted and avoid repeated transmission of the fragment files, whether each fragment file exists in a preset file receiving end is inquired according to the fragment transmission identification and the file signature, and the fragment files are marked with transmitted labels or non-transmitted labels according to the inquiry 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: mobile phones, computers, servers, etc.
Specifically, in the embodiment of the present invention, querying whether each 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 as the fragment transmission identification exists in the file receiving end;
in the distribution 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 transmission file identifier, then stores the received fragmented file in the created folder, and subsequently stores other fragmented files of the file to be transmitted in the folder.
When a file with the file name as the fragment transmission identifier does not exist in the file receiving end, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end;
when a file with the file name as the fragment transmission identifier exists in the file receiving end;
determining the file with the file name as the fragment transmission identifier in the file receiving end as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragment transmission identifier is consistent with the file signature of the fragment file corresponding to the fragment transmission identifier of the file;
when the comparison result is consistent, the fragment file corresponding to the fragment transmission identifier exists in the file receiving end;
and when the comparison result is inconsistent, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end.
In the embodiment of the invention, when the comparison result is inconsistent, the transmitted file corresponding to the fragment transmission identifier is deleted from the file receiving end, so that the influence on the subsequent combination of the received fragment files is avoided.
Further, in the embodiment of the present invention, the marking the fragmented file with a transmitted label or a non-transmitted label according to the query result includes:
when the query result of the fragment file is present, marking the fragment file with a transmitted label;
in the embodiment of the present invention, when the query result of the fragment file is that the fragment file already exists, it indicates that the same fragment file exists at the file receiving end, that is, the fragment file has already been transmitted, and therefore, the fragment file is marked with a transmitted label to identify that the fragment file has already been transmitted without repeated transmission.
And when the query result of the fragment file does not exist, marking the fragment file with a non-transmission label.
In the embodiment of the present invention, when the query result of the fragment file is that the fragment file does not exist, it indicates that the same fragment file does not exist at the file receiving end, that is, the fragment file has not been transmitted, and therefore, the fragment file is marked with an untransmitted tag to identify that the fragment file has not been transmitted yet and needs to be transmitted.
S7, determining the fragment files marked with the non-transmission labels in all the fragment files as target transmission files;
the fragment file marked with the transmitted label in the embodiment of the invention indicates that the same fragment file exists at the file receiving end and the corresponding fragment file is transmitted; the fragment file marked with the label which is not transmitted identifies that the same fragment file does not exist in the file receiving end and needs to be transmitted, so that the fragment file marked with the label which is not transmitted in all the fragment files is determined as a target transmission file.
And S8, transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
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 fragment files existing in the file receiving end to obtain the received files.
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 side of the first connector in the file name of the target transmission file to obtain the name of the target folder; determining a folder with the name of the target folder in the file receiving end as a receiving folder; and merging all 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 merged according to the size of the number on the right of the second connector in each file name to obtain the receiving file, and the target folder is deleted.
Fig. 2 is a functional block diagram of the file transfer device according to the present invention.
The file transmission device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the file transmission device may include a file fragmentation module 101, a label marking module 102, and a file transmission module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the file fragmentation 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 a file to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the label marking module 102 is configured to construct a fragment transmission identifier for each fragment file according to the transmission file identifier, the number of fragment files in the fragment file set, and the segmentation order of the fragment files; calculating a file signature of the fragment file; inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
the file transmission module 103 is configured to determine a fragment file marked with an untransmitted tag in all the fragment files as a target transmission file; and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
In detail, when the modules in the file transmission device 100 according to the embodiment of the present invention are used, the same technical means as the file transmission method described in fig. 1 are used, and the same technical effects can be produced, which is not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device 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, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, 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 to store application software installed in the electronic device and various types of data, such as codes of a file transfer program, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by 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 (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply 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 realized through the power management device. The power source may also include any component of one or more dc or ac power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or 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 device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The file transfer program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, and when running 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 a file 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 according to the transmission file identifier, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files;
calculating a file signature of the fragment file;
inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
determining the fragment files marked with the non-transmission labels in all the fragment 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 and all the fragment files existing in the file receiving end to obtain the received files.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, 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 said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program 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 fragment transmission identifier for each fragment file according to the transmission file identifier, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files;
calculating a file signature of the fragment file;
inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
determining the fragment files marked with the non-transmission labels in all the fragment files as target transmission files;
and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
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 according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
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 attributes 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 block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for file transfer, the method comprising:
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 fragment transmission identifier for each fragment file according to the transmission file identifier, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files;
calculating a file signature of the fragment file;
inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking the transmitted label or the untransmitted label on the fragment file according to an inquiry result;
determining the fragment files marked with the non-transmission labels in all the fragment 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 and all the fragment files existing in the file receiving end to obtain the received files.
2. The file transmission method according to claim 1, wherein the sequentially segmenting the files to be transmitted to obtain a fragmented file set includes:
cutting out files with the size of a preset cutting threshold value from the files to be transmitted to obtain sliced files;
judging whether the size of the file to be transmitted after segmentation is larger than the segmentation threshold value or not;
when the size of the file to be transmitted after segmentation is larger than the segmentation threshold, determining the file to be transmitted after segmentation as an updated file to be transmitted, and returning to the step of segmenting the file with the size of a preset segmentation threshold from the file to be transmitted;
and when the size of the segmented file to be transmitted is not larger than the segmentation threshold value, determining the segmented file to be transmitted as a fragmented file, and summarizing all the fragmented files to obtain the fragmented file set.
3. The file transmission method according to claim 1, wherein said querying whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature comprises:
inquiring whether a file with a file name as the fragment transmission identification exists in the file receiving end;
when a file with the file name as the fragment transmission identifier does not exist in the file receiving end, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end;
when a file with the file name as the fragment transmission identifier exists in the file receiving end;
determining the file with the file name as the fragment transmission identifier in the file receiving end as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragment transmission identifier is consistent with the file signature of the fragment file corresponding to the fragment transmission identifier of the file;
when the comparison result is consistent, the fragment file corresponding to the fragment transmission identifier exists in the file receiving end;
and when the comparison result is inconsistent, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end.
4. The file transmission method according to claim 1, wherein said marking the fragmented file with a transmitted label or a non-transmitted label according to the query result comprises:
when the query result of the fragment file is present, marking the fragment file with a transmitted label;
and when the query result of the fragment file does not exist, marking the fragment file with an untransmitted label.
5. The file transmission method according to claim 1, wherein the screening the files in the preset file set according to the transmission file identifier to obtain the file to be transmitted comprises:
acquiring a file identifier of each file in the file set, wherein the file identifier is the same as the type of the transmission file identifier;
and determining the file with the file identification being the same as the transmission file identification as the file to be transmitted.
6. The file transmission method according to any one of claims 1 to 6, wherein said calculating a file signature of the fragmented file comprises:
acquiring a pre-constructed signature function;
converting the fragmented file into binary data;
and calculating by taking the binary data as a variable parameter of the signature function to obtain the file signature.
7. A file transfer apparatus, comprising:
the file fragmentation 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 a file to be transmitted; sequentially segmenting the files to be transmitted to obtain a segmented file set;
the label marking module is used for constructing fragment transmission identifiers for each fragment file according to the transmission file identifiers, the number of fragment files in the fragment file set and the segmentation sequence of the fragment files; calculating a file signature of the fragment file; inquiring whether the fragment file exists in a preset file receiving end or not according to the fragment transmission identification and the file signature, and marking a transmitted label or a non-transmitted label on the fragment file according to an inquiry result;
the file transmission module is used for determining the fragment files marked with the untransmitted labels in all the fragment files as target transmission files; and transmitting all the target transmission files to the file receiving terminal so that the file receiving terminal combines all the received target transmission files and all the fragment files existing in the file receiving terminal to obtain the received files.
8. The apparatus for file transmission according to claim 7, wherein said querying whether the fragmented file exists in a preset file receiving end according to the fragmented transmission identifier and the file signature comprises:
inquiring whether a file with a file name as the fragment transmission identification exists in the file receiving end;
when a file with the file name as the fragment transmission identifier does not exist in the file receiving end, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end;
when a file with the file name as the fragment transmission identifier exists in the file receiving end;
determining the file with the file name as the fragment transmission identifier in the file receiving end as a transmitted file;
comparing whether the file signature of the transmitted file corresponding to the fragment transmission identifier is consistent with the file signature of the fragment file corresponding to the fragment transmission identifier of the file;
when the comparison result is consistent, the fragment file corresponding to the fragment transmission identifier exists in the file receiving end;
and when the comparison result is inconsistent, the fragment file corresponding to the fragment transmission identifier does not exist in the file receiving end.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the file transfer method of any of claims 1 to 6.
10. 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 6.
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 true CN115002100A (en) 2022-09-02
CN115002100B 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110196822A1 (en) * 2010-02-09 2011-08-11 Yonatan Zunger Method and System For Uploading Data Into A Distributed Storage System
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110196822A1 (en) * 2010-02-09 2011-08-11 Yonatan Zunger Method and System For Uploading Data Into A Distributed Storage System
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
CN115002100B (en) 2024-03-08

Similar Documents

Publication Publication Date Title
CN112653760B (en) Cross-server file transmission method and device, electronic equipment and storage medium
CN112347042A (en) File uploading 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
CN114185895A (en) Data import and export method and device, electronic equipment and 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
CN115002062B (en) Message processing method, device, equipment and readable storage medium
CN115002100B (en) File transmission method and device, electronic equipment and storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN114157634A (en) Unique account identification method, device, equipment and storage medium
CN113364848A (en) File caching method and device, electronic equipment and storage medium
CN115174555A (en) File transmission method and device, electronic equipment and storage medium
CN113452785B (en) Service access method and device based on offline resources, electronic equipment and medium
CN113438221B (en) Local end file loading method and device, electronic equipment and medium
CN113452703B (en) Combined communication request response method and device, electronic equipment and readable storage medium
CN115033605A (en) Data query 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
CN113868285A (en) Data reading method and device, electronic equipment and storage medium
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium
CN115226256A (en) Data switching method and device, electronic equipment and storage medium
CN115033510A (en) Component communication method, device, electronic device and storage medium
CN113568904A (en) Work submission method and device, electronic device and 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
TA01 Transfer of patent application right
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

GR01 Patent grant
GR01 Patent grant