Method for managing shared resources based on a local network and computer-readable storage medium
By recording resource status tables on offline servers within the local area network, and selecting the server with the best status for resource download, the problems of uneven load and slow response speed among offline servers are solved, achieving efficient resource allocation and storage management, and reducing costs and cloud load.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies suffer from problems such as unbalanced load, slow response speed, and inability to dynamically manage resources when sharing and allocating resources among multiple offline servers. In particular, when offline devices request resources, the database response speed decreases, and a dedicated data server needs to be configured, which is costly.
By recording resource status tables on offline servers within the local area network, the server with the best status is selected for resource download, and load balancing is achieved within the same local area network. Resource status data is stored using computer-readable storage media, avoiding duplicate downloads and the deployment of independent data servers.
It achieves load balancing among offline servers within the same local area network, improving the flexibility and response speed of resource allocation, reducing costs, saving storage space, and reducing the download load on cloud servers.
Smart Images

Figure CN115941698B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of shared resource allocation technology, and in particular to a shared resource management method based on a local area network and a computer-readable storage medium. Background Technology
[0002] Resource sharing and allocation technology is currently widely used in scenarios such as router network resource management, cloud server resource management, and cluster management of the same resources. An effective management mechanism and allocation method can make the allocation and processing of the same resources within a local area network extremely efficient.
[0003] For venues with multiple offline servers, an effective resource management solution is needed to manage resource sharing and allocation among them. This reduces the download load on the cloud-based CDN (Content Delivery Network) and effectively utilizes the storage space of the venue servers. Currently, the market primarily uses databases to manage resource sharing and allocation, relying on static data management that requires dedicated data servers, resulting in high costs. Furthermore, when offline devices request resources, the database typically filters for available resources based on certain conditions. If the resource request is large, the database response time decreases, making the resource allocation mechanism inflexible and unable to achieve balanced downloads and dynamic resource management across offline servers. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a shared resource management method and computer-readable storage medium based on a local area network, which can realize load balancing of offline servers in the same local area network and effective management of shared resources.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a shared resource management method based on a local area network, comprising:
[0006] The offline server obtains the resource ID and digest value of the resource based on the resource download request sent by the offline device;
[0007] Based on the resource ID and digest value of the resource and the resource status table of the first-line offline server, determine whether there is an offline server storing the resource among the first-line offline server and other offline servers in the same local area network.
[0008] If there is no offline server storing the resource within the same local area network, then the offline server with the best status among the offline servers in the same local area network is selected as the download server corresponding to the resource.
[0009] The corresponding download server requests the download of the resource from the cloud server and records the status data of the resource in its own resource status table. The status data of the resource includes the resource number, the IP address of the download server corresponding to the resource, and the resource storage location.
[0010] The corresponding download server generates a download link for the resource and returns the download link to the offline device through the offline server.
[0011] If an offline server storing the resource exists within the same local area network, the offline server storing the resource generates a download link for the resource and returns the download link to the offline device through the offline server.
[0012] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0013] The beneficial effects of this invention are as follows: By selecting the offline server with the best status to download and store resources, load balancing among offline servers within the same local area network (LAN) can be achieved; by recording a resource status table in the offline server, multiple offline servers within the same LAN only need to download the same cloud resource once, and the same cloud resource is stored on at most one offline server within the same LAN. When other offline devices within the same LAN need to download the same cloud resource, each offline server within the same LAN can obtain the storage location of the resource through the resource status table, achieving load balancing and effective allocation of data and resources. Furthermore, using the resource allocation management method of this invention, there is no need to deploy a separate data server; each offline server is connected at the same level, enabling flexible configuration of offline servers. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating a local area network-based shared resource management method according to the present invention.
[0015] Figure 2 This is a schematic diagram of the architecture of Embodiment 1 of the present invention;
[0016] Figure 3 This is a flowchart of the method according to Embodiment 1 of the present invention. Detailed Implementation
[0017] To explain the technical content, objectives, and effects of the present invention in detail, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0018] Please see Figure 1 A method for managing shared resources based on a local area network, comprising:
[0019] The offline server obtains the resource ID and digest value of the resource based on the resource download request sent by the offline device;
[0020] Based on the resource ID and digest value of the resource and the resource status table of the first-line offline server, determine whether there is an offline server storing the resource among the first-line offline server and other offline servers in the same local area network.
[0021] If there is no offline server storing the resource within the same local area network, then the offline server with the best status among the offline servers in the same local area network is selected as the download server corresponding to the resource.
[0022] The corresponding download server requests the download of the resource from the cloud server and records the status data of the resource in its own resource status table. The status data of the resource includes the resource number, the IP address of the download server corresponding to the resource, and the resource storage location.
[0023] The corresponding download server generates a download link for the resource and returns the download link to the offline device through the offline server.
[0024] If an offline server storing the resource exists within the same local area network, the offline server storing the resource generates a download link for the resource and returns the download link to the offline device through the offline server.
[0025] As can be seen from the above description, the beneficial effects of the present invention are as follows: when an offline device searches for resources, if none of the servers in the local area network store the data, the device can select the offline server with the best status to request the download of the resources from the cloud, so that the offline device can obtain the required resources as quickly as possible. It can also achieve load balancing among offline servers in the same local area network, and ultimately achieve effective management of shared resources.
[0026] Furthermore, the resource download request includes the resource ID and digest value of the resource; or
[0027] The resource download request includes the resource ID of the resource. The offline server, based on the resource download request sent by the offline device, obtains the resource ID and digest value of the resource, including:
[0028] After receiving a resource download request from an offline device, the offline server requests the digest value of the resource corresponding to the resource number from the cloud server based on the resource number.
[0029] As described above, by obtaining the resource number, one can query whether the status data of the resource exists in the resource status table; by obtaining the resource summary value, one can verify the stored resource and ensure that the obtained resource is the one required by the offline device.
[0030] Furthermore, the method also includes:
[0031] According to the preset first synchronization period, each offline server synchronizes the status data in its own resource status table to other offline servers on the same local area network.
[0032] As described above, by periodically synchronizing the status data of resources in each offline server, the offline server can quickly determine the relevant information of the resources stored in each offline server within the same local area network based on the resource status table.
[0033] Further, determining whether there is an offline server storing the resource among the first-line offline server and other offline servers located on the same local area network, based on the resource ID and digest value of the resource and the resource status table of the first-line offline server, includes:
[0034] The offline server checks its own resource status table to see if the status data of the resource exists, based on the resource number of the resource.
[0035] If the resource status data exists in the resource status table of the offline server, then a verification request is sent to the download server corresponding to the resource based on the IP address of the download server corresponding to the resource in the resource status data. The verification request includes the resource number and digest value of the resource.
[0036] After receiving the verification request, the corresponding download server verifies the resources stored within itself.
[0037] If the verification is successful, it is determined that there is an offline server storing the resource within the same local area network, and the corresponding download server is designated as the offline server storing the resource.
[0038] If the verification fails, it is determined that there is no offline server storing the resource within the same local area network.
[0039] As described above, an offline server can quickly determine whether another offline server on the same local area network has downloaded the resource by using its own stored resource status table.
[0040] Furthermore, after receiving the verification request, the corresponding download server verifies the resources it stores, including:
[0041] After receiving the verification request, the corresponding download server determines whether the status data of the resource exists in its own resource status table based on the resource number of the resource.
[0042] If it exists, then determine whether it stores the resource corresponding to the resource number based on the resource storage location in the resource status data;
[0043] If so, calculate the digest value of the resource corresponding to the resource number stored in the database to obtain the first digest value;
[0044] If the first digest value matches the digest value of the resource in the verification request, the verification is deemed successful.
[0045] As described above, by verifying the stored resources, it is ensured that the stored resources are the same as those requested by the offline devices. Furthermore, it is preferable to first check if the requested data is stored on the offline server being requested. If it is, the offline device can be quickly responded to, improving resource sharing efficiency.
[0046] Furthermore, after the offline server queries its own resource status table to see if the resource's status data exists based on the resource's resource number, the process further includes:
[0047] If the resource status data is not found in the resource status table of the first-line offline server, the first-line offline server sends an inquiry request to other offline servers in the same local area network. The inquiry request includes the resource number and digest value of the resource.
[0048] After receiving the query request, the other offline servers determine whether the status data of the resource exists in their own resource status table based on the resource number of the resource.
[0049] If the resource status data is not found in the resource status tables of other offline servers, it is determined that there is no offline server storing the resource in the same local area network.
[0050] If the resource status data exists in the resource status table of another offline server, then the other offline server verifies the resource stored in itself based on the resource number and digest value of the resource in the query request;
[0051] If the verification is successful, it is determined that there is an offline server storing the resource in the same local area network, and the other offline server is identified as the offline server storing the resource.
[0052] If the verification fails, it is determined that there is no offline server storing the resource within the same local area network.
[0053] As described above, since there may be a situation where a certain offline server has just downloaded the resource but has not yet synchronized the status data of the resource with other offline servers, querying other offline servers can prevent the resource from being downloaded repeatedly.
[0054] Furthermore, before selecting the offline server with the best status from the offline servers on the same local area network as the download server corresponding to the resource, the process further includes:
[0055] Each offline server updates its own server status table in real time based on its own server status data. The server status data includes load status data and / or disk status data. The load status data includes CPU utilization, and the disk status data includes remaining disk space.
[0056] According to the preset second synchronization cycle, each offline server synchronizes its latest server status data to other offline servers on the same local area network.
[0057] Further, selecting the offline server with the best status from among the offline servers in the same local area network as the download server corresponding to the resource includes:
[0058] Based on the remaining disk space and / or load status of each offline server in the same local area network, the offline server with the best status is determined, and the offline server with the best status is used as the download server corresponding to the resource.
[0059] As described above, by selecting the offline server with the best status to download and store resources, not only can the download speed be improved, but also the load balancing of offline servers in the same local area network can be achieved.
[0060] Furthermore, the status data of the resource also includes the most recent usage time and / or utilization rate; the method further includes:
[0061] The offline server adjusts the order of the status data of each resource in the resource status table based on the most recent usage time and / or utilization rate of each resource.
[0062] As described above, by adjusting the order of resource status data in the resource status table, placing recently used resources and those with high utilization rates at the front, query time can be saved to some extent and request response speed can be improved.
[0063] Furthermore, the status data of the resource also includes the resource generation time and / or recent usage time; the method further includes:
[0064] If the time difference between the resource generation time and the current time of a resource stored on the offline server exceeds a preset first time threshold and / or the time difference between the most recent usage time and the current time exceeds a preset second time threshold, then the offline server deletes the resource and removes the status data of the resource from its own resource status table.
[0065] As described above, storage space can be saved by reclaiming resources that have been stored for a certain period of time but have not been used.
[0066] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0067] Example 1
[0068] Please refer to Figure 2-3 Embodiment 1 of the present invention is: a shared resource management method based on a local area network, which can be applied to audiovisual venues. The architecture of this embodiment is as follows: Figure 2 As shown, the system includes a cloud server, at least one offline server, and at least one offline device, wherein each offline server and each offline device is located within the same local area network (LAN). When applied to audiovisual venues, the set-top boxes in the same audiovisual venue are equivalent to offline devices within the same LAN, and the venue server within the same audiovisual venue is equivalent to an offline server within the same LAN.
[0069] like Figure 3 As shown, it includes the following steps:
[0070] S1: The offline server obtains the resource ID and digest value of the resource based on the resource download request sent by the offline device.
[0071] Specifically, a first-line offline device sends a resource download request to a first-line offline server within the same local area network. In this embodiment, the resource download request includes the resource ID and digest value of the resource. At this time, the offline server can directly obtain the resource ID and digest value of the resource.
[0072] In another optional embodiment, the resource download request only includes the resource number of the resource. In this case, the offline device also needs to request the digest value of the resource corresponding to the resource number from the cloud server based on the resource number.
[0073] The abstract value can be an MD5 value.
[0074] S2: The offline server checks its own resource status table to see if the status data of the resource exists based on the resource number of the resource. If yes, proceed to step S3. If no, it may be because none of the offline servers in the local area network have stored the resource, or it may be because a certain offline server has downloaded the resource but has not yet synchronized the status data of the resource to other offline servers in the same local area network. Therefore, further analysis is required. In this case, proceed to step S9.
[0075] S3: Based on the IP address of the download server corresponding to the resource in the status data of the resource, send a verification request to the download server corresponding to the resource. The verification request includes the resource number and digest value of the resource.
[0076] S4: After receiving the verification request, the corresponding download server verifies the resources it stores and determines whether the verification passes. If it does, proceed to step S7. If the verification fails, it may be because the corresponding download server previously downloaded the resource and synchronized the status data of the resource to other offline servers in the same local area network. Subsequently, due to excessive storage time or other reasons, the resource was deleted or modified, but the deletion or modification message has not yet been synchronized to other offline servers. In this case, it is assumed that there is no offline server storing the resource in the local area network, and step S5 is executed.
[0077] Specifically, the verification process in this step includes the following steps:
[0078] S401: The corresponding download server determines whether the status data of the resource exists in its own resource status table based on the resource number of the resource. If yes, then step S402 is executed; otherwise, the verification is deemed unsuccessful.
[0079] S402: Based on the resource storage location in the status data of the resource, determine whether the resource corresponding to the resource number is stored, that is, determine whether the resource exists in the resource storage location. If yes, proceed to step S403; otherwise, determine that the verification fails.
[0080] S403: Calculate the digest value of the resource corresponding to the resource number stored in the self-stored database to obtain the first digest value.
[0081] S404: Determine whether the first digest value is consistent with the digest value of the resource in the verification request. If they are consistent, the verification is deemed successful; otherwise, the verification is deemed unsuccessful.
[0082] S5: Select the offline server with the best status from the offline servers in the same local area network as the download server corresponding to the resource.
[0083] Specifically, each offline server updates its own server status table in real time based on its own server status data. This server status table records the latest server status data, including load status data (CPU utilization) and disk status data (remaining disk space). According to a preset second synchronization cycle, each offline server synchronizes its latest server status data to other offline servers on the same local area network (LAN). In other words, each offline server periodically synchronizes its latest server status data with other offline servers, ensuring that each offline server records the latest server status data of all offline servers within the same LAN.
[0084] Then, based on the server status data of each offline server in the same local area network, the offline server with the best status is determined and used as the download server corresponding to the resource.
[0085] In an optional embodiment, the offline server with the best status can be determined solely based on the CPU utilization of each offline server, that is, the offline server with the lowest CPU utilization is selected as the offline server with the best status.
[0086] In another alternative embodiment, the offline server with the best status can be determined solely based on the remaining disk space of each offline server, that is, the offline server with the most remaining disk space is regarded as the offline server with the best status.
[0087] In this embodiment, the offline server with the best status is determined based on the CPU utilization and disk space remaining of each offline server. That is, the CPU utilization and disk space remaining are comprehensively analyzed, and the offline server with the best status is determined based on the analysis results of each offline server.
[0088] By selecting the offline server with the best status to download and store resources, load balancing among offline servers in the same local area network can be achieved.
[0089] S6: The corresponding download server requests the download of the resource from the cloud server and records the status data of the resource in its own resource status table. The status data of the resource includes the resource number, the IP address of the download server corresponding to the resource and the resource storage location, and may also include the download status, download time, resource generation time (i.e. the time when the resource was stored in the corresponding download server), recent usage time and utilization rate (i.e., the number of times the resource was requested to be used by offline devices, i.e., the number of times it was requested to be downloaded by offline devices).
[0090] S7: The corresponding download server generates a download link for the resource and returns the download link to the offline device through the offline server.
[0091] The process involves first sending the download link of the resource to the offline server, which then returns the download link to the offline device. The offline device can then download the requested resource using the provided download link.
[0092] Furthermore, the resource status data also includes the download link. After the corresponding download server generates the download link for the resource for the first time, it stores the download link in the resource status table.
[0093] S8: According to the preset first synchronization period, each offline server synchronizes the status data in its own resource status table to other offline servers in the same local area network.
[0094] Preferably, only the state data that has changed within the current first synchronization cycle can be synchronized.
[0095] By periodically synchronizing resource status data, other servers can easily query resource status based on their own resource status tables.
[0096] S9: The offline server sends an inquiry request to other offline servers on the same local area network. The inquiry request includes the resource number and digest value of the resource.
[0097] S10: After receiving the query request, the other offline server determines whether the status data of the resource exists in its own resource status table according to the resource number of the resource. That is, it determines whether the status data of the resource exists in the resource status table of another offline server. If yes, then proceed to step S11. If no, that is, the status data of the resource does not exist in the resource status tables of other offline servers, then it is considered that there is no offline server storing the resource in the local area network, and then proceed to step S5.
[0098] S11: The other offline server verifies the resource it stores based on the resource number and digest value of the resource in the query request, and determines whether the verification passes. If yes, proceed to step S12; otherwise, it is also considered that there is no offline server storing the resource in the local area network, and proceed to step S5.
[0099] The verification process in this step can be referred to steps S402-S404.
[0100] S12: Determine that there is an offline server storing the resource within the same local area network, and designate the other offline server as the offline server storing the resource, that is, designate the other offline server as the download server corresponding to the resource, and then execute step S7.
[0101] Furthermore, each offline server also manages the status data of each resource in the resource status table. Specifically, the offline server adjusts the order of the status data of each resource in the resource status table according to the most recent usage time and utilization rate of each resource in its own resource status table.
[0102] In an alternative embodiment, the order can be adjusted solely based on the most recent usage time of the resources, meaning that the more recent the usage time, the higher the ranking.
[0103] In another alternative embodiment, the order can be adjusted solely based on utilization, meaning that the higher the utilization, the higher the ranking.
[0104] In this embodiment, the order of resources is adjusted based on both the most recent usage time and utilization rate. For example, resources can be first sorted by most recent usage time, and then, based on this initial sorting, resources whose most recent usage times fall within the same time period (e.g., the same day) can be further sorted by utilization rate. Similarly, resources can be first sorted by utilization rate, and then, based on this initial sorting, resources whose utilization rates fall within the same range can be further sorted by most recent usage time.
[0105] By rearranging the order of resource status data in the resource status table, placing recently used resources and those with high utilization rates at the front, query time can be saved to some extent and request response speed can be improved.
[0106] Furthermore, if a resource is stored for a certain period of time (e.g., one year) and is not requested for download, automatic resource reclamation is triggered, thereby saving storage space. Specifically, if the time difference between the resource generation time and the current time of a resource stored on the offline server exceeds a preset first time threshold, and the time difference between the most recent usage time and the current time exceeds a preset second time threshold, then the offline server deletes the resource and removes the status data of the resource from its own resource status table.
[0107] In this embodiment, multiple offline servers in the same local area network only need to download the same cloud resource once, and the same cloud resource is stored on at most one offline server in the same local area network. When other offline devices in the same local area network need to download a certain cloud resource, each offline server in the same local area network can determine whether the cloud resource has been downloaded through the resource status table. If it has been downloaded, the storage location of the resource can also be obtained. If it has not been downloaded, the offline server with the best status will be assigned to download and store the cloud resource, thereby achieving the effect of load balancing and effective allocation of data and resources.
[0108] This embodiment uses a resource status table to manage resource status data, enabling effective management and allocation of resources, as well as efficient downloading and storage of resources. This saves cloud load and storage space on each offline server; moreover, the load of each offline server is balanced, leaving more space for other business processing.
[0109] Example 2
[0110] This embodiment is a computer-readable storage medium corresponding to the above embodiments, on which a computer program is stored. When the computer program is executed by a processor, it implements the various processes in the above embodiments of the shared resource management method based on a local area network, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0111] In summary, the present invention provides a shared resource management method and computer-readable storage medium based on a local area network (LAN). By recording a resource status table in the offline servers, multiple offline servers in the same LAN only need to download the same cloud resource once, and the same cloud resource is stored on at most one offline server in the same LAN. When other offline devices in the same LAN need to download the same cloud resource, each offline server in the same LAN can obtain the storage location of the resource through the resource status table, thus achieving effective management of shared resources. By selecting the offline server with the best status to download and store the resource, load balancing among offline servers in the same LAN can be achieved. By adjusting the order of the resource status data in the resource status table, placing the status data of recently used resources and resources with high utilization rates at the front, query time can be saved to a certain extent and request response speed can be improved. By reclaiming resources that have been stored for a certain period of time and have not been used, storage space can be saved.
[0112] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention's specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for managing shared resources based on a local area network, characterized by, The method comprises the following steps: A first offline server acquires a resource number and a digest value of a resource according to a resource download request sent by a first offline device; It is determined whether there is a first offline server storing the resource among the first offline server and other offline servers in the same local area network according to the resource number and the digest value of the resource and a resource state table of the first offline server; If there is no first offline server storing the resource in the same local area network, a first offline server with the best state is selected from each first offline server in the same local area network as a download server corresponding to the resource; The corresponding download server requests the cloud server to download the resource, and records state data of the resource to the resource state table of the corresponding download server, wherein the state data of the resource comprises a resource number, an IP address of the download server corresponding to the resource and a resource storage location; The corresponding download server generates a download link of the resource, and returns the download link of the resource to the first offline device through the first offline server; If there is a first offline server storing the resource in the same local area network, the first offline server storing the resource generates a download link of the resource, and returns the download link of the resource to the first offline device through the first offline server.
2. The method according to claim 1, wherein, The resource download request comprises a resource number and a digest value of a resource; or The resource download request comprises a resource number, and the first offline server acquires a resource number and a digest value of a resource according to a resource download request sent by a first offline device, which comprises the following steps: After receiving the resource download request sent by the first offline device, the first offline server requests a digest value of a resource corresponding to the resource number from the cloud server according to the resource number.
3. The method of claim 1, wherein, The method further comprises the following steps: According to a preset first synchronization period, each first offline server synchronizes state data in the resource state table of the first offline server to other first offline servers in the same local area network.
4. The method of claim 3, wherein, The step of determining whether there is a first offline server storing the resource among the first offline server and other offline servers in the same local area network according to the resource number and the digest value of the resource and a resource state table of the first offline server comprises the following steps: The first offline server queries whether there is state data of the resource in the resource state table of the first offline server according to the resource number of the resource; If there is state data of the resource in the resource state table of the first offline server, a verification request is sent to the download server corresponding to the resource according to an IP address of the download server corresponding to the resource in the state data of the resource, wherein the verification request comprises the resource number and the digest value of the resource; After receiving the verification request, the corresponding download server verifies the resource stored by itself; If the verification is passed, it is determined that there is a first offline server storing the resource in the same local area network, and the corresponding download server is determined as the first offline server storing the resource; If the verification is not passed, it is determined that there is no first offline server storing the resource in the same local area network.
5. The method of claim 4, wherein, The corresponding download server receives the verification request, and verifies the resource stored by itself, including: After the corresponding download server receives the verification request, whether the state data of the resource exists in the resource state table of the server itself is judged according to the resource number of the resource; If yes, whether the resource corresponding to the resource number is stored in the server itself is judged according to the resource storage location in the state data of the resource; If yes, the digest value of the resource corresponding to the resource number stored in the server itself is calculated to obtain a first digest value; If the first digest value is consistent with the digest value of the resource in the verification request, it is determined that the verification is passed.
6. The method of claim 4, wherein, After the first-line offline server queries whether the state data of the resource exists in the resource state table of the server itself according to the resource number of the resource, the method further includes: If the state data of the resource does not exist in the resource state table of the first-line offline server, the first-line offline server sends an inquiry request to other offline servers in the same local area network, and the inquiry request includes the resource number and the digest value of the resource; After the other offline servers receive the inquiry request, whether the state data of the resource exists in the resource state table of the server itself is judged according to the resource number of the resource; If the state data of the resource does not exist in the resource state table of the other offline servers, it is determined that there is no offline server storing the resource in the same local area network; If the state data of the resource exists in the resource state table of the other offline server, the other offline server verifies the resource stored by itself according to the resource number and the digest value of the resource in the inquiry request; If the verification is passed, it is determined that there is an offline server storing the resource in the same local area network, and the other offline server is regarded as the offline server storing the resource; If the verification is not passed, it is determined that there is no offline server storing the resource in the same local area network.
7. The method of claim 1, wherein, Before selecting the offline server with the optimal state from the offline servers in the same local area network as the corresponding download server of the resource, the method further includes: Each offline server updates the server state table of the server itself in real time according to the server state data of the server itself, the server state data including load state data and / or disk state data, the load state data including CPU usage, and the disk state data including disk remaining space; According to a preset second synchronization period, each offline server synchronizes the latest server state data of the server itself to other offline servers in the same local area network.
8. The method of claim 7, wherein, Selecting the offline server with the optimal state from the offline servers in the same local area network as the corresponding download server of the resource includes: According to the disk remaining space and / or load state of each offline server in the same local area network, the offline server with the optimal state is determined, and the offline server with the optimal state is regarded as the corresponding download server of the resource.
9. The method of claim 1, wherein, The state data of the resource further includes the latest use time and / or utilization rate; the method further includes: The offline server adjusts the order of the state data of each resource in the resource state table according to the latest use time and / or utilization of each resource in the resource state table of the offline server.
10. The method of claim 1, wherein, The state data of the resource further comprises resource generation time and / or latest use time; and the method further comprises: If the time difference between the resource generation time of a resource stored in the offline server and the current time exceeds a preset first time threshold and / or the time difference between the latest use time and the current time exceeds a preset second time threshold, the offline server deletes the resource and deletes the state data of the resource in the resource state table of the offline server.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The program is executed by the processor to implement the method of any one of claims 1-10.
Citation Information
Patent Citations
Network-based downloading method and system, and terminal
CN102185920A
Multimedia resource sharing method and device
CN105245500A
Resource downloading method and device, edge node and storage medium
CN111327651A