CN114218165A - File downloading method and device, computer equipment and medium - Google Patents

File downloading method and device, computer equipment and medium Download PDF

Info

Publication number
CN114218165A
CN114218165A CN202111574436.8A CN202111574436A CN114218165A CN 114218165 A CN114218165 A CN 114218165A CN 202111574436 A CN202111574436 A CN 202111574436A CN 114218165 A CN114218165 A CN 114218165A
Authority
CN
China
Prior art keywords
file
configuration information
request
downloading
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111574436.8A
Other languages
Chinese (zh)
Inventor
何辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202111574436.8A priority Critical patent/CN114218165A/en
Publication of CN114218165A publication Critical patent/CN114218165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application is applicable to the technical field of big data, and provides a file downloading method, a file downloading device, computer equipment and a medium, wherein the method comprises the following steps: receiving a file downloading request, acquiring pre-stored configuration information of a uniform resource locator, and calling a first server according to the file downloading request and the configuration information to obtain file parameters; calling a second server according to the file parameters and the configuration information to obtain a file storage path; and acquiring the file according to the file storage path to obtain a target file, and sending the target file to the user equipment corresponding to the file downloading request. According to the method and the device, the target file corresponding to the file downloading request can be automatically sent to the user equipment only by configuring and setting the uniform resource locator, the first server and the second system in advance, file downloading codes do not need to be set aiming at different file downloading scenes, the setting operation of the server is facilitated, in the file downloading process, the inquiry of the file downloading codes is not needed, and the file downloading efficiency is improved.

Description

File downloading method and device, computer equipment and medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a file downloading method, apparatus, computer device, and medium.
Background
With the improvement of the scientific and technical level and the coming of the big data era, the world wide web technology has been developed rapidly. By storing the file in the server, the user of the client can download the file stored in the server from the server.
In the existing file downloading process, aiming at a file downloading request sent by a user, a server needs to firstly inquire a file downloading scene corresponding to the file downloading request, then inquire a file downloading code of a gateway in the corresponding file downloading scene, and feed back a corresponding target file to the user based on the inquired file downloading code, so that the file downloading efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a file downloading method, apparatus, computer device, and medium, so as to solve the problem of low file downloading efficiency in the existing file downloading process.
A first aspect of an embodiment of the present application provides a file downloading method, including:
receiving a file downloading request, and acquiring pre-stored configuration information of a uniform resource locator, wherein the configuration information is used for determining a data object pointed by the file downloading request;
calling a first server according to the file downloading request and the configuration information to obtain file parameters;
calling a second server according to the file parameters and the configuration information to obtain a file storage path;
and acquiring a file according to the file storage path to obtain a target file, and sending the target file to the user equipment corresponding to the file downloading request.
Further, the calling a second server according to the file parameter and the configuration information to obtain a file storage path includes:
acquiring path data of the second server, wherein the path data comprises corresponding relations between different configuration information and a corresponding path query table, and the path query table comprises different file parameters and storage paths of pointed files;
and determining a path lookup table in the path data according to the configuration information, and matching the file parameters with the determined path lookup table to obtain the file storage path.
Further, the obtaining the file according to the file storage path to obtain the target file includes:
inquiring file stream according to the file storage path;
if a file stream is inquired according to the file storage path, generating the target file according to the inquired file stream;
and if the file stream is not inquired according to the file storage path, performing path splitting on the file storage path to obtain a file storage sub-path, and determining the target file according to the file storage sub-path.
Further, the determining the target file according to the file storage sub-path includes:
inquiring a file stream according to each file storage sub-path to obtain a candidate file stream, and screening the candidate file stream according to preset screening information, wherein the preset screening information comprises one or more combinations of preset data values, preset file types and preset file labels;
performing data stream encapsulation on the screened candidate file stream to obtain candidate files, and respectively obtaining association values between the candidate files and the file downloading request according to file identifiers of the candidate files and request identifiers of the file downloading request;
and determining the candidate file corresponding to the maximum association value as the target file.
Further, the calling the first server according to the file downloading request and the configuration information to obtain the file parameters includes:
acquiring a request identifier of the file downloading request, and determining the request type of the file downloading request according to the request identifier;
acquiring a parameter query table of the first server, and matching the request type and the configuration information with the queried parameter query table;
and if the request type and the configuration information are successfully matched with the inquired parameter inquiry table, determining the matched parameters as the file parameters.
Further, after the matching the request type and the configuration information with the queried parameter lookup table, the method further includes:
if the request type and the configuration information are not matched with the inquired parameter inquiry table, determining a similar type according to the type identifier of the request type;
matching the similar type and the configuration information with the queried parameter query table, and determining the matched parameters as the file parameters if the similar type and the configuration information are successfully matched with the queried parameter query table;
and if the similar type and the configuration information are not matched with the inquired parameter inquiry table, determining a default parameter as the file parameter.
Further, after obtaining the target file by performing file acquisition according to the file storage path, the method further includes:
determining a file downloading scene according to the request identifier of the file downloading request, and performing scene verification on the target file according to the file downloading scene, wherein the scene verification is used for detecting whether the application scene of the target file is matched with the file downloading scene;
and if the scene verification of the target file is unqualified, sending a scene verification error prompt to the user equipment.
A second aspect of an embodiment of the present application provides a file downloading apparatus, including:
the system comprises a configuration information acquisition unit, a file downloading request acquisition unit and a configuration information acquisition unit, wherein the configuration information acquisition unit is used for receiving the file downloading request and acquiring pre-stored configuration information of a uniform resource locator, and the configuration information is used for determining a data object pointed by the file downloading request;
the system calling unit is used for calling a first server according to the file downloading request and the configuration information to obtain file parameters, and calling a second server according to the file parameters and the configuration information to obtain a file storage path;
and the file downloading unit is used for acquiring a file according to the file storage path to obtain a target file and sending the target file to the user equipment corresponding to the file downloading request.
A third aspect of embodiments of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the computer device, where the processor implements the steps of the file downloading method provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the file downloading method provided by the first aspect.
According to the file downloading method, the file downloading device, the computer equipment and the medium, file parameters are determined according to a file downloading request and resource configuration information; determining a file storage path according to the file parameters and the resource configuration information; according to the method and the device for downloading the files, the files are obtained according to the file storage path, the target files corresponding to the file downloading requests can be automatically sent to the user equipment only by configuring and setting the uniform resource locator, the first server and the second system in advance, file downloading codes do not need to be set for different file downloading scenes, setting operation of the server is facilitated, inquiry of the file downloading codes is not needed in the file downloading process, and file downloading efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a file downloading method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an implementation of a file downloading method according to another embodiment of the present application;
fig. 3 is a block diagram illustrating a file downloading apparatus according to an embodiment of the present disclosure;
fig. 4 is a block diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a file downloading method provided in an embodiment of the present application, where the file downloading method is applied to any computer device or business system, the computer device may be a server, a mobile phone, or a tablet, and the file downloading method includes:
step S10, receiving a file downloading request and acquiring pre-stored configuration information of the uniform resource locator;
the file downloading method is applied to a designated server, the file downloading request can be transmitted in a voice, text or signal instruction mode, and the designated server receives the file downloading request based on a port on a front-end gateway;
in this step, the pre-stored url is stored in the designated server, and the user may log in a configuration web page corresponding to the designated server to set the url, so as to set the resource configuration information according to the user requirement, where the configuration information is used to determine a data object to which the file download request is directed, and the data object may be any database;
step S20, calling a first server according to the file downloading request and the configuration information to obtain file parameters;
the first server can be set according to requirements, and is used for determining corresponding file parameters according to a file downloading request and configuration information of a uniform resource locator when being called, wherein the file parameters are used for representing attribute information of a target file corresponding to the file downloading request, and the attribute information comprises information such as a file type, a file identifier and a file data value;
in the step, the first server is called by the file downloading request and the configuration information to obtain the file parameters, so that a user can automatically obtain the file parameters corresponding to the file downloading request and the configuration information only by setting the parameters of the first server, and the efficiency of obtaining the file parameters is improved, specifically, first calling instruction information aiming at a preset value of the first server is obtained, the obtained first calling instruction information, the file downloading request and the configuration information are packaged to obtain a first server calling instruction, the first calling instruction information is used for generating a header in the first server calling instruction, the first server is convenient to unpack the first server calling instruction by the first server based on the header to obtain the file downloading request and the configuration information, and the first server carries out parameter query according to the obtained file downloading request and the configuration information, the file parameters are obtained, and a file parameter query table is stored in the first server, and the file parameter query table stores corresponding relations between different file downloading requests and configuration information and corresponding file parameters, so that a user only needs to set the parameters of the file parameter query table, and the file parameters corresponding to the file downloading requests and the configuration information can be automatically obtained.
Optionally, in this step, the first server queries the information of the file root directory, the file sub-path, and the file name according to the file download request and the configuration information obtained by decapsulation, determines corresponding file parameters according to the queried information of the file root directory, the file sub-path, and the file name, and responds to the first server call instruction with the determined file parameters. Step S30, calling a second server according to the file parameters and the configuration information to obtain a file storage path;
the second server can be set according to requirements, and is used for determining a corresponding file storage path according to file parameters and configuration information of the uniform resource locator when being called, wherein the file storage path is used for representing a storage address of a corresponding file;
in the step, the second server is called through the file parameters and the configuration information to obtain the file storage path, so that the user can automatically acquire the file storage path corresponding to the file parameters and the configuration information only by setting the parameters of the second server, and the efficiency of acquiring the file storage path is improved. Specifically, calling instruction information aiming at a preset value of a second server is obtained, second calling instruction information is obtained, the obtained second calling instruction information, file parameters and configuration information are packaged to obtain a second server calling instruction, the second calling instruction information is used for generating a header in the second server calling instruction, the decapsulation of the second server calling instruction by the second server is facilitated based on the header, the file parameter and the configuration information are obtained, the second server carries out path query according to the obtained file parameter and the configuration information, the file storage path is obtained, the second server stores a path lookup table, which stores the corresponding relationship between different file parameters and configuration information and the corresponding file storage paths, therefore, the user can automatically acquire the file storage path corresponding to the file parameter and the configuration information only by setting the parameter of the path lookup table.
In this embodiment, the first server and the second server are respectively called to correspondingly obtain the file parameters and the file storage path, that is, the first server is only used for determining the file parameters when called, and the second server is only used for determining the file storage path when called, so that the bandwidths of the first server and the second server when called are reduced, and the accuracy and the efficiency of determining the file parameters and the file storage path are improved.
Optionally, in this step, the calling the second server according to the file parameter and the configuration information to obtain a file storage path includes:
acquiring path data of the second server;
the path data comprises corresponding relations between different configuration information and corresponding path query tables, the path query tables comprise different file parameters and storage paths of pointed files, and in the step, corresponding path data is obtained by obtaining an identifier of a second server according to the identifier of the second server;
determining a path query table in the path data according to the configuration information, and matching the file parameters with the determined path query table to obtain the file storage path;
and matching the file parameters with the determined path lookup table to obtain the file storage path.
Step S40, file acquisition is carried out according to the file storage path to obtain a target file, and the target file is sent to the user equipment corresponding to the file downloading request;
in the step, the target file can be sent to the user equipment corresponding to the file downloading request in a mode of sending a compressed data packet or a file downloading address.
Optionally, in this step, the obtaining a file according to the file storage path to obtain a target file includes:
inquiring file stream according to the file storage path;
inquiring a file stream corresponding to a file storage path in a locally pre-stored distributed storage medium, wherein in the step, the distributed storage medium can be set according to requirements;
if a file stream is inquired according to the file storage path, generating the target file according to the inquired file stream;
if a file stream is inquired according to the file storage path, the target file is obtained by means of data combination, data compression or data encapsulation of the inquired file stream;
if the file stream is not inquired according to the file storage path, path splitting is carried out on the file storage path to obtain a file storage sub-path, and the target file is determined according to the file storage sub-path;
if the file stream is not inquired according to the file storage path, path splitting is carried out on the file storage path to obtain a file storage sub-path, and a target file is determined according to the file storage sub-path;
for example, when the file storage sub-path is a1-a2-a3-a4-a5, the split file storage sub-path includes a1-a2-a3-a4, a1-a2-a3, a1-a2, a2-a3-a4-a5, a3-a4-a5, and the like.
Further, in this step, the determining the target file according to the file storage sub-path includes:
inquiring a file stream according to each file storage sub-path to obtain a candidate file stream, and screening the candidate file stream according to preset screening information;
performing data stream encapsulation on the screened candidate file stream to obtain candidate files, respectively obtaining association values between the candidate files and the file downloading request according to file identifiers of the candidate files and request identifiers of the file downloading request, and determining the target file of the candidate file corresponding to the maximum association value;
the preset screening information includes one or more combinations of a preset data value, a preset file type and a preset file tag, in the step, the data value, the data type or the data tag of the candidate file stream is screened according to the preset screening information, for example, the candidate file stream with the data value smaller than the preset data value is deleted, the candidate file stream with the data type not being the preset file type is deleted, the candidate file stream with the file tag not carrying the preset file tag is deleted, the preset data value can be set according to the user duration, the preset file type can be set according to the file type pointed by the user requirement or the identifier of the file download request, and the preset file tag can be set according to the file type pointed by the user requirement or the identifier of the file download request.
In this step, the correlation value is used to characterize the degree of correlation between the candidate file and the file download request, and when the correlation value between the candidate file and the file download request is larger, it is determined that the probability that the candidate file is the target file corresponding to the file download request is larger, specifically, the correlation value between each candidate file and the file download request is obtained by respectively matching the file identifier of each candidate file with the request identifier of the file download request with a pre-stored correlation value lookup table.
Further, in this step, after sending the target file to the user equipment corresponding to the file download request, the method further includes: calculating the hash value of the target file, acquiring the equipment identifier and the network address of the user equipment, generating a target file downloading migration map according to the hash value of the target file, the downloading time of the target file, the equipment identifier and the network address of the user equipment, storing information of the target file downloading migration map, and effectively facilitating tracking of the downloading end equipment corresponding to the target file and tracing of each time of downloading information corresponding to the target file based on the target file downloading migration map. In the embodiment, the file parameters are determined according to the file downloading request and the resource configuration information; determining a file storage path according to the file parameters and the resource configuration information; according to the method and the device for downloading the files, the files are obtained according to the file storage path, the target files corresponding to the file downloading requests can be automatically sent to the user equipment only by configuring and setting the uniform resource locator, the first server and the second system in advance, file downloading codes do not need to be set for different file downloading scenes, setting operation of the server is facilitated, inquiry of the file downloading codes is not needed in the file downloading process, and file downloading efficiency is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a file downloading method according to another embodiment of the present application. With respect to the embodiment of fig. 1, the file downloading method provided by this embodiment is used to further refine step S20 in the embodiment of fig. 1, and includes:
step S21, obtaining the request identification of the file downloading request, and determining the request type of the file downloading request according to the request identification;
the method comprises the steps of obtaining an information entity by performing entity analysis on a file downloading request, determining a request type query table according to a request identifier of the file downloading request, and matching the information entity with the request type query table to obtain a request type, wherein the request type query table stores corresponding relations between different information entities and corresponding request types;
step S22, obtaining a parameter query table of the first server, and matching the request type and the configuration information with the queried parameter query table;
the method comprises the steps that a server identification of a first server is obtained, a parameter query table is determined to be queried according to the server identification of the first server, and corresponding relations between different request types and resource configuration information and corresponding file parameters are stored in the parameter query table;
step S23, if the request type and the configuration information are successfully matched with the inquired parameter inquiry table, determining the matched parameters as the file parameters;
in a further embodiment, after matching the request type and the configuration information with the queried parameter lookup table, the method further includes:
if the request type and the configuration information are not matched with the inquired parameter inquiry table, determining a similar type according to the type identifier of the request type;
the type identifier of the request type is matched with a pre-stored similar type query table, the matched category is determined as the similar type of the request type of the file downloading request, and the similar type query table stores the corresponding relation between different types of identifiers and corresponding similar types.
Matching the similar type and the configuration information with the queried parameter query table, and determining the matched parameters as the file parameters if the similar type and the configuration information are successfully matched with the queried parameter query table;
if the similar type and the configuration information are successfully matched with the inquired parameter inquiry table, determining the parameters matched with the similar type and the configuration information as the file parameters pointed by the file downloading request;
if the similar type and the configuration information are not matched with the inquired parameter inquiry table, determining a default parameter as the file parameter;
the default parameter can be set according to requirements, optionally, if the similar type and the configuration information are not matched with the inquired parameter lookup table, a file downloading error prompt is sent.
Further, in this embodiment, after obtaining the target file by performing file acquisition according to the file storage path, the method further includes:
determining a file downloading scene according to the request identifier of the file downloading request, and performing scene verification on the target file according to the file downloading scene;
if the scene verification of the target file is unqualified, sending a scene verification error prompt to the user equipment;
the scene check is used for detecting whether an application scene of a target file is matched with a file downloading scene or not, in the step, whether a matching value between the file downloading scene and the target file is greater than a matching threshold value or not is judged by inquiring the matching value, and the matching value is used for representing the matching degree between the file downloading scene and the target file;
optionally, in this step, a file scene application set is determined according to the file identifier of the target file, and similarity matching is performed between the determined file scene application set and the file download scene to obtain the matching value, where the file scene application set includes an application scene when the corresponding target file is downloaded.
In this embodiment, the request type of the file downloading request can be effectively determined based on the request identifier obtained by the file downloading request, and the file parameter corresponding to the request type and the configuration information can be effectively determined based on the parameter lookup table obtained by the parameter lookup table of the first server, so that the accuracy of determining the file parameter is improved.
And matching the request type and the configuration information with the inquired parameter inquiry table.
Referring to fig. 3, fig. 3 is a block diagram of a file downloading device 100 according to an embodiment of the present disclosure. In this embodiment, the file downloading apparatus 100 includes units for executing steps in the embodiments corresponding to fig. 1 and fig. 2. Please refer to fig. 1 and fig. 2 and the related descriptions in the embodiments corresponding to fig. 1 and fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 3, the file downloading apparatus 100 includes: a configuration information obtaining unit 10, a system calling unit 11 and a file downloading unit 12, wherein:
the configuration information obtaining unit 10 is configured to receive a file download request, and obtain pre-stored configuration information of a uniform resource locator, where the configuration information is used to determine a data object to which the file download request is directed. The file downloading method is applied to a designated server, the file downloading request can be transmitted in a voice, text or signal instruction mode, and the designated server receives the file downloading request based on a port on a front-end gateway;
in the unit, the pre-stored url is stored in the designated server, and a user can log in a configuration web page corresponding to the designated server to set the url, so as to set the resource configuration information according to the user requirement, where the configuration information is used to determine a data object to which the file download request is directed, and the data object may be any database.
And the system calling unit 11 is configured to call a first server according to the file downloading request and the configuration information to obtain a file parameter, and call a second server according to the file parameter and the configuration information to obtain a file storage path. The first server can be set according to requirements, and is used for determining corresponding file parameters according to a file downloading request and configuration information of a uniform resource locator when being called, wherein the file parameters are used for representing attribute information of a target file corresponding to the file downloading request, and the attribute information comprises information such as a file type, a file identifier and a file data value;
in the unit, the first server is called through the file downloading request and the configuration information to obtain the file parameters, so that a user only needs to set the parameters of the first server, the automatic acquisition of the file parameters corresponding to the file downloading request and the configuration information can be realized, and the file parameter acquisition efficiency is improved.
Optionally, the system invoking unit 11 is further configured to: acquiring path data of the second server, wherein the path data comprises corresponding relations between different configuration information and a corresponding path query table, and the path query table comprises different file parameters and storage paths of pointed files;
and determining a path lookup table in the path data according to the configuration information, and matching the file parameters with the determined path lookup table to obtain the file storage path.
Further, the system invoking unit 11 is further configured to: acquiring a request identifier of the file downloading request, and determining the request type of the file downloading request according to the request identifier;
acquiring a parameter query table of the first server, and matching the request type and the configuration information with the queried parameter query table;
and if the request type and the configuration information are successfully matched with the inquired parameter inquiry table, determining the matched parameters as the file parameters.
Further, the system invoking unit 11 is further configured to: if the request type and the configuration information are not matched with the inquired parameter inquiry table, determining a similar type according to the type identifier of the request type;
matching the similar type and the configuration information with the queried parameter query table, and determining the matched parameters as the file parameters if the similar type and the configuration information are successfully matched with the queried parameter query table;
and if the similar type and the configuration information are not matched with the inquired parameter inquiry table, determining a default parameter as the file parameter.
And the file downloading unit 12 is configured to obtain a file according to the file storage path to obtain a target file, and send the target file to the user equipment corresponding to the file downloading request. The second server can be set according to requirements, and is used for determining a corresponding file storage path according to file parameters and configuration information of the uniform resource locator when being called, wherein the file storage path is used for representing a storage address of a corresponding file;
in the unit, the second server is called through the file parameters and the configuration information to obtain the file storage path, so that a user can automatically acquire the file storage path corresponding to the file parameters and the configuration information only by setting the parameters of the second server, and the acquisition efficiency of the file storage path is improved.
Optionally, the file downloading unit 12 is further configured to: inquiring file stream according to the file storage path;
if a file stream is inquired according to the file storage path, generating the target file according to the inquired file stream;
and if the file stream is not inquired according to the file storage path, performing path splitting on the file storage path to obtain a file storage sub-path, and determining the target file according to the file storage sub-path.
Further, the file downloading unit 12 is further configured to: inquiring a file stream according to each file storage sub-path to obtain a candidate file stream, and screening the candidate file stream according to preset screening information, wherein the preset screening information comprises one or more combinations of preset data values, preset file types and preset file labels;
performing data stream encapsulation on the screened candidate file stream to obtain candidate files, and respectively obtaining association values between the candidate files and the file downloading request according to file identifiers of the candidate files and request identifiers of the file downloading request;
and determining the candidate file corresponding to the maximum association value as the target file.
Further, the file downloading unit 12 is further configured to: determining a file downloading scene according to the request identifier of the file downloading request, and performing scene verification on the target file according to the file downloading scene, wherein the scene verification is used for detecting whether the application scene of the target file is matched with the file downloading scene;
and if the scene verification of the target file is unqualified, sending a scene verification error prompt to the user equipment.
In the embodiment, the file parameters are determined according to the file downloading request and the resource configuration information; determining a file storage path according to the file parameters and the resource configuration information; according to the method and the device for downloading the files, the files are obtained according to the file storage path, the target files corresponding to the file downloading requests can be automatically sent to the user equipment only by configuring and setting the uniform resource locator, the first server and the second system in advance, file downloading codes do not need to be set for different file downloading scenes, setting operation of the server is facilitated, inquiry of the file downloading codes is not needed in the file downloading process, and file downloading efficiency is improved.
Fig. 4 is a block diagram of a computer device 2 according to another embodiment of the present application. As shown in fig. 4, the computer device 2 of this embodiment includes: a processor 20, a memory 21 and a computer program 22, such as a program of a file download method, stored in said memory 21 and executable on said processor 20. The processor 20, when executing the computer program 22, implements the steps in the various embodiments of the file downloading methods described above, such as S10 through S40 shown in fig. 1, or S21 through S23 shown in fig. 2. Alternatively, when the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to fig. 3, for example, the functions of the units 10 to 12 shown in fig. 3, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 3, which is not repeated herein.
Illustratively, the computer program 22 may be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 22 in the computer device 2. For example, the computer program 22 may be divided into a configuration information acquisition unit 10, a system call unit 11, and a file download unit 12, each of which functions as described above.
The computer device may include, but is not limited to, a processor 20, a memory 21. Those skilled in the art will appreciate that fig. 4 is merely an example of a computer device 2 and is not intended to limit the computer device 2 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the computer device may also include input output devices, network access devices, buses, etc.
The processor 20 may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. The memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the computer device 2. The memory 21 is used for storing the computer program and other programs and data required by the computer device. The memory 21 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be non-volatile or volatile. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable storage media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for downloading a file, comprising:
receiving a file downloading request, and acquiring pre-stored configuration information of a uniform resource locator, wherein the configuration information is used for determining a data object pointed by the file downloading request;
calling a first server according to the file downloading request and the configuration information to obtain file parameters;
calling a second server according to the file parameters and the configuration information to obtain a file storage path;
and acquiring a file according to the file storage path to obtain a target file, and sending the target file to the user equipment corresponding to the file downloading request.
2. The method of claim 1, wherein the invoking a second server according to the file parameter and the configuration information to obtain a file storage path comprises:
acquiring path data of the second server, wherein the path data comprises corresponding relations between different configuration information and a corresponding path query table, and the path query table comprises different file parameters and storage paths of pointed files;
and determining a path lookup table in the path data according to the configuration information, and matching the file parameters with the determined path lookup table to obtain the file storage path.
3. The file downloading method according to claim 2, wherein the obtaining of the file according to the file storage path to obtain the target file comprises:
inquiring file stream according to the file storage path;
if a file stream is inquired according to the file storage path, generating the target file according to the inquired file stream;
and if the file stream is not inquired according to the file storage path, performing path splitting on the file storage path to obtain a file storage sub-path, and determining the target file according to the file storage sub-path.
4. The file downloading method of claim 3, wherein the determining the target file according to the file storage sub-path comprises:
inquiring a file stream according to each file storage sub-path to obtain a candidate file stream, and screening the candidate file stream according to preset screening information, wherein the preset screening information comprises one or more combinations of preset data values, preset file types and preset file labels;
performing data stream encapsulation on the screened candidate file stream to obtain candidate files, and respectively obtaining association values between the candidate files and the file downloading request according to file identifiers of the candidate files and request identifiers of the file downloading request;
and determining the candidate file corresponding to the maximum association value as the target file.
5. The method of claim 1, wherein the invoking the first server according to the file download request and the configuration information to obtain the file parameter comprises:
acquiring a request identifier of the file downloading request, and determining the request type of the file downloading request according to the request identifier;
acquiring a parameter query table of the first server, and matching the request type and the configuration information with the queried parameter query table;
and if the request type and the configuration information are successfully matched with the inquired parameter inquiry table, determining the matched parameters as the file parameters.
6. The file downloading method of claim 5, wherein after matching the request type and the configuration information with the queried parameter lookup table, further comprising:
if the request type and the configuration information are not matched with the inquired parameter inquiry table, determining a similar type according to the type identifier of the request type;
matching the similar type and the configuration information with the queried parameter query table, and determining the matched parameters as the file parameters if the similar type and the configuration information are successfully matched with the queried parameter query table;
and if the similar type and the configuration information are not matched with the inquired parameter inquiry table, determining a default parameter as the file parameter.
7. The file downloading method according to any one of claims 1 to 6, wherein after the file is obtained according to the file storage path to obtain the target file, the method further comprises:
determining a file downloading scene according to the request identifier of the file downloading request, and performing scene verification on the target file according to the file downloading scene, wherein the scene verification is used for detecting whether the application scene of the target file is matched with the file downloading scene;
and if the scene verification of the target file is unqualified, sending a scene verification error prompt to the user equipment.
8. A file downloading apparatus, comprising:
the system comprises a configuration information acquisition unit, a file downloading request acquisition unit and a configuration information acquisition unit, wherein the configuration information acquisition unit is used for receiving the file downloading request and acquiring pre-stored configuration information of a uniform resource locator, and the configuration information is used for determining a data object pointed by the file downloading request;
the system calling unit is used for calling a first server according to the file downloading request and the configuration information to obtain file parameters, and calling a second server according to the file parameters and the configuration information to obtain a file storage path;
and the file downloading unit is used for acquiring a file according to the file storage path to obtain a target file and sending the target file to the user equipment corresponding to the file downloading request.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202111574436.8A 2021-12-21 2021-12-21 File downloading method and device, computer equipment and medium Pending CN114218165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111574436.8A CN114218165A (en) 2021-12-21 2021-12-21 File downloading method and device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111574436.8A CN114218165A (en) 2021-12-21 2021-12-21 File downloading method and device, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN114218165A true CN114218165A (en) 2022-03-22

Family

ID=80704815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111574436.8A Pending CN114218165A (en) 2021-12-21 2021-12-21 File downloading method and device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN114218165A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745368A (en) * 2022-03-31 2022-07-12 广州极飞科技股份有限公司 File downloading method and device, computer equipment and computer readable storage medium
CN116684407A (en) * 2023-08-01 2023-09-01 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745368A (en) * 2022-03-31 2022-07-12 广州极飞科技股份有限公司 File downloading method and device, computer equipment and computer readable storage medium
CN114745368B (en) * 2022-03-31 2024-04-09 广州极飞科技股份有限公司 File downloading method, device, computer equipment and computer readable storage medium
CN116684407A (en) * 2023-08-01 2023-09-01 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium
CN116684407B (en) * 2023-08-01 2023-10-27 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN114218165A (en) File downloading method and device, computer equipment and medium
CN111259036A (en) Cross-library and cross-table query method, device, server and storage medium
US10645001B2 (en) Information transmission method and apparatus, device and storage medium
CN107566477B (en) Method and device for acquiring files in distributed file system cluster
US20170187837A1 (en) Ad download method, the client and the server
CN110213380B (en) Message pushing method and device, computer equipment and storage medium
CN110543324B (en) Plug-in increment updating method and device for application program
CN108429739B (en) Method, system and terminal equipment for identifying honeypots
CN110764688B (en) Method and device for processing data
CN108491715B (en) Terminal fingerprint database generation method and device and server
CN112416964A (en) Data processing method, device and system, computer equipment and computer readable storage medium
CN104767839A (en) IP positioning method and device
CN113110944A (en) Information searching method, device, server, readable storage medium and program product
US9665732B2 (en) Secure Download from internet marketplace
CN113067853A (en) Data pushing method and device, electronic equipment and storage medium
CN108134811B (en) Method, device and system for distributing or downloading target file
CN112235124B (en) Method and device for configuring pico-cell, storage medium and electronic device
CN113868698A (en) File desensitization method and equipment
CN107241446A (en) Document transmission method, device and the terminal device and storage medium of application program
CN111797334A (en) Website access method and device, electronic equipment and storage medium
CN111008220A (en) Dynamic identification method and device of data source, storage medium and electronic device
CN110674171A (en) Script generation method and device and data processing method and device
CN111723236A (en) Video index establishing method, device, equipment and computer readable medium
CN115208951A (en) Request processing method and device, electronic equipment and computer readable storage medium
CN104407846B (en) Information processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination