File upload and download method, device, computer device and medium
By verifying user permissions and plug-in information, decrypting the cryptographic text to obtain parameter information, and generating download link address, it solves the problems of confidential leakage and plug-in maintenance during file upload and download, and realizes file security and interoperability of multi-system extensions.
Patent Information
- Application Number
- CN202010286590.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-13
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2040-04-13
AI Technical Summary
The prior art has the risk of confidential leakage and difficulties in maintaining plug-ins during file upload and download, especially when faced with multiple business systems, which are poor interoperability.
By verifying the upload user permissions, decrypting the cipher text to obtain parameter information, verifying the download user permissions, and determining the target business system in multiple business systems, supporting the rapid expansion of multiple business systems and plug-in information verification, and generating the download link address.
Improves file security and interoperability, supports rapid expansion of multiple business systems, and reduces plug-in maintenance workload.
Smart Images

Figure CN113542187B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method, device, computer device and medium for uploading and downloading files. Background Art
[0002] With the popularization of Internet applications and the development of the information industry, the leakage of confidential information will bring certain losses to enterprises. In order to avoid the leakage of confidential information, one of the current traditional methods is to store the files and obtain the storage link address during the file upload process. During the file download process, the user's download permission is restricted by controlling the spread of the storage link address. However, this method may still cause the leakage of confidential files due to hacker attacks. Another traditional method is to develop corresponding plug-ins for each business system and use the developed plug-ins to upload and download files on the corresponding business system. However, this method needs to develop multiple plug-ins when facing multiple different business systems, which leads to problems such as difficulty in plug-in maintenance, that is, this method has poor interoperability. Summary of the Invention
[0003] In view of the above, it is necessary to provide a file upload and download method, device, computer device and medium, which can not only improve the security of files, but also support the horizontal expansion of business systems to improve interoperability.
[0004] A file upload and download method is applied to a computer device that communicates with multiple business systems. The file upload and download method includes:
[0005] When a file upload request is received, determining the uploading user who issued the file upload request and verifying whether the uploading user has upload permission;
[0006] When the uploading user has the upload permission, the data to be uploaded is received and stored, and a download link address is obtained;
[0007] When receiving a file download request corresponding to the download link address, determining a target business system that issues the file download request from the multiple business systems, and extracting ciphertext from the file download request;
[0008] Determine the encryption method of the target business system and determine the decryption method corresponding to the encryption method;
[0009] Decrypting the ciphertext using the decryption method to obtain parameter information, which includes user information, business system information, plug-in information and resource information;
[0010] Determining, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address;
[0011] When the downloading user has the download authority for the file corresponding to the download link address, verifying the plug-in information;
[0012] When the plug-in information passes the verification, the file is obtained from the download link address according to the resource information, and the file download request is responded to with the file.
[0013] According to a preferred embodiment of the present invention, the data to be uploaded includes multiple data blocks, and the receiving and storing of the data to be uploaded and obtaining the download link address includes:
[0014] Obtaining the sending time of the multiple data blocks sent by any business system;
[0015] storing the plurality of data blocks in order from smallest to largest according to the sending time, and determining storage locations of the plurality of data blocks;
[0016] The download link address is generated according to the storage location.
[0017] According to a preferred embodiment of the present invention, generating the download link address according to the storage location includes:
[0018] Obtaining a preset identifier corresponding to the storage location;
[0019] Inserting a start tag at the start position of the preset mark, and inserting an end tag at the end position of the preset mark;
[0020] The download link address is generated according to the start tag, the preset identifier and the end tag.
[0021] According to a preferred embodiment of the present invention, the decryption method is used to decrypt the ciphertext to obtain parameter information, including:
[0022] Segmenting the ciphertext according to a preset label to obtain a plurality of ciphertext segments and a segmentation order, wherein the plurality of ciphertext segments include a first ciphertext segment and other ciphertext segments;
[0023] Get the configuration vector and configuration key;
[0024] For each other ciphertext segment, perform a decryption operation on the other ciphertext segment using the decryption method and the configured key to obtain a first operation result, obtain a previous ciphertext segment of the other ciphertext segment, perform an exclusive-OR operation on the previous ciphertext segment and the first operation result to obtain another plaintext segment corresponding to the other ciphertext segment;
[0025] For the first ciphertext segment, perform a decryption operation on the first ciphertext segment using the decryption method and the configuration key to obtain a second operation result, and perform an exclusive-OR operation on the configuration vector and the second operation result to obtain a first plaintext segment corresponding to the first ciphertext segment;
[0026] The first plaintext segment and the other plaintext segments are combined according to the segmentation order to obtain the parameter information.
[0027] According to a preferred embodiment of the present invention, determining, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address includes:
[0028] Obtaining from the first configuration library the target number of the business system that has download authority for the file corresponding to the download link address, and extracting the system number from the business system information;
[0029] detecting whether the system number belongs to the target number;
[0030] When it is detected that the system number belongs to the target number, obtaining a target identification code having download authority for the file corresponding to the download link address from a second configuration library, and extracting a user identification code of the downloading user from the user information;
[0031] detecting whether the user identification code belongs to the target identification code;
[0032] When it is detected that the user identification code belongs to the target identification code, it is determined that the downloading user has the download authority for the file corresponding to the download link address.
[0033] According to a preferred embodiment of the present invention, the plug-in information includes the current time and the code to be verified, and the verification of the plug-in information includes:
[0034] Obtaining the validity period corresponding to the download link address from a third configuration library;
[0035] Obtaining a first tag, and extracting information corresponding to the first tag from the plug-in information as the current time;
[0036] Check whether the current time is within the valid time;
[0037] When it is detected that the current time is within the valid time, obtaining a second tag, and extracting information corresponding to the second tag from the plug-in information as the code to be verified;
[0038] Obtaining a file extraction code corresponding to the download link address from a fourth configuration library;
[0039] Detecting whether the code to be verified is the same as the file extraction code;
[0040] When it is detected that the code to be verified is identical to the file extraction code, it is determined that the plug-in information passes the verification.
[0041] According to a preferred embodiment of the present invention, the file uploading and downloading method further includes:
[0042] When the downloading user does not have the download authority for the file corresponding to the download link address, or the plug-in information fails to pass the verification, an alarm message is generated and the level of the alarm message is determined;
[0043] Determine an alarm mode according to the level;
[0044] The warning information is issued in the warning manner.
[0045] A file upload and download device, which runs on a computer device, wherein the computer device communicates with multiple business systems, and the file upload and download device comprises:
[0046] a verification unit, configured to, upon receiving a file upload request, determine the upload user who issued the file upload request and verify whether the upload user has upload authority;
[0047] An execution unit, configured to receive and store the data to be uploaded and obtain a download link address when the uploading user has upload authority;
[0048] a determining unit configured to, upon receiving a file download request corresponding to the download link address, determine a target business system that issues the file download request from the multiple business systems, and extract ciphertext from the file download request;
[0049] The determining unit is further configured to determine an encryption method of the target business system and a decryption method corresponding to the encryption method;
[0050] a decryption unit, configured to decrypt the ciphertext using the decryption method to obtain parameter information, wherein the parameter information includes user information, business system information, plug-in information, and resource information;
[0051] The determining unit is further configured to determine, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address;
[0052] The verification unit is further configured to verify the plug-in information when the downloading user has download authority for the file corresponding to the download link address;
[0053] The responding unit is configured to obtain a file from the download link address according to the resource information when the plug-in information passes the verification, and respond to the file download request with the file.
[0054] According to a preferred embodiment of the present invention, the data to be uploaded includes multiple data blocks, the execution unit receives and stores the data to be uploaded, and obtaining the download link address includes:
[0055] Obtaining the sending time of the multiple data blocks sent by any business system;
[0056] storing the plurality of data blocks in order from smallest to largest according to the sending time, and determining storage locations of the plurality of data blocks;
[0057] The download link address is generated according to the storage location.
[0058] According to a preferred embodiment of the present invention, the execution unit generates the download link address according to the storage location, including:
[0059] Obtaining a preset identifier corresponding to the storage location;
[0060] Inserting a start tag at the start position of the preset mark, and inserting an end tag at the end position of the preset mark;
[0061] The download link address is generated according to the start tag, the preset identifier and the end tag.
[0062] According to a preferred embodiment of the present invention, the decryption unit is specifically configured to:
[0063] Segmenting the ciphertext according to a preset label to obtain a plurality of ciphertext segments and a segmentation order, wherein the plurality of ciphertext segments include a first ciphertext segment and other ciphertext segments;
[0064] Get the configuration vector and configuration key;
[0065] For each other ciphertext segment, perform a decryption operation on the other ciphertext segment using the decryption method and the configured key to obtain a first operation result, obtain a previous ciphertext segment of the other ciphertext segment, perform an exclusive-OR operation on the previous ciphertext segment and the first operation result to obtain another plaintext segment corresponding to the other ciphertext segment;
[0066] For the first ciphertext segment, perform a decryption operation on the first ciphertext segment using the decryption method and the configuration key to obtain a second operation result, and perform an exclusive-OR operation on the configuration vector and the second operation result to obtain a first plaintext segment corresponding to the first ciphertext segment;
[0067] The first plaintext segment and the other plaintext segments are combined according to the segmentation order to obtain the parameter information.
[0068] According to a preferred embodiment of the present invention, the determining unit determines, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address, including:
[0069] Obtaining from the first configuration library the target number of the business system that has download authority for the file corresponding to the download link address, and extracting the system number from the business system information;
[0070] detecting whether the system number belongs to the target number;
[0071] When it is detected that the system number belongs to the target number, obtaining a target identification code having download authority for the file corresponding to the download link address from a second configuration library, and extracting a user identification code of the downloading user from the user information;
[0072] detecting whether the user identification code belongs to the target identification code;
[0073] When it is detected that the user identification code belongs to the target identification code, it is determined that the downloading user has the download authority for the file corresponding to the download link address.
[0074] According to a preferred embodiment of the present invention, the plug-in information includes the current time and the code to be verified, and the verification unit verifies that the plug-in information includes:
[0075] Obtaining the validity period corresponding to the download link address from a third configuration library;
[0076] Obtaining a first tag, and extracting information corresponding to the first tag from the plug-in information as the current time;
[0077] Check whether the current time is within the valid time;
[0078] When it is detected that the current time is within the valid time, obtaining a second tag, and extracting information corresponding to the second tag from the plug-in information as the code to be verified;
[0079] Obtaining a file extraction code corresponding to the download link address from a fourth configuration library;
[0080] Detecting whether the code to be verified is the same as the file extraction code;
[0081] When it is detected that the code to be verified is identical to the file extraction code, it is determined that the plug-in information passes the verification.
[0082] According to a preferred embodiment of the present invention, the device further comprises:
[0083] a generating unit, configured to generate warning information and determine a level of the warning information when the downloading user does not have download authority for the file corresponding to the download link address or the plug-in information fails to pass verification;
[0084] The determining unit is further configured to determine an alarm mode according to the level;
[0085] The sending unit is used to send the alarm information in the alarm manner.
[0086] A computer device, comprising:
[0087] a memory storing at least one instruction; and
[0088] The processor obtains the instructions stored in the memory to implement the file uploading and downloading method.
[0089] A computer-readable storage medium stores at least one instruction, wherein the at least one instruction is acquired by a processing device in a business system to implement the file upload and download method and / or the at least one instruction is acquired by a processor in a computer device to implement the file upload and download method.
[0090] It can be seen from the above technical solutions that the present invention can improve the security of files through dual verification of user permissions and plug-in information. In addition, when facing multiple business systems, there is no need to maintain multiple sets of plug-in codes. Only the business system information needs to be reconfigured, which supports the rapid horizontal expansion of multiple business systems and improves interoperability. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 This is an application environment diagram of a preferred embodiment of the file upload and download method of the present invention.
[0092] Figure 2 It is a flow chart of a preferred embodiment of the file upload and download method of the present invention.
[0093] Figure 3 It is a functional module diagram of a preferred embodiment of the file upload and download device of the present invention.
[0094] Figure 4 It is a structural diagram of a computer device according to a preferred embodiment of the present invention for implementing the method for uploading and downloading files. DETAILED DESCRIPTION
[0095] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0096] like Figure 1 FIG. 1 is an application environment diagram of a preferred embodiment of the file upload and download method of the present invention. The application environment diagram includes a computer device 1 and multiple business systems 2. The computer device 1 communicates with the multiple business systems 2, and the multiple business systems 2 include one or more user terminals.
[0097] The multiple business systems 2 are used to encrypt parameter information, and the multiple business systems 2 are also used to generate and send file upload requests and file download requests.
[0098] like Figure 2 FIG. 1 is a flow chart of a preferred embodiment of the file upload and download method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0099] The file upload and download method is applied to one or more computer devices 1. The computer device 1 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.
[0100] The network where the computer device 1 is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0101] The file upload and download method is applied to the computer device 1 , and the computer device 1 communicates with the multiple business systems 2 .
[0102] S10: When a file upload request is received, the uploading user who issues the file upload request is determined, and whether the uploading user has upload authority is verified.
[0103] In at least one embodiment of the present invention, the file upload request can be triggered by the uploading user (for example, by a preset function button), or can be automatically triggered within a preset time by the uploading user, which is not limited by the present invention.
[0104] The preset time may be a time point (eg, nine o'clock every morning) or a time period.
[0105] In at least one embodiment of the present invention, the information carried in the file upload request includes, but is not limited to: the target work number of the uploading user, the business system that issues the file upload request, etc.
[0106] In at least one embodiment of the present invention, the computer device 1 determines the uploading user who issues the file upload request and verifies whether the uploading user has the upload permission, including:
[0107] The computer device 1 extracts the target work number of the uploading user from the file upload request. Further, the computer device 1 obtains all work numbers with upload permission and detects whether the target work number belongs to all work numbers. When it is detected that the target work number belongs to all work numbers, the computer device 1 determines that the uploading user has upload permission.
[0108] In at least one embodiment of the present invention, when the uploading user does not have upload authority, the computer device 1 issues a reminder message. The recipient of the reminder message may be the business system logged in by the uploading user.
[0109] S11, when the uploading user has the upload authority, the data to be uploaded is received and stored, and a download link address is obtained.
[0110] In at least one embodiment of the present invention, the data to be uploaded includes a plurality of data blocks. Furthermore, the data to be uploaded is stored in a storage location corresponding to the download link address.
[0111] In at least one embodiment of the present invention, the computer device 1 receives and stores the data to be uploaded, and obtaining the download link address includes:
[0112] The computer device 1 obtains the sending time of the multiple data blocks sent by any business system. Further, the computer device 1 stores the multiple data blocks in sequence from small to large according to the sending time. The computer device 1 determines the storage location of the multiple data blocks. Further, the computer device 1 generates the download link address according to the storage location.
[0113] By receiving the data to be uploaded in segments, the storage efficiency of the data to be uploaded is improved.
[0114] In at least one embodiment of the present invention, the computer device 1 generates the download link address according to the storage location, including:
[0115] The computer device 1 obtains a preset identifier corresponding to the storage location. Further, the computer device 1 inserts a start tag at the starting position of the preset identifier and inserts an end tag at the ending position of the preset identifier. Further, the computer device 1 generates the download link address based on the start tag, the preset identifier and the end tag.
[0116] For example, the computer device 1 obtains a preset identifier of cunchuweizhia1, a start tag of http.pan / , and an end tag of / .com, and the computer device 1 can generate the download link address of http.pan / cunchuweizhia1 / .com.
[0117] Through the above implementation, the download link address can be quickly generated.
[0118] S12 , when a file download request corresponding to the download link address is received, a target business system 2 that issues the file download request is determined from the multiple business systems, and a ciphertext is extracted from the file download request.
[0119] In at least one embodiment of the present invention, the file download request may be triggered by a downloading user.
[0120] Furthermore, the information carried in the file download request includes, but is not limited to: the download link address, the target business system that issues the file download request, the ciphertext, and the like.
[0121] In at least one embodiment of the present invention, the computer device 1 determines the target business system 2 that issues the file download request from the multiple business systems 2, including:
[0122] The computer device 1 parses the message header of the file download request to obtain the sender of the file download request. Further, the computer device 1 determines the sender as the target business system 2.
[0123] In at least one embodiment of the present invention, the computer device 1 parses the method body of the file download request to obtain the ciphertext.
[0124] S13, determining the encryption method of the target business system 2, and determining a decryption method corresponding to the encryption method.
[0125] In at least one embodiment of the present invention, the encryption method may be Cipher Block Chaining (CBC) mode of the Advanced Encryption Standard (AES) algorithm, and further, the decryption method is an inverse operation of the encryption method.
[0126] In at least one embodiment of the present invention, the computer device 1 stores a mapping relationship between the encryption method and the decryption method.
[0127] S14, decrypting the ciphertext using the decryption method to obtain parameter information, where the parameter information includes user information, business system information, plug-in information, and resource information.
[0128] In at least one embodiment of the present invention, the computer device 1 decrypts the ciphertext using the decryption method to obtain parameter information including:
[0129] The computer device 1 divides the ciphertext according to a preset label to obtain multiple ciphertext segments and a division order, wherein the multiple ciphertext segments include a first ciphertext segment and other ciphertext segments. Further, the computer device 1 obtains a configuration vector and a configuration key. For each other ciphertext segment, the computer device 1 uses the decryption method and the configuration key to perform a decryption operation on the other ciphertext segment to obtain a first operation result, obtains a previous ciphertext segment of the other ciphertext segment, performs an XOR operation on the previous ciphertext segment and the first operation result to obtain other plaintext segments corresponding to the other ciphertext segments, and the computer device 1 uses the decryption method and the configuration key to perform a decryption operation on the first ciphertext segment to obtain a second operation result, performs an XOR operation on the configuration vector and the second operation result to obtain a first plaintext segment corresponding to the first ciphertext segment. Further, the computer device 1 combines the first plaintext segment and the other plaintext segments according to the division order to obtain the parameter information.
[0130] By decrypting the ciphertext in the decryption manner, the parameter information can be accurately obtained.
[0131] S15: Determine, based on the user information and the business system information, whether the downloading user corresponding to the user information has the download authority for the file corresponding to the download link address.
[0132] In at least one embodiment of the present invention, the computer device 1 determines, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address, including:
[0133] The computer device 1 obtains the target number of the business system that has download authority for the file corresponding to the download link address from the first configuration library, and the computer device 1 extracts the system number from the business system information. Further, the computer device 1 detects whether the system number belongs to the target number. When it is detected that the system number belongs to the target number, the computer device 1 obtains the target identification code that has download authority for the file corresponding to the download link address from the second configuration library, and extracts the user identification code of the downloading user from the user information. The computer device 1 detects whether the user identification code belongs to the target identification code. When it is detected that the user identification code belongs to the target identification code, the computer device 1 determines that the downloading user has download authority for the file corresponding to the download link address.
[0134] Among them, the first configuration library stores a mapping relationship between multiple download link addresses and the numbers of business systems that have download permissions for the files corresponding to the multiple download link addresses. Furthermore, the second configuration library stores a mapping relationship between multiple download link addresses and user identification codes that have download permissions for the files corresponding to the multiple download link addresses.
[0135] By performing double verification on the business system and the downloading user, it is possible to more accurately determine whether the downloading user has the download authority for the file corresponding to the download link address, thereby improving the security of the file.
[0136] S16: When the downloading user has the download authority for the file corresponding to the download link address, verify the plug-in information.
[0137] In at least one embodiment of the present invention, the plug-in information includes the current time and a code to be verified.
[0138] In at least one embodiment of the present invention, the computer device 1 verifies the plug-in information including:
[0139] The computer device 1 obtains the valid time corresponding to the download link address from the third configuration library, and the computer device 1 obtains a first label. Further, the computer device 1 extracts information corresponding to the first label from the plug-in information as the current time. Further, the computer device 1 detects whether the current time is within the valid time. When it is detected that the current time is within the valid time, the computer device 1 obtains a second label and extracts information corresponding to the second label from the plug-in information as the code to be verified. The computer device 1 obtains a file extraction code corresponding to the download link address from the fourth configuration library. Further, the computer device 1 detects whether the code to be verified is the same as the file extraction code. When it is detected that the code to be verified is the same as the file extraction code, the computer device 1 determines that the plug-in information has passed the verification.
[0140] By verifying the plug-in information, the downloading user can be verified again, ensuring that the downloading user has the download authority for the file corresponding to the download link address, thereby further improving the security of the file.
[0141] In at least one embodiment of the present invention, the file uploading and downloading method further includes:
[0142] When the downloading user does not have the download permission for the file corresponding to the download link address, or the plug-in information fails to pass the verification, the computer device 1 generates an alarm message and determines the level of the alarm message. The computer device 1 determines the alarm method according to the level and issues the alarm message in the alarm method.
[0143] Through the above implementation, when the downloading user does not have the download authority for the file corresponding to the download link address, or the plug-in information fails to pass verification, an alarm message can be issued in time to prevent users without download authority from downloading the file, thereby improving security.
[0144] S17: When the plug-in information passes the verification, obtain the file from the download link address according to the resource information, and respond to the file download request with the file.
[0145] In at least one embodiment of the present invention, after obtaining the file from the download link address according to the resource information, the computer device 1 obtains rendering parameters and renders the file using the rendering parameters.
[0146] The rendering parameter may be a watermark.
[0147] In at least one embodiment of the present invention, after obtaining the file from the download link address according to the resource information, the method further includes:
[0148] The computer device 1 obtains the file name of the file and generates prompt information according to the file name. Furthermore, the computer device 1 sends the prompt information to the terminal device of the designated contact.
[0149] Through the above implementation, when the file is obtained, the designated contact person can be promptly reminded to receive the file.
[0150] It can be seen from the above technical solutions that the present invention can improve the security of files through dual verification of user permissions and plug-in information. In addition, when facing multiple business systems, there is no need to maintain multiple sets of plug-in codes. Only the business system information needs to be reconfigured, which supports the rapid horizontal expansion of multiple business systems and improves interoperability.
[0151] like Figure 3 , is a functional module diagram of a preferred embodiment of the file upload and download device of the present invention. The file upload and download device 11 includes a verification unit 110, an execution unit 111, a determination unit 112, a decryption unit 113, a response unit 114, a generation unit 115 and a sending unit 116. The module / unit referred to in the present invention refers to a type of unit that can be processed by the processor 13 (e.g., Figure 4 As shown in FIG) obtained and capable of completing a series of computer program segments of fixed functions, which are stored in the memory 12 (as shown in FIG) Figure 4 In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.
[0152] The file upload and download device 11 runs on the computer device 1 , and the computer device 1 communicates with the multiple business systems 2 .
[0153] When receiving a file upload request, the verification unit 110 determines the uploading user who issued the file upload request and verifies whether the uploading user has the upload permission.
[0154] In at least one embodiment of the present invention, the file upload request can be triggered by the uploading user (for example, by a preset function button), or can be automatically triggered within a preset time by the uploading user, which is not limited by the present invention.
[0155] The preset time may be a time point (eg, nine o'clock every morning) or a time period.
[0156] In at least one embodiment of the present invention, the information carried in the file upload request includes, but is not limited to: the target work number of the uploading user, the business system that issues the file upload request, etc.
[0157] In at least one embodiment of the present invention, the verification unit 110 determines the uploading user who issues the file upload request and verifies whether the uploading user has the upload permission, including:
[0158] The verification unit 110 extracts the target work number of the uploading user from the file upload request. Further, the verification unit 110 obtains all work numbers with upload permission and detects whether the target work number belongs to all work numbers. When it is detected that the target work number belongs to all work numbers, the verification unit 110 determines that the uploading user has upload permission.
[0159] In at least one embodiment of the present invention, when the uploading user does not have upload authority, the sending unit 116 sends a reminder message. The recipient of the reminder message may be the business system logged in by the uploading user.
[0160] When the uploading user has the upload authority, the execution unit 111 receives and stores the data to be uploaded, and obtains a download link address.
[0161] In at least one embodiment of the present invention, the data to be uploaded includes a plurality of data blocks. Furthermore, the data to be uploaded is stored in a storage location corresponding to the download link address.
[0162] In at least one embodiment of the present invention, the execution unit 111 receives and stores the data to be uploaded, and obtaining the download link address includes:
[0163] The execution unit 111 obtains the sending time of the multiple data blocks sent by any business system. Further, the execution unit 111 stores the multiple data blocks in sequence from small to large according to the sending time, and determines the storage location of the multiple data blocks. The execution unit 111 generates the download link address according to the storage location.
[0164] By receiving the data to be uploaded in segments, the storage efficiency of the data to be uploaded is improved.
[0165] In at least one embodiment of the present invention, the executing unit 111 generates the download link address according to the storage location, including:
[0166] The execution unit 111 obtains a preset identifier corresponding to the storage location. Further, the execution unit 111 inserts a start tag at the start position of the preset identifier and inserts an end tag at the end position of the preset identifier. Furthermore, the execution unit 111 generates the download link address based on the start tag, the preset identifier and the end tag.
[0167] For example, if the execution unit 111 obtains a preset identifier of cunchuweizhia1, a start tag of http.pan / , and an end tag of / .com, the execution unit 111 can generate the download link address of http.pan / cunchuweizhia1 / .com.
[0168] Through the above implementation, the download link address can be quickly generated.
[0169] When receiving the file download request corresponding to the download link address, the determining unit 112 determines the target business system 2 that issues the file download request from the multiple business systems, and extracts ciphertext from the file download request.
[0170] In at least one embodiment of the present invention, the file download request may be triggered by a downloading user.
[0171] Furthermore, the information carried in the file download request includes, but is not limited to: the download link address, the target business system that issues the file download request, the ciphertext, and the like.
[0172] In at least one embodiment of the present invention, the determining unit 112 determines the target business system 2 that issues the file download request from the multiple business systems 2, including:
[0173] The determining unit 112 parses the message header of the file download request to obtain the sender of the file download request, and determines the sender as the target service system 2 .
[0174] In at least one embodiment of the present invention, the determining unit 112 parses the method body of the file download request to obtain the ciphertext.
[0175] The determining unit 112 determines the encryption method of the target business system 2 and determines a decryption method corresponding to the encryption method.
[0176] In at least one embodiment of the present invention, the encryption method may be Cipher Block Chaining (CBC) mode of the Advanced Encryption Standard (AES) algorithm, and further, the decryption method is an inverse operation of the encryption method.
[0177] In at least one embodiment of the present invention, the computer device 1 stores a mapping relationship between the encryption method and the decryption method.
[0178] The decryption unit 113 decrypts the ciphertext using the decryption method to obtain parameter information, which includes user information, business system information, plug-in information, and resource information.
[0179] In at least one embodiment of the present invention, the decryption unit 113 decrypts the ciphertext using the decryption method to obtain parameter information including:
[0180] The decryption unit 113 divides the ciphertext into segments according to a preset label to obtain multiple ciphertext segments and a division order, wherein the multiple ciphertext segments include a first ciphertext segment and other ciphertext segments. Further, a configuration vector and a configuration key are obtained. The decryption unit 113 performs a decryption operation on each other ciphertext segment using the decryption method and the configuration key to obtain a first operation result, obtains a previous ciphertext segment of the other ciphertext segment, performs an XOR operation on the previous ciphertext segment and the first operation result to obtain other plaintext segments corresponding to the other ciphertext segments. The decryption unit 113 performs a decryption operation on the first ciphertext segment using the decryption method and the configuration key to obtain a second operation result, performs an XOR operation on the configuration vector and the second operation result to obtain a first plaintext segment corresponding to the first ciphertext segment. Further, the decryption unit 113 combines the first plaintext segment and the other plaintext segments according to the division order to obtain the parameter information.
[0181] By decrypting the ciphertext in the decryption manner, the parameter information can be accurately obtained.
[0182] The determining unit 112 determines, based on the user information and the business system information, whether the downloading user corresponding to the user information has the download authority for the file corresponding to the download link address.
[0183] In at least one embodiment of the present invention, the determining unit 112 determines, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address, including:
[0184] The determining unit 112 obtains the target number of the business system that has the download permission for the file corresponding to the download link address from the first configuration library, extracts the system number from the business system information, and detects whether the system number belongs to the target number. When it is detected that the system number belongs to the target number, the determining unit 112 obtains the target identification code that has the download permission for the file corresponding to the download link address from the second configuration library, extracts the user identification code of the downloading user from the user information, and detects whether the user identification code belongs to the target identification code. When it is detected that the user identification code belongs to the target identification code, the determining unit 112 determines that the downloading user has the download permission for the file corresponding to the download link address.
[0185] Among them, the first configuration library stores a mapping relationship between multiple download link addresses and the numbers of business systems that have download permissions for the files corresponding to the multiple download link addresses. Furthermore, the second configuration library stores a mapping relationship between multiple download link addresses and user identification codes that have download permissions for the files corresponding to the multiple download link addresses.
[0186] By performing double verification on the business system and the downloading user, it is possible to more accurately determine whether the downloading user has the download authority for the file corresponding to the download link address, thereby improving the security of the file.
[0187] When the downloading user has the download authority for the file corresponding to the download link address, the verification unit 110 verifies the plug-in information.
[0188] In at least one embodiment of the present invention, the plug-in information includes the current time and a code to be verified.
[0189] In at least one embodiment of the present invention, the verification unit 110 verifies the plug-in information including:
[0190] The verification unit 110 obtains the valid time corresponding to the download link address from the third configuration library, the verification unit 110 obtains a first tag, and extracts information corresponding to the first tag from the plug-in information as the current time. Further, the verification unit 110 detects whether the current time is within the valid time. When it is detected that the current time is within the valid time, the verification unit 110 obtains a second tag, and extracts information corresponding to the second tag from the plug-in information as the code to be verified. The verification unit 110 obtains a file extraction code corresponding to the download link address from the fourth configuration library. Further, the verification unit 110 detects whether the code to be verified is the same as the file extraction code. When it is detected that the code to be verified is the same as the file extraction code, the verification unit 110 determines that the plug-in information has passed the verification.
[0191] By verifying the plug-in information, the downloading user can be verified again, ensuring that the downloading user has the download authority for the file corresponding to the download link address, thereby further improving the security of the file.
[0192] In at least one embodiment of the present invention, when the downloading user does not have the download permission for the file corresponding to the download link address, or the plug-in information fails to pass the verification, the generation unit 115 generates an alarm message and determines the level of the alarm message, the determination unit 112 determines the alarm method according to the level, and the sending unit 116 sends the alarm message in the alarm method.
[0193] Through the above implementation, when the downloading user does not have the download authority for the file corresponding to the download link address, or the plug-in information fails to pass verification, an alarm message can be issued in time to prevent users without download authority from downloading the file, thereby improving security.
[0194] When the plug-in information passes the verification, the response unit 114 obtains the file from the download link address according to the resource information, and responds to the file download request with the file.
[0195] In at least one embodiment of the present invention, after obtaining the file from the download link address according to the resource information, the responding unit 114 obtains rendering parameters and renders the file using the rendering parameters.
[0196] The rendering parameter may be a watermark.
[0197] In at least one embodiment of the present invention, after obtaining the file from the download link address according to the resource information, the method further includes:
[0198] The execution unit 111 obtains the file name of the file and generates prompt information according to the file name. Furthermore, the sending unit 116 sends the prompt information to the terminal device of the designated contact.
[0199] Through the above implementation, when the file is obtained, the designated contact person can be promptly reminded to receive the file.
[0200] It can be seen from the above technical solutions that the present invention can improve the security of files through dual verification of user permissions and plug-in information. In addition, when facing multiple business systems, there is no need to maintain multiple sets of plug-in codes. Only the business system information needs to be reconfigured, which supports the rapid horizontal expansion of multiple business systems and improves interoperability.
[0201] like Figure 4 FIG. 1 is a schematic diagram of the structure of a computer device according to a preferred embodiment of the present invention for implementing a method for uploading and downloading files.
[0202] In one embodiment of the present invention, the computer device 1 includes, but is not limited to, a memory 12 , a processor 13 , and a computer program stored in the memory 12 and executable on the processor 13 , such as a file upload and download program.
[0203] Those skilled in the art will understand that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation on the computer device 1. The computer device 1 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 1 may also include input and output devices, network access devices, buses, etc.
[0204] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. The processor 13 is the computing core and control center of the computer device 1, connecting various parts of the entire computer device 1 using various interfaces and lines, and obtaining the operating system of the computer device 1 and various installed application programs, program codes, etc.
[0205] The processor 13 obtains the operating system and various installed applications of the computer device 1. The processor 13 obtains the applications to implement the steps in the above-mentioned various file upload and download method embodiments, for example Figure 2 Steps shown.
[0206] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and retrieved by the processor 13 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the process of obtaining the computer program in the computer device 1. For example, the computer program may be divided into a verification unit 110, an execution unit 111, a determination unit 112, a decryption unit 113, a response unit 114, a generation unit 115, and a sending unit 116.
[0207] The memory 12 can be used to store the computer programs and / or modules. The processor 13 implements the various functions of the computer device 1 by running or accessing the computer programs and / or modules stored in the memory 12, as well as accessing the data stored in the memory 12. The memory 12 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the computer device. Furthermore, the memory 12 may include non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.
[0208] The memory 12 may be an external memory and / or an internal memory of the computer device 1. Furthermore, the memory 12 may be a physical memory, such as a memory stick, a TF card (Trans-flash Card), and the like.
[0209] If the modules / units integrated in the computer device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can also implement all or part of the processes in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is obtained by a processor, it can implement the steps of each of the above-mentioned method embodiments.
[0210] The computer program includes computer program code, which may be in source code form, object code form, an accessible file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0211] Combine Figure 2 The memory 12 in the computer device 1 stores a plurality of instructions to implement a file upload and download method, and the processor 13 can obtain the plurality of instructions to implement: when receiving a file upload request, determining the uploading user who issued the file upload request, and verifying whether the uploading user has the upload permission; when the uploading user has the upload permission, receiving and storing the data to be uploaded, and obtaining a download link address; when receiving a file download request corresponding to the download link address, determining the target business system that issued the file download request from the plurality of business systems, and extracting the ciphertext from the file download request; determining the encryption method of the target business system formula, and determine the decryption method corresponding to the encryption method; use the decryption method to decrypt the ciphertext to obtain parameter information, wherein the parameter information includes user information, business system information, plug-in information and resource information; based on the user information and the business system information, determine whether the downloading user corresponding to the user information has the download authority for the file corresponding to the download link address; when the downloading user has the download authority for the file corresponding to the download link address, verify the plug-in information; when the plug-in information passes the verification, obtain the file from the download link address according to the resource information, and respond to the file download request with the file.
[0212] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0213] In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods.
[0214] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0215] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0216] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.
[0217] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.
[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for uploading and downloading files, characterized in that: The file upload and download method is applied to a computer device, and the computer device communicates with multiple business systems. The file upload and download method includes: When a file upload request is received, determining the uploading user who issued the file upload request and verifying whether the uploading user has upload permission; When the uploading user has the upload permission, the data to be uploaded is received and stored, and a download link address is obtained; When receiving a file download request corresponding to the download link address, determining a target business system that issues the file download request from the multiple business systems, and extracting ciphertext from the file download request; Determine the encryption method of the target business system and determine the decryption method corresponding to the encryption method; Decrypting the ciphertext using the decryption method to obtain parameter information, the parameter information including user information, business system information, plug-in information and resource information, the plug-in information including the current time and the code to be verified; Determining, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address; When the downloading user has the download authority for the file corresponding to the download link address, verifying the plug-in information; When the plug-in information passes the verification, the file is obtained from the download link address according to the resource information, and the file download request is responded to with the file.
2. The file upload and download method according to claim 1, wherein: The data to be uploaded includes a plurality of data blocks, and the receiving and storing of the data to be uploaded and obtaining the download link address include: Obtaining the sending time of the multiple data blocks sent by any business system; storing the plurality of data blocks in order from smallest to largest according to the sending time, and determining storage locations of the plurality of data blocks; The download link address is generated according to the storage location.
3. The file upload and download method according to claim 2, wherein: Generating the download link address according to the storage location includes: Obtaining a preset identifier corresponding to the storage location; Inserting a start tag at the start position of the preset mark, and inserting an end tag at the end position of the preset mark; The download link address is generated according to the start tag, the preset identifier and the end tag.
4. The file upload and download method according to claim 1, wherein: Decrypting the ciphertext using the decryption method to obtain parameter information includes: Segmenting the ciphertext according to a preset label to obtain a plurality of ciphertext segments and a segmentation order, wherein the plurality of ciphertext segments include a first ciphertext segment and other ciphertext segments; Get the configuration vector and configuration key; For each other ciphertext segment, perform a decryption operation on the other ciphertext segment using the decryption method and the configured key to obtain a first operation result, obtain a previous ciphertext segment of the other ciphertext segment, perform an exclusive-OR operation on the previous ciphertext segment and the first operation result to obtain another plaintext segment corresponding to the other ciphertext segment; For the first ciphertext segment, perform a decryption operation on the first ciphertext segment using the decryption method and the configuration key to obtain a second operation result, and perform an exclusive-OR operation on the configuration vector and the second operation result to obtain a first plaintext segment corresponding to the first ciphertext segment; The first plaintext segment and the other plaintext segments are combined according to the segmentation order to obtain the parameter information.
5. The file upload and download method according to claim 1, wherein: The determining, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address includes: Obtaining from the first configuration library the target number of the business system that has download authority for the file corresponding to the download link address, and extracting the system number from the business system information; detecting whether the system number belongs to the target number; When it is detected that the system number belongs to the target number, obtaining a target identification code having download authority for the file corresponding to the download link address from a second configuration library, and extracting a user identification code of the downloading user from the user information; detecting whether the user identification code belongs to the target identification code; When it is detected that the user identification code belongs to the target identification code, it is determined that the downloading user has the download authority for the file corresponding to the download link address.
6. The file upload and download method according to claim 1, wherein: The verifying the plug-in information includes: Obtaining the validity period corresponding to the download link address from a third configuration library; Obtaining a first tag, and extracting information corresponding to the first tag from the plug-in information as the current time; Check whether the current time is within the valid time; When it is detected that the current time is within the valid time, obtaining a second tag, and extracting information corresponding to the second tag from the plug-in information as the code to be verified; Obtaining a file extraction code corresponding to the download link address from a fourth configuration library; Detecting whether the code to be verified is the same as the file extraction code; When it is detected that the code to be verified is identical to the file extraction code, it is determined that the plug-in information passes the verification.
7. The file upload and download method according to claim 1, wherein: The file upload and download method further includes: When the downloading user does not have the download authority for the file corresponding to the download link address, or the plug-in information fails to pass the verification, an alarm message is generated and the level of the alarm message is determined; Determine an alarm mode according to the level; The warning information is issued in the warning manner.
8. A file upload and download device, characterized in that: The file upload and download device runs on a computer device, and the computer device communicates with multiple business systems. The file upload and download device includes: a verification unit, configured to, upon receiving a file upload request, determine the upload user who issued the file upload request and verify whether the upload user has upload authority; An execution unit, configured to receive and store the data to be uploaded and obtain a download link address when the uploading user has upload authority; a determining unit configured to, upon receiving a file download request corresponding to the download link address, determine a target business system that issues the file download request from the multiple business systems, and extract ciphertext from the file download request; The determining unit is further configured to determine an encryption method of the target business system and a decryption method corresponding to the encryption method; a decryption unit, configured to decrypt the ciphertext using the decryption method to obtain parameter information, wherein the parameter information includes user information, business system information, plug-in information, and resource information, and the plug-in information includes the current time and a code to be verified; The determining unit is further configured to determine, based on the user information and the business system information, whether the downloading user corresponding to the user information has download authority for the file corresponding to the download link address; The verification unit is further configured to verify the plug-in information when the downloading user has download authority for the file corresponding to the download link address; The responding unit is configured to obtain a file from the download link address according to the resource information when the plug-in information passes the verification, and respond to the file download request with the file.
9. A computer device, characterized in that: The computer device comprises: a memory storing at least one instruction; and The processor obtains the instructions stored in the memory to implement the file upload and download method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is acquired by a processor in a computer device to implement the file uploading and downloading method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hyper text transfer protocol (HTTP) / hypertext transfer protocol secure (HTTPS) behavior management and control auditing method based on Web proxy
CN102868738A
Security verification method, security verification device and mobile terminal for plugin call in mobile terminal
CN102883324A