Resource storage method and device, storage medium, electronic equipment and computer program product
By collecting real-time information from the gateway in the FTTR network and making intelligent storage decisions, the problem of overloading a single device when storing files is solved, and reasonable allocation of resources and efficient data processing are achieved.
Patent Information
- Application Number
- CN202510688874.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-27
AI Technical Summary
In FTTR networks, storing files can easily lead to overloading of a single device, and the prior art has not yet proposed an effective solution.
By receiving storage requests, obtain real-time gateway information from each slave gateway, including storage capacity, network load and device load, and determine the most suitable storage gateway for resource storage to avoid overloading of a single device.
It realizes the rational allocation of resources and efficient data processing in the FTTR network, avoids overloading of a single device, and ensures the stability and fluency of the network.
Smart Images

Figure CN120223699A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of communications, and more particularly, to a method and apparatus for storing resources, a storage medium, an electronic device, and a computer program product. Background Art
[0002] With the widespread popularity of smart devices such as mobile phones, tablets, and smart TVs, the modern family's demand for data storage and sharing is increasing day by day, especially the efficient management of a large number of multimedia files such as photos, videos, documents, and music. The Fiber To The Room (FTTR) technology, with its excellent network performance, reaches directly into the room through optical fibers, pioneeringly providing communication capabilities with higher bandwidth and shorter latency than traditional networks, thus creating a first-class network experience environment for home users. Especially when multiple devices are performing high-bandwidth applications simultaneously, such as online games, high-definition video streaming, and remote work, the data storage solution under the FTTR technology is particularly important.
[0003] In the FTTR system architecture, whether it is an external storage or an internal storage, family members can seamlessly access the storage resources through the FTTR network, realizing the convenient upload and download of photos, videos, and files. This not only improves the data access speed but also ensures the stability and smoothness of the home network. However, in the prior art, in the FTTR network, when storing files, it is easy for a single device to be overloaded.
[0004] In view of the problem in the prior art that in the FTTR network, when storing files, it is easy for a single device to be overloaded, no effective solution has been proposed yet.
[0005] Therefore, it is necessary to improve the related technology to overcome the defects in the related technology. Summary of the Invention
[0006] Embodiments of the present invention provide a method and apparatus for storing resources, a storage medium, an electronic device, and a computer program product to at least solve the problem that in the FTTR network, when storing files, it is easy for a single device to be overloaded in the related technology.
[0007] According to an embodiment of the present invention, a method for storing resources is provided, including: receiving a storage request sent by a target object, where the storage request is used to request to store a first resource in a gateway; obtaining gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateway; determining a first storage gateway in the target network according to the gateway information to store the first resource in the first storage gateway.
[0008] According to another embodiment of the present invention, a storage device for resources is provided, including: a receiving module, configured to receive a storage request sent by a target object, where the storage request is used to request storing a first resource of the target object in a gateway; an obtaining module, configured to obtain gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateways; a determining module, configured to determine a first storage gateway in the target network according to the gateway information, so as to store the first resource in the first storage gateway.
[0009] According to still another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0010] According to still another embodiment of the present invention, an electronic device is further provided, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0011] According to still another embodiment of the present invention, a computer program product is further provided, including a computer program, and the computer program implements the steps in any one of the above method embodiments when executed by a processor.
[0012] Through the above embodiments of the present invention, a storage request sent by a target object is received, where the storage request is used to request storing a first resource in a gateway; gateway information of each slave gateway in a target network is obtained, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateways; a first storage gateway is determined in the target network according to the gateway information, so as to store the first resource in the first storage gateway. That is, in the embodiments of the present application, by comprehensively collecting real-time information of each slave gateway in the FTTR network and making an intelligent storage decision based on this information, the problem of single-device overload that is easily encountered when storing files in the FTTR network is solved, ensuring the reasonable allocation of network resources and the high efficiency of data processing. Description of the Drawings
[0013] Figure 1 is a hardware structure block diagram of a computer device for the resource storage method of the embodiments of the present application;
[0014] Figure 2 is a system architecture diagram of the resource storage method of the embodiments of the present application;
[0015] Figure 3 is a flowchart of a method for storing resources according to an embodiment of the present application;
[0016] Figure 4 is a schematic diagram of the networking of an FTTR home storage device according to an embodiment of the present application;
[0017] Figure 5 is a flowchart of a method for making a data storage decision according to an embodiment of the present application;
[0018] Figure 6 is a flowchart of a method for making a data synchronization decision according to an embodiment of the present application;
[0019] Figure 7 is a flowchart of a method for powering off a slave gateway according to an embodiment of the present application;
[0020] Figure 8 is a structural block diagram of a storage device for resources according to an embodiment of the present application. Detailed implementation manners
[0021] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.
[0022] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a hardware structural block diagram of the computer terminal on which the method embodiment of the present invention runs. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in the figure is only schematic, and it does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.
[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the resource storage method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0025] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a computer terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (abbreviated as RF) module, which is used to communicate with the Internet wirelessly.
[0026] The embodiments of the present application can run on Figure 2 the system architecture shown, such as Figure 2 shown, the system architecture includes: a user side, a main gateway, and a slave gateway. Among them, the user side is connected to the main gateway through UDP / TCP, the user side is connected to the slave gateway through SMB, and the slave gateway and the main gateway transmit information through internal messages.
[0027] When the slave gateway integrates storage capabilities, it can report its status to the main gateway.
[0028] The main gateway includes: a storage management and storage synchronization module. The storage management module is used to record the detailed information of all slave devices and also maintains a heartbeat mechanism with the slave gateway. When the user initiates a data upload request, this module filters out the best storage path according to the real-time status of the storage device (including storage capacity, network, and device load conditions).
[0029] The storage synchronization module is used to synchronize the data that fails to be backed up in time and actively copies it to other healthy devices outside the main storage device.
[0030] In this embodiment, a resource storage method running on a computer terminal or the above-mentioned system architecture is provided. Figure 3is a flowchart of resource storage according to an embodiment of the present invention, as Figure 3 shown. The process includes the following steps:
[0031] Step S302, receive a storage request sent by a target object, where the storage request is used to request storing a first resource in a gateway;
[0032] The main gateway can listen for and receive storage requests from target objects (such as user devices, applications, etc.).
[0033] Step S304, obtain gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a main gateway and the slave gateways;
[0034] After receiving the storage request, the main gateway collects real-time status information of all slave gateways in the target network, including but not limited to key metrics such as storage capacity, network load, and device load. The target network refers to an FTTR network environment composed of a main gateway and multiple slave gateways, where the slave gateway may or may not have a storage function. The schematic diagram of the target network is as Figure 4 shown.
[0035] Step S306, determine a first storage gateway in the target network according to the gateway information to store the first resource in the first storage gateway.
[0036] Based on the detailed gateway information collected in step S304, the main gateway uses an intelligent algorithm to make a decision on the data storage location. That is, by comprehensively considering the storage capacity of the slave gateway and the current load conditions of the network and devices, a first storage gateway is determined to store the first resource, thereby avoiding the imbalance of resource storage, preventing a single gateway from being overloaded, and ensuring the efficient operation of the entire FTTR network and the smoothness of data transmission.
[0037] Through the above steps, receive a storage request sent by a target object, where the storage request is used to request storing a first resource in a gateway; obtain gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a main gateway and the slave gateways; determine a first storage gateway in the target network according to the gateway information to store the first resource in the first storage gateway. That is, in the embodiment of the present application, by comprehensively collecting real-time information of each slave gateway in the FTTR network and making an intelligent storage decision based on this information, the problem of single device overload easily encountered when storing files in the FTTR network is solved, ensuring the reasonable allocation of network resources and the high efficiency of data processing.
[0038] Optionally, determining a first storage gateway in the target network according to the gateway information includes: determining the resource size of the first resource, and determining a first secondary gateway in the target network whose storage capacity is greater than or equal to the resource size of the first resource; determining the comprehensive score of each first secondary gateway according to the network load and device load of each first secondary gateway; determining a first storage gateway in the target network according to the comprehensive scores of each first secondary gateway.
[0039] In the embodiment of the present application, the main gateway determines the exact resource size of the first resource to be stored (such as files, media content, etc.). Further, in the target network (composed of the main gateway and multiple secondary gateways), all secondary gateways whose storage capacity is greater than or equal to the size of the first resource are filtered out, that is, the first secondary gateways.
[0040] For each of the filtered first secondary gateways, the main gateway further calculates its comprehensive score. Through a preset calculation formula (for example, comprehensive score = α×network load + β×device load, where α and β are weights), the comprehensive performance score of the secondary gateway is calculated. The lower the score, the lighter the current load of the gateway and the more suitable it is for storing data.
[0041] Finally, the main gateway selects the first storage gateway with the lowest score according to the comprehensive scores of each first secondary gateway, thereby effectively avoiding the concentrated overload of storage resources and realizing the intelligent allocation and balanced utilization of storage resources in the FTTR network.
[0042] Optionally, as Figure 5 shown, a data storage decision-making process is given, and the specific steps are as follows:
[0043] Step S501: The user initiates a storage request;
[0044] The user sends storage request information to the main gateway through the client application, indicating that there is data to be uploaded or stored.
[0045] Step S502: The main gateway sends an information acquisition request to the secondary gateway;
[0046] After receiving the request, the storage management module of the main gateway starts the storage decision-making process according to the latest device information record (see Table 1), and sends a decision information acquisition request to all secondary gateways with storage capabilities in the network to evaluate their current status.
[0047] Table 1
[0048]
[0049] Step S503: The secondary gateway reports information;
[0050] After receiving a request from each slave gateway, first, by checking the MAC field in the request, it is ensured that the message source is the master gateway to prevent illegal access. After passing the verification, the node management module of the slave gateway will feedback the real-time status information of the storage device, including storage capacity, network load, and device load, to the master gateway.
[0051] Step S504: Comprehensive score evaluation by the master gateway;
[0052] After the master gateway collects the feedback information of all slave gateways, it records it in the device status information table (see Table 2). Subsequently, using the preset comprehensive score calculation formula, comprehensive score = α × network load + β × device load, where the network load represents the ratio of the current bandwidth usage to the total bandwidth, and the device load reflects the utilization degree of the CPU. α and β are weight factors used to balance the influence of the two. If the network load and the device load are regarded as equally important, then α and β can both be set to 0.5. Through calculation, the device with a lower score indicates better performance, more abundant bandwidth and CPU resources, and thus is more suitable as the target for data storage.
[0053] Table 2
[0054]
[0055] Step S505: Return the optimal storage path to the user side;
[0056] Based on the comprehensive score result, the master gateway intelligently selects the most suitable storage device and feeds back this decision to the user or the client.
[0057] Step S506: The user side connects to the selected storage device to upload data.
[0058] By dynamically selecting a device with low network load and small CPU burden for data storage, the response speed and storage reliability of the entire system are significantly improved, creating a smooth and stable user storage experience.
[0059] Optionally, obtain the gateway information of each slave gateway in the target network, including: sending an information acquisition request to each slave gateway according to the stored device information, where the device information at least includes: the identification information and address information of the slave gateway; in the case where each slave gateway passes the verification of the information acquisition request, receive the gateway information sent by each slave gateway based on the information acquisition request.
[0060] In the embodiment of the present application, the master gateway first sends an information acquisition request to each slave gateway based on the stored device information. Among them, the device information at least includes the unique identification information (such as MAC address) and address information (such as IP address) of the slave gateway.
[0061] When an information acquisition request is received from the gateway, the request must first be verified. The verification step ensures that the source of the request is legitimate, i.e., from the main gateway. This further prevents unauthorized devices or third-party main gateways from interfering with or tampering with network data, thus ensuring the security of the entire FTTR network.
[0062] Once the verification is passed, the slave gateway will respond to the information acquisition request of the main gateway and send back gateway information including storage capacity, network load, device load, etc.
[0063] Optionally, after determining the first storage gateway in the target network according to the gateway information, the method further includes: determining the backup status of the second resource stored in the main gateway, and determining the third resource in the second resource whose backup status is unbacked up; determining a second storage gateway in the target network according to the gateway information, and storing the third resource in the second storage gateway.
[0064] In the FTTR network, in order to ensure the security and persistence of data, the data stored in the main gateway will be backed up to other storage resources in the network, such as slave gateways. Therefore, the main gateway needs to periodically or based on specific events check whether the data stored in its internal resources has been correctly backed up, that is, confirm whether the data exists in other specified storage locations, or whether the backup process has been completed.
[0065] The "third resource" refers to the data stored in the main gateway (second resource) but not successfully backed up at other locations. In other words, these data are stored in the main gateway but not in other slave gateways. The storage synchronization module of the main gateway will analyze the information of the storage resources and identify which data (i.e., the third resource) has not been backed up.
[0066] In the embodiments of the present application, the main gateway not only manages its own storage capacity and data, but also ensures the copy (backup) status of these data on other storage resources, so as to maintain the data integrity and availability of the entire network. When it is detected that some data is not backed up, the main gateway will send a storage request to other slave gateways to ensure that all important data is properly backed up and reduce the risk of data loss.
[0067] Optionally, determining the second storage gateway in the target network according to the gateway information includes: determining the resource size of the third resource, and determining a second slave gateway in the target network whose storage capacity is greater than or equal to the resource size of the third resource; determining the comprehensive score of each second slave gateway according to the network load and device load of each second slave gateway; determining the second storage gateway in the target network according to the comprehensive score of each second slave gateway.
[0068] In the embodiments of the present application, the master gateway screens out all slave gateways in the target network whose storage capacity is greater than or equal to the third resource size as potential second storage gateway candidates. That is, by comparing the storage capacity of each slave gateway with the size of the resource to be stored, the selection range is narrowed, and only the slave gateways with sufficient space are retained.
[0069] For the screened second slave gateways, the master gateway further calculates their comprehensive scores. Finally, the master gateway conducts a comparative analysis based on the comprehensive scores of each second slave gateway and selects a second storage gateway from them to store the third resource.
[0070] Optionally, determining the second storage gateway in the target network according to the comprehensive score of each second slave gateway includes: determining the magnitude relationship between the comprehensive score of each second slave gateway and a preset comprehensive score; in the case where any magnitude relationship indicates that the comprehensive score is less than the preset comprehensive score, determining the slave gateway with the largest storage capacity among the second slave gateways with a comprehensive score less than the preset comprehensive score, and determining the slave gateway with the largest storage capacity as the second storage gateway; in the case where each magnitude relationship indicates that the comprehensive score is greater than or equal to the preset comprehensive score, determining the second slave gateway with the highest comprehensive score among the second slave gateways, and determining the second slave gateway with the highest comprehensive score as the second storage gateway.
[0071] First, the master gateway compares the comprehensive score of each second slave gateway with a preset comprehensive score threshold. When the comprehensive score of any second slave gateway is lower than the preset comprehensive score, the master gateway will preferentially look for the one with the largest storage capacity among these slave gateways with lower scores.
[0072] The slave gateway with the largest storage capacity will be selected as the second storage gateway. A device with a relatively large storage space can be utilized. Even if there may be slight deficiencies in network and device loads, the larger storage capacity helps improve resource utilization efficiency.
[0073] If the comprehensive scores of all second slave gateways are not lower than the preset comprehensive score, it indicates that the overall network devices are in a relatively healthy and balanced state. At this time, the master gateway will select the second slave gateway with the highest comprehensive score as the second storage gateway.
[0074] Optionally, as Figure 6 shown, a data synchronization decision-making process is given, and the specific steps are as follows:
[0075] Step S601: The master gateway sends a request to obtain device information;
[0076] The storage synchronization module of the master gateway actively scans the storage data record information (such as Table 3) at a predetermined time interval and identifies any data that has not been cross-device backed up.
[0077] Table 3
[0078]
[0079] Step S602: Obtain relevant information from the gateway and return it;
[0080] When receiving a synchronization request from the master gateway by the slave gateway, first confirm the source as a legitimate master gateway by verifying the MAC field in the request. After successful verification, the node management module of the slave gateway returns information including storage capacity, network load, and device load.
[0081] Step S603: The master gateway determines the devices to be synchronized;
[0082] After the master gateway receives the response from the slave gateway, it integrates and updates these status information into the device status information table. Subsequently, considering the balance between storage capacity and comprehensive score (less than 0.8), it selects the device with the largest storage capacity for data synchronization and upload. If the comprehensive scores of all slave gateways are higher than 0.8, indicating relatively high network load and device load, at this time, according to the standard selection decision process, the most suitable device is selected for data backup to avoid overuse of individual devices and ensure the balanced and efficient utilization of storage resources.
[0083] Step S604: Send a synchronization instruction and execute data migration;
[0084] After determining the optimal storage path, the master gateway sends a synchronization instruction to the selected storage device, including specific backup data and target device information. The receiving storage device responds quickly and executes the data synchronization process, immediately migrating the unbacked-up data to the specified slave gateway device.
[0085] Optionally, before receiving a storage request from the target object, the method further includes at least one of the following: obtaining the status information of each slave gateway in the target network; determining whether to update the device information stored in the master gateway according to the status information; sending heartbeat information to each slave gateway in the target network, and determining whether to update the device information stored in the master gateway according to the response information of the heartbeat information.
[0086] Before receiving a storage request from the target object (user terminal or application), the master gateway obtains the latest status information of each slave gateway in the target network, including but not limited to fault status information and normal status information. By obtaining this information regularly or in real time, the accuracy and efficiency of storage decisions can be improved.
[0087] To enhance the timeliness and reliability of device information, the master gateway also sends heartbeat information to each slave gateway in the target network before receiving a storage request. The heartbeat information is used to confirm the current online status and response speed of the slave gateway. After receiving the heartbeat information, the slave gateway quickly feeds back its status, including but not limited to whether it is online and whether it is operating normally. The master gateway determines whether to update the device information it stores based on the received response information. For example, if a certain slave gateway fails to respond to the heartbeat information, it may indicate that it has gone offline or malfunctioned. At this time, the master gateway should update the device information and exclude this device from the storage allocation decision.
[0088] Through the above steps, the efficiency, stability, and security of data storage are ensured.
[0089] Optionally, as Figure 7 shown, a power-on and power-off process for the slave gateway is given, and the specific steps are as follows:
[0090] Step S701: The slave gateway powers on and starts, and self-checks its storage capacity;
[0091] When the slave gateway device starts or powers on, its storage node module immediately executes a self-detection program to verify whether the device is configured with a storage medium and its availability.
[0092] Step S702: The slave gateway reports its storage capacity and status;
[0093] Once it is confirmed that the storage function is available, the slave gateway will actively send a storage capacity report to the master gateway, indicating its qualification as a storage node. And the node management module continuously monitors the health status of the local storage device. Once a storage anomaly (such as disk failure, insufficient storage space, etc.) is detected, it immediately notifies the master gateway of the storage device anomaly information, triggering a timely fault response mechanism.
[0094] Step S703: Heartbeat packet interaction between devices;
[0095] After receiving the report from the slave gateway, the master gateway updates or corrects the device information table (such as Table 1) based on the storage capacity and anomaly status information to ensure that the recorded device status is accurate. The storage management module of the master gateway establishes continuous heartbeat communication with the slave gateways in the network. By sending heartbeat packets every 3 minutes and waiting for a response within 5 seconds, and trying up to 3 times, it effectively monitors and maintains the device connection, preventing the information record from becoming invalid due to power failure or network failure.
[0096] Step S704: Heartbeat anomaly response between devices, and the master gateway dynamically adjusts the device information table;
[0097] During the heartbeat keep-alive period, if the master gateway detects that any slave gateway fails to respond to the heartbeat signal within the specified number of retry attempts, it will be regarded as the disconnection or abnormality of the device, and then its record will be removed from the device information table (such as Table 1) to prevent invalid data from affecting subsequent storage decisions and data synchronization operations.
[0098] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0099] In this embodiment, a storage device for resources is also provided. This device is used to implement the above embodiments and preferred implementation methods, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0100] Figure 8 is a structural block diagram of a storage device for resources according to an embodiment of the present invention. As Figure 8 shown, the device includes:
[0101] A receiving module 82, configured to receive a storage request sent by a target object, where the storage request is used to request storing a first resource of the target object in a gateway;
[0102] An obtaining module 84, configured to obtain gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateway;
[0103] A determining module 86, configured to determine a first storage gateway in the target network according to the gateway information to store the first resource in the first storage gateway.
[0104] Through the above device, a storage request sent by a target object is received, where the storage request is used to request storing a first resource in a gateway; gateway information of each slave gateway in a target network is obtained, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateway; a first storage gateway is determined in the target network according to the gateway information to store the first resource in the first storage gateway. That is, in the embodiments of the present application, by comprehensively collecting real-time information of each slave gateway in the FTTR network and making an intelligent storage decision based on this information, the problem of single device overload that is easily encountered when storing files in the FTTR network is solved, ensuring the reasonable allocation of network resources and the efficiency of data processing.
[0105] In an exemplary embodiment, a determination module is configured to determine the resource size of the first resource and determine a first slave gateway in the target network whose storage capacity is greater than or equal to the resource size of the first resource; determine the comprehensive score of each first slave gateway according to the network load and device load of each first slave gateway; and determine a first storage gateway in the target network according to the comprehensive score of each first slave gateway.
[0106] In an exemplary embodiment, an acquisition module is configured to send an information acquisition request to each slave gateway according to the device information of the storage, where the device information at least includes: identification information and address information of the slave gateway; and receive the gateway information sent by each slave gateway based on the information acquisition request when the information acquisition request passes the verification by each slave gateway.
[0107] In an exemplary embodiment, a determination module is configured to determine the backup status of a second resource stored in the master gateway and determine a third resource in the second resource whose backup status is not backed up; determine a second storage gateway in the target network according to the gateway information and store the third resource in the second storage gateway.
[0108] In an exemplary embodiment, a determination module is configured to determine the resource size of the third resource and determine a second slave gateway in the target network whose storage capacity is greater than or equal to the resource size of the third resource; determine the comprehensive score of each second slave gateway according to the network load and device load of each second slave gateway; and determine a second storage gateway in the target network according to the comprehensive score of each second slave gateway.
[0109] In an exemplary embodiment, a determination module is configured to determine the magnitude relationship between the comprehensive score of each second slave gateway and a preset comprehensive score; in the case where any magnitude relationship indicates that the comprehensive score is less than the preset comprehensive score, determine the slave gateway with the largest storage capacity among the second slave gateways with a comprehensive score less than the preset comprehensive score, and determine the slave gateway with the largest storage capacity as the second storage gateway; in the case where each magnitude relationship indicates that the comprehensive score is greater than or equal to the preset comprehensive score, determine the slave gateway with the largest comprehensive score among the second slave gateways, and determine the slave gateway with the largest comprehensive score as the second storage gateway.
[0110] In an exemplary embodiment, a determination module is configured to perform at least one of the following: obtain the status information of each slave gateway in the target network; determine whether to update the device information stored in the master gateway according to the status information; send heartbeat information to each slave gateway in the target network, and determine whether to update the device information stored in the master gateway according to the response information of the heartbeat information.
[0111] It should be noted that the above-mentioned various modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited thereto: the above-mentioned modules are all located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.
[0112] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0113] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc, etc., various media that can store computer programs.
[0114] An embodiment of the present invention further provides an electronic device, including a memory and a processor, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0115] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0116] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details thereof will not be repeated herein.
[0117] Obviously, those skilled in the art should understand that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0118] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A storage method for a resource, characterized in that, Including: Receiving a storage request sent by a target object, where the storage request is used to request storing a first resource in a gateway; Obtaining gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateways; Determining a first storage gateway in the target network according to the gateway information to store the first resource in the first storage gateway.
2. The method according to claim 1, characterized in that, Determining a first storage gateway in the target network according to the gateway information includes: Determining the resource size of the first resource, and determining a first slave gateway in the target network whose storage capacity is greater than or equal to the resource size of the first resource; Determining a comprehensive score of each first slave gateway according to the network load and device load of each first slave gateway; Determining a first storage gateway in the target network according to the comprehensive score of each first slave gateway.
3. The method according to claim 1, wherein After determining a first storage gateway in the target network according to the gateway information, the method further includes: Determining the backup status of a second resource stored in the master gateway, and determining a third resource in the second resource whose backup status is unbacked up; Determining a second storage gateway in the target network according to the gateway information, and storing the third resource in the second storage gateway.
4. The method according to claim 3, wherein Determining a second storage gateway in the target network according to the gateway information includes: Determining the resource size of the third resource, and determining a second slave gateway in the target network whose storage capacity is greater than or equal to the resource size of the third resource; Determining a comprehensive score of each second slave gateway according to the network load and device load of each second slave gateway; Determining a second storage gateway in the target network according to the comprehensive score of each second slave gateway.
5. The method according to claim 4, characterized in that, Determining a second storage gateway in the target network according to the comprehensive score of each second slave gateway includes: Determining the magnitude relationship between the comprehensive score of each second slave gateway and a preset comprehensive score; In the case where any magnitude relationship indicates that the comprehensive score is less than the preset comprehensive score, determining the slave gateway with the largest storage capacity among the second slave gateways with a comprehensive score less than the preset comprehensive score, and determining the slave gateway with the largest storage capacity as the second storage gateway; In the case where each magnitude relationship indicates that the comprehensive score is greater than or equal to the preset comprehensive score, determining the slave gateway with the largest comprehensive score among the second slave gateways, and determining the slave gateway with the largest comprehensive score as the second storage gateway.
6. The method according to claim 1, wherein Before receiving a storage request sent by a target object, the method further includes at least one of the following: Obtaining status information of each slave gateway in the target network; determining whether to update device information stored in the master gateway according to the status information; Sending heartbeat information to each slave gateway in the target network, and determining whether to update device information stored in the master gateway according to the response information of the heartbeat information.
7. A storage device for a resource, characterized in that, Including: A receiving module, configured to receive a storage request sent by a target object, where the storage request is used to request storing a first resource of the target object in a gateway; An obtaining module, configured to obtain gateway information of each slave gateway in a target network, where the gateway information at least includes: storage capacity, network load, and device load, and the target network includes: a master gateway and the slave gateways; A determining module, configured to determine a first storage gateway in the target network according to the gateway information, so as to store the first resource in the first storage gateway.
8. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that, Including a computer program, where when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for detecting state of media resource board, storage medium and voice gateway
CN111314563A
Storage gateway resource allocation method based on streaming storage
CN112383628A
Resource scheduling method and device and electronic equipment
CN115269181A
Data processing method and device, computer equipment and computer readable storage medium
CN115729693A
Resource sharing method and system of distributed block storage gateway
CN116055494A