File uploading method and device, electronic equipment and storage medium
By copying and associating storage target files in the file server, the problems of network delay and slow processing speed in traditional file upload methods are solved, efficient file upload is achieved, and network bandwidth and delay are reduced.
Patent Information
- Application Number
- CN202410287355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2024-10-01
AI Technical Summary
The traditional file upload method has problems such as high network latency and slow processing speed. Especially when managing unstructured enterprise data, it is difficult to meet the high efficiency and low bandwidth requirements.
By copying the target file in the file server and associating it with the file information to the storage path, copying it directly to the hard disk avoids receiving files from the client device and reduces network bandwidth and latency.
It achieves fast file copying and efficient processing, reduces network bandwidth and delay, and improves the speed and efficiency of file upload.
Smart Images

Figure CN118740822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, specifically to the field of file storage, and in particular to a file uploading method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of enterprise digital transformation, the amount of data has exploded, and unstructured data (such as text, images, videos, etc.) has begun to occupy a large proportion of enterprise data. Traditional data warehouses can no longer meet the needs of enterprises for data management.
[0003] Minio object storage is a new type of data storage method. It has the characteristics of high reliability, high availability, and high scalability. It is very suitable for use with traditional data warehouses to store unstructured data. Traditional file uploads require uploading files to the backend, and then the backend saves them to the Minio server. This method has high network latency and slow processing speed.
[0004] In order to ensure that the data warehouse can manage the enterprise's unstructured data more efficiently, a more time-saving and bandwidth-saving file upload method is needed. Summary of the invention
[0005] Embodiments of the present disclosure provide a file uploading method, device, electronic device and storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a file upload method, comprising: in response to receiving a credential application request from a user end, parsing the credential application request, and determining file information of a target file, wherein the credential application request is generated by the user end after receiving the target file uploaded by the user; determining a storage path and a file identification value of the target file based on the file information; determining whether the target file has been stored in a file server based on the file identification value; in response to determining that the target file has been stored in the file server, calling a file server interface, copying the target file, and associating the target file with the file information and storing it in the storage path; generating a first response information and returning it to the user end.
[0007] In a second aspect, an embodiment of the present disclosure provides another file upload method, comprising: in response to receiving a target file uploaded by a user, determining a user identifier of the user and attribute information of the target file; generating a file identification value of the target file; determining file information of the target file based on the user identifier, attribute information and file identification value; encapsulating the file information in a credential application request and sending it to a back-end server, so that the back-end server determines whether the target file is already stored in the file server based on the credential application request; in response to receiving a first response information returned by the back-end server, discarding the target file, wherein the first response information is generated by the back-end server after determining that the target file is already stored in the file server.
[0008] In a third aspect, an embodiment of the present disclosure provides a file uploading device, comprising: a request parsing unit, configured to parse the credential application request in response to receiving a credential application request from a user terminal, and determine the file information of the target file, wherein the credential application request is generated by the user terminal after receiving the target file uploaded by the user; a first determination unit, configured to determine the storage path and file identification value of the target file according to the file information; a file retrieval unit, configured to determine whether the target file has been stored in the file server according to the file identification value; a file copying unit, configured to call the file server interface in response to determining that the target file has been stored in the file server, copy the target file, and store the target file in association with the file information in the storage path; a first response unit, configured to generate a first response information and return it to the user terminal.
[0009] In a fourth aspect, an embodiment of the present disclosure provides another file uploading device, comprising: a second determination unit, configured to determine a user identification of a user and attribute information of a target file in response to receiving a target file uploaded by a user; an identification generation unit, configured to generate a file identification value of the target file; a third determination unit, configured to determine the file information of the target file based on the user identification, attribute information and file identification value; a request sending unit, configured to encapsulate the file information in a credential application request and send it to a server, so that the server can determine whether the target file is already stored in the file server based on the credential application request; a file discarding unit, configured to discard the target file in response to receiving a first response information returned by the server, wherein the first response information is generated by the server after determining that the target file is already stored in the file server.
[0010] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the file upload method described in the first aspect or the second aspect is implemented.
[0011] In a sixth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the file upload method as described in the first aspect or the second aspect.
[0012] By applying the technical solution disclosed in the present invention, when the target file is already stored in the file server, the target file can be directly copied in the file server. Since the copying is performed in the hard disk, the speed is fast and the processing efficiency is high. In addition, since there is no need to receive the target file from the user terminal device and no need to forward it through the back end, the network bandwidth and delay can be reduced.
[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0015] Figure 1 is an exemplary system architecture diagram to which an embodiment of the file upload method disclosed herein can be applied;
[0016] Figure 2 A flowchart of an embodiment of the file uploading method disclosed in the present invention;
[0017] Figure 3 A flowchart of another embodiment of the file uploading method disclosed in the present invention;
[0018] Figure 4 A flowchart of an embodiment of the file uploading method disclosed in the present invention;
[0019] Figure 5 A flowchart of another embodiment of the file uploading method disclosed in the present invention;
[0020] Figure 6 A schematic diagram of the structure of an embodiment of a file uploading device disclosed in the present invention;
[0021] Figure 7 A schematic diagram of the structure of another embodiment of the file uploading device disclosed in the present invention;
[0022] Figure 8 A schematic diagram of the structure of an embodiment of an electronic device disclosed herein. DETAILED DESCRIPTION
[0023] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.
[0024] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0025] In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other.
[0026] In order to make the technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0027] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the file uploading method or the file uploading apparatus of the present disclosure can be applied.
[0028] like Figure 1 As shown, the system architecture 100 may include a user terminal device 101, a network 102, a backend server 103, and a file server 104. The network 102 is used to provide a medium for a communication link between the user terminal device 101, the backend server 103, and the file server 104. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0029] The user can use the client device 101 to interact with the backend server 103 and the file server 104 through the network 102 to receive messages or send files, etc. Various communication client applications, such as browser applications and file management applications, can be installed on the client device 101.
[0030] The user terminal device 101 can be hardware or software. When the user terminal device 101 is hardware, it can be various electronic devices, including but not limited to smart phones, tablet computers, car computers, laptop computers, desktop computers, etc. When the user terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0031] The back-end server 103 may be a server that provides management services for files, such as providing services such as file copying and file deletion. The back-end server 103 may receive requests from the user terminal device 101 and feedback response information. The back-end server 103 may also access the file server 104, process the files stored therein, and feedback the processing results to the user terminal device 101.
[0032] The file server 104 may be a server for storing files, in which unstructured data may be stored, and each file has a unique identification value for searching the file, etc. The file server 104 may include multiple storage buckets, and different storage buckets have different identifications.
[0033] It should be noted that the back-end server 103 and the file server 104 can be hardware or software. When the back-end server 103 and the file server 104 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the back-end server 103 and the file server 104 are software, they can be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module. No specific limitation is made here.
[0034] It should be noted that the file upload method provided in the embodiment of the present disclosure can be executed by the user terminal device 101 or by the backend server 103. Accordingly, the file upload device can be set in the user terminal device 101 or in the backend server 103.
[0035] It should be understood that Figure 1 The number of client devices, networks, back-end servers and file servers in the embodiment is only for illustration. Any number of client devices, networks, back-end servers and file servers may be provided according to implementation requirements.
[0036] Figure 2 FIG. 2 shows a process 200 of an embodiment of the file upload method disclosed in the present invention. The method of this embodiment can be applied to a backend server. Figure 2 As shown, the file uploading method of this embodiment may include the following steps:
[0037] Step 201, in response to receiving a credential application request from a user terminal, the credential application request is parsed to determine file information of a target file.
[0038] In this embodiment, the back-end server may receive a credential application request from the user terminal. Here, the credential application request is generated by the user terminal after receiving the target file uploaded by the user. Specifically, the user can upload the target file through various nutrients installed in the user terminal, and the target file can be various types of unstructured data. After detecting that the user has uploaded the target file, the user terminal may send a credential application request to the back-end server. The credential application request may include file information of the target file, which is used to apply for a credential from the back-end server, and the user terminal can upload the target file through the credential.
[0039] The back-end server can parse the credential application request to obtain the file information of the target file. Specifically, the credential application request can be parsed according to the communication protocol. The file information may include the target file's identification, storage path, file type, file size and other attribute information.
[0040] Step 202: Determine the storage path and file identification value of the target file according to the file information.
[0041] After obtaining the file information, the storage path and file identification value of the target file can be determined. The above storage path can be the storage path selected by the user when uploading the target file to the user terminal device, or it can be calculated by the user terminal device according to the user identification and / or the target file. The file identification value can be a value that uniquely identifies the target file, which can be generated by various algorithms. In some specific practices, the above file identification value can be generated by the MD5 algorithm.
[0042] Step 203: Determine whether the target file has been stored in the file server according to the file identification value.
[0043] After obtaining the file identification value, it is possible to query whether the target file is already stored in the file server. Specifically, the back-end server can call the file server interface to access the file server. Then the file identification value is used as a search term to search. If the search term is found, it is considered that the target file is already stored in the file server. Alternatively, the back-end server can synchronize a list of file identification values stored in the file server, and by querying the list, it can be determined whether the target file is already stored in the file server.
[0044] Step 204, in response to determining that the target file has been stored in the file server, calling the file server interface, copying the target file, and associating the target file with the file information and storing it in the storage path.
[0045] If the target file is already stored in the file server, the backend server does not need to receive the target file from the user terminal device, but only needs to call the file server interface to copy the target file in the file server, and store the target file and file information in the storage path.
[0046] Step 205: Generate first response information and return it to the user end.
[0047] After the target file is copied, a first response message may be generated and returned to the user end, wherein the first response message may include information such as the copy result of the target file and the response duration.
[0048] The file uploading method provided by the above embodiment of the present disclosure can directly copy the target file in the file server when the target file is already stored in the file server. Since the copying is performed in the hard disk, the speed is fast and the processing efficiency is high. In addition, since there is no need to receive the target file from the user terminal device and no need to forward it through the back end, the network bandwidth and delay can be reduced.
[0049] Continue to see Figure 3 , which shows a process 300 of another embodiment of the file upload method according to the present disclosure. The method of this embodiment is applied to a backend server. The method of this embodiment may include the following steps:
[0050] Step 301, in response to receiving a credential application request from a user terminal, the credential application request is parsed to determine file information of a target file and a user identifier.
[0051] In this embodiment, after receiving the credential application request, the backend server may parse the credential application request to determine the file information of the target file and the user identification. Here, the user identification may be a character string used to uniquely identify the user.
[0052] Step 302: In response to determining that the user indicated by the user identifier does not have upload authority for the storage path, third response information is generated and returned to the user terminal.
[0053] In this embodiment, the backend server can assign different data bucket storage permissions to different users. Therefore, after parsing the user ID, it can be queried whether the user indicated by the user ID has the upload permission for the storage path. If yes, the subsequent process can be continued. If not, a third response information can be generated and returned to the user end. The third response information may include text prompting the user that he has no permission, etc.
[0054] Step 303: Determine the storage path and file identification value of the target file according to the file information.
[0055] In some optional implementations of this embodiment, the file type can also be determined based on the file information. If the file type meets the preset conditions, the subsequent process can continue. Here, the preset conditions can include multiple file types.
[0056] Step 304: Determine whether the target file has been stored in the file server according to the file identification value.
[0057] Step 305, in response to determining that the target file has been stored in the file server, calling the file server interface, copying the target file, and associating the target file with the file information and storing it in the storage path; generating a first response message and returning it to the user end.
[0058] Step 306, in response to determining that the target file is not stored in the file server, a credential link is generated; based on the credential link, a second response message is generated and returned to the user end.
[0059] In this embodiment, if the back-end server determines that the target file is not stored in the file server, a credential link may be generated. The credential link is used for the user terminal to access the file server. Then, the credential link may be returned to the user terminal as the second response information. In this way, after receiving the second response information, the user terminal may access the file server through the credential link to upload the target file.
[0060] In some optional implementations of this embodiment, a valid time period may also be generated for the credential link. If the valid time period exceeds the credential link, the credential link becomes invalid and cannot be accessed. By setting the credential, the file server can be protected from attacks.
[0061] The file upload method provided by the above-mentioned embodiment of the present disclosure can generate a credential link for the user terminal to access the file server to upload the target file when the target file is not stored in the file server, thereby eliminating the need to send the target file to the back-end server and then store it in the file server, thereby reducing network bandwidth and improving processing efficiency.
[0062] Continue to see Figure 4 , which shows a process 400 of an embodiment of a file upload method according to the present disclosure. The method of this embodiment is applied to a user terminal. Figure 4 As shown, the method in this embodiment may include the following steps:
[0063] Step 401: in response to receiving a target file uploaded by a user, determining the user identifier and attribute information of the target file.
[0064] In this embodiment, after receiving the target file uploaded by the user, the user terminal may first determine the user ID of the user and at the same time determine the attribute information of the target file. The attribute information may include the file type and the file size.
[0065] Step 402: Generate a file identification value of the target file.
[0066] The user end can generate an identification value of the target file. Specifically, various existing algorithms can be used to generate the file identification value. In some specific practices, the MD5 algorithm can be used to generate the file identification value.
[0067] Step 403, determining the file information of the target file according to the user identification, attribute information and file identification value.
[0068] In this embodiment, after obtaining the user identification, attribute information and file identification value, the file information of the target file can be further obtained. Specifically, the user terminal can determine the storage path of the target file according to the user identification and attribute information. The user identification, attribute information, file identification value and storage path are used as file information.
[0069] Step 404: Encapsulate the file information in a credential application request and send it to the back-end server, so that the back-end server can determine whether the target file is stored in the file server according to the credential application request.
[0070] The user end can encapsulate the file information in a credential application request according to the communication protocol and send it to the back-end server. The back-end server can determine whether the target file has been stored in the file server according to the credential application request.
[0071] Step 405: in response to receiving the first response information returned by the backend server, discard the target file.
[0072] If the user receives the first response information from the backend server, it is confirmed that the target file has been stored in the file server and there is no need to upload it again, so the target file can be discarded. The first response information is generated by the backend server after determining that the target file has been stored in the file server.
[0073] The file upload method provided by the above-mentioned embodiment of the present disclosure can, when receiving the target file uploaded by the user, determine that the file information is encapsulated in the credential application request and sent to the back-end server. After the back-end server confirms that the target file has been stored in the file server, the target file is discarded, thereby eliminating the need for repeated uploading and improving the file upload efficiency.
[0074] Continue to see Figure 5 , which shows a process 500 of another embodiment of the file upload method according to the present disclosure. The method of this embodiment is applied to the user end. The method of this embodiment may include the following steps:
[0075] Step 501: in response to receiving a target file uploaded by a user, determining the user identifier of the user and attribute information of the target file.
[0076] Step 502: Generate a file identification value of the target file.
[0077] Step 503: Determine the file information of the target file according to the user identification, attribute information and file identification value.
[0078] Step 504: Encapsulate the file information in a credential application request and send it to the back-end server, so that the back-end server can determine whether the target file is stored in the file server according to the credential application request.
[0079] Step 505: in response to receiving the first response information returned by the backend server, discard the target file.
[0080] The first response information is generated by the back-end server after determining that the target file has been stored in the file server.
[0081] Step 506, in response to receiving the second response information returned by the back-end server, parsing the second response information, determining the credential link; and uploading the target file to the file server through the credential link.
[0082] In this embodiment, the second response information is generated by the backend server after determining that the target file is not stored in the file server. The user end can parse the credential link from the second response information, access the file server through the credential link, and upload the target file to the file server.
[0083] Step 507, parse the second response information, determine the validity period of the credential link; determine the access time of the credential link; in response to determining that the time between the access time and the generation time of the credential link is less than the validity period of the credential link, confirm that the credential link is valid.
[0084] In this embodiment, the back-end server can set a valid period for the credential link. The user end can parse the second response information to determine the valid period of the credential link. When accessing the credential link, the access time of the credential link can be recorded. If the time between the access time and the generation time of the credential link is less than the valid period, the credential link is considered valid and can continue to be accessed. If the time between the access time and the generation time of the credential link is greater than or equal to the valid period, the credential link is considered invalid and cannot continue to be accessed. This can improve the security of the credential link.
[0085] The file uploading method provided by the above-mentioned embodiment of the present disclosure can eliminate the need to upload the target file when it is determined that the target file has been stored in the file server, thereby reducing the occupied network bandwidth and improving the file uploading efficiency.
[0086] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a file uploading device, and the device embodiment is Figure 2Corresponding to the method embodiment shown, the device can be specifically applied to a backend server.
[0087] like Figure 6 As shown, the file uploading device 600 of this embodiment includes: a request parsing unit 601 , a first determining unit 602 , a file retrieving unit 603 , a file copying unit 604 and a first responding unit 605 .
[0088] The request parsing unit 601 is configured to parse the credential application request in response to receiving the credential application request from the user end, and determine the file information of the target file. The credential application request is generated by the user end after receiving the target file uploaded by the user.
[0089] The first determining unit 602 is configured to determine a storage path and a file identification value of a target file according to the file information.
[0090] The file retrieval unit 603 is configured to determine whether the target file has been stored in the file server according to the file identification value.
[0091] The file copying unit 604 is configured to call the file server interface in response to determining that the target file has been stored in the file server, copy the target file, and associate the target file with the file information and store it in the storage path.
[0092] The first response unit 605 is configured to generate first response information and return it to the user end.
[0093] Continue to see Figure 7 The present disclosure also provides another embodiment of a file uploading device. Figure 4 Corresponding to the method embodiment shown, the device can be specifically applied to user terminal equipment.
[0094] like Figure 7 As shown, the file uploading device 700 of this embodiment includes: a second determining unit 701 , an identification generating unit 702 , a third determining unit 703 , a request sending unit 704 and a file discarding unit 705 .
[0095] The second determining unit 701 is configured to determine the user identification of the user and the attribute information of the target file in response to receiving the target file uploaded by the user.
[0096] The identification generating unit 702 is configured to generate a file identification value of the target file.
[0097] The third determining unit 703 is configured to determine the file information of the target file according to the user identification, the attribute information and the file identification value.
[0098] The request sending unit 704 is configured to encapsulate the file information in a credential application request and send it to the server, so that the server can determine whether the target file is stored in the file server according to the credential application request.
[0099] The file discarding unit 705 is configured to discard the target file in response to receiving the first response information returned by the server, wherein the first response information is generated by the server after determining that the target file has been stored in the file server.
[0100] In addition, in the technical solution of the present application, an electronic device is also proposed.
[0101] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.
[0102] like Figure 8 As shown, the electronic device may include a processor 801, a memory 802, a bus 803, and a computer program stored in the memory 802 and executable on the processor 801, wherein the processor 801 and the memory 802 communicate with each other through the bus 803. When the processor 801 executes the computer program, the steps of implementing the above method include: in response to receiving a credential application request from a user end, parsing the credential application request, and determining the file information of the target file, wherein the credential application request is generated by the user end after receiving the target file uploaded by the user; determining the storage path and file identification value of the target file according to the file information; determining whether the target file has been stored in the file server according to the file identification value; in response to determining that the target file has been stored in the file server, calling the file server interface, copying the target file, and associating the target file with the file information and storing it in the storage path; generating a first response information and returning it to the user end. Or it includes: in response to receiving a target file uploaded by a user, determining the user identifier of the user and attribute information of the target file; generating a file identification value of the target file; determining the file information of the target file based on the user identifier, attribute information and file identification value; encapsulating the file information in a credential application request and sending it to a server, so that the server can determine whether the target file has been stored in the file server based on the credential application request; in response to receiving a first response information returned by the server, discarding the target file, wherein the first response information is generated by the server after determining that the target file has been stored in the file server.
[0103] In addition, in one embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented, for example, including: in response to receiving a credential application request from a user end, parsing the credential application request, and determining the file information of the target file, wherein the credential application request is generated by the user end after receiving the target file uploaded by the user; determining the storage path and file identification value of the target file based on the file information; determining whether the target file is stored in the file server based on the file identification value; in response to determining that the target file is stored in the file server, calling the file server interface, copying the target file, and associating the target file with the file information and storing it in the storage path; generating a first response information and returning it to the user end. Or it includes: in response to receiving a target file uploaded by a user, determining the user identifier of the user and attribute information of the target file; generating a file identification value of the target file; determining the file information of the target file based on the user identifier, attribute information and file identification value; encapsulating the file information in a credential application request and sending it to a server, so that the server can determine whether the target file has been stored in the file server based on the credential application request; in response to receiving a first response information returned by the server, discarding the target file, wherein the first response information is generated by the server after determining that the target file has been stored in the file server.
[0104] In summary, in the technical solution disclosed in the present invention, when the target file is already stored in the file server, the target file can be directly copied in the file server. Since the copying is performed in the hard disk, the speed is fast and the processing efficiency is high. In addition, since there is no need to receive the target file from the user terminal device and no need to forward it through the back end, the network bandwidth and delay can be reduced.
[0105] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.
Claims
1. A file upload method, applied to a backend server, comprising: In response to receiving a credential application request from a user terminal, parsing the credential application request to determine file information of a target file, wherein the credential application request is generated by the user terminal after receiving the target file uploaded by the user; Determine the storage path and file identification value of the target file according to the file information; Determining whether the target file has been stored in the file server according to the file identification value; In response to determining that the target file has been stored in the file server, calling a file server interface, copying the target file, and storing the target file in association with the file information in the storage path; Generate first response information and return it to the user terminal.
2. The method according to claim 1, wherein: The method further comprises: In response to determining that the target file is not stored in the file server, generating a credential link; According to the credential link, a second response message is generated and returned to the user end.
3. The method according to claim 2, wherein: The method further comprises: Parsing the credential application request to determine the user identifier; In response to determining that the user indicated by the user identifier does not have upload authority for the storage path, third response information is generated and returned to the user terminal.
4. The method according to claim 1, wherein: The step of determining whether the target file has been stored in the file server according to the file identification value comprises: Determine the file type according to the file information; In response to determining that the file type meets a preset condition, it is determined whether the target file has been stored in the file server according to the file identification value.
5. The method according to claim 2, wherein: The method further comprises: Generate a validity period for the credential link; The generating, according to the credential link, second response information and returning it to the user terminal includes: According to the credential link and the validity period, a second response message is generated and returned to the user terminal.
6. A file uploading method, applied to a user terminal, comprising: In response to receiving a target file uploaded by a user, determining a user identifier of the user and attribute information of the target file; Generate a file identification value of the target file; Determining the file information of the target file according to the user identification, the attribute information and the file identification value; Encapsulating the file information in a credential application request and sending it to a back-end server, so that the back-end server can determine whether the target file is already stored in the file server according to the credential application request; In response to receiving first response information returned by the backend server, the target file is discarded, wherein the first response information is generated by the backend server after determining that the target file has been stored in the file server.
7. The method according to claim 6, wherein: The method further comprises: In response to receiving a second response message returned by the backend server, parsing the second response message and determining a credential link, wherein the second response message is generated by the backend server after determining that the target file is not stored in the file server; The target file is uploaded to the file server through the credential link.
8. The method according to claim 7, wherein: The method further comprises: Parsing the second response information to determine the validity period of the credential link; Determining a time of access to the credential link; In response to determining that the duration between the access time and the generation time of the credential link is less than the validity duration, confirming that the credential link is valid.
9. A file uploading device, arranged on a back-end server, comprising: a request parsing unit, configured to, in response to receiving a credential application request from a user terminal, parse the credential application request to determine file information of a target file, wherein the credential application request is generated by the user terminal after receiving the target file uploaded by the user; A first determining unit is configured to determine a storage path and a file identification value of the target file according to the file information; A file retrieval unit, configured to determine whether the target file has been stored in the file server according to the file identification value; A file copying unit is configured to, in response to determining that the target file has been stored in the file server, call a file server interface, copy the target file, and store the target file in association with the file information in the storage path; The first response unit is configured to generate first response information and return it to the user terminal.
10. A file uploading device, arranged at a user end, comprising: A second determining unit is configured to determine a user identifier of the user and attribute information of the target file in response to receiving a target file uploaded by the user; an identification generating unit, configured to generate a file identification value of the target file; A third determining unit is configured to determine the file information of the target file according to the user identification, the attribute information and the file identification value; a request sending unit, configured to encapsulate the file information in a credential application request and send it to the server, so that the server can determine whether the target file is stored in the file server according to the credential application request; The file discarding unit is configured to discard the target file in response to receiving first response information returned by the server, wherein the first response information is generated by the server after determining that the target file has been stored in the file server.
11. An electronic device comprising a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the file upload method according to any one of claims 1 to 5 or the file upload method according to any one of claims 6 to 8 is implemented.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the file upload method according to any one of claims 1 to 5 or the file upload method according to any one of claims 6 to 8 is implemented.
