File download methods, devices, computer equipment and media
By receiving file download requests, obtaining configuration information, and calling the server to retrieve file parameters and storage paths, the problem of low file download efficiency in existing technologies is solved, and a highly efficient file download process is achieved.
Patent Information
- Application Number
- CN202111574436.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing file download process is inefficient, as it requires querying the file download code, which further reduces efficiency.
By receiving file download requests, obtaining pre-stored Uniform Resource Locator (URL) configuration information, calling the first server to obtain file parameters, and calling the second server to obtain the file storage path based on the configuration information, the target file is finally obtained and sent. This simplifies the file download process and reduces the dependence on file download code.
It improves file download efficiency, simplifies server setup, adapts to different file download scenarios, and eliminates the need to configure file download code for each scenario.
Smart Images

Figure CN114218165B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a file download method, apparatus, computer equipment, and medium. Background Technology
[0002] With the advancement of science and technology and the arrival of the big data era, World Wide Web technology has developed rapidly. By storing files on servers, client users can download files stored on the servers.
[0003] In the existing file download process, in response to a user's file download request, the server first needs to query the file download scenario corresponding to the file download request, then query the gateway for the file download code in the corresponding file download scenario, and then send the corresponding target file back to the user based on the queried file download code, resulting in low file download efficiency. Summary of the Invention
[0004] In view of this, embodiments of this application provide a file download method, apparatus, computer equipment, and medium to solve the problem of low file download efficiency in existing file download processes.
[0005] The first aspect of this application provides a file download method, including:
[0006] Receive a file download request and obtain pre-stored configuration information of the Uniform Resource Locator, the configuration information being used to determine the data object to which the file download request points;
[0007] Based on the file download request and the configuration information, the first server is invoked to obtain the file parameters;
[0008] The second server is invoked based on the file parameters and configuration information to obtain the file storage path;
[0009] The file is retrieved according to the file storage path to obtain the target file, and the target file is sent to the user device corresponding to the file download request.
[0010] Further, the step of calling the second server based on the file parameters and the configuration information to obtain the file storage path includes:
[0011] Obtain the path data of the second server. The path data includes the correspondence between different configuration information and the corresponding path lookup table. The path lookup table includes different file parameters and the storage path of the file they point to.
[0012] The path lookup table in the path data is determined based on the configuration information, and the file parameters are matched with the determined path lookup table to obtain the file storage path.
[0013] Further, the step of retrieving the file based on the file storage path to obtain the target file includes:
[0014] Perform a file stream query based on the file storage path;
[0015] If a file stream is found based on the file storage path, the target file is generated based on the found file stream;
[0016] If no file stream is found according to the file storage path, the file storage path is split to obtain file storage sub-paths, and the target file is determined based on the file storage sub-paths.
[0017] Further, determining the target file based on the file storage sub-path includes:
[0018] File stream queries are performed based on each file storage sub-path to obtain candidate file streams, and the candidate file streams are filtered according to preset filtering information, which includes one or more combinations of preset data values, preset file types, and preset file tags.
[0019] The filtered candidate file streams are encapsulated into data streams to obtain candidate files. Based on the file identifier of each candidate file and the request identifier of the file download request, the association value between each candidate file and the file download request is obtained.
[0020] The candidate file corresponding to the largest association value is used to determine the target file.
[0021] Further, the step of calling the first server based on the file download request and the configuration information to obtain file parameters includes:
[0022] Obtain the request identifier of the file download request, and determine the request type of the file download request based on the request identifier;
[0023] Obtain the parameter lookup table of the first server, and match the request type and the configuration information with the retrieved parameter lookup table;
[0024] If the request type and the configuration information match the parameter lookup table, the matched parameter will be determined as the file parameter.
[0025] Furthermore, after matching the request type and the configuration information with the retrieved parameter lookup table, the process further includes:
[0026] If the request type and the configuration information do not match the queried parameter lookup table, then a similar type is determined based on the type identifier of the request type;
[0027] The similarity type and the configuration information are matched with the queried parameter lookup table. If the similarity type and the configuration information are successfully matched with the queried parameter lookup table, the matched parameter is determined as the file parameter.
[0028] If the similarity type and the configuration information do not match the parameter lookup table, then the default parameter will be determined as the file parameter.
[0029] Furthermore, after obtaining the target file based on the file storage path, the process further includes:
[0030] The file download scenario is determined based on the request identifier of the file download request, and the target file is validated based on the file download scenario. The scenario validation is used to detect whether the application scenario of the target file is compatible with the file download scenario.
[0031] If the scene verification of the target file fails, a scene verification error message is sent to the user equipment.
[0032] A second aspect of this application provides a file download apparatus, including:
[0033] The configuration information acquisition unit is used to receive a file download request and acquire pre-stored configuration information of the Uniform Resource Locator, wherein the configuration information is used to determine the data object to which the file download request points;
[0034] The system call unit is used to call the first server according to the file download request and the configuration information to obtain the file parameters, and to call the second server according to the file parameters and the configuration information to obtain the file storage path;
[0035] The file download unit is used to obtain the file according to the file storage path, obtain the target file, and send the target file to the user device corresponding to the file download request.
[0036] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the computer device, wherein the processor executes the computer program to implement the steps of the file download method provided in the first aspect.
[0037] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the file download method provided in the first aspect.
[0038] This application provides a file download method, apparatus, computer device, and medium. The method determines file parameters based on a file download request and resource configuration information; determines a file storage path based on the file parameters and resource configuration information; and retrieves the file according to the file storage path to obtain the target file. This application embodiment only requires pre-configuration of the unified resource locator, the first server, and the second system to automatically send the target file corresponding to the file download request to the user device. For different file download scenarios, no file download code needs to be set, simplifying server setup. Furthermore, during the file download process, there is no need to query the file download code, improving file download efficiency. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating the implementation of a file download method provided in an embodiment of this application;
[0041] Figure 2 This is a flowchart illustrating the implementation of a file download method according to another embodiment of this application;
[0042] Figure 3 This is a structural block diagram of a file download device provided in an embodiment of this application;
[0043] Figure 4 This is a structural block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0045] Please see Figure 1 , Figure 1This illustration shows a flowchart of a file download method provided in an embodiment of this application. This file download method is applicable to any computer device or business system, and the computer device can be a server, mobile phone, tablet, or other similar device. The file download method includes:
[0046] Step S10: Receive a file download request and obtain the pre-stored configuration information of the Uniform Resource Locator;
[0047] The file download method is applied to a designated server. The file download request can be transmitted in the form of voice, text or signal commands. The designated server receives the file download request based on the port on the front-end gateway.
[0048] In this step, the pre-stored Uniform Resource Locator is stored in the designated server. Users can configure the Uniform Resource Locator by logging into the configuration webpage corresponding to the designated server, so as to set the resource configuration information according to the user's needs. The configuration information is used to determine the data object to which the file download request points. The data object can be any database.
[0049] Step S20: Based on the file download request and the configuration information, call the first server to obtain the file parameters;
[0050] The first server can be configured as needed. When invoked, the first server determines the corresponding file parameters based on the file download request and the configuration information of the Uniform Resource Locator. These file parameters are used to characterize the attribute information of the target file corresponding to the file download request, including information such as file type, file identifier, and file data value.
[0051] In this step, the file parameters are obtained by calling the first server through the file download request and configuration information. This allows the user to automatically obtain the file parameters corresponding to the file download request and configuration information simply by setting the parameters of the first server, thus improving the efficiency of file parameter acquisition. Specifically, the first call instruction information for the first server's preset values is obtained. The obtained first call instruction information, file download request, and configuration information are encapsulated to obtain the first server call instruction. This first call instruction information is used to generate a header in the first server call instruction. Based on this header, the first server can easily decapsulate the first server call instruction to obtain the file download request and configuration information. The first server performs parameter lookup based on the obtained file download request and configuration information to obtain the file parameters. The first server stores a file parameter lookup table, which stores the correspondence between different file download requests and configuration information and the corresponding file parameters. Therefore, the user only needs to set the parameters of the file parameter lookup table to automatically obtain the file parameters corresponding to the file download request and configuration information.
[0052] Optionally, in this step, the first server queries the file root directory, file subpath, and filename information based on the decapsulated file download request and configuration information. Based on the queried file root directory, file subpath, and filename information, it determines the corresponding file parameters and responds to the first server's call instruction with the determined file parameters. Step S30: Based on the file parameters and the configuration information, the second server is called to obtain the file storage path.
[0053] The second server can be configured as needed. When called, the second server determines the corresponding file storage path based on the file parameters and the configuration information of the Uniform Resource Locator. The file storage path is used to represent the storage address of the corresponding file.
[0054] In this step, the file storage path is obtained by calling the second server using file parameters and configuration information. This allows users to automatically obtain the file storage path corresponding to the file parameters and configuration information simply by setting parameters for the second server, improving the efficiency of file storage path retrieval. Specifically, the call instruction information for the second server's preset values is obtained, resulting in the second call instruction information. The obtained second call instruction information, file parameters, and configuration information are encapsulated to obtain the second server call instruction. This second call instruction information is used to generate a header in the second server call instruction. Based on this header, the second server can easily decapsulate the second server call instruction to obtain the file parameters and configuration information. The second server then performs a path lookup based on the obtained file parameters and configuration information to obtain the file storage path. The second server stores a path lookup table, which stores the correspondence between different file parameters and configuration information and their corresponding file storage paths. Therefore, users only need to set parameters for the path lookup table to automatically obtain the file storage path corresponding to the file parameters and configuration information.
[0055] In this embodiment, by calling the first server and the second server respectively, the file parameters and file storage path are obtained accordingly. That is, when the first server is called, it is only used to determine the file parameters, and when the second server is called, it is only used to determine the file storage path. This reduces the bandwidth when the first server and the second server are called, and improves the accuracy and efficiency of determining the file parameters and file storage path.
[0056] Optionally, in this step, the step of calling the second server based on the file parameters and the configuration information to obtain the file storage path includes:
[0057] Obtain the path data of the second server;
[0058] The path data includes the correspondence between different configuration information and the corresponding path lookup table. The path lookup table includes different file parameters and the storage path of the file they point to. In this step, the identifier of the second server is obtained, and the corresponding path data is obtained based on the identifier of the second server.
[0059] The path lookup table in the path data is determined based on the configuration information, and the file parameters are matched with the determined path lookup table to obtain the file storage path;
[0060] Specifically, the configuration information is matched with the path data to obtain the path lookup table, and the file parameters are matched with the determined path lookup table to obtain the file storage path.
[0061] Step S40: Obtain the target file according to the file storage path, and send the target file to the user device corresponding to the file download request;
[0062] In this step, the path is queried through the file storage path, and the data pointed to by the file storage path is identified as the target file. In this step, the target file can be sent to the user device corresponding to the file download request by sending a compressed data packet or a file download address.
[0063] Optionally, in this step, obtaining the target file based on the file storage path includes:
[0064] Perform a file stream query based on the file storage path;
[0065] In this step, the file stream corresponding to the file storage path in the locally pre-stored distributed storage medium can be configured according to requirements.
[0066] If a file stream is found based on the file storage path, the target file is generated based on the found file stream;
[0067] If a file stream is found based on the file storage path, the target file is obtained by combining, compressing, or encapsulating the found file stream.
[0068] If no file stream is found according to the file storage path, the file storage path is split to obtain file storage sub-paths, and the target file is determined according to the file storage sub-paths;
[0069] If no file stream is found based on the file storage path, the file storage path is split to obtain a file storage sub-path, and the target file is determined based on the file storage sub-path.
[0070] One method is to split the file storage path by randomly dividing it to obtain at least two file storage sub-paths. For example, if the file storage sub-path is a1-a2-a3-a4-a5, the resulting file storage sub-paths include a1-a2-a3-a4, a1-a2-a3, a1-a2, a2-a3-a4-a5, a3-a4-a5, etc.
[0071] Further, in this step, determining the target file based on the file storage sub-path includes:
[0072] File stream queries are performed based on each file storage sub-path to obtain candidate file streams, and the candidate file streams are filtered according to preset filtering information;
[0073] The filtered candidate file streams are encapsulated into data streams to obtain candidate files. Based on the file identifier of each candidate file and the request identifier of the file download request, the association value between each candidate file and the file download request is obtained, and the candidate file corresponding to the largest association value is determined as the target file.
[0074] The preset filtering information includes one or more combinations of preset data values, preset file types, and preset file tags. In this step, the data values, data types, or data tags of candidate file streams are filtered according to the preset filtering information. For example, candidate file streams with data values less than the preset data value are deleted, candidate file streams with data types that are not the preset file types are deleted, and candidate file streams whose file tags do not carry the preset file tags are deleted. The preset data value can be set according to user renewal, the preset file type can be set according to the file type pointed to by the user's needs or the file download request identifier, and the preset file tag can be set according to the file type pointed to by the user's needs or the file download request identifier.
[0075] In this step, the association value is used to characterize the degree of association between the candidate file and the file download request. The larger the association value between the candidate file and the file download request, the greater the probability that the candidate file is the target file corresponding to the file download request. Specifically, the association value between each candidate file and the file download request is obtained by matching the file identifier of each candidate file and the request identifier of the file download request with the pre-stored association value lookup table.
[0076] Furthermore, in this step, after sending the target file to the user device corresponding to the file download request, the method further includes: calculating the hash value of the target file, obtaining the device identifier and network address of the user device, generating a target file download migration map based on the hash value, download time, device identifier, and network address of the target file, and storing the target file download migration map. Based on the target file download migration map, it effectively facilitates the tracking of the downloading device corresponding to the target file and the tracing of each download information corresponding to the target file. In this embodiment, file parameters are determined based on the file download request and resource configuration information; the file storage path is determined based on the file parameters and resource configuration information; and the file is obtained based on the file storage path to obtain the target file. In this embodiment, only the unified resource locator, the first server, and the second system need to be configured in advance to automatically send the target file corresponding to the file download request to the user device. For different file download scenarios, there is no need to set file download code, which facilitates the server configuration operation. Moreover, during the file download process, there is no need to query the file download code, which improves the file download efficiency.
[0077] Please see Figure 2 , Figure 2 This is a flowchart illustrating the implementation of a file download method according to another embodiment of this application. Compared to... Figure 1 This embodiment provides a file download method for downloading files. Figure 1 Step S20 in the embodiment is further refined, including:
[0078] Step S21: Obtain the request identifier of the file download request, and determine the request type of the file download request based on the request identifier;
[0079] Specifically, by performing entity analysis on file download requests, information entities are obtained. A request type lookup table is determined based on the request identifier of the file download request. The information entities are then matched with the request type lookup table to obtain the request type. The request type lookup table stores the correspondence between different information entities and corresponding request types.
[0080] Step S22: Obtain the parameter lookup table of the first server, and match the request type and the configuration information with the retrieved parameter lookup table;
[0081] Specifically, by obtaining the server identifier of the first server, the parameter lookup table is determined based on the server identifier of the first server. The parameter lookup table stores the correspondence between different request types and resource configuration information and corresponding file parameters.
[0082] Step S23: If the request type and the configuration information match the queried parameter lookup table, the matched parameters are determined as the file parameters.
[0083] If the request type and configuration information successfully match the retrieved parameter lookup table, the matched file parameter is determined to be the file parameter pointed to by the file download request. Further, in this embodiment, after matching the request type and configuration information with the retrieved parameter lookup table, the process also includes:
[0084] If the request type and the configuration information do not match the queried parameter lookup table, then a similar type is determined based on the type identifier of the request type;
[0085] Specifically, the type identifier of the request type is matched with a pre-stored similar type lookup table, and the matched category is determined as the similar type of the file download request. The similar type lookup table stores the correspondence between different type identifiers and their corresponding similar types.
[0086] The similarity type and the configuration information are matched with the queried parameter lookup table. If the similarity type and the configuration information are successfully matched with the queried parameter lookup table, the matched parameter is determined as the file parameter.
[0087] If the similarity type and configuration information successfully match the queried parameter lookup table, then the parameters matched by the similarity type and configuration information are determined as the file parameters pointed to by the file download request.
[0088] If the similarity type and the configuration information do not match the parameter lookup table, then the default parameter will be determined as the file parameter;
[0089] The default parameter can be set according to requirements. Optionally, if the similarity type and configuration information do not match the parameter lookup table, a file download error message will be sent.
[0090] Furthermore, in this embodiment, after obtaining the target file based on the file storage path, the process further includes:
[0091] The file download scenario is determined based on the request identifier of the file download request, and the target file is verified based on the file download scenario.
[0092] If the scene verification of the target file fails, a scene verification error message is sent to the user equipment.
[0093] The scenario verification is used to detect whether the application scenario of the target file is compatible with the file download scenario. In this step, the matching value between the file download scenario and the target file is queried, and it is determined whether the matching value is greater than the matching threshold. The matching value is used to characterize the degree of matching between the file download scenario and the target file.
[0094] Optionally, in this step, a set of file scenario applications is determined based on the file identifier of the target file, and the determined set of file scenario applications is matched with the file download scenario to obtain the matching value. The set of file scenario applications includes the application scenario when the corresponding target file is downloaded.
[0095] In this embodiment, by obtaining the request identifier of the file download request, the request type of the file download request can be effectively determined based on the request identifier. By obtaining the parameter lookup table of the first server, the file parameters corresponding to the request type and configuration information can be effectively determined based on the parameter lookup table, thereby improving the accuracy of file parameter determination.
[0096] The request type and configuration information are then matched with the retrieved parameter lookup table.
[0097] Please see Figure 3 , Figure 3 This is a structural block diagram of a file download device 100 provided in an embodiment of this application. In this embodiment, the file download device 100 includes units used for performing... Figure 1 , Figure 2 The steps in the corresponding embodiments. Please refer to the details. Figure 1 , Figure 2 as well as Figure 1 , Figure 2 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown. See also... Figure 3 The file download device 100 includes: a configuration information acquisition unit 10, a system call unit 11, and a file download unit 12, wherein:
[0098] The configuration information acquisition unit 10 is used to receive a file download request and acquire pre-stored configuration information of the Uniform Resource Locator (URL). The configuration information is used to determine the data object to which the file download request points. The file download method is applied to a designated server. The file download request can be transmitted via voice, text, or signal commands. The designated server receives the file download request based on a port on the front-end gateway.
[0099] In this unit, the pre-stored Uniform Resource Locator is stored in the designated server. Users can configure the Uniform Resource Locator by logging into the configuration webpage corresponding to the designated server, so as to set the resource configuration information according to the user's needs. The configuration information is used to determine the data object to which the file download request points, and the data object can be any database.
[0100] System call unit 11 is used to call a first server based on the file download request and the configuration information to obtain file parameters, and to call a second server based on the file parameters and the configuration information to obtain the file storage path. The first server can be configured as needed. When called, the first server determines the corresponding file parameters based on the file download request and the configuration information of the Uniform Resource Locator. These file parameters characterize the attribute information of the target file corresponding to the file download request, including file type, file identifier, and file data values.
[0101] In this unit, the file parameters are obtained by calling the first server through the file download request and configuration information. This allows users to automatically obtain the file parameters corresponding to the file download request and configuration information simply by setting the parameters of the first server, thus improving the efficiency of file parameter acquisition.
[0102] Optionally, the system call unit 11 is further configured to: obtain path data of the second server, the path data including the correspondence between different configuration information and the corresponding path lookup table, the path lookup table including different file parameters and the storage path of the file to which they point;
[0103] The path lookup table in the path data is determined based on the configuration information, and the file parameters are matched with the determined path lookup table to obtain the file storage path.
[0104] Furthermore, the system call unit 11 is also used to: obtain the request identifier of the file download request, and determine the request type of the file download request based on the request identifier;
[0105] Obtain the parameter lookup table of the first server, and match the request type and the configuration information with the retrieved parameter lookup table;
[0106] If the request type and the configuration information match the parameter lookup table, the matched parameter will be determined as the file parameter.
[0107] Furthermore, the system call unit 11 is also used to: if the request type and the configuration information do not match the queried parameter lookup table, determine a similar type based on the type identifier of the request type;
[0108] The similarity type and the configuration information are matched with the queried parameter lookup table. If the similarity type and the configuration information are successfully matched with the queried parameter lookup table, the matched parameter is determined as the file parameter.
[0109] If the similarity type and the configuration information do not match the parameter lookup table, then the default parameter will be determined as the file parameter.
[0110] The file download unit 12 is used to obtain a target file based on the file storage path, and send the target file to the user device corresponding to the file download request. The second server can be configured as needed. When invoked, the second server determines the corresponding file storage path based on file parameters and the configuration information of the Uniform Resource Locator (URL). This file storage path represents the storage address of the corresponding file.
[0111] In this unit, the file storage path is obtained by calling the second server through file parameters and configuration information. This allows users to automatically obtain the file storage path corresponding to the file parameters and configuration information simply by setting the parameters of the second server, thus improving the efficiency of obtaining the file storage path.
[0112] Optionally, the file download unit 12 is further configured to: perform a file stream query based on the file storage path;
[0113] If a file stream is found based on the file storage path, the target file is generated based on the found file stream;
[0114] If no file stream is found according to the file storage path, the file storage path is split to obtain file storage sub-paths, and the target file is determined based on the file storage sub-paths.
[0115] Furthermore, the file download unit 12 is also used to: perform file stream query based on each file storage sub-path to obtain candidate file streams, and filter the candidate file streams according to preset filtering information, wherein the preset filtering information includes one or more combinations of preset data values, preset file types and preset file tags;
[0116] The filtered candidate file streams are encapsulated into data streams to obtain candidate files. Based on the file identifier of each candidate file and the request identifier of the file download request, the association value between each candidate file and the file download request is obtained.
[0117] The candidate file corresponding to the largest association value is used to determine the target file.
[0118] Furthermore, the file download unit 12 is also configured to: determine the file download scenario based on the request identifier of the file download request, and perform scenario verification on the target file based on the file download scenario, wherein the scenario verification is used to detect whether the application scenario of the target file is compatible with the file download scenario;
[0119] If the scene verification of the target file fails, a scene verification error message is sent to the user equipment.
[0120] In this embodiment, file parameters are determined based on the file download request and resource configuration information; the file storage path is determined based on the file parameters and resource configuration information; and the file is retrieved based on the file storage path to obtain the target file. In this embodiment, only the unified resource locator, the first server, and the second system need to be configured in advance to automatically send the target file corresponding to the file download request to the user device. For different file download scenarios, there is no need to set file download code, which facilitates the server configuration operation. Moreover, there is no need to query the file download code during the file download process, which improves the file download efficiency.
[0121] Figure 4 This is a structural block diagram of a computer device 2 provided in another embodiment of this application. For example... Figure 4As shown, the computer device 2 in this embodiment includes a processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the processor 20, such as a program for a file download method. When the processor 20 executes the computer program 22, it implements the steps in the various embodiments of the file download methods described above, for example... Figure 1 S10 to S40 as shown, or Figure 2 S21 to S23 are shown. Alternatively, the processor 20 implements the above when executing the computer program 22. Figure 3 The functions of each unit in the corresponding embodiments, for example, Figure 3 For details on the functions of units 10 to 12 shown, please refer to [link / reference needed]. Figure 3 The relevant descriptions in the corresponding embodiments are not repeated here.
[0122] For example, the computer program 22 can be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to complete this application. The one or more units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 22 in the computer device 2. For example, the computer program 22 can be divided into a configuration information acquisition unit 10, a system call unit 11, and a file download unit 12, with the specific functions of each unit as described above.
[0123] The computer device may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will understand that... Figure 4 This is merely an example of computer device 2 and does not constitute a limitation on computer device 2. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0124] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), 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.
[0125] The memory 21 can be an internal storage unit of the computer device 2, such as a hard disk or memory of the computer device 2. The memory 21 can also be an external storage device of the computer device 2, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device 2. Furthermore, the memory 21 can include both internal and external storage units of the computer device 2. The memory 21 is used to store the computer program and other programs and data required by the computer device. The memory 21 can also be used to temporarily store data that has been output or will be output.
[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0127] If an integrated module is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. This computer-readable storage medium can be non-volatile or volatile. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of a computer-readable storage medium may be appropriately added to or subtracted from the contents as required by the legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, a computer-readable storage medium may not include electrical carrier signals and telecommunication signals.
[0128] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A file download method, characterized in that, include: Receive a file download request and obtain pre-stored configuration information of the Uniform Resource Locator, the configuration information being used to determine the data object to which the file download request points, the data object being any database; The first server is invoked according to the file download request and the configuration information to obtain file parameters. The file parameters are used to characterize the attribute information of the target file corresponding to the file download request. The attribute information includes file type, file identifier and file data value. The second server is invoked based on the file parameters and configuration information to obtain the file storage path; The file is retrieved according to the file storage path to obtain the target file, and the target file is sent to the user device corresponding to the file download request; The file download scenario is determined based on the request identifier of the file download request, and the target file is validated based on the file download scenario. The scenario validation is used to detect whether the application scenario of the target file is compatible with the file download scenario. If the scene verification of the target file fails, a scene verification error message is sent to the user equipment.
2. The file download method according to claim 1, characterized in that, The step of calling the second server based on the file parameters and the configuration information to obtain the file storage path includes: Obtain the path data of the second server. The path data includes the correspondence between different configuration information and the corresponding path lookup table. The path lookup table includes different file parameters and the storage path of the file they point to. The path lookup table in the path data is determined based on the configuration information, and the file parameters are matched with the determined path lookup table to obtain the file storage path.
3. The file download method according to claim 2, characterized in that, The step of retrieving the file based on the file storage path to obtain the target file includes: Perform a file stream query based on the file storage path; If a file stream is found based on the file storage path, the target file is generated based on the found file stream; If no file stream is found according to the file storage path, the file storage path is split to obtain file storage sub-paths, and the target file is determined based on the file storage sub-paths.
4. The file download method according to claim 3, characterized in that, Determining the target file based on the file storage subpath includes: File stream queries are performed based on each file storage sub-path to obtain candidate file streams, and the candidate file streams are filtered according to preset filtering information, which includes one or more combinations of preset data values, preset file types, and preset file tags. The filtered candidate file streams are encapsulated into data streams to obtain candidate files. Based on the file identifier of each candidate file and the request identifier of the file download request, the association value between each candidate file and the file download request is obtained. The candidate file corresponding to the largest association value is used to determine the target file.
5. The file download method according to claim 1, characterized in that, The step of calling the first server based on the file download request and the configuration information to obtain file parameters includes: Obtain the request identifier of the file download request, and determine the request type of the file download request based on the request identifier; Obtain the parameter lookup table of the first server, and match the request type and the configuration information with the retrieved parameter lookup table; If the request type and the configuration information match the parameter lookup table, the matched parameter will be determined as the file parameter.
6. The file download method according to claim 5, characterized in that, After matching the request type and the configuration information with the retrieved parameter lookup table, the process further includes: If the request type and the configuration information do not match the queried parameter lookup table, then a similar type is determined based on the type identifier of the request type; The similarity type and the configuration information are matched with the queried parameter lookup table. If the similarity type and the configuration information are successfully matched with the queried parameter lookup table, the matched parameter is determined as the file parameter. If the similarity type and the configuration information do not match the parameter lookup table, then the default parameter will be determined as the file parameter.
7. A file download device, characterized in that, include: The configuration information acquisition unit is used to receive a file download request and acquire pre-stored configuration information of the Uniform Resource Locator. The configuration information is used to determine the data object to which the file download request points, and the data object is any database. The system call unit is used to call the first server according to the file download request and the configuration information to obtain file parameters, and to call the second server according to the file parameters and the configuration information to obtain the file storage path. The file parameters are used to characterize the attribute information of the target file corresponding to the file download request. The attribute information includes file type, file identifier and file data value. The file download unit is used to obtain the file according to the file storage path, obtain the target file, and send the target file to the user device corresponding to the file download request; The file download unit is further configured to: determine the file download scenario based on the request identifier of the file download request, and perform scenario verification on the target file based on the file download scenario, wherein the scenario verification is used to detect whether the application scenario of the target file is compatible with the file download scenario; If the scene verification of the target file fails, a scene verification error message is sent to the user equipment.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
File downloading method, server, client and storage medium
CN112231603A