File interaction method and system and server

By building an encrypted transmission channel between the client and the server and using encryption policies to perform file encryption processing, the problems of file transfer security and efficiency in the existing technology are solved, and an efficient and secure file interaction process is achieved.

CN119316413AInactive Publication Date: 2025-01-14HANG ZHOU LING XIN SHU KE XIN XI JI SHU YOU XIAN GONG SI
View PDF 18 Cites 0 Cited by

Patent Information

Application Number
CN202411804166.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing file transfer mode is vulnerable to attack in application scenarios with high data security requirements, and because it requires encryption using a specific network transmission protocol, the file interaction process is complicated and it is difficult to achieve efficient file interaction.

Method used

By building an encrypted transmission channel between the client and the server, using key exchange and encryption policies to encrypt files, simplify file interaction process, and realize file blocked encryption transmission under the TLCP protocol.

Benefits of technology

While ensuring data security, the file interaction process is simplified, the efficiency and security of file transmission are improved, and the network resource requirements are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316413A_ABST
    Figure CN119316413A_ABST
Patent Text Reader

Abstract

The invention provides a file interaction method and system and a server, and relates to the field of signal processing.The method comprises the steps that firstly, a network connection channel between a client side and a server side is built based on a network connection request sent by the client side, and the client side and the server side are controlled to conduct key exchange based on the network connection channel; an encrypted transmission channel is constructed according to a key exchange result; the method comprises the steps of determining a file interaction strategy and a file encryption strategy by obtaining a file interaction instruction sent by a client; and after an interaction file and a target end between the client and the server are determined based on the file interaction strategy, encrypting the interaction file by using the file encryption strategy, and transmitting the encrypted interaction file to the target end by using the encryption transmission channel. According to the method, in the process of carrying out file interactive transmission by using a specific network transmission protocol, interactive data between the client and the server can be fully encrypted, and the file interactive process is simplified while the data security is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of signal processing, and in particular to a file interaction method, system and server. Background Art

[0002] The security of data transmission is particularly important in the current information age. Currently, file transfer is mainly achieved through relevant file synchronization tools and public network protocols. This model is vulnerable to attacks during file transfer and there is a risk of data leakage. It is difficult to ensure data security in application scenarios with high data security requirements. Such application scenarios can only use specific network transmission protocols to encrypt data during file interaction to ensure data security, but the overall process of such network transmission protocols is relatively complex, making it difficult to achieve an efficient file interaction process. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a file interaction method, system and server, which can fully encrypt the interaction data between the client and the server during the process of file interaction transmission using a specific network transmission protocol, thereby ensuring data security while also simplifying the file interaction process.

[0004] In a first aspect, an embodiment of the present invention provides a file interaction method, which is used in a file interaction process between a client and a server, and the method includes: Building a network connection channel between the client and the server based on the network connection request sent by the client; controlling the client and the server to exchange keys based on the network connection channel, and building an encrypted transmission channel between the client and the server based on the key exchange result; Obtain the file interaction instruction sent by the client, and determine the file interaction strategy and file encryption strategy corresponding to the file interaction instruction; Determine the interaction files between the client and the server based on the file interaction strategy, and determine the target end of the interaction files from the client and the server using the file interaction strategy; The interactive file is encrypted using the file encryption strategy, and the encrypted interactive file is transmitted to the target end using the encrypted transmission channel.

[0005] In one embodiment, a network connection channel between a client and a server is established based on a network connection request sent by a client; a key exchange is controlled between the client and the server based on the network connection channel, and an encrypted transmission channel is established between the client and the server according to the key exchange result, including: Control the server to build Socket communication, and control the server to monitor the Socket connection request instructions sent by the client in real time; Obtain the network connection request sent by the client, determine the Socket connection request instruction according to the loading address contained in the network connection request, and control the client to send the Socket connection request instruction to the server, and then build a network connection channel based on the real-time monitoring result of the server; The key exchange instruction between the client and the server is determined based on the key certificate included in the network connection request, and the encrypted transmission channel is constructed using the key exchange result corresponding to the key exchange instruction.

[0006] In one implementation, obtaining a file interaction instruction sent by a client and determining a file interaction policy and a file encryption policy corresponding to the file interaction instruction include: Obtaining a file interaction instruction sent from a client; wherein the file interaction instruction is a file upload instruction or a file download instruction; When the file interaction instruction is a file upload instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be uploaded by the client corresponding to the file upload instruction and the file saving path of the server; When the file interaction instruction is a file download instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be downloaded on the server side corresponding to the file download instruction and the file saving path on the client side.

[0007] In one implementation, when the file interaction instruction is a file upload instruction; Determine the interactive files between the client and the server based on the file interaction strategy, and use the file interaction strategy to determine the target end of the interactive files from the client and the server, including: Obtain the file upload instruction corresponding to the file interaction strategy, and control the client to obtain the file to be uploaded corresponding to the file upload instruction; Encrypt the file upload instruction using the encryption strategy, and control the client to send the encrypted file upload instruction to the server; After receiving the file upload instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file upload instruction, and determines the file storage path corresponding to the file to be uploaded in the server based on the file upload instruction; The file to be uploaded by the client is determined as an interactive file, and the file saving path of the server is determined as the target end of the interactive file.

[0008] In one implementation, the interactive file is encrypted using a file encryption strategy, and the encrypted interactive file is transmitted to a target end using an encrypted transmission channel, including: Control the server to create temporary files according to the data volume of the interactive files; After the control client divides the interactive file according to the preset threshold, the file blocks corresponding to the interactive file are encrypted using the encryption strategy; The control client sends the encrypted file blocks to the corresponding file storage path of the server in the target end through the encrypted transmission channel; The decryption strategy corresponding to the encryption strategy is used to control the server to decrypt the file blocks and save them in temporary files in sequence.

[0009] In one embodiment, when the file interaction instruction is a file download instruction; Determine the interactive files between the client and the server based on the file interaction strategy, and use the file interaction strategy to determine the target end of the interactive files from the client and the server, including: Obtain the file download instruction corresponding to the file interaction strategy, and control the client to obtain the file save path corresponding to the file to be downloaded; Encrypt the file download instruction using the encryption strategy, and control the client to send the encrypted file download instruction to the server; After receiving the file download instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file download instruction, and determines the file to be downloaded by the server based on the file download instruction; The file to be downloaded on the server side is determined as an interactive file, and the file saving path on the client side is determined as the target end of the interactive file.

[0010] In one implementation, the interactive file is encrypted using a file encryption strategy, and the encrypted interactive file is transmitted to a target end using an encrypted transmission channel, including: Control the client to create temporary files according to the data volume of the interactive file; After the control server divides the interaction file according to the preset threshold, the file blocks corresponding to the interaction file are encrypted using the encryption strategy; The control server sends the encrypted file blocks to the corresponding file storage path of the client in the target end through the encrypted transmission channel; The decryption strategy corresponding to the encryption strategy is used to control the client to decrypt the file blocks and save them in temporary files in sequence.

[0011] In one embodiment, after encrypting the interactive file using the file encryption strategy and transmitting the encrypted interactive file to the target end using the encrypted transmission channel, the method further includes: When it is detected that the data volume of the interactive file received in the target end is lower than a preset threshold, the file interaction process between the client and the server is stopped.

[0012] In a second aspect, an embodiment of the present invention provides a file interaction system, which is used in a file interaction process between a client and a server, and the system includes: The initialization unit is used to establish a network connection channel between the client and the server based on the network connection request sent by the client; control the client and the server to exchange keys based on the network connection channel, and establish an encrypted transmission channel between the client and the server according to the key exchange result; A policy determination unit, used to obtain a file interaction instruction sent by a client, and determine a file interaction policy and a file encryption policy corresponding to the file interaction instruction; An interaction preparation unit, used to determine the interaction file between the client and the server based on the file interaction strategy, and determine the target end of the interaction file from the client and the server using the file interaction strategy; The interactive execution unit is used to encrypt the interactive file using the file encryption strategy, and transmit the encrypted interactive file to the target end using the encrypted transmission channel.

[0013] In a third aspect, an embodiment of the present invention further provides a server, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the file interaction method provided in the first aspect.

[0014] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions. When the computer executable instructions are called and executed by a processor, the computer executable instructions prompt the processor to implement the steps of the file interaction method provided in the first aspect.

[0015] The present invention provides a file interaction method, system and server. In the process of transmitting files between a client and a server using a specific network transmission protocol, the method first builds a network connection channel between the client and the server based on a network connection request sent by the client; controls the client and the server to exchange keys based on the network connection channel, and builds an encrypted transmission channel between the client and the server according to the key exchange result; then obtains the file interaction instruction sent by the client, determines the file interaction strategy and file encryption strategy corresponding to the file interaction instruction; then determines the interaction file between the client and the server based on the file interaction strategy, and determines the target end of the interaction file from the client and the server using the file interaction strategy; finally, encrypts the interaction file using the file encryption strategy, and transmits the encrypted interaction file to the target end using the encrypted transmission channel. In the process of file interaction transmission using a specific network transmission protocol, the method can fully encrypt the interaction data between the client and the server, and simplifies the file interaction process while ensuring data security.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flowchart of a file interaction method provided by an embodiment of the present invention; Figure 2 A flowchart of step S101 in a file interaction method provided by an embodiment of the present invention; Figure 3 A flowchart of step S102 in a file interaction method provided in an embodiment of the present invention; Figure 4 A flowchart of step S103 in a file interaction method provided by an embodiment of the present invention; Figure 5 A flowchart of step S104 in a file interaction method provided by an embodiment of the present invention; Figure 6 A flowchart of step S103 in another file interaction method provided by an embodiment of the present invention; Figure 7 A flowchart of step S104 in another file interaction method provided by an embodiment of the present invention; Figure 8 A flowchart of a file interaction method provided by an embodiment of the present invention when uploading a file; Fig. 9 A flowchart of a file interaction method provided by an embodiment of the present invention when downloading a file; Fig.10 A schematic diagram of the structure of a file interaction system provided by an embodiment of the present invention; Fig.11 A schematic diagram of the structure of a server provided in an embodiment of the present invention.

[0020] icon: 1010-initialization unit; 1020-strategy determination unit; 1030-interaction preparation unit; 1040-interaction execution unit; 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] The security of data transmission is particularly important in the current information age. Currently, file transmission is mainly achieved through relevant file synchronization tools and with the help of public network protocols. This model is vulnerable to attacks during the file transmission process and there is a risk of data leakage. It is difficult to ensure data security in application scenarios with high data security requirements. Such application scenarios can only use specific network transmission protocols to perform specific encryption on the data in the file interaction process to ensure data security, but the overall process of such network transmission protocols is relatively complex, and it is difficult to achieve an efficient file interaction process. Based on this, the present invention implements a file interaction method, system and server. The method can fully encrypt the interaction data between the client and the server during the file interaction transmission process using a specific network transmission protocol, thereby simplifying the file interaction process while ensuring data security.

[0023] To facilitate understanding of this embodiment, a file interaction method disclosed in an embodiment of the present invention is first described in detail. The method is used in a file interaction process between a client and a server. Figure 1 As shown, the method includes: Step S101, building a network connection channel between the client and the server based on a network connection request sent by the client; controlling the client and the server to exchange keys based on the network connection channel, and building an encrypted transmission channel between the client and the server according to the key exchange result; Step S102, obtaining a file interaction instruction sent by the client, and determining a file interaction policy and a file encryption policy corresponding to the file interaction instruction; Step S103, determining the interactive file between the client and the server based on the file interaction strategy, and determining the target end of the interactive file from the client and the server using the file interaction strategy; Step S104, encrypt the interactive file using the file encryption strategy, and transmit the encrypted interactive file to the target end using an encrypted transmission channel.

[0024] Specifically, during the process of file interaction, the method first builds a network connection channel between the client and the server, and controls the client and the server to exchange keys to build an encrypted transmission channel under the network connection channel. This method builds an encrypted transmission channel based on the key exchange results at the early stage of file interaction communication, thereby ensuring data security.

[0025] The starting end of the file interaction process is the client. After obtaining the file interaction instruction sent by the client, the file interaction strategy and file encryption strategy contained in it can be obtained by parsing it. Specifically, the file interaction strategy corresponds to the specific type of file interaction, such as file upload or file download; and the file encryption strategy is determined based on the file interaction strategy. The data flow direction of the file in the file interaction strategy determines the various encryptions required during the transmission process, and finally obtains the file encryption strategy.

[0026] After the file interaction strategy is obtained, the interaction files between the client and the server can be determined, thereby determining the file transmission direction of the interaction process, and determining whether the target end of the interaction file is the client or the server. After the target end is determined, the file encryption strategy can be used to encrypt the interaction file, and the encrypted interaction file can be transmitted to the target end through an encrypted transmission channel.

[0027] In a specific scenario, the network transmission protocol used for file interaction can be implemented using TLCP (Transport Layer Communication Protocol), which has high security, but lacks related file interaction tools. Therefore, in actual scenarios, there is a lack of tools for file interaction using the network transmission protocol. In an embodiment of the present invention, the TLCP protocol can be used to implement the entire process of file interaction.

[0028] Specifically, in one embodiment, a network connection channel is established between the client and the server based on a network connection request sent by the client; based on the network connection channel, the client and the server are controlled to exchange keys, and an encrypted transmission channel is established between the client and the server according to the key exchange result, step S101, such as Figure 2 As shown, including: Step S201, controlling the server to establish Socket communication, and controlling the server to monitor the Socket connection request instruction sent by the client in real time; Step S202, obtaining a network connection request sent by the client, determining a Socket connection request instruction according to a loading address included in the network connection request, and controlling the client to send the Socket connection request instruction to the server, and then building a network connection channel based on the real-time monitoring result of the server; Step S203, determining the key exchange instruction between the client and the server according to the key certificate included in the network connection request, and constructing an encrypted transmission channel using the key exchange result corresponding to the key exchange instruction.

[0029] This step can be understood as an initialization step, which mainly realizes the construction of an encrypted transmission channel between the server and the client. Specifically, the server is first controlled to build Socket communication, and the server is controlled to monitor the Socket connection request instruction sent from the client in real time. This step controls the server to build relevant Socket communication services and monitors the relevant connection request instructions sent from the client. The client realizes automatic processing in the form of a driver interface. When executing the file interaction process, the client can generate a network connection request, which contains information such as a loading address and a key certificate. After obtaining the network connection request sent by the client, the Socket connection request instruction is determined by the loading address contained in the network connection request, and the Socket connection request instruction is sent to the server for response. After the response is completed, a network connection channel can be constructed based on the real-time monitoring result of the server. The network connection channel is a preliminary channel, and it also needs to be encrypted using a key certificate. Specifically, the key exchange instruction is determined by the key certificate contained in the network connection request, and then the key exchange result corresponding to the key exchange instruction is used to construct an encrypted transmission channel between the client and the server.

[0030] In one implementation, the step S102 of obtaining the file interaction instruction sent by the client and determining the file interaction policy and the file encryption policy corresponding to the file interaction instruction is as follows: Figure 3 As shown, including: Step S301, obtaining a file interaction instruction sent from a client; wherein the file interaction instruction is a file upload instruction or a file download instruction; Step S302, when the file interaction instruction is a file upload instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be uploaded by the client corresponding to the file upload instruction and the file saving path of the server; Step S303, when the file interaction instruction is a file download instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be downloaded on the server side corresponding to the file download instruction and the file saving path on the client side.

[0031] Specifically, the starting end of the file interaction process in this implementation is the client. After obtaining the file interaction instruction sent by the client, the file interaction strategy and file encryption strategy contained therein can be obtained by parsing it. Specifically, the file interaction strategy corresponds to the specific type of file interaction, such as file upload or file download; the file encryption strategy is determined based on the file interaction strategy, and the data flow direction of the file in the file interaction strategy is used to determine the various encryptions required during the transmission process, thereby finally obtaining the file encryption strategy. When the file interaction instruction is a file upload instruction, the file interaction strategy and file encryption strategy are determined by using the file to be uploaded by the client corresponding to the file upload instruction and the file storage path of the server. When the file interaction instruction is a file download instruction, the file interaction strategy and file encryption strategy are determined by using the file to be downloaded by the server corresponding to the file download instruction and the file storage path of the client.

[0032] Different types of file interaction instructions are targeted at different file interaction strategies and file encryption strategies, and generally include two processes: file upload and file download. The following first describes the file interaction method based on the file upload process. In one embodiment, when the file interaction instruction is a file upload instruction; based on the file interaction strategy, determine the interaction file between the client and the server, and use the file interaction strategy to determine the target end of the interaction file from the client and the server in step S103, such as Figure 4 As shown, including: Step S401, obtaining a file upload instruction corresponding to the file interaction strategy, and controlling the client to obtain the file to be uploaded corresponding to the file upload instruction; Step S402, encrypting the file upload instruction using the encryption strategy, and controlling the client to send the encrypted file upload instruction to the server; Step S403, after receiving the file upload instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file upload instruction, and determines the file storage path corresponding to the file to be uploaded in the server based on the file upload instruction; Step S404: determine the file to be uploaded by the client as an interactive file, and determine the file storage path of the server as the target end of the interactive file.

[0033] The file upload process is the process of the client uploading files to the server. Therefore, the client is first controlled to obtain the file to be uploaded corresponding to the file upload instruction, and then the file upload instruction is encrypted using the encryption strategy and sent to the server, thereby ensuring the security of data transmission.

[0034] After receiving the file upload instruction, the server can obtain the original file upload instruction by decrypting it using the decryption strategy corresponding to the encryption strategy, and then use the file upload instruction to obtain the file save path corresponding to the uploaded file in the server.

[0035] In one implementation, the interactive file is encrypted using a file encryption strategy, and the encrypted interactive file is transmitted to the target end using an encrypted transmission channel in step S104, such as Figure 5 As shown, including: Step S501, controlling the server to create a temporary file according to the data volume of the interactive file; Step S502, after the control client divides the interaction file according to the preset threshold, the file blocks corresponding to the interaction file are encrypted using the encryption strategy; Step S503, controlling the client to send the encrypted file blocks to the file storage path corresponding to the server in the target end through the encrypted transmission channel; Step S504, after decrypting the file blocks using the decryption policy corresponding to the encryption policy, the server is controlled to sequentially save the decrypted file blocks in temporary files.

[0036] After the interactive file and the target end are determined, the file upload process from the client to the server can be executed. During the file upload process, the server is first controlled to create a temporary file according to the data volume of the interactive file. At this time, the temporary file serves as the data carrier of the interactive file. It can be understood that the data storage space is first specified from the server, and finally the interactive file is uploaded to the data storage space.

[0037] The file is transferred in blocks, which can reduce the demand for network resources when transferring large files. Specifically, the client is controlled to divide the interactive file according to the preset threshold, and the file blocks corresponding to the interactive file are encrypted using the encryption strategy, so that each file block is encrypted. Then the client is controlled to send the encrypted file blocks to the corresponding file saving path of the server in the target end through the encrypted transmission channel. The sending process strictly follows the order of the file block division, and the file blocks are sent to the file saving path in the server in turn through loop iteration. After the saving is completed, the decryption strategy corresponding to the encryption strategy is used to control the server to decrypt the file blocks and save them in temporary files in turn, thereby realizing the complete file upload function.

[0038] The following first describes the file interaction method by referring to the file upload process. In one embodiment, when the file interaction instruction is a file download instruction, the interactive file between the client and the server is determined based on the file interaction strategy, and the target end of the interactive file is determined from the client and the server by using the file interaction strategy. Figure 6As shown, including: Step S601, obtaining a file download instruction corresponding to the file interaction strategy, and controlling the client to obtain a file save path corresponding to the file to be downloaded; Step S602, encrypting the file download instruction using the encryption strategy, and controlling the client to send the encrypted file download instruction to the server; Step S603, after receiving the file download instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file download instruction, and determines the file to be downloaded by the server based on the file download instruction; Step S604: determine the file to be downloaded on the server side as an interactive file, and determine the file saving path on the client side as the target end of the interactive file.

[0039] The file download process is the process in which the client makes a file download request to the server and finally downloads the file in the server to the client. Therefore, the client is first controlled to obtain the file save path corresponding to the file to be downloaded, and then the file download instruction is encrypte...

[0040] After receiving the file download instruction, the server can obtain the original file download instruction by decrypting it using the decryption strategy corresponding to the encryption strategy, and then determine the file to be downloaded by the server based on the file download instruction.

[0041] In one implementation, the interactive file is encrypted using a file encryption strategy, and the encrypted interactive file is transmitted to the target end using an encrypted transmission channel in step S104, such as Figure 7 As shown, including: Step S701, controlling the client to create a temporary file according to the data volume of the interactive file; Step S702, after the control server divides the interaction file according to the preset threshold, the file blocks corresponding to the interaction file are encrypted using the encryption strategy; Step S703, controlling the server to send the encrypted file blocks to the file storage path corresponding to the client in the target end through the encrypted transmission channel; Step S704: After decrypting the file blocks, the client is controlled to save them in temporary files in sequence using the decryption policy corresponding to the encryption policy.

[0042] After the interactive file and the target end are determined, the file download process from the server to the client can be executed. During the file download process, the client is first controlled to create a temporary file according to the data volume of the interactive file. At this time, the temporary file serves as the data carrier of the interactive file. It can be understood that the data storage space is first specified from the client, and finally the interactive file is uploaded to the data storage space.

[0043] The file is transferred in blocks, which can reduce the demand for network resources when transferring large files. Specifically, the server is controlled to divide the interactive file according to the preset threshold, and the file blocks corresponding to the interactive file are encrypted using the encryption strategy, so that each file block is encrypted. Then the server is controlled to send the encrypted file blocks to the file saving path corresponding to the client in the target end through the encrypted transmission channel. The sending process strictly follows the order of the file block division, and the file blocks are sent to the file saving path in the client in turn through loop iteration. After the saving is completed, the decryption strategy corresponding to the encryption strategy is used to control the client to decrypt the file blocks and save them in temporary files in turn, thereby realizing the complete file download function.

[0044] When the file interaction process in the target end is controlled, it can be achieved by the size of the interactive file data received in the target end. In one embodiment, after the interactive file is encrypted using a file encryption strategy and the encrypted interactive file is transmitted to the target end using an encrypted transmission channel, the method also includes: when it is detected that the data volume of the interactive file received in the target end is lower than a preset threshold, the file interaction process between the client and the server is stopped.

[0045] Specifically, whether it is file uploading or file downloading, when the amount of interactive file data received in the target end is 0, it indicates that no additional data will be written to the target file. At this time, the file upload or file download has been completed, so the file interaction process between the client and the server can be stopped directly.

[0046] The file interaction method uses the TLCP protocol for data transmission, which can ensure the confidentiality and integrity of data during the transmission process. Figure 8 The flowchart of a file interaction method when uploading a file is shown. Here, taking the client uploading a file as an example, the file writing process on the server is explained.

[0047] First, the client initializes the connection and uses the TLCP protocol to request the establishment of an encrypted channel, and finally establishes a connection with the server. The server finally completes the establishment of an encrypted channel with the client by listening to the SSLSocket connection. The client builds a communication channel by loading connection information such as the address and key certificate, thereby realizing the connection between the client and the server.

[0048] Key exchange is also performed during the connection process. The client and server exchange keys using the SM2 algorithm to ensure the security of the connection session.

[0049] After the connection is established, files can be uploaded. A large file is used as an example to illustrate the specific details of block encryption transmission. The default threshold for file block size in this embodiment is 1MB. Assuming that the large file is 1GB in size, the specific process is as follows: First, the client requests the server to upload a file and encrypts it using the SM4 algorithm. After receiving the request, the server decrypts the command through SM4 and then creates a large file; The client starts to read the large file data to be uploaded according to the block threshold size. The actual read size each time may be less than the threshold size due to different data volumes in the network card buffer or the file has been read to the end of the file content. The read data is then encrypted according to SM4, and the encrypted data is finally written to the input stream of the encrypted connection channel with the server. After receiving the data, the server first verifies the checksum of the content and compares it with the server to confirm whether it is complete. If it is normal, it will be decrypted immediately and stored in the same file location specified by the server in an appended manner to achieve breakpoint resuming.

[0050] Iterate the above process, according to the current embodiment 1G calculation, the final file will be cut into at least 1024 copies, each with 1MB of data; that is, the large file upload process is completed after completing the above four steps at least 1024 times; After the server receives the data, if it finds that the actual data content is empty, it means that the last uploaded file has reached the end of the file, which means that the client's file upload process ends and the server's write stream will also be closed.

[0051] like Fig. 9 The flowchart of a file interaction method when downloading a file shows the process of establishing a connection. Figure 8 After the encrypted channel is established, the file can be downloaded. A large file is used as an example to illustrate the specific details of block encryption transmission. The default threshold of file block in this example is 1MB. Assuming that the large file is 1GB in size, the specific process is as follows: First, the client requests the server to download the file and encrypts it using the SM4 algorithm; After receiving the request, the server decrypts the command through SM4 and then starts to read the file; it reads data according to the block threshold size. The actual read size each time may be less than the threshold size due to different data volumes in the network card buffer or the file has been read to the end of the file content; the read data is then encrypted according to SM4, and the encrypted data is finally written to the input stream of the encrypted connection channel with the client; After receiving the data, the client first verifies the checksum of the content and compares it with the server to confirm whether it is complete. If it is normal, it will be decrypted immediately and stored in the same specified file location in an appended manner to achieve breakpoint resuming; Iterate the above process, according to the current embodiment 1G calculation, the final file will be cut into at least 1024 parts, each with 1MB of data; that is, the large file download process is completed after completing the above three steps at least 1024 times.

[0052] After the client receives the data, if it finds that the actual data content is empty, it means that the last downloaded file has reached the end of the file, that is, the client file download process ends, and the client write stream will also be closed.

[0053] It can be seen from the file interaction method in the above embodiment that this method can fully encrypt the interaction data between the client and the server during the file interaction transmission process using a specific network transmission protocol, thereby ensuring data security while also simplifying the file interaction process.

[0054] For the file interaction method provided in the above embodiment, the embodiment of the present invention provides a file interaction system, which is used in the file interaction process between the client and the server, such as Fig.10 As shown, the system includes: The initialization unit 1010 is used to establish a network connection channel between the client and the server based on the network connection request sent by the client; control the client and the server to exchange keys based on the network connection channel, and establish an encrypted transmission channel between the client and the server according to the key exchange result; The policy determination unit 1020 is used to obtain the file interaction instruction sent by the client, and determine the file interaction policy and the file encryption policy corresponding to the file interaction instruction; The interaction preparation unit 1030 is used to determine the interaction file between the client and the server based on the file interaction strategy, and determine the target end of the interaction file from the client and the server using the file interaction strategy; The interaction execution unit 1040 is used to encrypt the interaction file using the file encryption strategy, and transmit the encrypted interaction file to the target end using the encrypted transmission channel.

[0055] From the file interaction system mentioned in the above embodiment, it can be seen that the system can fully encrypt the interaction data between the client and the server during the process of file interaction transmission using a specific network transmission protocol, thereby ensuring data security while also simplifying the file interaction process.

[0056] The file interaction system provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned file interaction method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned file interaction method embodiment.

[0057] This embodiment also provides a server, the structural diagram of which is as follows: Fig.11 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above-mentioned file interaction method.

[0058] Fig.11 The server shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .

[0059] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0060] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.

[0061] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the above embodiment in combination with its hardware.

[0062] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the file interaction method in the above embodiment are executed.

[0063] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0064] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0065] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0066] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0067] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A file interaction method, characterized in that: The method is used in a file interaction process between a client and a server, and the method comprises: Building a network connection channel between the client and the server based on the network connection request sent by the client; controlling the client and the server to exchange keys based on the network connection channel, and building an encrypted transmission channel between the client and the server according to the key exchange result; Obtaining a file interaction instruction sent by the client, and determining a file interaction strategy and a file encryption strategy corresponding to the file interaction instruction; Determine an interactive file between the client and the server based on the file interaction strategy, and determine a target end of the interactive file from the client and the server using the file interaction strategy; The interactive file is encrypted using the file encryption strategy, and the encrypted interactive file is transmitted to the target end using the encrypted transmission channel.

2. The file interaction method according to claim 1, characterized in that: Establishing a network connection channel between the client and the server based on the network connection request sent by the client; Controlling the client and the server to exchange keys based on the network connection channel, and building an encrypted transmission channel between the client and the server according to the key exchange result, including: Control the server to build Socket communication, and control the server to monitor the Socket connection request instruction sent by the client in real time; Obtaining a network connection request sent by the client, determining the Socket connection request instruction according to the loading address included in the network connection request, and controlling the client to send the Socket connection request instruction to the server, and then building the network connection channel based on the real-time monitoring result of the server; The key exchange instruction between the client and the server is determined according to the key certificate included in the network connection request, and the encrypted transmission channel is constructed using the key exchange result corresponding to the key exchange instruction.

3. The file interaction method according to claim 1, characterized in that: Obtaining a file interaction instruction sent by the client, and determining a file interaction strategy and a file encryption strategy corresponding to the file interaction instruction, including: Acquire the file interaction instruction sent from the client; wherein the file interaction instruction is a file upload instruction or a file download instruction; When the file interaction instruction is the file upload instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be uploaded by the client corresponding to the file upload instruction and the file saving path of the server; When the file interaction instruction is the file download instruction, the file interaction strategy and the file encryption strategy are determined by using the file to be downloaded on the server corresponding to the file download instruction and the file saving path on the client.

4. The file interaction method according to claim 3, characterized in that: When the file interaction instruction is the file upload instruction; Determining an interactive file between the client and the server based on the file interaction strategy, and determining a target end of the interactive file from the client and the server using the file interaction strategy, including: Obtaining the file upload instruction corresponding to the file interaction strategy, and controlling the client to obtain the file to be uploaded corresponding to the file upload instruction; Encrypting the file upload instruction using the encryption strategy, and controlling the client to send the encrypted file upload instruction to the server; After receiving the file upload instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file upload instruction, and determines the file storage path corresponding to the file to be uploaded in the server based on the file upload instruction; The file to be uploaded of the client is determined as the interactive file, and the file saving path of the server is determined as the target end of the interactive file.

5. The file interaction method according to claim 4, characterized in that: Encrypting the interactive file by using the file encryption strategy, and transmitting the encrypted interactive file to the target end by using the encrypted transmission channel, including: Controlling the server to create a temporary file according to the data volume of the interactive file; After controlling the client to divide the interaction file according to a preset threshold, the file blocks corresponding to the interaction file are encrypted using the encryption strategy; Control the client to send the encrypted file block to the file saving path corresponding to the server in the target end through the encrypted transmission channel; The server is controlled to decrypt the file blocks using the decryption strategy corresponding to the encryption strategy, and then the decrypted file blocks are sequentially saved in the temporary file.

6. The file interaction method according to claim 3, characterized in that: When the file interaction instruction is the file download instruction; Determining an interactive file between the client and the server based on the file interaction strategy, and determining a target end of the interactive file from the client and the server using the file interaction strategy, including: Obtain the file download instruction corresponding to the file interaction strategy, and control the client to obtain the file saving path corresponding to the file to be downloaded; Encrypting the file download instruction using the encryption strategy, and controlling the client to send the encrypted file download instruction to the server; After receiving the file download instruction, the server uses the decryption policy corresponding to the encryption policy to control the server to decrypt the file download instruction, and determines the file to be downloaded by the server based on the file download instruction; The file to be downloaded on the server is determined as the interactive file, and the file saving path on the client is determined as the target end of the interactive file.

7. The file interaction method according to claim 6, characterized in that: Encrypting the interactive file by using the file encryption strategy, and transmitting the encrypted interactive file to the target end by using the encrypted transmission channel, including: Controlling the client to create a temporary file according to the data volume of the interactive file; After controlling the server to divide the interaction file according to a preset threshold, the file blocks corresponding to the interaction file are encrypted using the encryption strategy; Control the server to send the encrypted file block to the file saving path corresponding to the client in the target end through the encrypted transmission channel; The client is controlled to decrypt the file blocks using the decryption strategy corresponding to the encryption strategy, and then the decrypted file blocks are sequentially saved in the temporary file.

8. The file interaction method according to claim 1, characterized in that: After encrypting the interactive file using the file encryption strategy and transmitting the encrypted interactive file to the target end using the encrypted transmission channel, the method further includes: When it is detected that the data volume of the interactive file received in the target end is lower than a preset threshold, the file interaction process between the client and the server is stopped.

9. A file interaction system, characterized in that: The system is used for the file interaction process between the client and the server, and the system includes: an initialization unit, configured to establish a network connection channel between the client and the server based on a network connection request sent by the client; control the client and the server to perform key exchange based on the network connection channel, and establish an encrypted transmission channel between the client and the server according to a key exchange result; A policy determination unit, configured to obtain a file interaction instruction sent by the client, and determine a file interaction policy and a file encryption policy corresponding to the file interaction instruction; An interaction preparation unit, configured to determine an interaction file between the client and the server based on the file interaction strategy, and determine a target end of the interaction file from the client and the server using the file interaction strategy; The interactive execution unit is used to encrypt the interactive file by using the file encryption strategy, and transmit the encrypted interactive file to the target end by using the encrypted transmission channel.

10. A server, characterized in that: The system comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the file interaction method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for reinforcing network SSL service

    CN101304310A

  • Cloud upload and download method and system of multi-threaded slice

    CN102710630A

  • Method, device and system for implementation of SSL (secure socket layer) / TLS (transport layer security) connection

    CN102811224A

  • Data encryption transmission method and device

    CN107277007A

  • Distributed file storage method and system based on block chain

    CN112256663A