A file transmission method and device for converting file data into messages
Through custom communication protocols, files are divided and messaged, combined with encryption algorithms, the file server pressure and integrity problems in file transmission are solved, and efficient and secure file transmission is achieved.
Patent Information
- Application Number
- CN202210453806.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-04-27
AI Technical Summary
In the existing file transfer methods, due to the limitations of the communication protocol, file breakpoint transmission may cause damage to file integrity and increase the processing pressure of the file server.
Through a custom communication protocol, the file is divided into several copies, and each file data is messaged and converted into file string data in json format, and processed with symmetric encryption and asymmetric encryption algorithms, which are adapted to messaged files Data transmission significantly improves the transmission efficiency after file segmentation.
The data security and integrity after file segmentation and message processing are ensured, the file transfer efficiency is significantly improved, and the file transfer integrity and security is realized.
Smart Images

Figure CN114785773B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of file transmission, and in particular to a file transmission method and device for converting file data into messages. Background Art
[0002] File transfer refers to transferring files from one end (source end) to another end (destination end). In the conventional file transfer process, only the source end and the destination end are specified, which are generally the file server and the client. In the file transfer process, on the one hand, since the file storage in the file server is relatively large, it is generally encrypted before transmission to ensure the security of the file. In the prior art, when performing file transfer, direct encryption or header encryption is generally used. On the other hand, if the capacity of the file to be transferred is large, the entire file breakpoint resume transmission method is usually adopted to adapt the file transfer process to the processing capacity of the file server.
[0003] Due to the limitations of the communication protocol in the existing file transfer method, the entire file breakpoint resume transmission method may damage the file integrity and increase the processing pressure of the file server. Summary of the invention
[0004] In order to overcome the technical defect of the existing file transmission technology that the file server is under great pressure, the present invention provides a file transmission method and device for converting file data into messages.
[0005] In order to solve the above problems, the present invention is implemented according to the following technical solutions:
[0006] In a first aspect, the present invention discloses a file transmission method for converting file data into messages, comprising the following steps:
[0007] Step S1: Obtain a cross-domain pre-check request from the client, and return a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client;
[0008] Step S2: Obtain encryption information from the client from the request body, where the encryption information includes an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client;
[0009] Step S3: Return the asymmetric encryption public key and the encrypted symmetric encryption key to the client;
[0010] Step S4: Divide the target file into several parts and convert them into file string data in json format respectively, and perform symmetrical encryption based on the encryption information;
[0011] Step S5: Send the encrypted file string data in json format to the client in sequence;
[0012] Step S6: The client performs decryption based on the symmetric encryption key, and merges the file string data and converts it into a target file.
[0013] As a preferred embodiment of the present invention, after the encrypted json formatted file string data is discretely sent to the client in sequence, the method further includes:
[0014] Step S7: Obtain the TEARDOWN end request from the request body; record the download history data into the database; and return a FIN signal to the client.
[0015] As a preferred implementation of the present invention, after returning the supported symmetric encryption algorithm list and asymmetric encryption algorithm list to the client, it also includes:
[0016] Get the target file ID corresponding to the target file that the client needs to download from the request body;
[0017] Get the parsing request from the request body to parse the target file ID;
[0018] Based on the parsing results, obtain the specific information of the target file;
[0019] Returns the specific information of the target file to the client.
[0020] As a preferred implementation of the present invention, the target file is segmented and converted into file string data in json format respectively, and symmetric encryption is performed based on the encryption information, specifically including:
[0021] Calculate the file server's processing power to figure out the window size;
[0022] According to the window size, the file is divided into several sub-files adapted to the window size;
[0023] The subfile is encoded into character data through base64 and a messageID and sequence number are generated;
[0024] Encapsulate each character file data and messageID into a Message object;
[0025] Convert the Message object into a file string data in json format;
[0026] Get the symmetric encryption algorithm used in the encrypted information;
[0027] Use a symmetric encryption algorithm to encrypt the file string data in JSON format based on the sequence number.
[0028] As a preferred implementation of the present invention, the encryption information includes the symmetric encryption algorithm, asymmetric encryption algorithm and target file ID selected by the client; the specific information of the target file includes file size, file format, file name and file creation time.
[0029] In a second aspect, the present invention further discloses a file transmission device for converting file data into messages, comprising:
[0030] The cross-domain pre-check module M1 is used to obtain a cross-domain pre-check request from the client and return a list of supported symmetric encryption algorithms and asymmetric encryption algorithms to the client;
[0031] The encryption execution module M2 is used to obtain encryption information from the client from the request body, wherein the encryption information includes an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client;
[0032] The key return module M3 is used to return the asymmetric encryption public key and the encrypted symmetric encryption key to the client;
[0033] The segmentation and conversion module M4 is used to segment the target file into several parts and convert them into file string data in JSON format respectively, and symmetrically encrypt the target file based on the encryption information;
[0034] A discrete sending module M5 is used to discretely send encrypted file string data in json format to the client in sequence;
[0035] The data conversion module M6 is used to enable the client to decrypt based on the symmetric encryption key and merge the file string data and convert them into a target file.
[0036] As a preferred embodiment of the present invention, it also includes an ending module M7, which specifically executes the following when running: obtaining a TEARDOWN ending request from the request body; recording the download history data into a database; and returning a FIN signal to the client.
[0037] As a preferred embodiment of the present invention, the cross-domain pre-check module M1 includes a file parsing sub-module M11, which specifically performs the following operations during runtime: obtaining a target file ID corresponding to a target file that the client needs to download from a request body; obtaining a parsing request from the request body to parse the target file ID; obtaining specific information of the target file based on the parsing result; and returning the specific information of the target file to the client.
[0038] As a preferred embodiment of the present invention, the segmentation and conversion module M4, when running, specifically performs the following steps: calculating the processing capacity of the file server to calculate the window size; dividing the file into a number of sub-files adapted to the window size according to the window size; encoding the sub-files into character data through base64 and generating a messageID and a serial number; encapsulating each character file data and messageID into a Message object; converting the Message object into file string data in json format; obtaining the symmetric encryption algorithm selected in the encrypted information; and using the symmetric encryption algorithm to encrypt the file string data in json format in sequence based on the serial number.
[0039] As a preferred implementation of the present invention, the encryption information includes the symmetric encryption algorithm, asymmetric encryption algorithm and target file ID selected by the client; the specific information of the target file includes file size, file format, file name and file creation time.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The present invention divides a file into several parts based on the window size of the file server by means of a custom communication protocol, and converts the data of each file into a message, converts it into a message object, and serializes it into JSON characters. Then, symmetric encryption and asymmetric encryption algorithms are combined to make the encryption method suitable for the transmission of the messaged file data after the segmentation, thereby ensuring the security and integrity of the data after the file segmentation and message processing. Then, through discrete transmission, the transmission efficiency of the file after segmentation is significantly improved, thereby enabling the method of file segmentation and messaged discrete transmission to be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings, wherein:
[0043] Figure 1 It is a flowchart of a file transmission method for converting file data into messages according to the present invention;
[0044] Figure 2 It is a structural schematic diagram of a file transmission device for converting file data into messages according to the present invention. DETAILED DESCRIPTION
[0045] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0046] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0047] The access device and the server can be directly or indirectly connected through wired or wireless communication. The access device can be a terminal or a server. The target application is running on the access device. The target application is an application that can initiate data requests to the server, such as social applications, payment applications, game applications, etc. The server can be an application server that provides services for the target application, or a proxy server that is different from the application server corresponding to the target application. The server is used to identify whether each access device is a malicious device and intercept data messages from malicious devices. When the server is a proxy server, the proxy server forwards data messages that do not belong to malicious devices to the application server. The terminal can be a desktop terminal or a mobile terminal, and the mobile terminal can be a smart phone, a tablet computer, a laptop, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The server and the server can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms.
[0048] Example 1
[0049] like Figure 1 As shown, in a first aspect, the present invention discloses a file transmission method for converting file data into messages, comprising the following steps:
[0050] Step S1: Obtain a cross-domain pre-check request from the client, and return a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client.
[0051] Specifically, when the client needs to download a file, it needs to send a corresponding cross-domain pre-check request instruction to the file server. After the file server obtains the cross-domain pre-check request from the client, it returns to the client a list of symmetric encryption algorithms and a list of asymmetric encryption algorithms that the file server and the target file support at the same time. The list of symmetric encryption algorithms includes multiple symmetric encryption algorithms arranged in order based on the frequency of use, and the list of asymmetric encryption algorithms includes multiple asymmetric encryption algorithms arranged in order based on the frequency of use, so that the client can select the encryption algorithm and non-encryption algorithm to be finally adopted.
[0052] The method further includes step S11: obtaining the target file ID corresponding to the target file that the client needs to download from the request body; obtaining a parsing request from the request body to parse the target file ID; obtaining specific information of the target file based on the parsing result; and returning the specific information of the target file to the client. The specific information of the target file includes file size, file format, file name, and file creation time, as well as other information that can display file attributes, file content, and file source.
[0053] Step S2: Obtain encryption information from the client from the request body, where the encryption information includes an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client.
[0054] Specifically, a request body is created to store information from the client, and the client uploads and stores encrypted information in the request body. Specifically, the encrypted information includes the symmetric encryption algorithm, asymmetric encryption algorithm and target file ID selected by the client. The file server obtains the encrypted information from the request body to retrieve the target file and prepares the corresponding symmetric encryption algorithm and asymmetric encryption algorithm.
[0055] Step S3: Return the asymmetric encryption public key and the encrypted symmetric encryption key to the client.
[0056] Specifically, the file server uses an asymmetric encryption algorithm to encrypt the symmetric encryption key based on the encrypted information, and then returns the asymmetric encryption public key to the client, and returns the asymmetric encryption key after asymmetric encryption to the client. The client can decrypt the symmetric encryption key based on the asymmetric encryption public key to ensure the security of the file in the form of double encryption. It is also easier to verify whether the file is complete and whether it has been modified.
[0057] Step S4: Divide the target file into several parts and convert them into file string data in json format respectively, and symmetrically encrypt the target file based on the encryption information.
[0058] Specifically, the specific execution sub-steps of this step are:
[0059] Calculate the file server's processing power to figure out the window size;
[0060] According to the window size, the file is divided into several sub-files adapted to the window size;
[0061] The subfile is encoded into character data through base64 and a messageID and sequence number are generated;
[0062] Encapsulate each character file data and messageID into a Message object;
[0063] Convert the Message object into a file string data in json format;
[0064] Get the symmetric encryption algorithm used in the encrypted information;
[0065] Use a symmetric encryption algorithm to encrypt the file string data in JSON format based on the sequence number.
[0066] Step S5: Send the encrypted file string data in json format to the client in sequence.
[0067] Specifically, the file server discretely sends the encrypted file string data in json format based on the sequence number of the encrypted file string data in json format. The present invention discretely sends the message-processed data in the form of message sending, and the size of each message data is adapted to the window size of the file processor, which can significantly improve the transmission efficiency.
[0068] Step S6: The client performs decryption based on the symmetric encryption key, and merges the file string data and converts it into a target file.
[0069] Specifically, the client receives encrypted file string data in json format from the file server in sequence, decrypts the symmetric encryption key by using the asymmetric encryption public key to obtain the symmetric encryption key, decrypts the encrypted file string data in json format by using the symmetric encryption key to obtain multiple discrete file string data in json format, and combines the data based on the sequence number after re-conversion to obtain the target file. After obtaining the target file, the integrity of the target file is also checked to ensure that the file is complete and secure.
[0070] The method also includes step S7: obtaining a TEARDOWN end request from the request body; recording the download history data into a database; and returning a FIN signal to the client.
[0071] The present invention creatively divides a file into several parts based on the window size of the file server by means of a custom communication protocol, and converts the data of each file into a message, converts it into a message object, and serializes it into JSON characters, and then combines symmetric encryption and asymmetric encryption algorithms to make the encryption method suitable for the transmission of the messaged file data after the segmentation, thereby ensuring the security and integrity of the data after the file segmentation and message processing, and then through discrete transmission, the sending efficiency of the file after segmentation is significantly improved, thereby enabling the method of file segmentation and messaged discrete transmission to be realized.
[0072] For other steps of the file transmission method for converting file data into messages described in this embodiment, refer to the prior art.
[0073] Example 2
[0074] like Figure 2 As shown, in a second aspect, the present invention further discloses a file transmission device for converting file data into messages, comprising a cross-domain pre-check module M1, an encryption execution module M2, a key return module M3, a segmentation conversion module M4, a discrete sending module M5 and a data conversion module M6, wherein:
[0075] The cross-domain pre-check module M1 is used to obtain a cross-domain pre-check request from the client and return a list of supported symmetric encryption algorithms and asymmetric encryption algorithms to the client;
[0076] The cross-domain pre-check module M1 also includes a file parsing sub-module M11, which specifically performs the following operations during runtime: obtaining the target file ID corresponding to the target file that the client needs to download from the request body; obtaining a parsing request from the request body to parse the target file ID; obtaining specific information of the target file based on the parsing result; and returning the specific information of the target file to the client.
[0077] The encryption execution module M2 is used to obtain encryption information from the client from the request body, wherein the encryption information includes an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client;
[0078] The key return module M3 is used to return the asymmetric encryption public key and the encrypted symmetric encryption key to the client;
[0079] The segmentation and conversion module M4 is used to segment the target file into several parts and convert them into file string data in json format respectively, and perform symmetrical encryption based on the encryption information;
[0080] The discrete sending module M5 is used to discretely send encrypted file string data in json format to the client in sequence.
[0081] The data conversion module M6 is used to enable the client to decrypt based on the symmetric encryption key, and merge the file string data and convert them into a target file.
[0082] As a preferred embodiment of the present invention, it also includes an ending module M7, which specifically executes the following when running: obtaining a TEARDOWN ending request from the request body; recording the download history data into a database; and returning a FIN signal to the client.
[0083] When the segmentation and conversion module M4 is running, the specific execution is: calculating the processing capacity of the file server to calculate the window size; dividing the file into several sub-files adapted to the window size according to the window size; encoding the sub-files into character data through base64 and generating messageID and serial number; encapsulating each character file data and messageID into a Message object; converting the Message object into file string data in json format; obtaining the symmetric encryption algorithm selected in the encrypted information; using the symmetric encryption algorithm to encrypt the file string data in json format in sequence based on the serial number.
[0084] More specifically, the encryption information includes the symmetric encryption algorithm, asymmetric encryption algorithm and target file ID selected by the client; the specific information of the target file includes file size, file format, file name and file creation time.
[0085] To sum up, when running, the file transmission device for converting file data into messages described in the embodiment of the present invention can execute all the steps of the file transmission method for converting file data into messages described in Example 1, so as to achieve the technical effect of converting the file into messages after splitting, and realizing complete and secure file transmission through discrete sending.
[0086] For other structures of the file transmission device for converting file data into messages described in this embodiment, refer to the prior art.
[0087] Example 3
[0088] The present invention also discloses an electronic device, at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor, and when the at least one processor executes the instructions, the following steps are specifically implemented: obtaining a cross-domain pre-check request from a client, and returning a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client; obtaining encryption information from the client from a request body, the encryption information including an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client; returning an asymmetric encryption public key and an encrypted symmetric encryption key to the client; dividing a target file into several parts and converting them into file string data in json format respectively, and performing symmetric encryption based on the encryption information; sending the encrypted file string data in json format discretely to the client in sequence; the client decrypts based on the symmetric encryption key, and merges the file string data into a target file.
[0089] Example 4
[0090] The present invention also discloses a storage medium storing a computer program. When the computer program is executed by a processor, the following steps are specifically implemented: obtaining a cross-domain pre-check request from a client, and returning a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client; obtaining encryption information from the client from a request body, wherein the encryption information includes an asymmetric encryption algorithm and a symmetric encryption algorithm to be used by the client; returning an asymmetric encryption public key and an encrypted symmetric encryption key to the client; dividing a target file into several parts and converting them into file string data in json format respectively, and performing symmetric encryption based on the encryption information; sending the encrypted file string data in json format to the client in discrete order; the client decrypts based on the symmetric encryption key, and merges the file string data into the target file.
[0091] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0092] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0093] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0094] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, Java, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0095] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0096] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0097] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0098] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the above-mentioned module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0099] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A file transmission method for converting file data into messages, It is characterized in that The following steps are involved: Obtain a cross-domain pre-check request from a client, and return a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client; the list of symmetric encryption algorithms includes multiple symmetric encryption algorithms arranged in order based on usage frequency, and the list of asymmetric encryption algorithms includes multiple asymmetric encryption algorithms arranged in order based on usage frequency; Get the target file ID corresponding to the target file that the client needs to download from the request body; Get the parsing request from the request body to parse the target file ID; Based on the parsing result, obtaining specific information of the target file, the specific information of the target file including file size, file format, file name and file creation time; Return the specific information of the target file to the client; Obtaining encryption information from the client from the request body, wherein the encryption information includes the symmetric encryption algorithm, the asymmetric encryption algorithm and the target file ID selected by the client; Return the asymmetric encryption public key and the encrypted symmetric encryption key to the client; based on the encrypted information, encrypt the symmetric encryption key using an asymmetric encryption algorithm; The target file is divided into several parts and converted into file string data in json format respectively, and symmetric encryption is performed based on the encrypted information, including: Calculate the file server's processing power to figure out the window size; According to the window size, the file is divided into several sub-files adapted to the window size; The subfile is encoded into character data through base64 and a messageID and sequence number are generated; Encapsulate each character file data and messageID into a Message object; Convert the Message object into a file string data in json format; Get the symmetric encryption algorithm used in the encrypted information; Use a symmetric encryption algorithm to encrypt the string data in the JSON format based on the sequence number. Send encrypted JSON formatted file string data to the client in discrete order. Specifically, the message-processed data is discretely sent in the form of message sending, and the size of each message data is adapted to the window size of the file processor. The client performs decryption based on the symmetric encryption key, and merges the file string data and converts it into a target file. Specifically, the client sequentially receives the encrypted file string data in json format from the file server, decrypts the symmetric encryption key by using the asymmetric encryption public key to obtain the symmetric encryption key, decrypts the encrypted file string data in json format by using the symmetric encryption key to obtain discrete multiple file string data in json format, and combines the data based on the sequence number after re-conversion to obtain the target file; Get the TEARDOWN end request from the request body; Record and download historical data into the database; Returns a FIN signal to the client.
2. A file transmission device for converting file data into messages, It is characterized in that include: A cross-domain pre-check module, which is used to obtain a cross-domain pre-check request from a client, and return a list of supported symmetric encryption algorithms and a list of asymmetric encryption algorithms to the client; the list of symmetric encryption algorithms includes a plurality of symmetric encryption algorithms arranged in sequence based on usage frequency, and the list of asymmetric encryption algorithms includes a plurality of asymmetric encryption algorithms arranged in sequence based on usage frequency; The cross-domain pre-check module includes a file parsing submodule, which specifically performs the following when running: obtaining the target file ID corresponding to the target file that the client needs to download from the request body; obtaining a parsing request from the request body to parse the target file ID; obtaining specific information of the target file based on the parsing result; returning the specific information of the target file to the client; the specific information of the target file includes file size, file format, file name and file creation time; An encryption execution module, which is used to obtain encryption information from the client from the request body, wherein the encryption information includes the symmetric encryption algorithm, the asymmetric encryption algorithm and the target file ID selected by the client; The key return module is used to return the asymmetric encryption public key and the encrypted symmetric encryption key to the client; based on the encrypted information, the symmetric encryption key is encrypted using an asymmetric encryption algorithm; The segmentation and conversion module is used to segment the target file into several parts and convert them into file string data in JSON format respectively, and symmetrically encrypt the target file based on the encryption information, specifically including: Calculate the file server's processing power to figure out the window size; According to the window size, the file is divided into several sub-files adapted to the window size; The subfile is encoded into character data through base64 and a messageID and sequence number are generated; Encapsulate each character file data and messageID into a Message object; Convert the Message object into a file string data in json format; Get the symmetric encryption algorithm used in the encrypted information; Use a symmetric encryption algorithm to encrypt the string data in the JSON format based on the sequence number. A discrete sending module is used to discretely send encrypted file string data in json format to the client in sequence. Specifically, the data processed by message is discretely sent in the form of message sending, and the size of each message data is adapted to the window size of the file processor; a data conversion module is used to enable the client to decrypt based on the symmetric encryption key, and merge the file string data and convert them into a target file. Specifically, the client receives encrypted file string data in json format from the file server in sequence, decrypts the symmetric encryption key through the asymmetric encryption public key to obtain the symmetric encryption key, decrypts the encrypted file string data in json format through the symmetric encryption key to obtain discrete multiple file string data in json format, and combines the data based on the sequence number after re-conversion to obtain the target file; The end module specifically executes the following when running: obtaining the TEARDOWN end request from the request body; recording the downloaded historical data into the database; and returning a FIN signal to the client.
