A file downloading method, device and computing equipment
By using the global Map mapping relationship and notification queue mechanism in the cloud storage system, the problem of low file concurrent download efficiency is solved, and efficient resource utilization and download efficiency are achieved.
Patent Information
- Application Number
- CN202410162489.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-02-05
AI Technical Summary
In cloud storage systems, the efficiency of file concurrent download is low, resulting in waste of computing resources and excessive download pressure.
By detecting the observation point corresponding to the file identifier in the global Map mapping relationship, if it exists, the file download request is loaded into the corresponding notification queue and waited until the file cache of the observation point is completed, and then the cached file information is notified to the user who downloads it later for downloading.
It effectively avoids the allocation of concurrent computing resource for subsequent download requests for the same file, reduces the waste of computing resources, and improves the efficiency of concurrent file downloads.
Smart Images

Figure CN118018543B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer storage technology, and in particular to a file downloading method, device and computing equipment. Background Art
[0002] With the continuous development of big data and artificial intelligence, the demand for data storage has shown explosive growth. These data files are characterized by large quantity and large size. Users usually store files in the cloud to achieve high-speed file download and improve user experience.
[0003] As we all know, distributed storage is to store data in multiple independent devices to improve system reliability, availability, access efficiency and scalability. When the server receives a request from a user to download a file, it needs to find all the fragment addresses based on the computing nodes corresponding to the computing cluster involved when the data was stored at that time, and download and process the complete file based on the address. In this process, a series of resource-consuming calculations (such as the computing nodes mapped by the computing cluster, the required material resources and network resources, etc.) are required, and finally the file data stream is returned to the user. However, when the number of requests is huge and concurrent, it puts a lot of pressure on the cloud service. Usually, the cloud service will set up a download cache. Corresponding resources need to be allocated for download requests from different users, and the cached data will be destroyed after the download is completed. When there is a request to download the same file again, the relevant calculations need to be re-executed, resulting in a waste of computing resources. Summary of the invention
[0004] The main purpose of the present application is to provide a file downloading method, apparatus and computing device, aiming to solve the technical problem of low efficiency of concurrent file downloading.
[0005] To achieve the above-mentioned purpose, an embodiment of the present application provides a file download method, including: obtaining a file download request from a user, wherein the file download request includes a file identifier of a file to be downloaded; detecting whether there is an observation point corresponding to the file identifier in a preset global Map mapping relationship; if the observation point exists, loading the file download request into a notification queue corresponding to the observation point for waiting; caching the file in response to the first file download request in the notification queue of the observation point; and sending download feedback information to users corresponding to each subsequent file download request in the notification queue of the observation point based on the file caching result of the first file download request.
[0006] Optionally, the global Map mapping relationship includes key-value pair data, with a file identifier as the key value of the key-value pair data, and the observation point corresponding to the file identifier as the value value of the key-value pair data. Based on the detection, determining whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship includes: querying whether there is a key value corresponding to the file identifier in the key-value pair data; if there is a key value corresponding to the file identifier, determining that there is an observation point corresponding to the file identifier in the global Map mapping relationship, wherein the value corresponding to the key value corresponds to the observation point.
[0007] Optionally, after detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship, the method also includes: if the observation point does not exist, constructing an observation point in the global Map mapping relationship based on the file identifier; establishing a notification queue corresponding to the observation point; and loading a newly acquired subsequent file download request with the same file identifier into the corresponding established notification queue for waiting.
[0008] Optionally, loading the file download request into the notification queue corresponding to the observation point for waiting includes: constructing a notification queue corresponding to the observation point based on the file identifier; loading the first file download request and subsequent file download requests corresponding to the identifier into the corresponding notification queue as the observed and the observer, respectively, for waiting.
[0009] Optionally, the file caching result based on the first file download request sends download feedback information to users corresponding to subsequent file download requests in the notification queue of the observation point, including: obtaining a cache task end signal sent by the observed person; instructing the observation point to send an observation signal to the observed person based on the cache task end signal; if the observation signal indicates that the file caching is successful, sending corresponding file cache data to all observers in the notification queue; if the observation signal indicates that the file caching fails, sending download failure information to all observers in the notification queue.
[0010] Optionally, before the step of detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship, it also includes: obtaining characteristic data of the file to be downloaded based on the file identifier, the characteristic data including the occupied memory value and data type of the file to be downloaded, the data type including cold data and non-cold data; judging whether it is greater than a preset threshold based on the occupied memory value; if so, parsing and downloading based on the file download request; if not, judging whether it is hot data based on the data type; if not, parsing and downloading based on the file download request; if so, detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship.
[0011] Optionally, if the observation signal indicates that the file cache fails, after sending the download failure information to all observers in the notification queue, the method also includes: the observation point sends the log information of the cache failure to the log management module; marks the number of cache failures of the file identifier; if the number of cache failures of the same file identifier is greater than or equal to a preset number, then when the file download request for the file identifier is obtained again, sending the corresponding user a feedback message of rejecting the download in response to the file download request again.
[0012] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides a file concurrent downloading device, which includes: an acquisition module, used to obtain a user's file download request, wherein the file download request contains a file identifier of a file to be downloaded; an observation point detection module, used to detect whether there is an observation point corresponding to the file identifier in a preset global Map mapping relationship; a queue management module, used to load the file download request into a notification queue corresponding to the observation point for waiting if the observation point exists; and a download feedback module, used to send download feedback information to each user based on the first file download request in the notification queue of the observation point.
[0013] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides a computer-readable storage medium, which includes instructions, and when the instructions are executed on a computer, the computer executes the file downloading method described in any embodiment of the present application.
[0014] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides a computing device, which includes: at least one processor, a memory and an input and output unit; wherein the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the file download method described in any embodiment of the present application.
[0015] The file download method provided in the embodiment of the present application, when obtaining a file download request sent by a user, detects whether there is an observation point corresponding to the file download request in the preset global Map mapping relationship. When a corresponding observation point exists, the file download request is loaded into the notification queue corresponding to the observation point and waits until the file cache of the observation point ends, and then the cached file information is notified to the user who downloads later for downloading. In other words, when the file cache of the previous download request has not ended, because the file request downloaded later is suspended and waiting, it can prevent subsequent identical file download requests from concurrently executing related resource calculations and allocations, thereby avoiding waste of computing resources and improving the efficiency of concurrent file downloads as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a file downloading method according to an implementation mode of the present application;
[0017] Figure 2 A flowchart of a file downloading method according to another embodiment of the present application;
[0018] Figure 3 The present invention is a structural block diagram of a device for concurrently downloading files according to an embodiment of the present application.
[0019] Figure 4 A schematic diagram of the structure of a medium provided in one embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of a computing device provided in one embodiment of the present application.
[0021] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0022] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0023] Those skilled in the art know that the embodiments of the present application can be implemented as a system, device, equipment, method or computer program product. Therefore, the present application can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0024] With the continuous development of big data and artificial intelligence, the demand for data storage has exploded. In order to facilitate data storage, users usually store files in the cloud. When a user needs to download a file, the user sends a download request to the cloud server through the user terminal. When the cloud server receives the download request, it will perform a series of resource-consuming calculations inside the cloud server, and finally return the file data stream to the user terminal.
[0025] However, when the number of file download requests is huge and files are downloaded concurrently, it will cause great pressure on the cloud server. Usually, cloud services will set up download caches, and corresponding resources need to be allocated for download requests from different users. After the download is completed, the cached data will be destroyed. When there is a request to download the same file again, the relevant calculations need to be performed again, which not only wastes the computing resources of the cloud server, but also reduces the efficiency of file downloads.
[0026] To solve the above problems, the present application provides a file downloading method, and concurrent file downloading refers to downloading the same file from multiple sources or multiple paths at the same time. The file downloading method provided in the embodiment of the present application can be applicable to the scenario where multiple users download the same file or the same user downloads multiple different files. Figure 1 Flow chart of a file download method according to an embodiment of the present application. The method can be executed by a cloud server with computing function, and further can be executed by a global manager in the cloud server. The global manager is a functional module independent of the process created in the cloud server, such as Figure 1 As shown, the file downloading method may include the following steps:
[0027] S110, obtaining a file download request from a user, wherein the file download request includes a file identifier of a file to be downloaded;
[0028] S120, detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship;
[0029] S130: If there is an observation point, the file download request is loaded into a notification queue corresponding to the observation point for waiting;
[0030] S140, caching the file in response to the first file download request in the observation point notification queue;
[0031] S150: Send download feedback information to users corresponding to subsequent file download requests in the notification queue of the observation point based on the file cache result of the first file download request.
[0032] The file download method provided in the embodiment of the present application, when obtaining a file download request sent by a user, detects whether there is an observation point corresponding to the file download request in the preset global Map mapping relationship. When a corresponding observation point exists, the file download request is loaded into the notification queue corresponding to the observation point and waits until the file cache of the observation point ends, and then the cached file information is notified to the user who downloads later for downloading. In other words, when the file cache of the previous download request has not ended, because the file request downloaded later is suspended and waiting, it can prevent subsequent identical file download requests from concurrently executing related resource calculations and allocations, thereby avoiding waste of computing resources and improving the efficiency of concurrent file downloads as a whole.
[0033] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application.
[0034] In step S110, the file identifier is usually called a file handle or file descriptor. The file identifier is a name or symbol used to uniquely identify a file so that it can be accurately identified and operated when it is necessary to access, modify or delete the file. In the embodiment of the present application, the file identifier is obtained when the user uploads the file to the cloud server, the cloud server receives the file data in the form of a file data stream, and hashes the received data stream.
[0035] In step S120, in this exemplary embodiment, an observation point is constructed, and the observation point manages the communication channel between the observed and the observer, and the observation point can notify the observer according to the change of the observed.
[0036] In this exemplary embodiment, the pre-established global Map mapping relationship is a key-value data structure, where the key is the file identifier and the value is the observation point. This step is that the global manager queries whether there is a corresponding key-value pair data in the pre-established Map mapping relationship according to the file identifier in the currently obtained file download request.
[0037] In an exemplary embodiment, before step S120, the following steps are further included:
[0038] Acquire characteristic data of the file to be downloaded based on the file identifier, the characteristic data including a memory occupied value and a data type of the file to be downloaded, the data type including cold data and non-cold data;
[0039] Determine whether the occupied memory value is greater than a preset threshold;
[0040] If so, parsing and downloading based on the file download request;
[0041] If not, determine whether it is hot data based on the data type; if not, parse and download based on the file download request; if so, detect whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship.
[0042] In an exemplary embodiment, step S120 may specifically include:
[0043] Check whether there is a key value corresponding to the file identifier in each key-value pair data;
[0044] If there is a key value corresponding to the file identifier, it is determined that there is an observation point corresponding to the file identifier in the global Map mapping relationship, wherein the value corresponding to the key value is the corresponding observation point.
[0045] Specifically, the global manager dynamically manages the observation points. When a user downloads a file, the global manager will query whether the key exists in the global Map mapping relationship through the file identifier. If the key exists, the corresponding value is the observation point.
[0046] It can be seen that this step is to associate the file download request obtained later with the file download request obtained earlier through the file identifier, so that in the subsequent steps, the computing resources of the file download request obtained later can be managed based on the observation point constructed by the file download request obtained earlier, so as to avoid wasting computing resources.
[0047] In step S130, the notification queue of the observation point includes the observed and the observer. When the cloud server obtains the first file download request for a certain file identifier, it can create an observation point for the file download request and create a notification queue corresponding to the observation point, wherein the first file download request serves as the observed, and the subsequent file download requests with the same file identifier are loaded into the notification queue of the corresponding observation point as observers, thereby establishing a correspondence between the previous file download request and the subsequent file download request through the file identifier.
[0048] If there is an observation point corresponding to the current file identifier in the global Map mapping relationship, it means that the cloud server has currently obtained the previous file download request for the current file identifier. At this time, the global manager loads the current file download request into the notification queue corresponding to the observation point for waiting, that is, suspends the current file download request, thereby preventing the cloud server from concurrently performing related resource calculations and allocations based on subsequent file download requests to avoid wasting computing resources. This situation can typically be, for example, for a certain file identifier, if the first file download request has not ended, that is, the file cache has not been completed, and the file cache mechanism cannot take effect. In this case, by loading the subsequent file download request into the notification queue for waiting, the cloud server will not allocate computing resources to the subsequent file download request, that is, it is not necessary to re-execute related resource calculations and allocations for the subsequent file download request, so that it can avoid multiple file download requests based on the same file identifier from concurrently performing related calculations, thereby effectively avoiding waste of computing resources.
[0049] In an exemplary embodiment, after step S120, the method may further include the following steps:
[0050] If the observation point does not exist, construct the observation point in the global Map mapping relationship based on the file identifier;
[0051] Establish a notification queue corresponding to the observation point;
[0052] The newly acquired subsequent file download request with the same file identifier is loaded into the established notification queue for waiting.
[0053] Among them, if there is no observation point corresponding to the current file identifier in the global Map mapping relationship, it means that the cloud server has not yet obtained the file download request for the file identifier. In other words, the current file download request is the first file download request for the file identifier. At this time, the global manager can create a corresponding observation point in the global Map mapping relationship according to the file identifier, and establish a notification queue corresponding to the observation point. When the cloud server obtains a new file download request for the same file identifier, the newly obtained file download request is loaded into the created observation point notification queue for waiting. Obviously, the current file download request is the observer in the created notification queue, and the newly obtained file download request is the observer in the notification queue. Then repeat the above step S130 to suspend the newly obtained file download request to save computing resources and avoid wasting computing resources.
[0054] In an exemplary embodiment, the process of constructing an observation point in a global Map mapping relationship based on a file identifier may specifically include: constructing a key-value pair data in a global Map mapping relationship using the file identifier as a key value, wherein the value of the key-value pair data is the observation point. That is, a key-value data pair is established, wherein the key value is the file identifier, and the value value is the corresponding observation point, thereby constructing a corresponding relationship between the file identifier and the observation point.
[0055] In an exemplary embodiment, the step of establishing a notification queue corresponding to an observation point may specifically include: taking the file identifier as a basis, establishing a notification queue corresponding to the observation point with the current file download request as the observer, that is, after creating the observation point, creating a notification queue corresponding to the observation point based on the file identifier of the observation point, and the file download request with the same file identifier obtained later is loaded into the notification queue as the observer.
[0056] Accordingly, the process of loading the newly acquired subsequent file download request with the same file identifier into the established notification queue for waiting may specifically include: loading the newly acquired subsequent file download request with the same file identifier as an observer into the established notification queue for waiting.
[0057] In step S140, the cloud server executes the file cache strategy to cache the first file download request of the same file identifier, so that for subsequent file download requests, the cloud server can directly send the cached file to the user without repeated calculation.
[0058] As described above, the first file download request in the observation point notification queue is the observed person, and step S140 is equivalent to the cloud server caching the file in response to the observed person's file download request at the observation point. It can be understood that the result of file caching may be a successful file caching or a failed file caching, and accordingly, the download feedback information sent in step S150 will also be different.
[0059] In step S150, as described above, the first user request in the notification queue is the observed person, and the remaining user requests in the notification queue are observers. Thus, step S150 is equivalent to the cloud server sending download feedback information to the corresponding observer user based on the file cache result of the observed person.
[0060] It should be understood that before step S150, the cloud server needs to send download feedback information to the corresponding user of the observed person based on the file caching result. For example, if the file caching is successful, the cloud server sends the cached file to the observed user; if the file caching fails, the cloud server sends a download failure message to the observed user.
[0061] In other words, in an embodiment of the present application, the cloud server can first respond to the observed person's file download request and send a cached file or download failure information to the observed user, and then respond to each observer's file download request in turn, and send the cached file or download failure information to the user end in turn.
[0062] In an exemplary embodiment, step S150 may specifically include the following steps:
[0063] S151, obtaining a cache task end signal sent by the observer;
[0064] S152: Based on the cache task end signal, download feedback information is sent to the user corresponding to each observer in the notification queue.
[0065] Among them, after the file caching is completed, the observed person will send a cache task end signal to the global manager. The cache task end signal carries information on whether the file caching is successful or failed, so that the global manager can send corresponding download feedback information to each observer corresponding to the observed person according to the cache task end signal.
[0066] In an exemplary embodiment, step S151 may specifically include the following steps:
[0067] S1511, instructing the observation point to send an observation signal to the observed person based on the cache task end signal;
[0068] S1512: If the observation signal indicates that the file is cached successfully, the corresponding file cache data is sent to all observers in the notification queue;
[0069] S1513. If the observation signal indicates that the file cache fails, a download failure message is sent to all observers in the notification queue.
[0070] Among them, after obtaining the cache task completion signal sent by the observed person, the global manager instructs the observation point to send an observation signal to each corresponding observer, that is, regardless of whether the observed person successfully caches the file, the observation point sends an observation signal to each corresponding observer.
[0071] When the observed person successfully caches the file, the observation point sends an observation signal of successful file caching to the corresponding observer, and the global manager sends the cached file to each observer user in the notification queue in turn. Alternatively, if the observed person fails to cache the file, the observation point sends an observation signal of file caching failure to the corresponding observer, and the global manager sends download failure information to each observer user.
[0072] It can be seen that in this exemplary embodiment, the established observation point can actively send an observation signal to the observed person based on the file cache status of the observed person, that is, when the file cache status corresponding to the observation point changes, the observer will be actively notified. This can avoid the observer's need to obtain the observed person's status data in real time, thereby achieving logical decoupling between concurrent download requests and further reducing resource overhead.
[0073] In an exemplary embodiment, after step S1513, the method may further include the following steps:
[0074] The observation point sends the log information of cache failure to the log management module;
[0075] The number of cache failures for the global manager marking file identifiers;
[0076] If the number of cache failures for the same file identifier is greater than or equal to the preset number, when a file download request for the file identifier is obtained again, a feedback message of refusing download is sent to the corresponding user in response to the file download request again.
[0077] Specifically, the log management module is a functional module in the cloud server that specializes in managing log information. The observation point sends log information of cache failure to the log management module. In this way, the cloud server can analyze the specific reasons for the file cache failure based on the log information. For example, it can analyze which specific file has a problem, or which specific link has a problem in the process of segment downloading, or whether there is a problem with the network, etc.
[0078] At the same time, the global manager can mark the number of cache failures of the file identifier. For example, the global manager can mark the number of cache failures of the key in the key-value pair data. In this way, if the cache failure of the same key exceeds a preset number (for example, 3 times, 5 times, etc.), when there is another request to download the same file, the cloud server can directly send a feedback message to the user to refuse the download, for example, it can directly refuse the communication to protect the cloud server resources. In this case, the cloud server can send a prompt message to notify the operation and maintenance personnel to intervene and investigate.
[0079] In an exemplary embodiment, after step S150, the file download method may further include the following steps: removing the key-value pair data corresponding to the observation point from the global Map mapping relationship. Exemplarily, after the observed person completes the task, regardless of whether the file cache is successful or failed, the global manager may remove the observation point from the global Map mapping relationship, that is, destroy the observation point, because after the observation point sends a cache task end signal, it cannot be determined whether there will be subsequent file download requests for the file identifier or how long it will take for the file download request to be made for the file identifier. In this way, by destroying the observation point, it is possible to avoid the observation point occupying system resources.
[0080] In this exemplary embodiment, by constructing an observation point, the observation point manages its own data and behavior, manages the communication channel between the observed and the observer, etc. The observation point can notify the observer according to the changes of the observed person, and after the observed person completes the task, the global manager can destroy the observation point, thereby realizing dynamic management of the observation point and avoiding waste of system resources.
[0081] Figure 2 FIG. 1 is a flowchart of a file downloading method according to another embodiment of the present application. Figure 2 As shown, the method may specifically include the following steps:
[0082] S310: The cloud server obtains a file download request initiated by a user.
[0083] S320: The cloud server queries whether there is a corresponding observation point for the file identifier based on a preset global Map mapping relationship.
[0084] S330. If there is a corresponding observation point in the global Map mapping relationship, the cloud server will load all file download requests into the notification queue of the corresponding observation point respectively, and suspend all file download requests loaded into the notification queue. That is, the cloud server does not need to allocate computing resources to the current file download request and does not need to cache files for the current file request to save system resources.
[0085] S340: The cloud server determines whether an observation signal is received based on the observation point. If an observation signal is received, the process jumps to step S360; if no observation signal is received, the process returns to step S330 and executes the step again.
[0086] S350. If there is no corresponding observation point in the global Map mapping relationship, the cloud server creates a corresponding observation point based on the file identifier and writes it into the global Map mapping relationship. The cloud server allocates computing resources for the current file download request based on the observation point and caches the file until the current task is completed and an observation signal is issued.
[0087] S360: The cloud server determines whether the file cache is successful based on the observed signal. If the file cache is successful, step S370 is executed; otherwise, if the file cache fails, step S380 is executed.
[0088] S370, the observation point corresponds to notifying all file download requests in the queue to end the suspended state, query the file cache data, respond to the file download request and return the file cache data to the user, and the user end completes the download.
[0089] S380, the observation point corresponds to notifying all file download requests in the queue to end the suspended state, and returns download failure information in response to the file download request.
[0090] In summary, in this exemplary embodiment, the cloud server obtains the file download request initiated by the user, and searches for an observation point corresponding to the file identifier based on a preset global Map mapping relationship. When a corresponding observation point exists, the file download request is loaded into the observation point notification queue of the observation point and suspended for waiting, that is, computing resources are no longer allocated for the current and subsequent identical file download requests, thereby avoiding waste of system resources and improving the efficiency of concurrent file downloads.
[0091] Based on the above embodiment, the present application embodiment also provides a file concurrent downloading device. Figure 3 FIG. 1 is a structural block diagram of a file concurrent downloading device according to an embodiment of the present application. Figure 3 As shown, the file concurrent downloading device 300 may include an acquisition module 310, an observation point detection module 320, a queue management module 330, a cache module 340 and a download feedback module 350, wherein:
[0092] The acquisition module 310 may be used to acquire a file download request from a user, wherein the file download request includes a file identifier of a file to be downloaded;
[0093] The observation point detection module 320 may be used to detect whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship;
[0094] The queue management module 330 may be used to load the file download request into the notification queue corresponding to the observation point for waiting if there is an observation point;
[0095] The cache module 340 may be used to cache the first file download request in the observation point notification queue;
[0096] The download feedback module 350 may be used to send download feedback information to each user based on the first file download request in the notification queue of the observation point.
[0097] In an exemplary embodiment, the file concurrent downloading device 300 may also include an observation point construction module, which can be used to construct an observation point in the global Map mapping relationship based on the file identifier if the observation point does not exist; accordingly, the queue management module 330 can also be used to establish a notification queue corresponding to the observation point, and load the newly acquired subsequent file download request with the same file identifier into the established notification queue for waiting.
[0098] In an exemplary embodiment, the observation point construction module can also be specifically used to: use the file identifier as a key value to construct key-value pair data in a global Map mapping relationship, wherein the value of the key-value pair data is the observation point.
[0099] In an exemplary embodiment, the queue management module 330 can also be specifically used to: based on the file identifier, establish a notification queue corresponding to the observation point with the current file download request as the observer, and load the newly acquired subsequent file download request with the same file identifier as the observer into the established notification queue for waiting.
[0100] In an exemplary embodiment, the notification queue of the observation point includes the observed and the observer, the observed is the first file download request in the notification queue of the observation point, and the observer is the remaining file download requests in the notification queue of the observation point; the download feedback module 350 can also be specifically used to: obtain the cache task end signal sent by the observed; based on the cache task end signal, send download feedback information to the users corresponding to each observer in the notification queue.
[0101] In an exemplary embodiment, the download feedback module 350 can also be specifically used to: send an observation signal to the observed person based on the cache task end signal indicating the observation point; if the observation signal indicates that the file caching is successful, send the corresponding file cache data to all observers in the notification queue; if the observation signal indicates that the file caching fails, send download failure information to all observers in the notification queue.
[0102] In an exemplary embodiment, the observation point detection module 320320 can also be specifically used to: query whether there is a key value corresponding to the file identifier in each key-value pair data; if there is a key value corresponding to the file identifier, determine whether there is an observation point corresponding to the file identifier in the global Map mapping relationship, wherein the value corresponding to the key value is the corresponding observation point.
[0103] In an exemplary embodiment, the file concurrent downloading device 300 may further include a key-value pair data destruction module, which may be used to remove the key-value pair data corresponding to the observation point from the global Map mapping relationship.
[0104] It should be understood that the concurrent file downloading device 300 provided in the embodiment of the present application can have the beneficial effects described in any of the above method embodiments, which will not be repeated here.
[0105] Based on the above embodiments, Figure 4 For a description of the computer-readable storage medium of the exemplary embodiment of the present application, please refer to Figure 4 , the computer-readable storage medium shown is a CD 40, on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, it will implement the steps described in the above method implementation, for example, obtaining a user's file download request, wherein the file download request contains a file identifier of the file to be downloaded; detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship; if there is an observation point, loading the file download request into the notification queue corresponding to the observation point for waiting; caching the first file download request in the notification queue of the observation point; and sending download feedback information to the users corresponding to each subsequent file download request in the notification queue of the observation point based on the file caching result of the first file download request. The specific implementation method of each step will not be repeated here.
[0106] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0107] Based on the above embodiments, the present application also provides a computing device, as shown below: Figure 5 A computing device for downloading files according to an exemplary embodiment of the present application.
[0108] Figure 5 A block diagram of an exemplary computing device 50 suitable for implementing the embodiments of the present application is shown. The computing device 50 may be a computer system or a cloud server. Figure 5 The computing device 50 shown is merely an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present application.
[0109] like Figure 5 As shown, the components of the computing device 50 may include, but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 connecting different system components (including the system memory 502 and the processing unit 501).
[0110] The computing device 50 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 50, including volatile and non-volatile media, removable and non-removable media.
[0111] The system memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 5021 and / or cache memory 5022. The computing device 50 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the ROM 5023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 is not shown in the Figure 5 As shown in FIG. 5 , a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 503 via one or more data medium interfaces. System memory 502 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of each embodiment of the present application.
[0112] A program / utility 5025 having a set (at least one) of program modules 5024 may be stored, for example, in system memory 502, and such program modules 5024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 5024 generally perform the functions and / or methods of the embodiments described herein.
[0113] The computing device 50 may also communicate with one or more external devices 504 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output (I / O) interface 505. Furthermore, the computing device 50 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 506. Figure 5 As shown, the network adapter 506 communicates with other modules (such as the processing unit 501, etc.) of the computing device 50 via the bus 503. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computing device 50 .
[0114] The processing unit 501 executes various functional applications and data processing by running the program stored in the system memory 502, for example, obtaining the user's file download request, wherein the file download request contains the file identifier of the file to be downloaded; detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship; if there is an observation point, the file download request is loaded into the notification queue corresponding to the observation point for waiting; the first file download request in the notification queue of the observation point is cached; based on the file cache result of the first file download request, download feedback information is sent to the user corresponding to each subsequent file download request in the notification queue of the observation point. The specific implementation method of each step is not repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the file concurrent download device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the implementation of the present application, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for concretization.
[0115] In the description of the present application, it should be noted that the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0117] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0120] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a cloud server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0121] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
[0122] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
Claims
1. A file downloading method, characterized in that: include: Obtaining a file download request from a user, wherein the file download request includes a file identifier of a file to be downloaded, and the file identifier is calculated by using hash encryption after uploading the file to a cloud server; Detecting whether there is an observation point corresponding to the file identifier in a preset global Map mapping relationship; If the observation point exists, the file download request is loaded into a notification queue corresponding to the observation point for waiting; wherein the first file download request in the notification queue is used as the observed object, and the subsequent file download requests corresponding to the same file identifier are used as observers; Responding to the first file download request in the observation point notification queue, performing file caching; Obtaining a cache task end signal sent by a user corresponding to the observed person; Sending an observation signal to a user corresponding to the observer based on the observation point corresponding to the cache task end signal indication; If the observation signal indicates that the file cache is successful, sending the corresponding file cache data to all users corresponding to the observers in the notification queue; If the observation signal indicates that the file cache fails, download failure information is sent to all users corresponding to the observers in the notification queue.
2. The file downloading method according to claim 1, characterized in that: The global Map mapping relationship includes key-value pair data, with a file identifier as the key value of the key-value pair data, and the observation point corresponding to the file identifier as the value of the key-value pair data. The detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship includes: Query whether there is a key value corresponding to the file identifier in the key-value pair data; If there is a key value corresponding to the file identifier, it is determined that there is an observation point corresponding to the file identifier in the global Map mapping relationship, wherein the value corresponding to the key value corresponds to the observation point.
3. The file downloading method according to claim 1 or 2, characterized in that: After detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship, the method further includes: If the observation point does not exist, constructing an observation point in the global Map mapping relationship based on the file identifier; Establishing a notification queue corresponding to the observation point; The newly acquired subsequent file download request having the same file identifier is loaded into the corresponding established notification queue for waiting.
4. The file downloading method according to claim 1, characterized in that: The step of loading the file download request into a notification queue corresponding to the observation point for waiting comprises: Based on the file identifier, construct a notification queue corresponding to the observation point; The first file download request and the subsequent file download requests corresponding to the file identifier are loaded into the corresponding notification queue as an observed object and an observer respectively to wait.
5. The file downloading method according to claim 1, characterized in that: If the observation signal indicates that the file cache fails, after sending download failure information to all observers in the notification queue, the method further includes: The observation point sends log information of cache failure to the log management module; Mark the number of cache failures of the file identifier; If the number of cache failures for the same file identifier is greater than or equal to a preset number, when a file download request for the file identifier is obtained again, a feedback message of refusing download is sent to the corresponding user in response to the file download request again.
6. The file downloading method according to claim 1, characterized in that: Before the step of detecting whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship, the method further includes: Acquire characteristic data of the file to be downloaded based on the file identifier, the characteristic data including a memory occupied value and a data type of the file to be downloaded, the data type including cold data and non-cold data; Determine whether the occupied memory value is greater than a preset threshold; If so, parsing and downloading based on the file download request; If not, determine whether it is hot data based on the data type; if not, parse and download based on the file download request; if so, detect whether there is an observation point corresponding to the file identifier in the preset global Map mapping relationship.
7. The file downloading method according to claim 1, characterized in that: After sending the download feedback information to the user corresponding to each file download request in the notification queue, the method further includes: Remove the key-value pair data corresponding to the observation point from the global Map mapping relationship.
8. A device for concurrent file downloading, characterized in that: The device comprises: An acquisition module, used to acquire a file download request from a user, wherein the file download request includes a file identifier of a file to be downloaded, and the file identifier is calculated by using hash encryption after uploading the file to a cloud server; An observation point detection module, used to detect whether there is an observation point corresponding to the file identifier in a preset global Map mapping relationship; A queue management module, configured to load the file download request into a notification queue corresponding to the observation point for waiting if the observation point exists; wherein the first file download request in the notification queue serves as an observed object, and subsequent file download requests corresponding to the same file identifier serve as observers; A download feedback module, configured to cache a file in response to a first file download request in the observation point notification queue; Obtaining a cache task end signal sent by a user corresponding to the observed person; Sending an observation signal to a user corresponding to the observer based on the observation point corresponding to the cache task end signal indication; If the observation signal indicates that the file cache is successful, sending the corresponding file cache data to all users corresponding to the observers in the notification queue; If the observation signal indicates that the file cache fails, download failure information is sent to all users corresponding to the observers in the notification queue.
9. A computing device, characterized in that The computing device comprises: at least one processor, memory, and input-output unit; The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the file downloading method according to any one of claims 1 to 7.
Citation Information
Patent Citations
File downloading method and device
CN103559056A
Mirror caching method for mobile transparent computing system server terminal multi-user access
CN105512053A
File downloading method and device
CN117118970A