CN111783123A - File processing method, device, equipment and storage medium - Google Patents

File processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111783123A
CN111783123A CN202010638864.1A CN202010638864A CN111783123A CN 111783123 A CN111783123 A CN 111783123A CN 202010638864 A CN202010638864 A CN 202010638864A CN 111783123 A CN111783123 A CN 111783123A
Authority
CN
China
Prior art keywords
file
fragment
fragmented
fragmentation
files
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.)
Withdrawn
Application number
CN202010638864.1A
Other languages
Chinese (zh)
Inventor
缪练
梁志婷
徐世超
徐浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Minglue Artificial Intelligence Group Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group 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 Shanghai Minglue Artificial Intelligence Group Co Ltd filed Critical Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202010638864.1A priority Critical patent/CN111783123A/en
Publication of CN111783123A publication Critical patent/CN111783123A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The application provides a file processing method, a file processing device, file processing equipment and a storage medium, and relates to the technical field of data encryption. The file processing method comprises the following steps: carrying out fragmentation processing on an original file to obtain a plurality of fragmented files; adding fragment information of each fragment file into a file header of each fragment file; and uploading each fragmented file added with the file header to a server. According to the method, the original file is subjected to fragmentation processing, and unique fragmentation information is added to each obtained fragmentation file, so that the fragmentation file added with the fragmentation information is uploaded to a server, and uploading of the original file is achieved.

Description

File processing method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of data encryption, in particular to a file processing method, a file processing device, file processing equipment and a storage medium.
Background
For some files generated on a terminal device (e.g., a mobile phone terminal, a recording pen, etc.), the files generated on the terminal device are uploaded to a server for analysis, playing, downloading, and the like. The protocol of file transfer is usually performed by http protocol, or custom tcp protocol. During the process of transmitting the file, a certain measure is usually adopted to protect the file so as to prevent the file from being intercepted.
In the prior art, when a terminal device sends a request to a server, a user name and a password are provided to ensure that a transmitted file cannot be read correctly after being intercepted, so as to protect the file.
However, in the above prior art method, when the connection between the terminal and the server is not trusted, the key and the password transmitted in the clear text are easily intercepted, which may cause the file to be threatened.
Disclosure of Invention
The present invention provides a file processing method, device, apparatus and storage medium, so as to solve the problem of poor security during file transmission in the prior art.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a file processing method, including:
carrying out fragmentation processing on an original file to obtain a plurality of fragmented files;
adding fragment information of the fragment files into a file header of each fragment file;
and uploading each fragment file added with the file header to a server.
Optionally, the performing fragmentation processing on the original file to obtain a plurality of fragmented files includes:
and according to the preset byte size, carrying out fragmentation processing on the original file to obtain a plurality of fragment files, wherein the size of each fragment file is the preset byte size.
Optionally, the performing fragmentation processing on the original file according to a preset byte size to obtain the multiple fragmented files includes:
determining whether the byte size of the original file is greater than or equal to the preset byte size;
and if so, carrying out fragmentation processing on the original file according to the size of the preset bytes to obtain the plurality of fragmented files.
Optionally, the fragmentation information includes: the sequence number of the fragment file and the size of the fragment file;
adding the fragmentation information of the fragmentation file in the file header of each fragmentation file comprises:
and adding the sequence number of the fragment file in a first preset byte in the file header of each fragment file, and adding the size of the fragment file in a second preset byte.
Optionally, the fragmentation information further includes: the total number of the fragmented files, adding the fragmentation information of the fragmented files in the file header of each fragmented file, further includes:
and adding the total number of the fragment files in a third preset byte in the file header of each fragment file.
Optionally, the fragmentation information further includes: the information digest value of the fragmented file, adding the fragmented information of the fragmented file to the file header of each fragmented file, further includes:
and adding the information digest value of the fragment file in a fourth preset byte in the file header of each fragment file.
Optionally, uploading each fragmented file to which the file header is added to a server, includes:
uploading each fragment file added with the file header to the server through a preset protocol, so that the server analyzes each fragment file according to the preset protocol and combines the fragment files to obtain the original file.
In a second aspect, an embodiment of the present application further provides a file processing apparatus, including: the system comprises a processing module, an adding module and an uploading module;
the processing module is used for carrying out fragmentation processing on the original file to obtain a plurality of fragmented files;
the adding module is used for adding the fragment information of the fragment files in the file header of each fragment file;
and the uploading module is used for uploading each fragment file added with the file header to a server.
Optionally, the processing module is specifically configured to perform fragmentation processing on the original file according to a preset byte size to obtain the multiple fragmented files, where the size of each fragmented file is the preset byte size.
Optionally, the processing module is specifically configured to determine whether a byte size of the original file is greater than or equal to the preset byte size; and if so, carrying out fragmentation processing on the original file according to the size of the preset bytes to obtain the plurality of fragmented files.
Optionally, the fragmentation information includes: the sequence number of the fragment file and the size of the fragment file;
the adding module is specifically configured to add the sequence number of the fragmented file in a first preset byte in a file header of each fragmented file, and add the size of the fragmented file in a second preset byte.
Optionally, the fragmentation information further includes: the total number of the fragmented files;
the adding module is specifically configured to add the total number of the fragmented files to a third preset byte in a file header of each fragmented file.
Optionally, the fragmentation information further includes: the information abstract value of the fragment file;
the adding module is specifically configured to add the information digest value of the fragmented file to a fourth preset byte in the file header of each fragmented file.
Optionally, the uploading module is specifically configured to upload each fragmented file to which the file header is added to the server through a preset protocol, so that the server parses each fragmented file according to the preset protocol, and combines the fragmented files to obtain the original file.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the file processing method as provided in the first aspect when executed.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the file processing method as provided in the first aspect.
The beneficial effect of this application is:
the embodiment of the application provides a file processing method, a file processing device, equipment and a storage medium, wherein the method comprises the following steps: carrying out fragmentation processing on an original file to obtain a plurality of fragmented files; adding fragment information of each fragment file into a file header of each fragment file; and uploading each fragmented file added with the file header to a server. According to the method, the original file is subjected to fragmentation processing, and unique fragmentation information is added to each obtained fragmentation file, so that the fragmentation file added with the fragmentation information is uploaded to a server, and uploading of the original file is achieved.
In addition, the fragmentation information is added to the fragmentation file, so that the addition of extra information during file transmission can be avoided, the data transmission quantity can be effectively reduced, and the file transmission efficiency is improved.
Finally, through protocol transmission, the security of information acquisition between the terminal equipment and the server can be ensured, and other third-party equipment is prevented from illegally acquiring file information, so that the file is protected in the file transmission process.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a diagram of exemplary hardware and software components of a processing device that may implement the concepts of the present application, as provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a file processing method according to an embodiment of the present application;
fig. 3 is a diagram of a file fragmentation processing architecture according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating another document processing method according to an embodiment of the present application;
FIG. 5 is a schematic view of a document processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Before the proposal of the present application is made, in the prior art, in the process of transmitting a file, in HTTP, Basic access authentication (Basic access authentication) is a login verification method for allowing a web browser or other client program to provide an identity credential in the form of a user name and a password when requesting the file transmission, before the file transmission, a colon is added to the user name and then the password is concatenated, and the obtained result character string is encoded by using the Base64 algorithm. For example, if the user name provided is adadin and the password is open session, the result after splicing is that adadin is openeseme, and then the result is encoded by Base64, so as to obtain QWxhZGRpbjpvcGVuIHNlc2FtZQ ═ qwzq. And finally, sending out the character string coded by the Base64, decoding by the server to obtain a character string of a user name and a password separated by a colon, and acquiring a corresponding file according to the password.
However, while basic authentication is very easy to implement, this approach is based on the following assumptions: the connection between the client and the server host is secure and trusted. In particular, if transport layer security protocols such as SSL/TLS are not used, keys and passwords transmitted in the clear can be easily intercepted, resulting in the file being intercepted.
Fig. 1 is a schematic diagram of exemplary hardware and software components of a processing device that can implement the concepts of the present application according to an embodiment of the present application. For example, the processor 220 may be used on the electronic device 200 and to perform the functions herein. The electronic device 200 may be a general purpose computer or a special purpose computer, both of which may be used to implement the document processing method of the present application. Although only a single computer is shown, for convenience, the functions described herein may be implemented in a distributed fashion across multiple similar platforms to balance processing loads.
For example, the electronic device 200 may include a network port 210 connected to a network, one or more processors 220 for executing program instructions, a communication bus 230, and a different form of storage medium 240, such as a disk, ROM, or RAM, or any combination thereof. Illustratively, the computer platform may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application may be implemented in accordance with these program instructions. The electronic device 200 also includes an Input/Output (I/O) interface 250 between the computer and other Input/Output devices (e.g., keyboard, display screen).
For ease of illustration, only one processor is depicted in the electronic device 200. However, it should be noted that the electronic device 200 in the present application may also comprise a plurality of processors, and thus the steps performed by one processor described in the present application may also be performed by a plurality of processors in combination or individually. For example, if the processor of the electronic device 200 executes steps a and B, it should be understood that steps a and B may also be executed by two different processors together or separately in one processor. For example, a first processor performs step a and a second processor performs step B, or the first processor and the second processor perform steps a and B together.
The following describes specific implementation steps, principles and beneficial effects of the program anti-aliasing processing method according to the present application by using various embodiments.
Fig. 2 is a schematic flowchart of a file processing method according to an embodiment of the present application; fig. 3 is a diagram of a file fragmentation processing architecture according to an embodiment of the present application. The execution main body of the scheme of the application can be terminal equipment or a server. In some cases, when the file to be transmitted is a voice file in the ogg format, the voice file is mostly generated on the terminal device, for example: generated in a mobile phone or a recording pen, etc. Then, the terminal device can process the generated file by using the file processing method of the application, and send the processed file to the server for file analysis, file playing, file downloading and the like. In other cases, when other terminal devices request to obtain the target file from the server, the server may also process the target file by using the file processing method of the present application, and transmit the processed file to the corresponding terminal device.
Alternatively, as shown in fig. 2, the method of the present application may include:
s101, carrying out fragmentation processing on the original file to obtain a plurality of fragmented files.
In the present application, the original file may be a file in any format, for example: an ogg format file, an APE format file, an MPEG file format, etc.
Optionally, the original file is sliced, that is, the original file is divided into a plurality of subfiles. The size of the fragment can be set by self-definition according to actual requirements, and can also be adjusted adaptively.
And S102, adding the fragment information of the fragment file in the file header of each fragment file.
Optionally, a private protocol may be added in the header of each fragmented file, where the protocol content of the private protocol may be fragmentation information of the fragmented file, and the fragmentation information of each fragmented file may be unique. By adding corresponding fragmentation information to each fragmentation file, protection of each fragmentation file can be realized.
It should be noted that, by adopting fragmentation processing, fragmentation information is added for each fragmented file, and multiple fragmented files can be processed in parallel, which can reduce the performance consumption of the device and improve the processing efficiency of the file. On the other hand, the protection performance of the original file can be effectively improved, even if part of the fragmented files are intercepted, the complete original file still cannot be obtained, and the original file is prevented from being leaked.
As shown in fig. 3, the original file is divided into a plurality of fragmented files, each of which is composed of fragmentation information and a file stream, and the fragmentation information is added to the file stream header. Wherein, a file stream may refer to the file content of a fragmented file. Therefore, the fragmented files are protected through the fragmented information, and the original files are protected.
And S103, uploading each fragmented file added with the file header to a server.
Optionally, each fragmented file to which the header file is added may be packaged and uploaded to the server in batch, or each fragmented file may be independently uploaded to the server according to the time when the header file is added to each fragmented file. The uploading of the original file is realized in the form of uploading the fragmented file, so that the transmission safety of the original file can be improved, and the original file is protected.
To sum up, the file processing method provided by this embodiment includes: carrying out fragmentation processing on an original file to obtain a plurality of fragmented files; adding fragment information of each fragment file into a file header of each fragment file; and uploading each fragmented file added with the file header to a server. According to the method, the original file is subjected to fragmentation processing, and unique fragmentation information is added to each obtained fragmentation file, so that the fragmentation file added with the fragmentation information is uploaded to a server, and uploading of the original file is achieved.
Optionally, in step S101, performing fragmentation processing on the original file to obtain a plurality of fragmented files, which may include: and according to the preset byte size, carrying out fragmentation processing on the original file to obtain a plurality of fragment files, wherein the size of each fragment file is the preset byte size.
In an implementation manner, the original file may be fragmented according to a predetermined byte size, and the original file is divided into a plurality of files with the same size.
The byte size may be preset according to the original file size. For example: when the size of the original file meets the first threshold value, the byte size can be set to be the first byte size, so that the original file is subjected to fragmentation processing according to the first byte size, and a plurality of fragmented files are obtained. And when the size of the original file meets the second threshold value but is smaller than the first threshold value, the byte size can be set to be the second byte size, so that the original file can be subjected to fragmentation processing according to the second byte size to obtain a plurality of fragmented files.
Generally, the first byte size may be set to 65535 bytes and the second byte size may be set to 258 bytes. For example, when the original file size is 10M, the original file may be divided into 161 fragmented files according to 65535 byte size.
It should be noted that, for a plurality of fragmented files obtained by fragmentation, since the size of the original file and the size of the preset byte are fixed, there may be a case where the size of one fragmented file in the plurality of fragmented files is smaller than the size of the preset byte, but adding fragmentation information to the fragmented file is not affected.
In the embodiment, the original file is uniformly fragmented by adopting the preset byte size, and the fragmentation is not performed in a file stream format, so that the obtained fragmented file only contains one part of the complete fragmented stream, the head and the tail of the file stream are effectively separated, and the file content of the fragmented file cannot be correctly analyzed and obtained even if part of the fragmented file is stolen in the file transmission process.
Fig. 4 is a flowchart of another file processing method provided in the embodiment of the present application, and optionally, as shown in fig. 4, in the foregoing step, the fragmenting an original file according to a preset byte size to obtain multiple fragmented files may include:
s201, determining whether the byte size of the original file is larger than or equal to a preset byte size.
Optionally, when the original file is subjected to the fragmentation processing, it may be determined whether the size of the original file meets a preset condition, so that the fragmentation processing is performed on the original file meeting the preset condition.
Generally, whether the byte size of the original file is larger than or equal to the preset byte size can be judged according to the byte size of the original file and the preset byte size, and when the original file is too small and does not meet the fragmentation condition, the fragmentation processing of the original file has no practical significance.
And S202, if so, carrying out fragmentation processing on the original file according to the preset byte size to obtain a plurality of fragmented files.
When the byte size of the original file meets the preset byte size, the original file is fragmented according to the preset byte size as described above.
Optionally, the fragmentation information in step S102 may include: the sequence number of the fragment file and the size of the fragment file; step S102, adding the fragmentation information of the fragmented file in the file header of each fragmented file, which may include: and adding the sequence number of the fragment file in a first preset byte in the file header of each fragment file, and adding the size of the fragment file in a second preset byte.
In this embodiment, the fragmentation information of the fragmentation file is unique, and the fragmentation information of each fragmentation file may be determined according to the file size and the file content of each fragmentation file.
In an implementation manner, the fragmentation information may include a sequence number of the fragmentation file and a size of the fragmentation file, and then the fragmentation information may be added in a file header of the fragmentation file according to a preset rule according to the sequence number of the fragmentation file and the size of the fragmentation file.
Optionally, the sequence number of the fragmented file may also refer to a file sequence of the fragmented file corresponding to the original file, for example, the original file is formed by combining 1, 2, and 3 files in sequence, and then the sequence numbers of the three files also correspond to 1, 2, and 3 in sequence.
In the following, a method for acquiring the serial number of the fragmented file is first described: when the original file is sliced, a plurality of sliced files with consecutive numbers can be obtained by slicing, as shown in fig. 3, a sliced file 1, a sliced file 2 …, a sliced file n, and the like. And taking the number as the serial number of each fragment file according to the number corresponding to each fragment file.
Optionally, in this embodiment, a sequence number of the fragmented file may be added to a first preset byte in a file header of the fragmented file, and a size of the fragmented file may be added to a second preset byte in the file header. The first preset byte and the second preset byte may be one byte or two bytes, and may be specifically set according to a protocol rule of a private protocol.
For example: when the sequence number of the fragmentation file and the size of the fragmentation file set in the protocol rule are represented by 16-bit characters, the first preset byte may be two bytes so as to enable the complete addition of the sequence number of the fragmentation file and the size of the fragmentation file, and when the sequence number of the fragmentation file and the size of the fragmentation file set in the protocol rule are represented by 8-bit characters, the first preset byte may be one byte sufficient for the complete addition of the sequence number of the fragmentation file and the size of the fragmentation file.
It should be noted that the arrangement order of the first preset byte and the second preset byte may be arbitrarily adjusted, for example: taking the first preset byte and the second preset byte as two bytes, the first byte and the second byte add the sequence number of the fragmented file in the file header of the fragmented file, and the size of the fragmented file is added in the third byte and the fourth byte. Alternatively, the size of the slice file may be added to the first byte and the second byte, and the sequence number of the slice file may be added to the third byte and the fourth byte. The adding sequence of different fragmentation information is not specifically limited in the present application.
Optionally, the fragmentation information in step S102 may further include: the total number of the fragmented files, in step S102, adding the fragmentation information of the fragmented files in the file header of each fragmented file, which may further include: and adding the total number of the fragmented files in a third preset byte in the file header of each fragmented file.
The total number of the fragmented files, that is, the number of fragmented files obtained by performing fragmentation processing on the original file, is described. In this embodiment, the total number of fragmented files is not greater than 255. The total number of the fragmented files and the size of the fragmented files are corresponding to each other, and the total number of the fragmented files is used as one of the fragmented information, so that the transmission safety of the fragmented files can be further improved.
It should be noted that the total number of the fragmented files is usually less than 8-bit characters, and therefore, in this embodiment, the third preset byte may be one byte, which is used to add the total number of the fragmented files.
Similar to the above, the arrangement order of the first preset byte, the second preset byte and the third preset byte can be adjusted at will, and the application does not limit the arrangement order.
Optionally, the slicing information in step S102 may further include: the information digest value of the fragmented file, in step S102, adding the fragmentation information of the fragmented file in the file header of each fragmented file, which may further include: and adding the information digest value of the fragment file in the fourth preset byte in the file header of each fragment file.
In some implementations, the shard information of the shard file may further include an information digest value of each shard file, where the information digest value is associated with the file content of each shard file, and each shard file has a unique information digest value.
The information abstract value of the fragment file is mainly used for checking the integrity of the file, is not an abbreviation of the file content of the fragment file, but is a feature code obtained by performing mathematical transformation on the original fragment file according to a disclosed algorithm. This signature has the following properties, firstly it is irreversible, for example with a secret text such as: "xxxx" is transformed by an algorithm to obtain a feature code (xxxxxxx), and the feature code is informed to other people, so that the file content of the fragmented file can be determined according to the feature code.
In this embodiment, the information digest value may be an MD5 value, but is not limited to the MD5 value in practical application, and may also be an MD2 value, an MD4 value, or the like. Because the MD5 value is a 128-bit (bit) feature code, and the character string is long, the probability that the MD5 values corresponding to any two files are the same is extremely low, and the uniqueness of the files is ensured. Through the verification of the information abstract value, the complete fragment file can be effectively acquired.
Optionally, in this embodiment, the information digest value is expressed by an MD5 value, and then, the corresponding fourth preset byte may be 16 bytes, so as to be able to completely add the information digest value of the fragmented file.
Similarly, the arrangement order of the first preset byte, the second preset byte, the third preset byte and the fourth preset byte is not unique, that is, in the fragmentation information of the fragmentation file, the sequence number of the fragmentation file, the size of the fragmentation file, the total number of the fragmentation file and the information digest value of the fragmentation file may be arranged according to any rule. For example: the sequence numbers of the first byte and the second byte adding fragmentation files, the sizes of the third byte and the fourth byte adding fragmentation files, the total number of the fifth byte adding fragmentation files and the information digest values of the sixth byte to the 21 st byte adding fragmentation files. Or the sizes of the first byte and the second byte adding fragmentation files, the sequence numbers of the third byte and the fourth byte adding fragmentation files, the information summary values of the fifth byte to the 20 th byte adding fragmentation files, the total number of the 21 st byte adding fragmentation files and the like.
The different adding sequences of the fragment information have the same protection effect on the fragment files, the stealing of the original file can be effectively prevented by adding the fragment information to the fragment files, and even if all the fragment files are stolen, the complete file content can not be obtained by analyzing because the meaning of each byte in the added fragment information is not public, so that the effective protection of the file is realized.
Optionally, in this application, adding fragmentation information to each fragmentation file, where the fragmentation information is information related to the fragmentation file, may avoid adding additional information during file transmission, for example: and information such as user names, file passwords and the like does not need to be added. Therefore, the data transmission quantity can be effectively reduced, and the file transmission efficiency is improved.
Optionally, in step S103, uploading each fragmented file to which the file header is added to the server may include: uploading each fragment file added with the file header to a server through a preset protocol, so that the server analyzes each fragment file according to the preset protocol and combines the fragment files to obtain an original file.
Optionally, when uploading each fragmented file to which the header file is added to the server, the fragmented file may be uploaded according to a preset protocol, so that the server may parse each fragmented file according to a meaning represented by each byte in the header file specified in the protocol, and combine and restore the multiple fragmented files according to a sequence number of each fragmented file to obtain an original file.
It should be noted that the preset protocol may be an http transmission protocol, and through protocol transmission, security of information acquisition between the terminal device and the server may be ensured, and illegal acquisition of file information by other third-party devices may be avoided, so as to protect files during file transmission.
To sum up, the file processing method provided by the embodiment of the present application includes: carrying out fragmentation processing on an original file to obtain a plurality of fragmented files; adding fragment information of each fragment file into a file header of each fragment file; and uploading each fragmented file added with the file header to a server. According to the method, the original file is subjected to fragmentation processing, and unique fragmentation information is added to each obtained fragmentation file, so that the fragmentation file added with the fragmentation information is uploaded to a server, and uploading of the original file is achieved.
In addition, the fragmentation information is added to the fragmentation file, so that the addition of extra information during file transmission can be avoided, the data transmission quantity can be effectively reduced, and the file transmission efficiency is improved.
Finally, through protocol transmission, the security of information acquisition between the terminal equipment and the server can be ensured, and other third-party equipment is prevented from illegally acquiring file information, so that the file is protected in the file transmission process.
The following describes a device, an apparatus, a storage medium, and the like for executing the file processing method provided in the present application, and specific implementation procedures and technical effects thereof are referred to above, and are not described again below.
Fig. 5 is a schematic diagram of a document processing apparatus according to an embodiment of the present application, where functions implemented by the document processing apparatus correspond to steps executed by the foregoing method. The apparatus may be understood as the terminal device, or may be understood as a component that is independent from the terminal device and implements the functions of the present application under the control of the server, and optionally, as shown in fig. 5, the file processing apparatus may include: a processing module 501, an adding module 502 and an uploading module 503;
the processing module 501 is configured to perform fragmentation processing on an original file to obtain a plurality of fragmented files;
an adding module 502, configured to add fragmentation information of a fragmented file in a file header of each fragmented file;
an uploading module 503, configured to upload each fragmented file to which the file header is added to the server.
Optionally, the processing module 501 is specifically configured to perform fragmentation processing on an original file according to a preset byte size to obtain multiple fragmented files, where the size of each fragmented file is the preset byte size.
Optionally, the processing module 501 is specifically configured to determine whether the byte size of the original file is greater than or equal to a preset byte size; and if so, carrying out fragmentation processing on the original file according to the preset byte size to obtain a plurality of fragmented files.
Optionally, the fragmentation information includes: the sequence number of the fragment file and the size of the fragment file;
the adding module 502 is specifically configured to add a sequence number of the fragmented file in a first preset byte in a file header of each fragmented file, and add the size of the fragmented file in a second preset byte.
Optionally, the fragmentation information further includes: the total number of fragmented files;
the adding module 502 is specifically configured to add the total number of the fragmented files in a third preset byte in the file header of each fragmented file.
Optionally, the fragmentation information further includes: the information abstract value of the fragment file;
the adding module 502 is specifically configured to add an information digest value of each fragmented file in a fourth preset byte in a file header of each fragmented file.
Optionally, the uploading module 503 is specifically configured to upload each fragmented file to which the file header is added to the server through a preset protocol, so that the server parses each fragmented file according to the preset protocol, and combines the fragmented files to obtain an original file.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device may be integrated in a terminal device or a chip of the terminal device, and the terminal may be a computing device with a data processing function.
The apparatus may include: a processor 601, a memory 602.
The memory 602 is used for storing programs, and the processor 601 calls the programs stored in the memory 602 to execute the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units 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 unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (10)

1. A file processing method, comprising:
carrying out fragmentation processing on an original file to obtain a plurality of fragmented files;
adding fragment information of the fragment files into a file header of each fragment file;
and uploading each fragment file added with the file header to a server.
2. The method according to claim 1, wherein the slicing the original file to obtain a plurality of sliced files comprises:
and according to the preset byte size, carrying out fragmentation processing on the original file to obtain a plurality of fragment files, wherein the size of each fragment file is the preset byte size.
3. The method according to claim 2, wherein the performing fragmentation processing on the original file according to a preset byte size to obtain the plurality of fragmented files comprises:
determining whether the byte size of the original file is greater than or equal to the preset byte size;
and if so, carrying out fragmentation processing on the original file according to the size of the preset bytes to obtain the plurality of fragmented files.
4. The method of claim 1, wherein the fragmentation information comprises: the sequence number of the fragment file and the size of the fragment file;
adding the fragmentation information of the fragmentation file in the file header of each fragmentation file comprises:
and adding the sequence number of the fragment file in a first preset byte in the file header of each fragment file, and adding the size of the fragment file in a second preset byte.
5. The method of claim 4, wherein the fragmentation information further comprises: the total number of the fragmented files, adding the fragmentation information of the fragmented files in the file header of each fragmented file, further includes:
and adding the total number of the fragment files in a third preset byte in the file header of each fragment file.
6. The method of claim 1, wherein the fragmentation information further comprises: the information digest value of the fragmented file, adding the fragmented information of the fragmented file to the file header of each fragmented file, further includes:
and adding the information digest value of the fragment file in a fourth preset byte in the file header of each fragment file.
7. The method according to any one of claims 1 to 6, wherein uploading each fragmented file with a file header added thereto to a server comprises:
uploading each fragment file added with the file header to the server through a preset protocol, so that the server analyzes each fragment file according to the preset protocol and combines the fragment files to obtain the original file.
8. A document processing apparatus, characterized by comprising: the system comprises a processing module, an adding module and an uploading module;
the processing module is used for carrying out fragmentation processing on the original file to obtain a plurality of fragmented files;
the adding module is used for adding the fragment information of the fragment files in the file header of each fragment file;
and the uploading module is used for uploading each fragment file added with the file header to a server.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the program instructions to perform the steps of the file processing method according to any one of claims 1 to 7 when executed.
10. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the file processing method according to one of claims 1 to 7.
CN202010638864.1A 2020-07-03 2020-07-03 File processing method, device, equipment and storage medium Withdrawn CN111783123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010638864.1A CN111783123A (en) 2020-07-03 2020-07-03 File processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010638864.1A CN111783123A (en) 2020-07-03 2020-07-03 File processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111783123A true CN111783123A (en) 2020-10-16

Family

ID=72759582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010638864.1A Withdrawn CN111783123A (en) 2020-07-03 2020-07-03 File processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111783123A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112351086A (en) * 2020-10-29 2021-02-09 北京华云安信息技术有限公司 File transmission method, device, equipment and computer readable storage medium
CN112398916A (en) * 2020-10-29 2021-02-23 北京华云安信息技术有限公司 File transmission method and device based on HTTP (hyper text transport protocol)
CN113271343A (en) * 2021-04-28 2021-08-17 华录光存储研究院(大连)有限公司 Data downloading and uploading method and electronic equipment
CN114338646A (en) * 2021-11-29 2022-04-12 王建冬 File interactive transmission method, device, equipment and storage medium
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112351086A (en) * 2020-10-29 2021-02-09 北京华云安信息技术有限公司 File transmission method, device, equipment and computer readable storage medium
CN112398916A (en) * 2020-10-29 2021-02-23 北京华云安信息技术有限公司 File transmission method and device based on HTTP (hyper text transport protocol)
CN112351086B (en) * 2020-10-29 2023-11-28 北京华云安信息技术有限公司 File transmission method, apparatus, device and computer readable storage medium
CN112398916B (en) * 2020-10-29 2024-02-02 北京华云安信息技术有限公司 File transmission method and device based on HTTP (hyper text transport protocol)
CN113271343A (en) * 2021-04-28 2021-08-17 华录光存储研究院(大连)有限公司 Data downloading and uploading method and electronic equipment
CN114338646A (en) * 2021-11-29 2022-04-12 王建冬 File interactive transmission method, device, equipment and storage medium
CN114363321A (en) * 2021-12-30 2022-04-15 支付宝(杭州)信息技术有限公司 File transmission method, equipment and system

Similar Documents

Publication Publication Date Title
CN111783123A (en) File processing method, device, equipment and storage medium
CN108900471B (en) Server, client, network system and method for transmitting data
CN110224999B (en) Information interaction method and device and storage medium
CN109194625B (en) Client application protection method and device based on cloud server and storage medium
CN111901337A (en) File uploading method and system and storage medium
CN111193817B (en) Method and device for automatically registering equipment serial number, computer equipment and storage medium
US8953786B2 (en) User input based data encryption
CN117640256B (en) Data encryption method, recommendation device and storage medium of wireless network card
CN112507326A (en) SM3 hash algorithm-based password information encryption method and device and computer equipment
CN113688399A (en) Firmware digital signature protection method and device, computer equipment and storage medium
CN113449338A (en) Information encryption storage method and system based on block chain
CN112689014A (en) Double-full-duplex communication method and device, computer equipment and storage medium
CN115208701A (en) Data packet selective encryption method and device
CN114430346A (en) Login method and device and electronic equipment
CN112836232A (en) Dynamic webpage privacy protection method based on k anonymity under webpage fingerprint identification background
CN112235104B (en) Data encryption transmission method, system, terminal and storage medium
CN112699404A (en) Method, device and equipment for verifying authority and storage medium
CN109936438A (en) A kind of method of Internet of things system terminal device secure accessing certification
CN108183785A (en) A kind of method, system, device and readable storage medium storing program for executing for preventing from hitting library or dragging library
CN112328415A (en) Interface calling method and device, computer equipment and readable storage medium
CN111475690B (en) Character string matching method and device, data detection method and server
CN109214163B (en) Identity authentication method and device
US11153312B2 (en) User authentication method, evaluation device, non-transitory computer-readable storage medium, and user authentication system
CN110585727B (en) Resource acquisition method and device
CN113158218A (en) Data encryption method and device and data decryption method and device

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20201016

WW01 Invention patent application withdrawn after publication