WO2024113847A1 - 共享资源分配方法、装置及计算设备集群 - Google Patents

共享资源分配方法、装置及计算设备集群 Download PDF

Info

Publication number
WO2024113847A1
WO2024113847A1 PCT/CN2023/104516 CN2023104516W WO2024113847A1 WO 2024113847 A1 WO2024113847 A1 WO 2024113847A1 CN 2023104516 W CN2023104516 W CN 2023104516W WO 2024113847 A1 WO2024113847 A1 WO 2024113847A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
shared
request
service
limit value
Prior art date
Application number
PCT/CN2023/104516
Other languages
English (en)
French (fr)
Inventor
刘强
冯浩
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2024113847A1 publication Critical patent/WO2024113847A1/zh

Links

Definitions

  • the present invention relates to the field of communication technology, and in particular to a shared resource allocation method, device and computing device cluster.
  • resource pooling can improve resource utilization, significantly reduce costs, and improve system elasticity. Specifically, multiple services can share a resource pool to improve resource utilization.
  • tokens (indicating specific resources) are put into the bucket at a set fixed rate.
  • a request comes from a service, it will try to get a token from the bucket based on the resource limit of the service corresponding to the request. If a token can be obtained, it will be processed. If there is no token, it will be queued and wait until a token is available.
  • the above scheme can control the resources that the service can obtain to not exceed the upper limit, when the resource upper limit is low, although it can ensure that there is no interference between different services, there may be a large number of remaining resources that cannot be used, resulting in low resource utilization. Therefore, the above scheme may have the problem of low resource utilization.
  • the embodiments of the present invention provide a shared resource allocation method, apparatus and computing device cluster, which consider the resource usage of the shared resources by the service corresponding to the request, and when there are surplus resources, the surplus resources can be fully utilized to ensure the service quality.
  • an embodiment of the present invention provides a method for allocating shared resources, wherein the shared resources are shared by multiple services provided by multiple service nodes, and the method comprises: receiving a resource request sent by a first service node among multiple service nodes; determining a first probability based on the resource usage of the shared resources by the first service corresponding to the resource request; and determining whether to allocate resources in the shared resources to the first service in response to the resource request based on the first probability.
  • the resource usage of the shared resources by the service corresponding to the request is considered.
  • the surplus resources can be fully utilized to ensure the service quality.
  • a first probability is determined based on resource usage of shared resources by a first service corresponding to a resource request, including: obtaining an upper resource limit and a lower resource limit of the first service relative to the shared resources; and determining the first probability based on resource usage of the shared resources, the upper resource limit and the lower resource limit of the first service.
  • the resource upper limit and resource lower limit of the service corresponding to the request are considered, so that the probability of whether the resource can be obtained can be determined more accurately.
  • the first probability is a first value.
  • the first value may be 1, indicating that the resource can definitely be acquired.
  • the first probability is the second value.
  • the first value may be 0, indicating that the resource cannot be obtained.
  • the first value may be greater than 0 and less than 1, indicating the possibility of acquiring the resource.
  • obtaining a resource upper limit value and a resource lower limit value of a first service relative to a shared resource includes: determining a first request type corresponding to the resource request from a plurality of request types configured for the first service corresponding to the resource request; wherein each of the plurality of request types is configured with a first resource upper limit value and a first resource lower limit value relative to the shared resource; and using the first resource upper limit value and the second resource lower limit value configured for the first request type as the resource upper limit value and the resource lower limit value of the first service corresponding to the resource request relative to the shared resource.
  • the lower limit of the resource includes: determining a first request type corresponding to the resource request from a plurality of request types configured for the first service corresponding to the resource request; wherein each of the plurality of request types is configured with a first resource upper limit value and a first resource lower limit value relative to the shared resource; and using the first resource upper limit value and the second resource lower limit value configured for the first request type as the resource upper limit value and the resource lower limit value
  • the service request types can be subdivided, so that the upper and lower resource limits can be determined more accurately.
  • the first service is configured with a second resource lower limit and a second resource upper limit for a shared resource, the sum of the first resource upper limit values configured for each of the multiple request types is less than or equal to the second resource lower limit, and the first resource upper limit values configured for each of the multiple request types are less than or equal to the second resource upper limit.
  • the sum of the resource lower limits configured by multiple services can be equal to the total resource amount of the shared resources, which can reduce the impact between different services.
  • the resource upper limits configured by multiple services can be equal to the total resource amount of the shared resources, which can ensure resource utilization.
  • a first probability is determined based on resource usage of shared resources by the first service corresponding to the resource request, including: when there are surplus resources in the shared resources required by the resource request, the first probability is determined based on resource usage of the shared resources by the first service corresponding to the resource request.
  • the surplus resources when there are surplus resources, the surplus resources can be used as much as possible to ensure resource utilization.
  • the shared resources include memory, disk read bandwidth, and disk write bandwidth.
  • the shared resource is provided by a storage node.
  • the above method is executed by a storage node that provides shared resources.
  • the shared resource is provided by multiple storage nodes.
  • the above method is executed by a control node of multiple storage nodes that provide shared resources.
  • an embodiment of the present invention provides a shared resource allocation device, comprising: a receiving module for receiving a resource request sent by a first service node among multiple service nodes; a probability determination module for determining a first probability based on the resource usage of the shared resources by the first service corresponding to the resource request; and a response judgment module for determining whether to allocate resources in the shared resources to the first service in response to the resource request based on the first probability.
  • the probability determination module includes: a limit value acquisition unit and a probability determination unit; wherein,
  • a limit value acquisition unit used to acquire a resource upper limit value and a resource lower limit value of the first service relative to the shared resource
  • the probability determination unit is used to determine the first probability based on the resource usage of the shared resource by the first service, the resource upper limit value, and the resource lower limit value.
  • the first probability is a first value.
  • the first probability is the second value.
  • the limit value acquisition unit includes: a type determination subunit and a limit value acquisition subunit; wherein,
  • a type determination subunit configured to determine a first request type corresponding to the resource request from a plurality of request types configured in a first service corresponding to the resource request; wherein each of the plurality of request types is configured with a first resource upper limit value and a first resource lower limit value relative to the shared resource;
  • the limit value acquisition subunit is used to use the first resource upper limit value and the second resource lower limit value configured for the first request type as the resource upper limit value and the resource lower limit value of the first service corresponding to the resource request relative to the shared resource.
  • the first service is configured with a second resource lower limit and a second resource upper limit for a shared resource, the sum of the first resource upper limit values configured for each of the multiple request types is less than or equal to the second resource lower limit, and the first resource upper limit values configured for each of the multiple request types are less than or equal to the second resource upper limit.
  • the probability determination module is used to determine the first probability based on the resource usage of the shared resource by the first service corresponding to the resource request when there are surplus resources in the shared resource required by the resource request.
  • the shared resources include memory, disk read bandwidth, and disk write bandwidth.
  • the shared resource is provided by a storage node.
  • the shared resource is provided by multiple storage nodes.
  • an embodiment of the present invention provides a shared resource allocation system, which may include multiple service nodes and multiple storage nodes, each of which is used to execute the method provided in the first aspect.
  • the storage nodes include The memory and the controller, the processor of the storage node executes the instructions stored in the memory of the storage node, and the storage node executes the method provided by the first method.
  • the multiple storage nodes have a control node, which can control the nodes to execute the method provided in the first aspect.
  • control node includes a memory and a controller
  • the processor of the control node executes instructions stored in the memory of the control node
  • the control node executes the method provided by the first method
  • an embodiment of the present invention provides a shared resource allocation device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory.
  • the processor is used to execute the method provided in the first aspect.
  • the shared resource is provided by a storage node, and the shared resource allocation device is set on the storage node providing the shared resource.
  • the shared resources are provided by multiple storage nodes, and the shared resource allocation device is set on a control node of the multiple storage nodes providing the shared resources.
  • an embodiment of the present invention provides a shared resource allocation device, characterized in that the device runs computer program instructions to execute the method provided in the first aspect.
  • the device may include a processor, which may be coupled to a memory, read instructions in the memory, and execute the method provided in the first aspect according to the instructions.
  • the memory may be integrated in a chip or a processor, or may be independent of the chip or the processor.
  • the shared resource is provided by a storage node, and the shared resource allocation device is set on the storage node providing the shared resource.
  • the shared resources are provided by multiple storage nodes, and the shared resource allocation device is set on a control node of the multiple storage nodes providing the shared resources.
  • an embodiment of the present invention provides a computing device cluster, comprising: at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method provided in the first aspect.
  • an embodiment of the present invention provides a computing device cluster, which runs computer program instructions to execute the method provided in the first aspect.
  • the cluster includes at least one computing device.
  • an embodiment of the present invention provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method provided in the first aspect.
  • an embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the first aspect.
  • FIG. 1a is a system architecture diagram 1 of a shared resource allocation system provided by an embodiment of the present invention.
  • FIG1b is a second system architecture diagram of a shared resource allocation system provided by an embodiment of the present invention.
  • FIG2a is a schematic diagram of a scenario of shared resource allocation provided by an embodiment of the present invention.
  • FIG2b is a second schematic diagram of a shared resource allocation scenario provided by an embodiment of the present invention.
  • FIG3 is a flow chart of a method for allocating shared resources according to an embodiment of the present invention.
  • FIG4 is a schematic diagram of the flow chart of step 303 in FIG3 ;
  • FIG5 is a second flow chart of a method for allocating shared resources according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of the structure of a shared resource allocation device provided in an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of the structure of a computing device provided by an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of the structure of a computing device cluster provided by an embodiment of the present invention.
  • words such as “exemplary”, “for example” or “for example” are used to indicate examples, illustrations or explanations. Any embodiment or design described as “exemplary”, “for example” or “for example” in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as “exemplary”, “for example” or “for example” is intended to present related concepts in a specific way.
  • the term "and/or" is only a description of the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can represent: A exists alone, B exists alone, and A and B exist at the same time.
  • the term “multiple” means two or more.
  • multiple systems refers to two or more systems
  • multiple terminals refers to two or more terminals.
  • first and second are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features.
  • the terms “include”, “comprises”, “has” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized.
  • FIG. 1a shows an example diagram of the architecture of a shared resource allocation system used in an embodiment of the present invention. It should be understood that the shared resource allocation system applicable to the embodiment of the present invention may also be applicable to other shared resource allocation systems other than the shared resource allocation system shown in FIG. 1a, and the embodiment of the present invention does not limit this. As shown in FIG. 1a, the shared resource allocation system includes a terminal device 110, a cloud management platform 120, and a cloud device cluster 130.
  • the terminal device 110 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
  • Exemplary embodiments of the terminal device 101 involved in the embodiments of the present invention include, but are not limited to, electronic devices equipped with iOS, Android, Windows, Harmony OS, or other operating systems. The embodiments of the present invention do not specifically limit the type of electronic device.
  • the cloud management platform 120 may be a separate electronic device or a device integrated into an electronic device.
  • the embodiment of the present invention does not limit the specific deployment method and deployment location of the cloud management platform.
  • the terminal device 110 accesses the cloud management platform 120 through the network.
  • the network may be a wired network or a wireless network.
  • the wired network may be a cable network, an optical fiber network, a digital data network (DDN), etc.
  • the wireless network may be a telecommunication network, an internal network, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, a mobile phone (Global System for Mobile Communications, GSM), a CDMA (Code Division Multiple Access) network, a CPRS (General Packet Radio Service) network, etc. or any combination thereof.
  • GSM Global System for Mobile Communications
  • CDMA Code Division Multiple Access
  • CPRS General Packet Radio Service
  • the network can use any known network communication protocol to achieve communication between different client layers and gateways.
  • the above-mentioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), Firewire, global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), new radio (NR), Bluetooth, wireless fidelity (Wi-Fi) and other communication protocols.
  • the device cluster 130 is a cluster composed of multiple electronic devices, which are hardware devices, such as physical servers.
  • the device cluster 130 may include multiple service nodes 131 and multiple storage nodes 132.
  • the cloud management and the device cluster 120 communicate via a network, such as an internal network; and the electronic devices in the device cluster 120 communicate with each other via a network, such as an interconnected network.
  • the service node 131 may be a hardware device or may be embedded in a virtualized environment.
  • the service node involved in the embodiment of the present invention may be a virtual machine executed on a hardware server including one or more other virtual machines.
  • the service node 131 is used to provide cloud services, and may be a server or a hyperterminal that can establish a communication connection with other electronic devices and provide computing functions and/or storage functions for other electronic devices.
  • the terminal device 110 controls the service node 131 through the cloud management platform 120 to provide various cloud services, such as object storage, block storage, file storage, database and other services.
  • the terminal device 110 can access the cloud management platform 120, purchase cloud services on the cloud management platform 120, and use cloud services.
  • the service node 131 can generate a resource request and send the resource request to the storage node 132 through the control node 133.
  • the purchased cloud service may be a virtual machine, on which the user may install and run an application.
  • the service node 131 may adapt and install the application, and then may send a resource request through the application, thereby controlling the service node 131 to generate a resource request and send the resource request to the storage node 133.
  • the purchased cloud service may be a model training service, and the number and specifications of the containers using the model training service may be configured.
  • the cloud management platform 120 may allocate one or more service nodes 131 to provide the model training service based on the number and specifications of the containers. These service nodes 131 generate resource requests in the process of providing the cloud service and send the resource requests to the storage node 133.
  • the storage node 132 is used to store data, and the service node 131 can access all storage nodes 132 through resource requests, write data from the storage node 132, and read data.
  • the processing here can be reading, modifying and deleting.
  • the storage node 132 is a hardware device with data reading and data writing capabilities, or is implanted in a virtualized environment; it is worth noting that the storage node 132 has resources such as a processor A1, a memory B1, a disk C1, and a network card D1, and these resources are shared resources for multiple services.
  • shared resources are resources that need to be competed, such as memory, disk read bandwidth (for the convenience of description and distinction, referred to as disk read bandwidth), disk write bandwidth (for the convenience of description and distinction, referred to as disk write bandwidth), network bandwidth, etc.
  • the shared resources provided in the embodiment of the present invention include at least memory, and further, may also include disk read bandwidth, disk write bandwidth, and network bandwidth. It should be noted that multiple storage nodes 132 can communicate with each other.
  • multiple storage nodes 132 can form one or more shared resource pools.
  • Figure 1a shows two shared resource pools.
  • the shared resources of each shared resource pool are shared by multiple services.
  • the services provided by different shared resource pools can be the same, partially the same, or completely different.
  • the specific needs need to be determined in combination with actual needs.
  • the embodiment of the present invention does not make specific limitations on this.
  • resource requests can forward resource requests between multiple shared resource pools.
  • multiple storage nodes 132 in a shared resource pool can communicate with each other.
  • storage nodes 132 in different shared resource pools can also communicate with each other.
  • the shared resource pool 1 can be composed of multiple storage nodes 132.
  • the processor A1 of the storage node 132 can receive a resource request sent by the service node 131. If the resource request needs to write data, the processor A1 can temporarily save the data to be written in the resource request in the memory B1. When the total amount of data in the memory B1 reaches a certain threshold, the processor A1 sends the data stored in the memory B1 to the hard disk C1 for persistent storage. If the resource request is a read request, the processor A1 can read the data to be read in the resource request from the hard disk C1 and temporarily save it in the memory B1, and then send it to the service node 131 through the network card D1.
  • the processor A1 is also used for calculation or processing, such as metadata management, deduplication, data compression, data verification, virtualized storage space, and address conversion.
  • the shared resource pool 2 may be composed of multiple storage nodes 132 and several control nodes 133, and FIG. 1a shows multiple control nodes 133.
  • the control node 133 has at least resources such as a processor A2, a memory B2, and a network card D2.
  • the processor A2 of the control node 133 can receive a resource request sent by the service node 131, if the resource request needs to write data, the processor A2 can temporarily save the data to be written in the resource request in the memory B2.
  • the processor A2 sends the data stored in the memory B2 to the storage node 132 through the network card D2 for persistent storage.
  • the processor A2 can temporarily save the resource request in the memory B2, and then send it to the storage node 132 through the network card D2.
  • the processor A2 is also used for calculation or processing, such as metadata management, deduplication, data compression, data verification, virtualized storage space, and address conversion.
  • the processor A1 of the storage node 132 is used to write data to the hard disk C1 or read data from the hard disk C1 according to the read/write data request sent by the control node 133.
  • the memory B1 of the storage node 132 is used to temporarily store data to be written to the hard disk C1, or read data from the hard disk C1 to be sent to the control node 133.
  • the processor A1, the memory B1, and the network card D1 can be integrated together as an intelligent network card.
  • the control node 133 and the storage node 132 have a subordinate relationship, and resource requests need to be forwarded between the control nodes 133.
  • the control nodes 133 can communicate with each other.
  • the control node 133 and the storage node 132 have no subordinate relationship, and any control node 133 can access any storage node 132 in the shared resource pool 2.
  • multiple storage nodes 132 can provide a unified entrance, and all resource requests from the outside need to pass through this entrance.
  • the entrance is the engine 134.
  • the engine 134 is used to send the resource request of the service node 132 to the storage node.
  • the service node 131 can issue a resource request to the engine 134, and the engine 134 sends the resource request to the storage node 133.
  • the engine 134 determines that the resource request needs to write data in the storage node 132
  • the engine 134 needs to divide the data in the resource request into multiple parts, obtain multiple resource requests and send them to the corresponding storage node 132, thereby realizing data storage.
  • the engine 134 needs to divide the resource request into multiple resource requests and send them to the corresponding storage node 132, thereby realizing data reading.
  • the embodiment of the present invention considers the resource usage of the shared resources by the service corresponding to the request, controls the resource occupancy of the request within a set range, and when there are surplus resources, fully utilizes the surplus storage resources to ensure service quality.
  • the embodiment of the present invention provides a shared resource allocation method. It is understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. For example, the shared resource allocation system shown in FIG. 1a.
  • the shared resource allocation method provided by the embodiment of the present invention is introduced below in conjunction with the shared resource allocation system shown in FIG. 1a.
  • shared resources are shared by multiple services, and each of the multiple services is configured with a resource upper limit and a resource upper limit.
  • the sum of the resource lower limits configured by the multiple services can be equal to the total resource amount of the shared resource.
  • the resource upper limit value configured by each of the multiple services can be equal to the total amount of resources of the shared resources, and of course it can also be appropriately smaller than the total amount of resources of the shared resources.
  • the resource upper limit value of the service can include the memory upper limit value, the disk read bandwidth upper limit value, and the disk write bandwidth upper limit value.
  • the resource lower limit value of the service is similar and will not be repeated. It should be noted that for memory, in order to reduce the impact between different services, the sum of the memory lower limits configured by each of the multiple services can be equal to the total amount of content of the shared resources, and of course it can also be appropriately smaller than the total amount of content of the shared resources. In order to ensure the utilization of resources, the memory upper limit value configured by each of the multiple services can be equal to the total amount of memory of the shared resources, and of course it can also be appropriately smaller than the total amount of content of the shared resources.
  • the disk write bandwidth is similar to the disk read bandwidth, and will not be repeated.
  • the shared resource allocation method provided in the embodiment of the present invention can be applied to the storage node 132 of the shared resource pool, and can also be applied to the control node 133 of the shared resource pool.
  • the shared resource can be provided by one storage node, and the shared resource allocation method provided in the embodiment of the present invention is executed by each storage node 132 to achieve the allocation of local shared resources;
  • the shared resource can be provided by multiple storage nodes and managed by the control node 133, and the shared resource allocation method provided in the embodiment of the present invention can be executed by the control node 133 to achieve the allocation of the overall shared resources.
  • FIG3 is a flow chart of a shared resource allocation method provided by an embodiment of the present invention. As shown in FIG3, the shared resource allocation method includes:
  • Step 301 The service node 131 sends a resource request to the storage node 132.
  • the service node 131 may determine the storage node 132 to which the resource node needs to be sent, and send a resource request to the determined storage node 132.
  • the resource request may be a request to write data or a request to read data.
  • Step 302 The storage node 132 determines whether there are any remaining resources available for resource requests in the shared resources managed by itself. If yes, execute step 303 .
  • the storage node 132 can determine the probability that its shared resources can be used P NodeResourec (x).
  • P NodeResource (x) is calculated by the following formula (1):
  • This formula indicates that when there are remaining resources in the storage node 132 , the probability that the remaining resources of the storage node 132 can be used is 1, and when there are no remaining resources in the storage node 132 , the probability that the remaining resources of the storage node 132 can be used is 0.
  • resource requests for writing data two resources are mainly used, one is memory and the other is disk read bandwidth; for resource requests for reading data, two resources are mainly used, one is memory and the other is disk read bandwidth.
  • Step 303 The storage node 132 determines a first probability based on the resource usage of the shared resources managed by the first service corresponding to the resource request.
  • the first probability indicates the possibility of the resource request obtaining resources.
  • the resource usage of the shared resources of the storage node 132 by the first service corresponding to the resource request is considered, and the possibility of the resource request obtaining resources is analyzed to ensure resource utilization as much as possible.
  • resource usage here is the current resource usage.
  • resource usage includes memory usage and disk read bandwidth usage (for the sake of ease of description and distinction, it can be called disk read bandwidth usage), and disk write bandwidth usage (for the sake of ease of description and distinction, it can be called disk write bandwidth usage).
  • resource usage mainly focuses on memory usage and disk read bandwidth usage (for the sake of ease of description and distinction, it can be called disk read bandwidth usage);
  • resource usage mainly focuses on memory usage and disk write bandwidth usage (for the sake of ease of description and distinction, it can be called disk write bandwidth usage).
  • step 303 specifically includes the following steps:
  • Step 3031 The storage node 132 obtains the resource upper limit value and resource lower limit value of the first service relative to the shared resources managed by itself.
  • the resource upper limit value of the first service may include a memory upper limit value, a disk read bandwidth upper limit value, and a disk write bandwidth upper limit value.
  • the first service can be divided into multiple request types, and the multiple request types are respectively configured with resource upper limits and resource lower limits.
  • the resource upper limits include memory upper limits, disk read bandwidth upper limits, and disk write bandwidth upper limits.
  • the resource lower limits include memory lower limits, disk read bandwidth lower limits, and disk write bandwidth lower limits.
  • the sum of the memory lower limits configured for each of the multiple request types can be equal to the memory lower limit configured for the shared resource of the storage node 132 by the first service, or can be appropriately smaller.
  • the memory upper limit configured for each of the multiple request types can be equal to the memory lower limit configured for the shared resource of the storage node 132 by the first service.
  • the memory upper limit of the memory configuration in the resource can of course be appropriately smaller than that.
  • the disk write bandwidth and disk read bandwidth are similar and will not be described in detail.
  • multiple request classification parameters may be set, and request classification may be performed based on the multiple request classification parameters.
  • these request classification parameters may be read/write type, priority, resource consumption, etc.
  • the priority indicates the level of priority processing of the request, for example, it may be divided into level 1 to level 3, and the priority of level 1 to level 3 decreases in sequence.
  • the multiple request types are divided into multiple write request types and multiple read request types.
  • the disk read bandwidth lower limit value and disk read bandwidth upper limit value configured for each write request type can be empty. Based on such settings, resource requests under the write request type do not need to consider the disk read bandwidth.
  • the disk write bandwidth lower limit and disk read bandwidth upper limit configured for each write request type can be empty. Based on such settings, resource requests under the read request type do not need to consider the disk write bandwidth.
  • each of the multiple request types configured by the first service corresponds to parameter information
  • the parameter information includes the range of parameter values of each of the multiple request classification parameters.
  • the request type of the resource request can be determined specifically in the following manner:
  • the request classification parameter may be a read/write type, a priority, a resource consumption, etc.
  • the resource consumption may be estimated by the storage node 132.
  • the storage node 132 may store the resource consumption of historical resource requests (referred to as historical resource requests for ease of description and distinction), select a request similar to the resource request from the historical resource requests, and use the resource consumption of the similar request as the resource consumption of the resource request.
  • Step 3032 The storage node 132 determines a first probability based on the resource usage, resource upper limit, and resource lower limit of the shared resources managed by the first service.
  • the first probability includes memory usage probability, read bandwidth usage probability, and write bandwidth usage probability.
  • the memory usage probability P service (x) is calculated according to the following formula (2):
  • x represents the memory usage of the shared resources of the storage node 132 by the first service
  • serconfig std represents the memory lower limit value in the resource lower limit value
  • serconfig max represents the memory upper limit value in the resource upper limit value
  • the first probability P service (x) 1 that the resource request can obtain the memory.
  • the memory usage of the shared resource of the storage node 132 by the first service is greater than the memory lower limit (serconfig std ) and less than the memory upper limit (serconfig max )
  • the memory usage of the shared resource of the storage node 132 by the first service is inversely proportional to the first probability P service (x).
  • the first probability P service (x) 0 that the resource request can obtain the memory.
  • the read bandwidth usage probability and write bandwidth usage probability are similar and will not be described in detail.
  • the memory in the above description can be replaced with disk read bandwidth and disk write bandwidth.
  • Step 304 The storage node 132 determines, according to the first probability, whether to allocate resources from the shared resources managed by itself to the first service in response to the resource request; if yes, execute step 305 .
  • Implementation method 1 When the memory usage probability of the resource request is greater than or equal to a preset value, it is considered that the memory can be successfully acquired; otherwise, the memory cannot be successfully acquired.
  • Implementation method 2 the storage node 132 may randomly generate a probability value based on the memory usage of the shared resources managed by itself. For example, the storage node 132 may randomly generate a probability value based on the memory usage of the shared resources managed by itself at different times, by counting the number of times the first service can be allocated memory under the current memory usage in the historical period, the execution results of the resource request, etc. Subsequently, if the probability value is greater than or equal to the memory usage probability of the resource request, it is considered that the memory is successfully acquired, otherwise it is considered that the memory cannot be successfully acquired.
  • Step 305 The storage node 132 allocates resources from the shared resources managed by itself to the first service in response to the resource request, and executes the resource request.
  • the storage node 132 itself stores multiple tokens (indicating the authority to use certain resources), then obtains the token corresponding to the resource request, uses the resources indicated by the token to execute the resource request, and returns the token after the resource request is executed.
  • the token indicates the permission to use the memory and disk read bandwidth; for resource requests to write data or modify stored data, the token indicates the permission to use the memory and disk write bandwidth.
  • control node 133 stores a plurality of tokens
  • the storage node 132 may request the token from the control node 133 , so that the storage node 132 may process the resource request using its own resources.
  • the storage node 132 may receive multiple resource requests at the same time. According to a feasible implementation, the storage node 132 may determine the respective priorities of the multiple resource requests to which resources need to be allocated, and execute the multiple resource requests according to the priorities.
  • the priority in the resource request can be used as the corresponding priority. If the resource request does not carry a priority, the preset priority corresponding to the service in the resource request can be used as the corresponding priority.
  • the storage node 132 may sequentially execute resource conditions, determine resource requests to which resources should be allocated first based on priorities, and execute the resource requests.
  • the storage node 132 can allocate resources in parallel, and can determine multiple resource requests to which resources are allocated first based on the priority, and execute the multiple resource requests in parallel. In this example, the storage node 132 can determine the number of resource requests to which resources can be allocated based on the remaining resources of the shared resources managed by itself and the priority of the resource request, and then select the resource request that is adapted to the number based on the priority, and allocate resources to execute the resource request.
  • the storage node considers the resource usage of the shared resources managed by itself by the service corresponding to the request, controls the resource occupancy of the request within the set range, and when there are surplus resources, can make full use of the remaining storage resources to ensure service quality.
  • a plurality of storage nodes 132 form two shared resource pools.
  • Example A is described below. In Example A, it is assumed that the resource request is a request to read data, which is referred to as a read request for ease of description and distinction.
  • the resource request in the shared resource pool may be forwarded between the storage nodes 132 .
  • the service node 131 generates a read request, determines the storage node 132 where the data to be read by the read request is located, and assumes that it is storage node A, and then sends the read request to storage node A.
  • the service node 131 may send the read request to any storage node 132, and the resource request is forwarded between the storage nodes 132, so that the resource request is sent to the storage node 132 where the data to be read by the read request is located.
  • storage node A determines whether there is any surplus memory and disk read bandwidth used by the read request. If so, it is necessary to determine the current memory usage and disk read bandwidth usage, as well as the request type of the read request, and based on the configuration of the request type, determine the memory upper limit, memory lower limit, disk read bandwidth upper limit, and disk read bandwidth lower limit.
  • storage node A substitutes the memory usage, the memory upper limit value and the memory lower limit value into the above formula (2) to obtain the memory usage probability; and substitutes the disk read bandwidth usage, the disk read bandwidth upper limit value and the disk read bandwidth lower limit value into the above formula (2) to obtain the disk read bandwidth usage probability.
  • storage node A determines whether it can obtain memory based on the memory usage probability, and determines whether it can obtain disk read bandwidth based on the disk read bandwidth usage probability.
  • memory and disk read bandwidth can be obtained, it executes the read request, allocates memory and disk read bandwidth resources to the read request, and reads data from the disk.
  • the method shown in FIG. 3 can also be applied to the system architecture shown in FIG. 1b.
  • the service node 131 in the above step 301 needs to send a resource request to the storage node 132 through the engine 134.
  • the following provides a specific example B in combination with FIG. 1b and the method described in the above embodiment.
  • the resource request is a request to read data, which is referred to as a read request for ease of description and distinction.
  • multiple storage nodes 132 form two shared resource pools.
  • the service node 131 generates a read request and sends the read request to the engine 134.
  • the engine 134 determines the storage node 132 where the data to be read by the read request is located. Assuming it is storage node A, the read request is sent to storage node A.
  • storage node A processes the read request according to the processing method of storage node A in the above specific example A.
  • the shared resource allocation method applied in the application scenario shown in FIG. 2b is described. It is worth noting that if applied to the control node 133, Then the control node 133 can write data into any storage node 132 it manages. In addition, different storage nodes 132 communicate with each other, and resource requests can be forwarded between multiple storage nodes 132. In actual applications, when different control nodes 133 manage different storage nodes 133, the control node 133 can execute the shared resource allocation method provided by the embodiment of the present invention.
  • FIG5 is a flow chart of a shared resource allocation method provided in an embodiment of the present invention.
  • the shared resource allocation method can be applied to a resource request for writing data.
  • the shared resource allocation method includes:
  • Step 501 The service node 131 sends a resource request to the control node 133.
  • Step 502 The control node 133 determines whether there are any remaining resources available for resource requests in the shared resources managed by itself. If yes, step 503 is executed.
  • Step 503 The control node 133 determines a first probability based on the resource usage of the shared resources managed by the first service corresponding to the resource request.
  • Step 504 The control node 133 determines whether to allocate resources from the shared resources managed by itself to the first service in response to the resource request according to the first probability; if yes, execute step 505 .
  • the resource request may be returned to the service node 132, and the service node 132 may reselect a control node 133 to send the resource request, or the resource request may be sent to another control node 133 for processing.
  • Step 505 The control node 133 allocates resources from the shared resources managed by itself to the first service in response to the resource request, and determines the storage node 132 that executes the resource request.
  • the resource request is a request to write data.
  • the control node 133 can consider the remaining disk capacity of the storage node 132 and the resource request being processed, and send the resource request to the storage node 132 with sufficient disk capacity and light load while considering load balancing.
  • Step 506 The control node 133 sends a resource request to the storage node 132 that executes the resource request.
  • the storage node 132 may directly execute the resource request, or process the resource request in the manner of steps 302 to 305 . If the resource request cannot be processed, the resource request may be sent to the control node 133 or directly forwarded to other storage nodes 132 .
  • control node 133 can send the resource request to the storage node 132.
  • the storage node 132 executes the resource request, if it finds that it does not have data that needs to be read, it can forward the resource request to the storage node 132 that has the data that needs to be read.
  • the resource request is a request to write data, which is referred to as a write request for ease of description and distinction.
  • multiple storage nodes 132 form two shared resource pools.
  • the service node 131 generates a write request, determines the control node 133 to which the write request needs to be sent, assuming it is the control node A, and sends the write request to the control node A. Assume that the control node 133 can access N storage nodes 132 .
  • control node A determines whether there is any surplus memory and disk read bandwidth used by write requests in the N storage nodes 132. If so, it is necessary to determine the current memory usage and disk read bandwidth usage of the N storage nodes 132, as well as the request type of the write request, and based on the configuration of the request type, determine the memory upper limit value, memory lower limit value, disk read bandwidth upper limit value, and disk read bandwidth lower limit value for the N storage nodes 132.
  • control node A substitutes the memory usage, the memory upper limit value and the memory lower limit value into the above formula (2) to obtain the memory usage probability; and substitutes the disk read bandwidth usage, the disk read bandwidth upper limit value and the disk read bandwidth lower limit value into the above formula (2) to obtain the disk read bandwidth usage probability.
  • control node A determines whether memory can be obtained based on the memory usage probability, and determines whether disk read bandwidth can be obtained based on the disk read bandwidth usage probability.
  • a write request is sent to storage node 132 for execution to write data.
  • the method shown in FIG. 5 can also be applied to the system architecture shown in FIG. 1b .
  • the service node 131 in step 501 needs to send a resource request to the engine 134 , and steps 502 to 506 are executed by the engine 134 .
  • the present invention also provides a shared resource allocation device, as shown in FIG6 , comprising:
  • the receiving module 601 is configured to receive a resource request sent by a first service node among the multiple service nodes;
  • a probability determination module 602 configured to determine a first probability based on a resource usage of the shared resource by the first service corresponding to the resource request;
  • the allocation module 603 is configured to determine, according to the first probability, whether to allocate resources in the shared resources to the first service in response to the resource request.
  • the receiving module 601, the probability determination module 602 and the allocation module 603 can all be implemented by software, or can be implemented by hardware.
  • the implementation of the receiving module 601 is introduced below by taking the receiving module 601 as an example.
  • the implementation of the probability determination module 602 and the allocation module 603 can refer to the implementation of the receiving module 601.
  • the receiving module 601 may include code running on a computing instance.
  • the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more.
  • the receiving module 601 may include code running on multiple hosts/virtual machines/containers. It should be noted that the multiple hosts/virtual machines/containers used to run the code may be distributed in the same region (region) or in different regions.
  • the multiple hosts/virtual machines/containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.
  • VPC virtual private cloud
  • multiple hosts/virtual machines/containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs.
  • VPC virtual private cloud
  • a VPC is set up in a region.
  • a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
  • the receiving module 601 may include at least one computing device, such as a server, etc.
  • the receiving module 601 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • the multiple computing devices included in the receiving module 601 can be distributed in the same region or in different regions.
  • the multiple computing devices included in the receiving module 601 can be distributed in the same AZ or in different AZs.
  • the multiple computing devices included in the receiving module 601 can be distributed in the same VPC or in multiple VPCs.
  • the multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
  • the receiving module 601 can be used to execute any step in the shared resource allocation method
  • the probability determination module 602 can be used to execute any step in the shared resource allocation method
  • the allocation module 603 can be used to execute any step in the shared resource allocation method.
  • the steps that the receiving module 601, the probability determination module 602, and the allocation module 603 are responsible for implementing can be specified as needed.
  • the full functions of the shared resource allocation device are realized by respectively implementing different steps in the shared resource allocation method through the receiving module 601, the probability determination module 602, and the allocation module 603.
  • the present invention also provides a computing device 700.
  • the computing device 700 includes: a bus 702, a processor 704, a memory 706, and a communication interface 708.
  • the processor 704, the memory 706, and the communication interface 708 communicate with each other through the bus 702.
  • the computing device 700 can be a server or a terminal device. It should be understood that the present invention does not limit the number of processors and memories in the computing device 700.
  • the bus 702 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • the bus may be divided into an address bus, a data bus, a control bus, etc.
  • FIG. 3 is represented by only one line, but does not mean that there is only one bus or one type of bus.
  • the bus 104 may include a path for transmitting information between various components of the computing device 700 (e.g., the memory 706, the processor 704, the communication interface 708).
  • Processor 704 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the memory 706 may include a volatile memory, such as a random access memory (RAM).
  • the processor 704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
  • ROM read-only memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory 706 stores executable program codes, and the processor 704 executes the executable program codes to respectively implement the functions of the aforementioned receiving module 601, probability determination module 602 and allocation module 603, thereby implementing the shared resource allocation method. That is, the memory 706 stores instructions for executing the shared resource allocation method.
  • the communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.
  • a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks.
  • An embodiment of the present invention further provides a computing device cluster.
  • the computing device cluster includes at least one computing device.
  • the computing device may be a server, such as a central server, an edge server, or a local server in a local data center.
  • the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
  • the computing device cluster includes at least one computing device 700.
  • the same instructions for executing the shared resource allocation method may be stored in the memory 706 in one or more computing devices 700 in the computing device cluster. That is, the instructions stored in the memory 706 in different computing devices 700 may implement all functions in the receiving module 601, the probability determination module 602 and the allocation module 603.
  • one or more computing devices 700 in the computing device cluster can be virtualized into multiple storage nodes 132.
  • each storage node 132 executes the shared resource allocation method provided by the embodiment of the present invention, each storage node 132 stores instructions for executing the shared resource allocation method.
  • one or more computing devices 700 in the computing device cluster can be virtualized into several control nodes 133, which are used to manage multiple storage nodes 132.
  • each control node 133 stores instructions for executing the shared resource allocation method.
  • several control nodes 133 in the computing device cluster can also store partial instructions for executing the shared resource allocation method.
  • a combination of one or more computing devices 700 can jointly execute instructions for executing the shared resource allocation method. That is, the instructions stored in the memory 706 in different computing devices 700 can implement the functions of one or more modules in the receiving module 601, the probability determination module 602 and the allocation module 603.
  • one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network, etc.
  • the network is connected via a communication interface in each computing device.
  • the embodiment of the present invention also provides a computer program product including instructions.
  • the computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium.
  • the at least one computing device executes the shared resource allocation method.
  • the embodiment of the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media.
  • the available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).
  • the computer-readable storage medium includes instructions that instruct the computing device to execute the shared resource allocation method.
  • the method steps in the embodiments of the present invention can be implemented by hardware or by a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be a component of the processor.
  • the processor and the storage medium can be located in an ASIC.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
  • the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a server, data center, etc. that includes one or more available media integrated.
  • Data storage device may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

公开了一种共享资源分配方法、装置及计算设备集群。在方法实施例中,共享资源由多个服务节点提供的多个服务共享,方法包括:接收多个服务节点中的第一服务节点发送的资源请求;基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率;根据第一概率确定是否响应于资源请求对第一服务分配共享资源中的资源。由此,通过本发明实施例提供的技术方案,考虑请求对应的服务对共享资源的资源使用量,当资源有剩余时,可以充分利用剩余资源,确保服务质量。

Description

共享资源分配方法、装置及计算设备集群
本发明要求于2022年11月29日提交中国国家知识产权局、申请号为202211505602.3、申请名称为“共享资源分配方法、装置及计算设备集群”的中国专利申请的优先权,其全部内容通过引用结合在本发明中。
技术领域
本发明涉及通信技术领域,尤其涉及一种共享资源分配方法、装置及计算设备集群。
背景技术
现有云计算系统中,通过资源池化可以提高资源利用率,显著降低成本,提高系统弹性。具体地,多个服务可以共享一个资源池来提高资源利用率。
目前,提前设置好可以使用共享的资源池的多个服务各自的资源上限。在实际使用时,通过设定的固定速率向桶中放入令牌(指示了特定的资源)。当服务下的请求到来时,会基于该请求对应的服务的资源上限尝试从桶中获取令牌,如果能获取到令牌则进行处理,如果没有令牌就进行排队等待,直到有令牌为止。
但是,通过上述方案虽然可以控制服务能够获得的资源不超过上限,但是当资源上限较低时,虽然可以保障不同服务之间不存在干扰,但是可能会存在较多的剩余资源无法利用的情况,导致资源利用率较低,因此上述方案可能存在资源利用率较低的问题。
公开于该背景技术部分的信息仅仅旨在增加对本发明的总体背景的理解,而不应当被视为承认或以任何形式暗示该信息构成已为本领域一般技术人员所公知的现有技术。
发明内容
本发明实施例提供了一种共享资源分配方法、装置及计算设备集群,考虑请求对应的服务对共享资源的资源使用量,当资源有剩余时,可以充分利用剩余资源,确保服务质量。
第一方面,本发明实施例提供了一种共享资源分配方法,共享资源由多个服务节点提供的多个服务共享,方法包括:接收多个服务节点中的第一服务节点发送的资源请求;基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率;根据第一概率确定是否响应于资源请求对第一服务分配共享资源中的资源。
本方案中,考虑请求对应的服务对共享资源的资源使用量,当资源有剩余时,可以充分利用剩余资源,确保服务质量。
在一种可能的实现方式中,基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率,包括:获取第一服务相对于共享资源的资源上限值、资源下限值;基于第一服务对共享资源的资源使用量、资源上限值、资源下限值,确定第一概率。
本方案中,考虑请求对应的服务的资源上限值和资源下限值,可以更为准确的确定资源是否可以获取的概率。
在一个例子中,当资源使用量小于资源下限值时,第一概率为第一数值。
示例地,第一数值可以为1,表示一定可以获取到资源。
在一个例子中,当资源使用量大于资源上限值时,第一概率为第二数值。
示例地,第一数值可以为0,表示一定不可以获取到资源。
在一个例子中,当资源使用量位于资源下限值和资源上限值之间时,第一概率和资源使用量之间为反比关系。
示例地,第一数值可以为大于0小于1,表示获取到资源的可能性。
在一种可能的实现方式中,获取第一服务相对于共享资源的资源上限值、资源下限值,包括:从资源请求对应的第一服务配置的多个请求类型中,确定资源请求对应的第一请求类型;其中,多个请求类型各自配置有相对于共享资源的第一资源上限值和第一资源下限值;将第一请求类型配置的第一资源上限值和第二资源下限值,作为资源请求对应的第一服务相对于共享资源的资源上限值、 资源下限值。
本方案中,可以对服务的请求类型进行细分,从而可以较为准确的确定出资源上限值和资源下限值。
在一种可能的实现方式中,第一服务配置有针对共享资源的第二资源下限值和第二资源上限值,多个请求类型各自配置的第一资源上限值之和小于等于第二资源下限值,多个请求类型各自配置的第一资源上限值小于等于第二资源上限值。
本方案中,多个服务各自配置的资源下限值之和可以等于共享资源的资源总量,可以降低不同服务之间的影响,多个服务各自配置的资源上限值可以等于共享资源的资源总量,可以确保资源的利用率。
在一种可能的实现方式中,基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率,包括:当共享资源中资源请求需要使用的资源有剩余时,基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率。
本方案中,在资源存在剩余时,可以尽可能的利用剩余资源,确保资源利用率。
在一种可能的实现方式中,共享资源包括内存、磁盘读带宽、磁盘写带宽。
在一种可能的实现方式中,共享资源由一个存储节点提供。
在实际应用中,上述方法由提供共享资源的存储节点执行。
在一种可能的实现方式中,共享资源由多个存储节点提供。
在实际应用中,上述方法由提供共享资源的多个存储节点的控制节点执行。
第二方面,本发明实施例提供了一种共享资源分配装置,包括:接收模块,用于接收多个服务节点中的第一服务节点发送的资源请求;概率确定模块,用于基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率;响应判断模块,用于根据第一概率确定是否响应于资源请求对第一服务分配共享资源中的资源。
本方案的有益效果参见上文,不再赘述。
在一种可能的实现方式中,概率确定模块,包括:限值获取单元和概率确定单元;其中,
限值获取单元,用于获取第一服务相对于共享资源的资源上限值、资源下限值;
概率确定单元,用于基于第一服务对共享资源的资源使用量、资源上限值、资源下限值,确定第一概率。
本方案的有益效果参见上文,不再赘述。
在一个例子中,当资源使用量小于资源下限值时,第一概率为第一数值。
在一个例子中,当资源使用量大于资源上限值时,第一概率为第二数值。
在一个例子中,当资源使用量位于资源下限值和资源上限值之间时,第一概率和资源使用量之间为反比关系。
在一个例子中,限值获取单元,包括:类型确定子单元和限值获取子单元;其中,
类型确定子单元,用于从资源请求对应的第一服务配置的多个请求类型中,确定资源请求对应的第一请求类型;其中,多个请求类型各自配置有相对于共享资源的第一资源上限值和第一资源下限值;
限值获取子单元,用于将第一请求类型配置的第一资源上限值和第二资源下限值,作为资源请求对应的第一服务相对于共享资源的资源上限值、资源下限值。
在一种可能的实现方式中,第一服务配置有针对共享资源的第二资源下限值和第二资源上限值,多个请求类型各自配置的第一资源上限值之和小于等于第二资源下限值,多个请求类型各自配置的第一资源上限值小于等于第二资源上限值。
本方案的有益效果参见上文,不再赘述。
在一种可能的实现方式中,概率确定模块,用于当共享资源中资源请求需要使用的资源有剩余时,基于资源请求对应的第一服务对共享资源的资源使用量,确定第一概率。
在一种可能的实现方式中,共享资源包括内存、磁盘读带宽、磁盘写带宽。
在一种可能的实现方式中,共享资源由一个存储节点提供。
在一种可能的实现方式中,共享资源由多个存储节点提供。
第三方面,本发明实施例提供了一种共享资源分配系统,该系统可以包括多个服务节点和多个存储节点,所述多个存储节点的每个存储节点用于执行第一方面中所提供的方法。在实际应用中,存储节点包括 存储器和控制器,存储节点的处理器执行存储节点的存储器存储的指令,存储节点执行第一方法提供的方法。
在一种可能的实现方式中,多个存储节点具有控制节点,可以控制节点执行第一方面中所提供的方法。
在实际应用中,控制节点包括存储器和控制器,控制节点的处理器执行控制节点的存储器存储的指令,控制节点执行第一方法提供的方法。
第四方面,本发明实施例提供了一种共享资源分配装置,包括:至少一个存储器,用于存储程序;至少一个处理器,用于执行存储器存储的程序,当存储器存储的程序被执行时,处理器用于执行第一方面中所提供的方法。
在一个例子中,共享资源由一个存储节点提供,共享资源分配装置设置在提供共享资源的存储节点上。
在一个例子中,共享资源由多个存储节点提供,共享资源分配装置设置在提供共享资源的多个存储节点的控制节点上。
第五方面,本发明实施例提供了一种共享资源分配装置,其特征在于,装置运行计算机程序指令,以执行第一方面中所提供的方法。
在一个例子中,该装置可以包括处理器,该处理器可以与存储器耦合,读取存储器中的指令并根据该指令执行第一方面中所提供的方法。其中,该存储器可以集成在芯片或处理器中,也可以独立于芯片或处理器之外。
在一个例子中,共享资源由一个存储节点提供,共享资源分配装置设置在提供共享资源的存储节点上。
在一个例子中,共享资源由多个存储节点提供,共享资源分配装置设置在提供共享资源的多个存储节点的控制节点上。
第六方面,本发明实施例提供了一种计算设备集群,包括:至少一个计算设备,每个计算设备包括处理器和存储器;至少一个计算设备的处理器用于执行至少一个计算设备的存储器中存储的指令,以使得计算设备集群执行第一方面中所提供的方法。
第七方面,本发明实施例提供了一种计算设备集群,该集群运行计算机程序指令,以执行第一方面中所提供的方法。示例性的,该集群包括至少一个计算设备。
第八方面,本发明实施例提供了一种计算机存储介质,计算机存储介质中存储有指令,当指令在计算机上运行时,使得计算机执行第一方面中所提供的方法。
第九方面,本发明实施例提供了一种包含指令的计算机程序产品,当指令在计算机上运行时,使得计算机执行第一方面中所提供的方法。
附图说明
图1a是本发明实施例提供的一种共享资源分配系统的系统架构图一;
图1b是本发明实施例提供的一种共享资源分配系统的系统架构图二;
图2a是本发明实施例提供的共享资源分配的场景示意图一;
图2b是本发明实施例提供的共享资源分配的场景示意图二;
图3是本发明实施例提供的共享资源分配方法的流程示意图一;
图4是图3中步骤303的流程示意图;
图5是本发明实施例提供的共享资源分配方法的流程示意图二;
图6是本发明实施例提供的共享资源分配装置的结构示意图;
图7是本发明实施例提供的一种计算设备的结构示意图;
图8是本发明实施例提供的一种计算设备集群的结构示意图。
具体实施方式
为了使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图,对本发明实施例中的技术方案进行描述。
在本发明实施例的描述中,“示例性的”、“例如”或者“举例来说”等词用于表示作例子、例证或说明。本发明实施例中被描述为“示例性的”、“例如”或者“举例来说”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、“例如”或者“举例来说”等词旨在以具体方式呈现相关概念。
在本发明实施例的描述中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,单独存在B,同时存在A和B这三种情况。另外,除非另有说明,术语“多个”的含义是指两个或两个以上。例如,多个系统是指两个或两个以上的系统,多个终端是指两个或两个以上的终端。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
图1a示出了本发明实施例所应用的一种共享资源分配系统的架构示例图。应理解,本发明实施例适用的共享资源分配系统还可以适用图1a示出的共享资源分配系统之外的其他共享资源分配系统,本发明实施例对此不做限定。如图1a所示,共享资源分配系统包括终端设备110、云管理平台120、云设备集群130。
其中,终端设备110可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。本发明实施例中涉及的终端设备101的示例性实施例包括但不限于搭载iOS、android、Windows、鸿蒙系统(Harmony OS)或者其他操作系统的电子设备。本发明实施例对电子设备的类型不做具体限定。
其中,云管理平台120可以是单独的电子设备,也可以是集成于电子设备上的装置,本发明实施例并不限定云管理平台的具体部署方式和部署位置。
这里,终端设备110通过网络访问云管理平台120。其中,网络可以为有线网络或无线网络。示例地,有线网络可以为电缆网络、光纤网络、数字数据网(Digital Data Network,DDN)等,无线网络可以为电信网络、内部网络、互联网、局域网络(Local Area Network,LAN)、广域网络(Wide Area Network,WAN)、无线局域网络(Wireless Local Area Network,WLAN)、城域网(Metropolitan Area Network,MAN)、公共交换电话网络(Public Service Telephone Network,PSTN)、蓝牙网络、紫蜂网络(ZigBee)、移动电话(Global System for Mobile Communications,GSM)、CDMA(Code Division Multiple Access)网络、CPRS(GeneralPacketRadioService)网络等或其任意组合。可以理解的是,网络可使用任何已知的网络通信协议来实现不同客户端层和网关之间的通信,上述网络通信协议可以是各种有线或无线通信协议,诸如以太网、通用串行总线(universal serial bus,USB)、火线(firewire)、全球移动通讯系统(global system for mobile communications,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址接入(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA)、长期演进(long term evolution,LTE)、新空口(new radio,NR)、蓝牙(bluetooth)、无线保真(wireless fidelity,Wi-Fi)等通信协议。
其中,设备集群130由多个电子设备组成的集群,这些电子设备为硬件设备,比如,物理服务器。设备集群130可以包括多个服务节点131和多个存储节点132。
其中,云管理与设备集群120之间通过网络通信,比如,内部网络;设备集群120中的电子设备之间通过网络相同通信,比如,互连网络。
可选地,服务节点131可以为硬件设备,也可以植入虚拟化环境中,例如,本发明实施例中涉及的服务节点可以是在包括一个或多个其他虚拟机的硬件服务器上执行的虚拟机。值得注意的是,服务节点131用于提供云服务,其可以为一种可以与其他的电子设备建立通信连接、且能为其他的电子设备提供计算功能和/或存储功能的服务器或者是超级终端。
值得注意的是,在实际应用中,终端设备110通过云管理平台120控制服务节点131提供各种各样的云服务,比如,对象存储、块存储、文件存储、数据库等服务。
举例来说,终端设备110可以访问云管理平台120,在云管理平台120上购买云服务,从而使用云服务,在使用云服务的过程中,服务节点131可以生成资源请求,并将资源请求通过控制节点133发送到存储节点132。
示例地,购买的云服务可以为虚拟机,用户可以在虚拟机上安装应用程序并运行,对应的,服务节点131适配的安装该应用程序,进而可以通过应用程序发送资源请求,从而控制服务节点131生成资源请求,并将资源请求发送到存储节点133。
示例地,购买的云服务可以为模型训练服务,则可以配置使用模型训练服务的容器的数目和规格,对应的,云管理平台120可以基于容器的数目和规格分配一个或多个服务节点131提供模型训练服务,这些服务节点131在提供云服务的过程中生成资源请求,并将资源请求发送到存储节点133。
可选地,存储节点132用于存储数据,服务节点131可以通过资源请求从访问所有的存储节点132,从存储节点132中写入数据、读出数据,这里的处理可以为读取、修改和删除。另外,存储节点132为具有数据读取和数据写入能力的硬件设备,或者,植入虚拟化环境中;值得注意的是,存储节点132具有处理器A1、内存B1、磁盘C1、网卡D1等资源,这些资源为多个服务的共享资源。值得注意的是,共享资源为需要竞争的资源,比如内存,磁盘的读带宽(为了便于描述和区别,称为磁盘读带宽)、磁盘的写带宽(为了便于描述和区别,称为磁盘写带宽)、网络带宽等。本发明实施例提供的共享资源包括至少包括内存,进一步地,还可以包括磁盘读带宽、磁盘写带宽、网络带宽。需要指出,多个存储节点132之间可以相互通信。
进一步的,多个存储节点132可以形成一个或者多个共享资源池,图1a示出了2个共享资源池。需要说明的是,每个共享资源池的共享资源由多个服务共享,不同共享资源池所提供的服务可以相同,也可以部分相同,也可以完全不同,具体需要结合实际需求确定,本发明实施例对此不做具体限定。需要说明的是,若共享资源池有多个,则资源请求可以在多个共享资源池之间转发资源请求。可选地,共享资源池中的多个存储节点132之间可以相互通信。可选地,不同共享资源池中的存储节点132之间也可以相互通信。
如图1a所示,共享资源池1可由多个存储节点132组成,对于任一存储节点132,存储节点132的处理器A1可以接收服务节点131发送的资源请求,如该资源请求需要写入数据时,处理器A1可以将资源请求中需要写入的数据暂时保存在内存B1。当内存B1中的数据总量达到一定阈值时,处理器A1将内存B1中存储的数据发送给硬盘C1进行持久化存储。如该资源请求为读请求时,处理器A1可以从硬盘C1中读取出资源请求中需要读取的数据暂时保存在内存B1中,后续通过网卡D1发送给服务节点131。除此之外,处理器A1还用于进行计算或处理,例如元数据管理、重复数据删除、数据压缩、数据校验、虚拟化存储空间以及地址转换等。
如图1a所示,共享资源池2可由多个存储节点132和若干个控制节点133组成,图1a示出了多个控制节点133。控制节点133至少具有处理器A2、内存B2、网卡D2等资源。控制节点133的处理器A2可以接收服务节点131发送的资源请求时,如该资源请求需要写入数据时,处理器A2可以将资源请求中需要写入的数据暂时保存在内存B2,当内存B2中的数据总量达到一定阈值时,处理器A2将内存B2中存储的数据通过网卡D2发送给存储节点132进行持久化存储。如该资源请求为读请求时,处理器A2可以将资源请求暂时保存在内存B2中,后续通过网卡D2发送给存储节点132。除此之外,处理器A2还用于进行计算或处理,例如元数据管理、重复数据删除、数据压缩、数据校验、虚拟化存储空间以及地址转换等。存储节点132的处理器A1用于根据控制节点133发送的读/写数据请求,往硬盘C1中写入数据或者从硬盘C1中读取数据。存储节点132的内存B1用于临时存储将要写入硬盘C1的数据,或者从硬盘C1读取出来将要发送给控制节点133的数据。在一个例子中,处理器A1、内存B1、网卡D1可以集成到一起作为智能网卡。在一个例子中,控制节点133和存储节点132具有隶属关系,则需要在控制节点133之间转发资源请求,这里,控制节点133之间可以相互通信。在一个例子中,控制节点133和存储节点132没有隶属关系,则任一控制节点133均可访问共享资源池2中的任一存储节点132。
如图1b所示,多个存储节点132可以提供一个统一的入口,所有从外部来的资源请求都需要经过这个入口。该入口为引擎134。引擎134用于将服务节点132的资源请求发送到存储节点。在实际应用中,服务节点131可以发出资源请求到引擎134,引擎134将资源请求发送到存储节点133。在一个例子中,引擎134在判断资源请求是需要在存储节点132写入数据时,可选地,引擎134需要将该资源请求中的数据划分成多份,得到多个资源请求发送到对应的存储节点132,从而实现数据存储。若判断资源请求需要读出存储节点132已经存储的数据,可选地,若该资源请求指示了需要读出多个存储节点132中存储的数据,则引擎134需要将该资源请求划分成多个资源请求发送到对应的存储节点132,从而实现数据读取。
本发明实施例考虑请求对应的服务对共享资源的资源使用量,控制请求的资源占用在设定的范围内,并在资源有剩余时,可以充分利用剩余存储资源,确保服务质量。
【方法实施例】
本发明实施例提供了一种共享资源分配方法。可以理解,该方法可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行。比如,图1a示出的共享资源分配系统。下面结合图1a示出的共享资源分配系统对本发明实施例提供的共享资源分配方法进行介绍。
值得注意的是,共享资源由多个服务共享,多个服务各自配置有资源上限值和资源上限值。在一个例子中,为了降低不同服务之间的影响,多个服务各自配置的资源下限值之和可以等于共享资源的资源总量, 当然也可以适当小于共享资源的资源总量。为了确保资源的利用率,多个服务各自配置的资源上限值可以等于共享资源的资源总量,当然也可以适当小于共享资源的资源总量。可选地,服务的资源上限值可以包括内存上限值、磁盘读带宽上限值、磁盘写带宽上限值。服务的资源下限值类同,不再赘述。指的注意的是,对于内存,为了降低不同服务之间的影响,多个服务各自配置的内存下限值之和可以等于共享资源的内容总量,当然也可以适当小于共享资源的内容总量。为了确保资源的利用率,多个服务各自配置的内存上限值可以等于共享资源的内存总量,当然也可以适当小于共享资源的内容总量。磁盘写带宽和磁盘读带宽类同,不再赘述。
本发明实施例提供的共享资源分配方法可以应用在共享资源池的存储节点132上,也可以应用在共享资源池的控制节点133上。如图2a所示,共享资源可以有一个存储节点提供,则本发明实施例提供的共享资源分配方法由每个存储节点132执行,实现局部的共享资源的分配;如图2b所示,共享资源可以由多个存储节点提供,由控制节点133管理,则本发明实施例提供的共享资源分配方法可以由控制节点133执行,实现整体的共享资源的分配。
首先描述应用在图2a所示的应用场景的共享资源分配方法。图3本发明实施例提供了一种共享资源分配方法的流程示意图。如图3所示,该共享资源分配方法包括:
步骤301、服务节点131向存储节点132发送资源请求。
值得注意的是,在实际应用中,服务节点131可以确定资源节点需要发往的存储节点132,向确定的存储节点132发送资源请求。这里,资源请求可以为写入数据的请求,也可以为读出数据的请求。
步骤302、存储节点132判断自身管理的共享资源中资源请求可使用的资源是否存在剩余,如果是,执行步骤303。
在实际应用中,存储节点132的可以确定自身的共享资源可以被使用的概率PNodeResourec(x)。PNodeResource(x)通过如下公式(1)计算:
该公式表示,当存储节点132存在剩余资源时,存储节点132的剩余资源可以被使用的概率为1,当存储节点132不存在剩余资源时,存储节点132的剩余资源可以被使用的概率为0。
当PNodeResource(x)=1时,说明存储节点132自身的共享资源存在剩余;当PNodeResource(x)=0时,说明存储节点132自身的共享资源不存在剩余。
需要说明的是,在实际应用中,对于写入数据的资源请求,主要使用两种资源,一种是内存,另一种磁盘读带宽;对于读出数据的资源请求,主要使用两种资源,一种是内存,另一种磁盘读带宽。
步骤303、存储节点132基于资源请求对应的第一服务对自身管理的共享资源的资源使用量,确定第一概率。
本方案中,第一概率指示了资源请求获取到资源的可能性,这里,考虑资源请求对应的第一服务对存储节点132的共享资源的资源使用情况,分析资源请求获取到资源的可能性,能够尽可能确保资源利用率。
值得注意的是,这里的资源使用量为当前的资源使用量。这里,资源使用量包括内存的使用量和磁盘读带宽的使用量(为了便于描述和区别,可以称为磁盘读带宽使用量)、磁盘写带宽的使用量(为了便于描述和区别,可以称为磁盘写带宽使用量)。在一些可能的实现方式中,对于读出数据的资源请求,资源使用量主要关注内存的使用量和磁盘的读带宽的使用量(为了便于描述和区别,可以称为磁盘读带宽使用量);对于写入数据或修改已存数据的资源请求,主要使用两种资源,资源使用量主要关注内存使用量和磁盘的写带宽的使用量(为了便于描述和区别,可以称为磁盘写带宽使用量)。
如图4所示,根据一种可行的实现方式,步骤303具体包括如下步骤:
步骤3031、存储节点132获取第一服务相对于自身管理的共享资源的资源上限值和资源下限值。
根据一种可行的实现方式,第一服务的资源上限值可以包括内存上限值、磁盘读带宽上限值、磁盘写带宽上限值。
根据一种可行的实现方式,第一服务可以分为多个请求类型,多个请求类型分别配置资源上限值和资源下限值。其中,资源上限值包括内存上限值、磁盘读带宽上限值、磁盘写带宽上限值。资源下限值包括内存下限值、磁盘读带宽下限值、磁盘写带宽下限值。
值得注意的是,为了降低不同请求类型的请求之间的影响,多个请求类型各自配置的内存下限值之和,可以等于第一服务针对存储节点132的共享资源中的内存配置的内存下限值,当然也可以适当小于。为了确保资源的利用率,多个请求类型各自配置的内存上限值可以等于,第一服务针对存储节点132的共享 资源中的内存配置的内存上限值,当然也可以适当小于。磁盘写带宽、磁盘读带宽类同,不再赘述。
具体地,可以设置多个请求分类参数,基于多个请求分类参数进行请求分类,示例地,这些请求分类参数可以为读写类型、优先级、资源消耗量等。其中,优先级指示了请求优先处理的级别,比如,可以分为第1级至第3级,第1级至第3级的优先级依次递减。具体地,多个请求类型分为多个写请求类型和多个读请求类型。
其中,对于多个写请求类型,每个写请求类型配置的磁盘读带宽下限值、磁盘读带宽上限值可以为空,基于这样的设置可以使得写请求类型下的资源请求无需考虑磁盘读带宽。
对于多个读请求类型,每个写请求类型配置的磁盘写带宽下限值、磁盘读带宽上限值可以为空,基于这样的设置可以使得读请求类型下的资源请求无需考虑磁盘写带宽。。
另外,第一服务配置的多个请求类型各自对应有参数信息,参数信息包括多个请求分类参数各自的参数值的范围。则具体可通过如下方式确定资源请求的请求类型:
确定多个请求分类参数各自针对资源请求的参数值;基于多个请求分类参数的参数值,和多个请求参数类型的参数信息匹配,将匹配的参数信息对应的请求类型确定资源请求的请求类型。
这里,请求分类参数可以为读写类型、优先级、资源消耗量等。其中,资源消耗量可以由存储节点132预估,示例地,存储节点132可以存储历史的资源请求(为了便于描述和区别,称为历史资源请求)的资源消耗量,从历史资源请求中选择和资源请求相似的请求,将相似的请求的资源消耗量作为资源请求的资源消耗量。
步骤3032、存储节点132基于第一服务对自身管理的共享资源的资源使用量、资源上限值、资源下限值,确定第一概率。
这里,第一概率包括内存使用概率、读带宽使用概率、写带宽使用概率。
在一个例子中,内存使用概率Pservice(x)按照下面公式(2)计算:
其中,x表示第一服务对存储节点132的共享资源的内存使用量,serconfigstd表示资源下限值中的内存下限值;serconfigmax表示资源上限值中的内存上限值。
这里,第一服务对存储节点132的共享资源中的内存使用量小于内存下限值(serconfigstd)时,此时,资源请求可以获取到内存的第一概率Pservice(x)=1。
第一服务对存储节点132的共享资源的内存使用量大于内存下限值(serconfigstd)小于内存上限值(serconfigmax)时,第一服务对存储节点132的共享资源中内存的使用量和第一概率Pservice(x)之间为反比关系。
第一服务对存储节点132的共享资源的内存使用量大于内存上限值(serconfigmax)时,此时,资源请求可以获取到内存的第一概率Pservice(x)=0。
读带宽使用概率、写带宽使用概率类同,不再赘述。将上述描述中的内存换成磁盘读带宽、磁盘写带宽即可。
步骤304、存储节点132根据第一概率确定是否响应于资源请求对第一服务分配自身管理的共享资源中的资源,如果是,执行步骤305。
下面对内存是否可以获取进行描述。
根据一种可行的实现方式,当内存使用概率=1时,说明可以成功获取内存;当内存使用概率=0时,说明不可以成功获取内存;当内存使用概率大于0小于1时,示例性地,可以通过如下两种实现方式确定是否可以获取内存。
实现方式1:当资源请求的内存使用概率大于等于预设数值时,则认为可以成功获取内存,否则,不可以成功获取内存。
实现方式2,存储节点132可以基于自身管理的共享资源中内存的使用量,随机生成一个概率数值。示例地,存储节点132可以基于自身管理的共享资源在不同时刻的内存使用量,统计历史时段中针对第一服务在当前的内存使用量下可以分配到内存的次数、资源请求的执行结果等情况,从而随机生成一个概率数值。后续,若该概率数值大于等于资源请求的内存使用概率,则认为成功获取内存,否则认为不可以成功获取内存。
读带宽和写带宽是否可以获取类同,不再赘述。
在实际应用中,对于读出数据的资源请求,当内存和磁盘读带宽均可使用时,认为可以分配共享资源。
对于写入数据的资源请求,当内存和磁盘写带宽均可使用时,认为可以分配共享资源。
步骤305、存储节点132响应于资源请求对第一服务分配自身管理的共享资源中的资源,执行资源请求。
根据一种可行的实现方式,存储节点132自身存储有多个令牌(指示了可以使用一定资源的权限),则获取资源请求对应的令牌,使用令牌指示的资源执行资源请求,在资源请求执行完成后,归还令牌。
这里,对于读出数据的资源请求,令牌指示了内存、磁盘读带宽的使用权限;对于写入数据或修改已存数据的资源请求,令牌指示了内存、磁盘写带宽的使用权限。
根据另一种可行的实现方式,控制节点133存储有多个令牌,存储节点132可以向控制节点133请求令牌,从而使得存储节点132可以利用自身的资源处理资源请求。
在实际应用中,存储节点132在同一时刻可以接收多个资源请求,根据一种可行的实现方式,存储节点132可以确定需要分配资源的多个资源请求各自的优先级,根据优先级执行多个资源请求。
在一个例子中,若资源请求中携带有优先级,则可以将资源请求中的优先级作为其对应的优先级。若资源请求中未携带有优先级,则可以将该资源请求中的服务对应的预先设置的优先级作为其对应的优先级。
在一个例子中,存储节点132可以顺次执行资源情况,则基于优先级,确定出优先分配资源的资源请求,执行资源请求。
在一个例子中,存储节点132可以并行分配资源,则可以基于优先级,确定出优先分配资源的多个资源请求,并行执行多个资源请求。该例子中,存储节点132可以基于自身管理的共享资源的剩余资源,以及,资源请求的优先级,确定可以分配资源的资源请求的数目,之后,基于优先级,选择适配该数目的资源请求,分配资源执行资源请求。
本方案中,存储节点考虑请求对应的服务对自身管理的共享资源的资源使用量,控制请求的资源占用在设定的范围内,并在资源有剩余时,可以充分利用剩余存储资源,确保服务质量。
以下结合图1a和上述实施例描述的方法提供具体示例A和示例B。如图1a所示,多个存储节点132形成2个共享资源池。
下面描述示例A,在示例A中,假设资源请求为读出数据的请求,为了便于描述和区别,称为读请求。共享资源池中的资源请求可以在存储节点132之间转发。
首先,服务节点131生成读请求,确定读请求需要读出的数据所在的存储节点132,假设为存储节点A,则将读请求发送到存储节点A。或者,服务节点131可以将读请求发送到任一存储节点132,资源请求在存储节点132之间转发,从而将资源请求发送到读请求需要读出的数据所在的存储节点132中。
然后,存储节点A判断读请求使用的内存和磁盘读带宽是否存在剩余,如果存在,需要确定当前的内存使用量和磁盘读带宽使用量,以及,确定读请求的请求类型,并基于该请求类型的配置,确定内存上限值、内存下限值、磁盘读带宽上限值、磁盘读带宽下限值。
然后,存储节点A将内存使用量、内存上限值和内存下限值,代入上述公式(2)中,得到内存使用概率;将磁盘读带宽使用量、磁盘读带宽上限值和磁盘读带宽下限值,代入上述公式(2)中,得到磁盘读带宽使用概率。
之后,存储节点A基于内存使用概率判断是否可以获取内存,基于磁盘读带宽使用概率判断是否可以获取磁盘读带宽,在可以获取内存和磁盘读带宽时,执行读请求,为读请求分配内存和磁盘读带宽的资源,从磁盘中读出数据。
上述图3所示的方法除了可以应用在图1a所示的系统架构,还可以应用在图1b所示的系统架构,在应用在图1b所示的系统架构,上述步骤301中的服务节点131需要通过引擎134向存储节点132发送资源请求。以下结合图1b和上述实施例描述的方法提供具体示例B。在该示例中,假设资源请求为读出数据的请求,为了便于描述和区别,称为读请求。如图1b所示,多个存储节点132形成2个共享资源池。
首先,服务节点131生成读请求,将读请求发送到引擎134,引擎134确定读请求需要读出的数据所在的存储节点132,假设为存储节点A,则将读请求发送到存储节点A。
然后,存储节点A按照上述具体示例A中存储节点A的处理方式处理读请求即可。
其次描述应用在图2b所示的应用场景的共享资源分配方法。值得注意的是,若应用到控制节点133, 则控制节点133可以将数据写入其管理的任一存储节点132,另外,不同的存储节点132之间相互通信,资源请求可以在多个存储节点132之间转发。在实际应用,在不同的控制节点133各自管理的存储节点133不同时,可以由控制节点133执行本发明实施例提供的共享资源分配方法。
图5本发明实施例提供了一种共享资源分配方法的流程示意图,该共享资源分配方法可以应用于写入数据的资源请求,如图5所示,该共享资源分配方法包括:
步骤501、服务节点131向控制节点133发送资源请求。
步骤502、控制节点133判断判断自身管理的共享资源中资源请求可使用的资源是否存在剩余,如果是,执行步骤503。
详细内容参见上文对302的描述,区别仅仅在于将共享资源由一个存储节点132提供替换为由控制节点133管理的多个存储节点132提供。
步骤503、控制节点133基于资源请求对应的第一服务对自身管理的共享资源的资源使用量,确定第一概率。
详细内容参见上文对303的描述,区别仅仅在于将共享资源由一个存储节点132提供替换为由控制节点133管理的多个存储节点132提供。
步骤504、控制节点133根据第一概率确定是否响应于资源请求对第一服务分配自身管理的共享资源中的资源,如果是,执行步骤505。
详细内容参见上文对304的描述,区别仅仅在于将共享资源由一个存储节点132提供替换为由控制节点133管理的多个存储节点132提供。
这里,若控制节点133判断不需要响应,则可以将资源请求返回给服务节点132,由服务节点132重新选择控制节点133发送资源请求,或者,可以将资源请求发送到其他的控制节点133处理。
步骤505、控制节点133响应于资源请求对第一服务分配自身管理的共享资源中的资源,确定执行资源请求的存储节点132。
这里,资源请求为写入数据的请求,此时,控制节点133可以考虑存储节点132剩余的磁盘容量以及正在处理的资源请求,在考虑负载均衡的情况下,将资源请求发送到磁盘容量充足、负载较小的存储节点132中。
步骤506、控制节点133向执行资源请求的存储节点132发送资源请求。
存储节点132可以直接执行资源请求,也可以按照前述步骤302至步骤305的方式处理资源请求,如无法处理该资源请求,可以将资源请求发送至控制节点133或者,直接转发到其他的存储节点132。
值得注意的是,在采用图5所示的方法处理读出数据的资源请求时,控制节点133可以将资源请求发送到存储节点132,存储节点132在执行资源请求时,若发现自身不存在需要读出的数据时,可以将该资源请求转发到存在需要读出的数据的存储节点132。
以下结合图1a和上述实施例描述的方法提供具体示例C。在该示例中,假设资源请求为写入数据的请求,为了便于描述和区别,称为写请求。如图1a所示,多个存储节点132形成2个共享资源池。
首先,服务节点131生成写请求,确定需要写请求需要发送到的控制节点133,假设为控制节点A,则将写请求发送到控制节点A。假设控制节点133可以访问N个存储节点132。
然后,控制节点A判断N个存储节点132中写请求使用的内存和磁盘读带宽是否存在剩余,如果存在,需要确定N个存储节点132的当前的内存使用量和磁盘读带宽使用量,以及,确定写请求的请求类型,并基于该请求类型的配置,确定针对N个存储节点132的内存上限值、内存下限值、磁盘读带宽上限值、磁盘读带宽下限值。
然后,控制节点A将内存使用量、内存上限值和内存下限值,代入上述公式(2)中,得到内存使用概率;将磁盘读带宽使用量、磁盘读带宽上限值和磁盘读带宽下限值,代入上述公式(2)中,得到磁盘读带宽使用概率。
之后,控制节点A基于内存使用概率判断是否可以获取内存,基于磁盘读带宽使用概率判断是否可以获取磁盘读带宽,在可以获取内存和磁盘读带宽时,将写请求发送到存储节点132中执行以写入数据。
上述图5所示的方法除了可以应用在图1a所示的系统架构,还可以应用在图1b所示的系统架构,在应用在图1b所示的系统架构,上述步骤501中的服务节点131需要向引擎134发送资源请求,步骤502至步骤506由引擎134执行。
【装置实施例】
本发明还提供一种共享资源分配装置,如图6所示,包括:
接收模块601,用于接收所述多个服务节点中的第一服务节点发送的资源请求;
概率确定模块602,用于基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率;
分配模块603,用于根据所述第一概率确定是否响应于所述资源请求对所述第一服务分配所述共享资源中的资源。
其中,接收模块601、概率确定模块602和分配模块603均可以通过软件实现,或者可以通过硬件实现。示例性的,接下来以接收模块601为例,介绍接收模块601的实现方式。类似的,概率确定模块602和分配模块603的实现方式可以参考接收模块601的实现方式。
模块作为软件功能单元的一种举例,接收模块601可以包括运行在计算实例上的代码。其中,计算实例可以包括物理主机(计算设备)、虚拟机、容器中的至少一种。进一步地,上述计算实例可以是一台或者多台。例如,接收模块601可以包括运行在多个主机/虚拟机/容器上的代码。需要说明的是,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的区域(region)中,也可以分布在不同的region中。进一步地,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的可用区(availability zone,AZ)中,也可以分布在不同的AZ中,每个AZ包括一个数据中心或多个地理位置相近的数据中心。其中,通常一个region可以包括多个AZ。
同样,用于运行该代码的多个主机/虚拟机/容器可以分布在同一个虚拟私有云(virtual private cloud,VPC)中,也可以分布在多个VPC中。其中,通常一个VPC设置在一个region内,同一region内两个VPC之间,以及不同region的VPC之间跨区通信需在每个VPC内设置通信网关,经通信网关实现VPC之间的互连。
模块作为硬件功能单元的一种举例,接收模块601可以包括至少一个计算设备,如服务器等。或者,接收模块601也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。
接收模块601包括的多个计算设备可以分布在相同的region中,也可以分布在不同的region中。接收模块601包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。同样,接收模块601包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,所述多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。
需要说明的是,在其他实施例中,接收模块601可以用于执行共享资源分配方法中的任意步骤,概率确定模块602可以用于执行共享资源分配方法中的任意步骤,分配模块603可以用于执行共享资源分配方法中的任意步骤,接收模块601、概率确定模块602、以及分配模块603负责实现的步骤可根据需要指定,通过接收模块601、概率确定模块602、以及分配模块603分别实现共享资源分配方法中不同的步骤来实现共享资源分配装置的全部功能。
【计算设备/计算设备集群】
本发明还提供一种计算设备700。如图7所示,计算设备700包括:总线702、处理器704、存储器706和通信接口708。处理器704、存储器706和通信接口708之间通过总线702通信。计算设备700可以是服务器或终端设备。应理解,本发明不限定计算设备700中的处理器、存储器的个数。
总线702可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图3中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线104可包括在计算设备700各个部件(例如,存储器706、处理器704、通信接口708)之间传送信息的通路。
处理器704可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。
存储器706可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。处理器704还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。
存储器706中存储有可执行的程序代码,处理器704执行该可执行的程序代码以分别实现前述接收模块601、概率确定模块602和分配模块603的功能,从而实现共享资源分配方法。也即,存储器706上存有用于执行共享资源分配方法的指令。
通信接口708使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备700与其他设备或通信网络之间的通信。
本发明实施例还提供了一种计算设备集群。该计算设备集群包括至少一台计算设备。该计算设备可以是服务器,例如是中心服务器、边缘服务器,或者是本地数据中心中的本地服务器。在一些实施例中,计算设备也可以是台式机、笔记本电脑或者智能手机等终端设备。
如图8所示,所述计算设备集群包括至少一个计算设备700。计算设备集群中的一个或多个计算设备700中的存储器706中可以存有相同的用于执行共享资源分配方法的指令。也即,不同的计算设备700中的存储器706存储的指令可以实现接收模块601、概率确定模块602和分配模块603中的所有功能。
在一种可能的实现方式中,该计算设备集群中的一个或多个计算设备700可以虚拟成多个存储节点132,在由存储节点132执行本发明实施例提供的共享资源分配方法时,每个存储节点132存储有执行共享资源分配方法的指令。
在一种可能的实现方式中,该计算设备集群中的一个或多个计算设备700可以虚拟成若干个控制节点133,这些控制节点133用于管理多个存储节点132,在由控制节点133执行本发明实施例提供的共享资源分配方法时,每个控制节点133存储有执行共享资源分配方法的指令。可选地,该计算设备集群中的若干个控制节点133也可以分别存有用于执行共享资源分配方法的部分指令。换言之,一个或多个计算设备700的组合可以共同执行用于执行共享资源分配方法的指令。也即,不同的计算设备700中的存储器706存储的指令可以实现接收模块601、概率确定模块602和分配模块603中的一个或多个模块的功能。
在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,所述网络可以是广域网或局域网等等。具体地,通过各个计算设备中的通信接口与所述网络进行连接。
【计算机程序产品】
本发明实施例还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算设备上运行时,使得至少一个计算设备执行共享资源分配方法。
【计算机可读存储介质】
本发明实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行共享资源分配方法。
本发明的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等 数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
可以理解的是,在本发明的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本发明的实施例的范围。

Claims (15)

  1. 一种共享资源分配方法,其特征在于,所述共享资源由多个服务节点提供的多个服务共享,所述方法包括:
    接收所述多个服务节点中的第一服务节点发送的资源请求;
    基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率;
    根据所述第一概率确定是否响应于所述资源请求对所述第一服务分配所述共享资源中的资源。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率,包括:
    获取所述第一服务相对于所述共享资源的资源上限值、资源下限值;
    基于所述第一服务对所述共享资源的资源使用量、资源上限值、资源下限值,确定第一概率。
  3. 根据权利要求2所述的方法,其特征在于,当所述资源使用量小于所述资源下限值时,所述第一概率为第一数值;
    当所述资源使用量大于所述资源上限值时,所述第一概率为第二数值;
    当所述资源使用量位于所述资源下限值和所述资源上限值之间时,所述第一概率和所述资源使用量之间为反比关系。
  4. 根据权利要求2所述的方法,其特征在于,所述获取所述第一服务相对于所述共享资源的资源上限值、资源下限值,包括:
    从所述资源请求对应的第一服务配置的多个请求类型中,确定所述资源请求对应的第一请求类型;其中,所述多个请求类型各自配置有相对于所述共享资源的第一资源上限值和第一资源下限值;
    将所述第一请求类型配置的第一资源上限值和第二资源下限值,作为所述资源请求对应的第一服务相对于所述共享资源的资源上限值、资源下限值。
  5. 根据权利要求4所述的方法,其特征在于,所述第一服务配置有针对所述共享资源的第二资源下限值和第二资源上限值,所述多个请求类型各自配置的第一资源上限值之和小于等于所述第二资源下限值,所述多个请求类型各自配置的第一资源上限值小于等于所述第二资源上限值。
  6. 根据权利要求1至5任一所述的方法,其特征在于,所述多个服务节点各自配置的资源下限值小于等于所述共享资源的总量;所述多个配置各自配置的资源上限值小于等于所述共享资源的总量。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率,包括:
    当所述共享资源中所述资源请求需要使用的资源有剩余时,基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述共享资源由一个存储节点提供。
  9. 根据权利要求1至7任一所述的方法,其特征在于,所述共享资源由多个存储节点提供。
  10. 一种共享资源分配装置,其特征在于,所述装置包括:
    接收模块,用于接收所述多个服务节点中的第一服务节点发送的资源请求;
    概率确定模块,用于基于所述资源请求对应的第一服务对所述共享资源的资源使用量,确定第一概率;
    响应判断模块,用于根据所述第一概率确定是否响应于所述资源请求对所述第一服务分配所述共享资源中的资源。
  11. 一种计算设备集群,其特征在于,包括至少一个存储节点,所述至少一个存储节点各自提供共享资源,每个存储节点包括处理器和存储器;
    所述至少一个存储节点的处理器用于执行所述至少一个存储节点的存储器中存储的指令,以使得所述至少一个存储节点各自执行如权利要求1至7任一所述的方法。
  12. 一种计算设备集群,其特征在于,包括至少一个控制节点,所述至少一个控制节点管理多个存储节点提供的共享资源;每个控制节点包括处理器和存储器;
    所述至少一个控制节点的处理器用于执行所述至少一个控制节点的存储器中存储的指令,以使得所述至少一个控制节点执行如权利要求1至7任一所述的方法。
  13. 一种计算设备集群,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器;
    所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述至少一个计算设备执行如权利要求1至9任一所述的方法。
  14. 一种包含指令的计算机程序产品,其特征在于,当所述指令被计算设备集群运行时,使得所述计算设备集群执行如权利要求1至9任一所述的方法。
  15. 一种计算机可读存储介质,其特征在于,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求1至9任一所述的方法。
PCT/CN2023/104516 2022-11-29 2023-06-30 共享资源分配方法、装置及计算设备集群 WO2024113847A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211505602.3A CN118152104A (zh) 2022-11-29 2022-11-29 共享资源分配方法、装置及计算设备集群
CN202211505602.3 2022-11-29

Publications (1)

Publication Number Publication Date
WO2024113847A1 true WO2024113847A1 (zh) 2024-06-06

Family

ID=91295372

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104516 WO2024113847A1 (zh) 2022-11-29 2023-06-30 共享资源分配方法、装置及计算设备集群

Country Status (2)

Country Link
CN (1) CN118152104A (zh)
WO (1) WO2024113847A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103369041A (zh) * 2013-07-09 2013-10-23 北京奇虎科技有限公司 基于云计算的资源分配方法及装置
CN107688492A (zh) * 2016-08-05 2018-02-13 阿里巴巴集团控股有限公司 资源的控制方法、装置和集群资源管理系统
CN111433745A (zh) * 2017-12-14 2020-07-17 谷歌有限责任公司 共享计算资源的动态容量优化
CN113467939A (zh) * 2021-06-24 2021-10-01 深圳前海微众银行股份有限公司 一种容量管理方法、装置、平台和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103369041A (zh) * 2013-07-09 2013-10-23 北京奇虎科技有限公司 基于云计算的资源分配方法及装置
CN107688492A (zh) * 2016-08-05 2018-02-13 阿里巴巴集团控股有限公司 资源的控制方法、装置和集群资源管理系统
CN111433745A (zh) * 2017-12-14 2020-07-17 谷歌有限责任公司 共享计算资源的动态容量优化
CN113467939A (zh) * 2021-06-24 2021-10-01 深圳前海微众银行股份有限公司 一种容量管理方法、装置、平台和存储介质

Also Published As

Publication number Publication date
CN118152104A (zh) 2024-06-07

Similar Documents

Publication Publication Date Title
CN111464355B (zh) Kubernetes容器集群的伸缩容控制方法、装置和网络设备
CN109375872B (zh) 数据访问请求的处理方法、装置和设备及存储介质
JP5510556B2 (ja) 仮想マシンのストレージスペースおよび物理ホストを管理するための方法およびシステム
WO2019179453A1 (zh) 虚拟机创建方法及装置
US8751657B2 (en) Multi-client storage system and storage system management method
US20220210073A1 (en) Technologies for network device load balancers for accelerated functions as a service
WO2019178761A1 (zh) 应用编程接口api网关集群的控制方法和api网关集群
US11880714B2 (en) Technologies for providing dynamic selection of edge and local accelerator resources
WO2019127234A1 (zh) 一种对象迁移的方法、设备和系统
US10235047B2 (en) Memory management method, apparatus, and system
US11768706B2 (en) Method, storage medium storing instructions, and apparatus for implementing hardware resource allocation according to user-requested resource quantity
CN112600761B (zh) 一种资源分配的方法、装置及存储介质
WO2020042612A1 (zh) 消息存储、读取方法及装置、服务器、存储介质
US11316916B2 (en) Packet processing method, related device, and computer storage medium
WO2020224531A1 (zh) 存储系统中令牌的分配方法和装置
US20220188021A1 (en) Storage device and operating method thereof
WO2019047708A1 (zh) 资源配置方法及相关产品
WO2020259208A1 (zh) 内存调度方法、装置、设备及存储介质
WO2023151268A1 (zh) 一种业务分流方法、装置及系统
WO2017054533A1 (zh) 云互通的外部资源管理方法、装置及系统
US20200272526A1 (en) Methods and systems for automated scaling of computing clusters
WO2024051485A1 (en) Methods and systems for request traffic management
WO2024113847A1 (zh) 共享资源分配方法、装置及计算设备集群
WO2017070963A1 (zh) 一种虚拟资源的部署方法、装置及系统
WO2016201998A1 (zh) 一种缓存分配、数据访问、数据发送方法、处理器及系统