File downloading method and device, equipment, storage medium and program product
By setting up file sub-servers in the back-end server to share the processing of large file download requests, the problem of excessive memory usage of the back-end server is solved, and the stability and efficiency of the system are improved.
Patent Information
- Application Number
- CN202411158624.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In the housing provident fund management system, when the back-end server processes large file download requests, it causes too high memory usage, which may cause memory overflow and application downtime.
Set up a file sub-server in the back-end server and send files to the mobile terminal through the file sub-server to share some of the processing requests of the application object when downloading the file, thereby reducing the memory usage of the application object.
It effectively reduces the memory usage rate of the backend server when downloading files, avoids memory overflow and application downtime, and improves the stability and efficiency of the system.
Smart Images

Figure CN118972382A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a file downloading method, device, equipment, storage medium and program product. Background Art
[0002] In order to improve the operational efficiency of housing provident fund management, optimize the housing provident fund management and operation system through the use of digital technology, and realize accurate and efficient business audits and fast and safe fund settlement, the Housing Provident Fund Supervision Department of the Ministry of Housing and Urban-Rural Development initiated the construction of a supervision front-end application. The construction supervision front-end application has functions such as instant messaging, data reporting, operation and maintenance work orders, and message push. However, with the expansion of the scale of mobile supervision users, the number of installations of supervision front-end applications has also increased. When users use the instant messaging and operation and maintenance work order functions of the construction supervision front-end application, if they send large files (for example, files over 30M), the application in the back-end server will need to process a large number of requests and download files concurrently, resulting in high application memory usage, and even memory overflow and application downtime. Summary of the invention
[0003] The embodiments of the present application provide a file downloading method, apparatus, device, storage medium and program product, which can share part of the processing requests of an application object during file downloading, thereby reducing the memory usage of the application object.
[0004] In a first aspect, an embodiment of the present application provides a file downloading method, which is applied to a backend server, wherein the backend server includes an application object and a file sub-server, and a communication channel is connected between the application object and the file sub-server. The method includes:
[0005] The application object receives a download request sent by a mobile terminal, wherein the download request is used to request downloading of the target file, and the target file is stored in the file sub-server;
[0006] The application object sends the download request to the file sub-server through the communication channel;
[0007] The file sub-server sends the target file to the mobile terminal in response to the download request, so that the mobile terminal receives the target file.
[0008] In a second aspect, an embodiment of the present application provides a file downloading method, which is applied to a mobile terminal, and the method includes:
[0009] Sending a download request to an application object in a backend server, the backend server comprising the application object and a file sub-server, the application object and the file sub-server being connected via a communication channel, the download request being used to request downloading the target file, the target file being stored in the file sub-server, so that the application object sends the download request to the file sub-server through the communication channel; the file sub-server sends the target file to the mobile terminal in response to the download request;
[0010] Receive the target file sent by the file sub-server.
[0011] In a third aspect, an embodiment of the present application provides a file downloading device, which is applied to a backend server, wherein the backend server includes an application object and a file sub-server, and a communication channel is connected between the application object and the file sub-server, and the device includes:
[0012] The application object is used to receive a download request sent by a mobile terminal, wherein the download request is used to request downloading of the target file, and the target file is stored in the file sub-server;
[0013] The application object is further used to send the download request to the file sub-server through the communication channel;
[0014] The file sub-server is used to send the target file to the mobile terminal in response to the download request, so that the mobile terminal receives the target file.
[0015] In a fourth aspect, an embodiment of the present application provides a file downloading device, which is applied to a mobile terminal, and the device includes:
[0016] A first sending module is used to send a download request to an application object in a backend server, the backend server includes the application object and a file sub-server, the application object and the file sub-server are connected by a communication channel, the download request is used to request downloading the target file, the target file is stored in the file sub-server, so that the application object sends the download request to the file sub-server through the communication channel; the file sub-server sends the target file to the mobile terminal in response to the download request;
[0017] The first receiving module is used to receive the target file sent by the file sub-server.
[0018] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the file download method as described in any one of the above is implemented.
[0019] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the file downloading method as described in any one of the above is implemented.
[0020] In a seventh aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the file downloading methods described above.
[0021] In the file downloading method, device, equipment, storage medium and program product of the embodiment of the present application, the mobile terminal can send a download request to the application object in the back-end server, and then the application object sends the download request to the file sub-server in the back-end server through the communication channel; in this way, the file sub-server can respond to the download request and send the target file to the mobile terminal. In this way, in the embodiment of the present application, a file sub-server is set in the back-end server, and the file is sent to the mobile terminal through the file sub-server, which can share part of the processing request of the application object when downloading the file, thereby reducing the memory usage of the application object. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 It is a flowchart of a file downloading system provided by an embodiment of the present application;
[0024] Figure 2 It is a flowchart of a file downloading method provided in an embodiment of the present application;
[0025] Figure 3 It is a flowchart of an application scenario provided by an embodiment of the present application;
[0026] Figure 4 It is a structural diagram of a file downloading device provided in an embodiment of the present application;
[0027] Figure 5 is a structural diagram of another file downloading device provided in an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0030] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0031] In order to improve the operational efficiency of housing provident fund management, optimize the housing provident fund management and operation system through the use of digital technology, and realize accurate and efficient business audits and fast and safe fund settlement, the Housing Provident Fund Supervision Department of the Ministry of Housing and Urban-Rural Development initiated the construction of a supervision front-end application. The construction supervision front-end application has functions such as instant messaging, data reporting, operation and maintenance work orders, and message push. However, with the expansion of the scale of mobile supervision users, the number of installations of supervision front-end applications has also increased. When users use the instant messaging and operation and maintenance work order functions of the construction supervision front-end application, if they send large files (for example, files over 30M), the application in the back-end server will need to process a large number of requests and download files concurrently, resulting in high application memory usage, and even memory overflow and application downtime.
[0032] The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0033] In order to solve the problems of the prior art, the embodiments of the present application provide a file downloading method, device, equipment, storage medium and program product. The following first introduces the file downloading system provided by the embodiments of the present application.
[0034] Figure 1 The following is an architecture diagram of a file downloading system applicable to the embodiment of the present application. Figure 1 As shown, the file downloading system 100 may include: a mobile terminal 101 and a backend server 102 .
[0035] The mobile terminal 101 may refer to a front-end device that a user may use to achieve accurate and efficient business audit and fund settlement, such as a personal computer, a mobile phone, and a tablet. The mobile terminal may include a construction supervision front-end application, which has functions such as instant messaging, data reporting, operation and maintenance work orders, and message push, and may send a download request for a large file to a back-end server.
[0036] The backend server 102 can be a backend device for accurate and efficient business audit and fund settlement, such as a cloud server. The backend server can process download requests generated when the mobile terminal builds the instant messaging and operation and maintenance work order functions of the supervision front-end application, and send the download file to the mobile terminal.
[0037] The back-end server 102 may specifically include an application object 1021 and a file sub-server 1022, and a communication channel is connected between the application object 1021 and the file sub-server 1022. Among them, the application object, i.e., a software application, is a type of program in a computer system, which is designed to help users perform specific tasks or meet specific needs. In the embodiment of the present application, the application object may refer to a software application written in Java. The file sub-server is a simple file server built in the back-end server using the nginx application in the present application, and a communication channel is built between the Java application and the file sub-server, so that the application object and the file sub-server can use the communication channel to download files. In the embodiment of the present application, since the nginx application is easy and fast to build and occupies less resources, it is suitable for building a low-cost simple file server, which can reduce the cost of operation.
[0038] The mobile terminal 101 and the backend server 102 are connected in communication. Specifically, Ethernet or wireless network connection can be used for communication. Of course, the communication method is not limited to this, and can also be other network connection communication methods, which are not specifically limited here.
[0039] The following is an introduction to the file downloading method provided in the embodiment of the present application.
[0040] Figure 2The flowchart of the file download method provided by an embodiment of the present application is shown. Optionally, the method of the embodiment of the present application can be applied to the above Figure 1 The mobile terminal and backend server shown in FIG. Figure 2 As shown, a file downloading method 200 may include the following steps S201 to S205:
[0041] S201, the mobile terminal sends a download request to the application object in the backend server, the download request is used to request to download a target file, the target file is stored in the file sub-server,
[0042] S202, the application object receives a download request sent by the mobile terminal;
[0043] S203, the application object sends the download request to the file sub-server through the communication channel;
[0044] S204, the file sub-server sends the target file to the mobile terminal in response to the download request;
[0045] S205: The mobile terminal receives the target file sent by the file sub-server.
[0046] In the file download method of the embodiment of the present application, the mobile terminal can send a download request to the application object in the back-end server, and then the application object sends the download request to the file sub-server in the back-end server through the communication channel; in this way, the file sub-server can respond to the download request and send the target file to the mobile terminal. In this way, in the embodiment of the present application, a file sub-server is set in the back-end server, and the file is sent to the mobile terminal through the file sub-server, which can share part of the processing request of the application object when downloading the file, thereby reducing the memory usage of the application object.
[0047] In S201, the download request may be used to request downloading of a target file. The target file is stored in a file sub-server. For example, the target file is a file in the file sub-server with a file size exceeding 30 MB.
[0048] The mobile terminal sends a download request to the application object in the backend server. Exemplarily, the mobile terminal sends the download request to the application object in the backend server via wireless communication.
[0049] In S202, the application object receives a download request sent by a mobile terminal. For example, the application object receives the download request sent by the mobile terminal in a wireless communication manner.
[0050] In S203, the communication channel, illustratively, may be a channel for file downloading constructed between the application object and the file sub-server using the nginx application.
[0051] In S204, the target file is sent to the mobile terminal. Exemplarily, the target file may be sent directly to the mobile terminal; or the target file may be sent to the mobile terminal at a preset download speed.
[0052] In S205, the mobile terminal receives the target file sent by the file sub-server. For example, the mobile terminal may directly receive the target file sent by the file sub-server, or the mobile terminal may receive the target file sent by the file sub-server at a preset download speed.
[0053] As an implementation of the present application, in order to ensure that the target file can be downloaded, before the above S201, the above method may further include:
[0054] The mobile terminal receives a target operation of the user clicking to download a target file in a display operation interface of the mobile terminal;
[0055] The mobile terminal sends a query request to the application object in response to the target operation, the query request being used to query whether the target file is downloadable;
[0056] The application object queries the queue status information of the download queue in the application object in response to the query request, where the queue status information is used to indicate whether the download queue is full;
[0057] The application object generates a download flag according to the queue status information, and the download flag is used to indicate whether the target file can be downloaded;
[0058] The application object sends a download mark to the mobile terminal;
[0059] The above S201 may specifically include:
[0060] When the download mark indicates that the target file is downloadable, the mobile terminal sends a download request to the application object in the backend server.
[0061] The above target operation may be an operation in which the user clicks to download the target file in the display operation interface of the mobile terminal.
[0062] The above query request can be used to query whether the target file is downloadable.
[0063] The above queue status information can be used to indicate whether the download queue is full.
[0064] The download flag can be used to indicate whether the target file is downloadable. For example, the download flag includes a first flag and a second flag, wherein the first flag is used to indicate that the target file is downloadable, and the second flag is used to indicate that the target file is not downloadable.
[0065] The above-mentioned generation of a download flag based on the queue status information may specifically include: when the queue status information indicates that the download queue is not full, adding the download request to the download queue and generating a first flag, the first flag is used to indicate that the target file can be downloaded; when the queue status information indicates that the download queue is full, not adding the download request to the download queue, and generating a second flag, the second flag is used to indicate that the target file cannot be downloaded; the download flag includes the first flag and the second flag.
[0066] In some embodiments, when the download mark indicates that the target file cannot be downloaded, the mobile terminal periodically polls to obtain a new download mark until the new download mark indicates that the target file can be downloaded.
[0067] In an embodiment of the present application, the mobile terminal queries the queue status information of the download queue in the application object by sending a query request to the application object, and sends a download mark indicating whether the target file can be downloaded to the mobile terminal, so that the mobile terminal sends a download request to the application object in the back-end server only when the download mark indicates that the target file can be downloaded, thereby ensuring that the target file can be downloaded.
[0068] As another implementation method of the present application, in order to enhance the reliability of the download mark, the query request may include user authentication information. Before the application object sends the download mark to the mobile terminal, the method may further include:
[0069] The application object responds to the query request, authenticates the user authentication information, and generates an authentication result, which is used to indicate whether the user authentication information is authenticated;
[0070] The application object sends the download mark to the mobile terminal, which may specifically include:
[0071] When the authentication result indicates that the user authentication information is authenticated successfully, the application object sends a download mark to the mobile terminal.
[0072] The user authentication information mentioned above may refer to data and credentials for verifying the user's identity, such as user name, password, biometric information, etc.
[0073] The above-mentioned authentication of the user authentication information and generation of the authentication result may be, for example, the user name and password input by the user are compared and authenticated with the password stored in the database to generate the authentication result.
[0074] The above authentication result can be used to indicate whether the user authentication information has been authenticated.
[0075] In the embodiment of the present application, the user authentication information is authenticated to generate an authentication result, and only when the authentication result indicates that the user authentication information has been authenticated, the application object sends the download mark to the mobile terminal to enhance the reliability of the download mark.
[0076] In some embodiments, when the authentication result indicates that the user authentication information has been authenticated, the application object sends a download mark to the mobile terminal, which may specifically include:
[0077] When the authentication result indicates that the user authentication information is authenticated successfully, the application object generates a first download token;
[0078] The application object sends the first download token and the download flag to the mobile terminal;
[0079] The above S202 may specifically include:
[0080] The application object receives a download request sent by the mobile terminal, where the download request includes a second download token;
[0081] The application object verifies the second download token according to the first download token and generates a verification result, where the verification result is used to indicate whether the second download token is consistent with the first download token;
[0082] The above S203 may specifically include:
[0083] When the verification result indicates that the second download token is consistent with the first download token, the application object sends the download request to the file sub-server through the communication channel.
[0084] The first download token may be an authorization certificate with a validity period, which allows a user to access a specific system or service within a certain period of time.
[0085] The above download request may include a second download token. In theory, the second download token is consistent with the first download token.
[0086] The above verification result can be used to indicate whether the second download token is consistent with the first download token.
[0087] In the embodiment of the present application, the application object verifies whether the second download token in the download request is consistent with the first download token generated when the authentication result indicates that the user authentication information is authenticated, so as to enhance the security and reliability of the file download.
[0088] In some embodiments, the above S204 may specifically include:
[0089] The file sub-server responds to the download request and sends the target file to the mobile terminal at a preset download speed;
[0090] The above S205 may specifically include:
[0091] The mobile terminal receives the target file sent by the file sub-server at a preset download speed.
[0092] The above-mentioned preset download speed, exemplarily, can be a parameter value of the speed limit configured by the nginx application to limit the user's download speed.
[0093] In an embodiment of the present application, the target file is sent to the mobile terminal at a preset download speed, and the user's download speed is limited, which can effectively reduce the proportion of bandwidth occupied during downloading, thereby further reducing the memory usage of the application object and improving the availability of non-download services.
[0094] In order to facilitate the understanding of the file downloading method in the embodiment of the present application, the actual application process of this file downloading method is described as follows:
[0095] In this application, a simple file server (i.e., the above-mentioned file sub-server) can be constructed by using the nginx application, and a file download channel (i.e., the above-mentioned communication channel) can be constructed between the Java application (i.e., the above-mentioned application object) and the file server to solve the problem of high memory usage of the Java virtual machine when concurrently downloading large files (i.e., the above-mentioned target files). At the same time, since the nginx application is easy and fast to build and occupies less resources, it is suitable for building a low-cost simple file server.
[0096] like Figure 3 As shown, the embodiment of the present application may include the following steps:
[0097] 1. The user clicks the download button on the front-end (i.e. the above-mentioned mobile terminal) interface, and the request is sent to the gateway (equivalent to the above-mentioned application object) with the user authentication information to query whether the current request can download the file (equivalent to the above-mentioned query request).
[0098] 2. After the gateway authenticates the user, it generates a temporary download token (i.e., the first download token mentioned above). It determines whether the download queue is full. If not, it adds the request to the download queue and returns a downloadable flag and download token. If full, it does not add the request to the download queue and returns a non-downloadable flag and download token.
[0099] 3. The front end determines whether the download is available based on the returned flag. If it is available, it sends a download request to the gateway with the download token.
[0100] 4. The gateway checks and verifies whether the download token is valid. If it is valid, it will request the nginx file server (equivalent to the above file sub-server) through the constructed channel to download the file (equivalent to the above target file).
[0101] 5. The nginx file server will provide speed-limited download service based on the configured download speed and return the file to the front end.
[0102] 6. When the gateway verifies that the download token is invalid, it returns an invalid error message to the front end. The front end does not prompt the user and will re-initiate the download request and return to step 1.
[0103] 7. The front end determines whether the download is possible based on the returned flag. If it is not possible to download, the front end will put the download task into the background and periodically poll step 1.
[0104] In the embodiment of the present application, by configuring nginx flow limiting and speed limiting strategies, the user download speed is limited, the Java application memory usage is reduced, and the system reliability is improved. At the same time, since nginx occupies less resources, the operating cost is reduced. Flow limiting and speed limiting download can effectively reduce the bandwidth ratio occupied during downloading and improve the availability of non-download services.
[0105] Based on the file downloading method provided in the above embodiment, the present application also provides a specific implementation of the file downloading device. Please refer to the following embodiment.
[0106] like Figure 4 As shown, a file downloading device 400 provided in an embodiment of the present application is applied to a backend server, the backend server includes an application object 401 and a file sub-server 402, and a communication channel is connected between the application object and the file sub-server. The device 400 may include:
[0107] The application object 401 is used to receive a download request sent by a mobile terminal, where the download request is used to request downloading of a target file, which is stored in a file sub-server;
[0108] The application object 401 is also used to send the download request to the file sub-server through the communication channel;
[0109] The file sub-server 402 is used to send the target file to the mobile terminal in response to the download request, so that the mobile terminal receives the target file.
[0110] In the file downloading device of the embodiment of the present application, the mobile terminal can send a download request to the application object in the backend server, and then the application object sends the download request to the file sub-server in the backend server through the communication channel; in this way, the file sub-server can respond to the download request and send the target file to the mobile terminal. In this way, in the embodiment of the present application, a file sub-server is set in the backend server, and the file is sent to the mobile terminal through the file sub-server, which can share part of the processing request of the application object when downloading the file, thereby reducing the memory usage of the application object.
[0111] As an implementation method of this application, in order to ensure that the target file can be downloaded,
[0112] The application object 401 is further used to receive a query request sent by the mobile terminal in response to a target operation, the query request is used to query whether the target file is downloadable, and the target operation is an operation in which the user clicks on the display operation interface of the mobile terminal to download the target file;
[0113] The above-mentioned application object 401 is also used to query the queue status information of the download queue in the application object in response to the query request, and the queue status information is used to indicate whether the download queue is full;
[0114] The application object 401 is also used to generate a download flag according to the queue status information, and the download flag is used to indicate whether the target file can be downloaded;
[0115] The above-mentioned application object 401 is also used to send a download mark to the mobile terminal, so that the mobile terminal sends a download request to the application object when the download mark indicates that the target file can be downloaded.
[0116] As another implementation method of the present application, in order to protect the security of the download mark, the query request may include user authentication information.
[0117] The application object 401 is also used to authenticate the user authentication information in response to the query request and generate an authentication result, which is used to indicate whether the user authentication information has been authenticated;
[0118] The above-mentioned application object 401 is specifically used to send a download mark to the mobile terminal when the authentication result indicates that the user authentication information is authenticated successfully.
[0119] In some embodiments, the application object 401 is specifically used to generate a first download token when the authentication result indicates that the user authentication information is authenticated; and send the first download token and the download flag to the mobile terminal;
[0120] The application object 401 is specifically used to receive a download request sent by a mobile terminal, the download request including a second download token; verify the second download token according to the first download token, and generate a verification result, the verification result is used to indicate whether the second download token is consistent with the first download token;
[0121] The application object 401 is specifically used to send the download request to the file sub-server through the communication channel when the verification result indicates that the second download token is consistent with the first download token.
[0122] In some embodiments, the file sub-server 402 is specifically configured to send the target file to the mobile terminal at a preset download speed in response to a download request, so that the mobile terminal receives the target file at the download speed.
[0123] like Figure 5 As shown, another file downloading device 500 provided in an embodiment of the present application is applied to a mobile terminal. The device 500 may include the following modules: a first sending module 501 and a first receiving module 502.
[0124] The first sending module 501 is used to send a download request to an application object in a backend server, the backend server includes an application object and a file sub-server, the application object and the file sub-server are connected by a communication channel, the download request is used to request downloading a target file, the target file is stored in the file sub-server, so that the application object sends the download request to the file sub-server through the communication channel; the file sub-server responds to the download request and sends the target file to the mobile terminal;
[0125] The first receiving module 502 is used to receive a target file sent by a file sub-server.
[0126] In the file downloading device of the embodiment of the present application, the mobile terminal can send a download request to the application object in the backend server, and then the application object sends the download request to the file sub-server in the backend server through the communication channel; in this way, the file sub-server can respond to the download request and send the target file to the mobile terminal. In this way, in the embodiment of the present application, a file sub-server is set in the backend server, and the file is sent to the mobile terminal through the file sub-server, which can share part of the processing request of the application object when downloading the file, thereby reducing the memory usage of the application object.
[0127] As an implementation of the present application, in order to ensure that the target file can be downloaded, the above-mentioned device 500 may further include:
[0128] The second receiving module is used to receive a target operation of a user clicking to download a target file in a display operation interface of a mobile terminal;
[0129] a second sending module, configured to send a query request to the application object in response to the target operation, the query request being used to query whether the target file can be downloaded, so that the application object responds to the query request and queries queue status information of the download queue in the application object, the queue status information being used to indicate whether the download queue is full; the application object generates a download flag according to the queue status information, the download flag being used to indicate whether the target file can be downloaded; and the application object sends the download flag to the mobile terminal;
[0130] A third receiving module, used for receiving a download flag sent by the application object;
[0131] The first sending module 501 is specifically configured to send a download request to an application object in a backend server when the download flag indicates that the target file is downloadable.
[0132] In some embodiments, the first receiving module 502 is specifically configured to receive a target file sent by a file sub-server at a preset download speed.
[0133] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0134] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.
[0135] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0136] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0137] In certain embodiments, the memory 602 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0138] The processor 601 implements any one of the file downloading methods in the above embodiments by reading and executing the computer program instructions stored in the memory 602 .
[0139] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0140] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0141] Bus 610 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0142] The electronic device can execute the file downloading method in the embodiment of the present application, thereby realizing the combination Figure 2 , Figure 4 and Figure 5 The invention discloses a method and device for downloading files.
[0143] In addition, in combination with the file downloading method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the file downloading methods in the above embodiment is implemented.
[0144] In combination with the file downloading method in the above embodiment, an embodiment of the present application may provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the file downloading methods above.
[0145] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0146] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0147] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0148] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0149] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A file downloading method, characterized in that: Applied to a backend server, the backend server includes an application object and a file sub-server, the application object and the file sub-server are connected through a communication channel, and the method includes: The application object receives a download request sent by a mobile terminal, wherein the download request is used to request downloading of the target file, and the target file is stored in the file sub-server; The application object sends the download request to the file sub-server through the communication channel; The file sub-server sends the target file to the mobile terminal in response to the download request, so that the mobile terminal receives the target file.
2. The method according to claim 1, characterized in that Before the application object receives the download request sent by the mobile terminal, the method further includes: The application object receives a query request sent by the mobile terminal in response to a target operation, wherein the query request is used to query whether the target file is downloadable, and the target operation is an operation in which a user clicks to download the target file in a display operation interface of the mobile terminal; The application object queries queue status information of a download queue in the application object in response to the query request, wherein the queue status information is used to indicate whether the download queue is full; The application object generates a download flag according to the queue status information, wherein the download flag is used to indicate whether the target file is downloadable; The application object sends the download flag to the mobile terminal, so that the mobile terminal sends the download request to the application object when the download flag indicates that the target file can be downloaded.
3. The method according to claim 2, characterized in that The query request includes user authentication information, Before the application object sends the download mark to the mobile terminal, the method further includes: The application object authenticates the user authentication information in response to the query request and generates an authentication result, wherein the authentication result is used to indicate whether the user authentication information is authenticated; The application object sends the download mark to the mobile terminal, including: When the authentication result of the application object indicates that the user authentication information has been authenticated, the application object sends the download mark to the mobile terminal.
4. The method according to claim 3, characterized in that When the authentication result of the application object indicates that the user authentication information is authenticated, the application object sends the download mark to the mobile terminal, including: The application object generates a first download token when the authentication result indicates that the user authentication information is authenticated; The application object sends the first download token and the download flag to the mobile terminal; The application object receives a download request sent by a mobile terminal, including: The application object receives the download request sent by the mobile terminal, where the download request includes a second download token; The application object verifies the second download token according to the first download token, and generates a verification result, wherein the verification result is used to indicate whether the second download token is consistent with the first download token; The application object sends the download request to the file sub-server through the communication channel, including: When the verification result indicates that the second download token is consistent with the first download token, the application object sends the download request to the file sub-server through the communication channel.
5. The method according to claim 1, characterized in that The file sub-server sends the target file to the mobile terminal in response to the download request, including: In response to the download request, the file sub-server sends the target file to the mobile terminal at a preset download speed, so that the mobile terminal receives the target file at the download speed.
6. A file downloading method, characterized in that: Applied to a mobile terminal, the method comprises: Sending a download request to an application object in a backend server, the backend server comprising the application object and a file sub-server, the application object and the file sub-server being connected via a communication channel, the download request being used to request downloading the target file, the target file being stored in the file sub-server, so that the application object sends the download request to the file sub-server through the communication channel; the file sub-server sends the target file to the mobile terminal in response to the download request; Receive the target file sent by the file sub-server.
7. The method according to claim 6, characterized in that Before sending the download request to the application object in the backend server, the method further includes: Receiving a target operation of a user clicking to download a target file in a display operation interface of the mobile terminal; In response to the target operation, a query request is sent to the application object, the query request is used to query whether the target file can be downloaded, so that the application object responds to the query request and queries queue status information of a download queue in the application object, the queue status information is used to indicate whether the download queue is full; the application object generates a download flag according to the queue status information, the download flag is used to indicate whether the target file can be downloaded; the application object sends the download flag to the mobile terminal; Receiving the download flag sent by the application object; The sending of a download request to the application object in the backend server includes: When the download flag indicates that the target file is downloadable, a download request is sent to the application object in the backend server.
8. The method according to claim 6, characterized in that The receiving the target file sent by the file sub-server includes: The target file is received and sent by the file sub-server at a preset download speed.
9. A file downloading device, characterized in that: Applied to a backend server, the backend server includes an application object and a file sub-server, the application object and the file sub-server are connected through a communication channel, and the device includes: The application object is used to receive a download request sent by a mobile terminal, wherein the download request is used to request downloading of the target file, and the target file is stored in the file sub-server; The application object is further used to send the download request to the file sub-server through the communication channel; The file sub-server is used to send the target file to the mobile terminal in response to the download request, so that the mobile terminal receives the target file.
10. A file downloading device, characterized in that: Applied to a mobile terminal, the device comprises: A first sending module is used to send a download request to an application object in a backend server, the backend server includes the application object and a file sub-server, the application object and the file sub-server are connected by a communication channel, the download request is used to request downloading the target file, the target file is stored in the file sub-server, so that the application object sends the download request to the file sub-server through the communication channel; the file sub-server sends the target file to the mobile terminal in response to the download request; The first receiving module is used to receive the target file sent by the file sub-server.
11. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the file downloading method according to any one of claims 1 to 8 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the file downloading method according to any one of claims 1 to 8 is implemented.
13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the file downloading method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Information processing system, method and device
CN108632209A
File downloading method, device and equipment and storage medium
CN111835856A
File downloading method and device, computer equipment and computer readable storage medium
CN114745368A
Application function configuration method, terminal device, server, and storage medium
WO2021218621A1
