WO2017144011A1 - 资源分配方法及装置 - Google Patents

资源分配方法及装置 Download PDF

Info

Publication number
WO2017144011A1
WO2017144011A1 PCT/CN2017/074737 CN2017074737W WO2017144011A1 WO 2017144011 A1 WO2017144011 A1 WO 2017144011A1 CN 2017074737 W CN2017074737 W CN 2017074737W WO 2017144011 A1 WO2017144011 A1 WO 2017144011A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage
capacity
application
storage resource
resource
Prior art date
Application number
PCT/CN2017/074737
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 WO2017144011A1 publication Critical patent/WO2017144011A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3034Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/503Resource availability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Definitions

  • the present application relates to the field of network technologies, and in particular, to a resource allocation method and apparatus.
  • the application developer When the search service platform allocates storage resources for the website or application, the application developer first submits a search service request to the search service platform, where the search service request includes the storage capacity required by the application developer. After receiving the search service request of the application developer, the search service platform allocates the storage resource equal to the requested storage capacity to the application developer according to the storage capacity requested by the application developer, so that the corresponding website or application implements the search function.
  • the search service platform allocates storage resources according to the size of the storage capacity requested by the application developer, that is, allocates storage resources equal to the requested storage capacity.
  • some application developers actually use much less storage resources than allocated storage resources, which causes serious waste of storage resources and leads to resource utilization. The rate is reduced.
  • the embodiment of the present application provides a resource allocation method and device, which can avoid waste of storage resources and improve resource utilization.
  • the technical solution is as follows:
  • An embodiment of the present application provides a resource allocation method, where the method includes:
  • An embodiment of the present application provides a resource allocation apparatus, where the apparatus includes:
  • a resource allocation module configured to allocate a first storage resource to the application after receiving the search service request of the application, so that the application runs a search function based on the first storage resource, where the first storage resource has a first storage capacity
  • a monitoring module configured to monitor an actual usage capacity of the first storage resource during the running of the application
  • an adjustment module configured to adjust, according to the monitoring result, the first storage resource that has been allocated for the application.
  • the real-time monitoring of the actual used capacity of the storage resource allocated to the application is performed in the application running process, and the storage resource is re-allocated according to the actual used capacity, which avoids the storage resource. Waste, improve resource utilization, and reduce the cost of search services provided by search service platforms.
  • FIG. 1 is a flowchart of a resource allocation method according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another resource allocation apparatus according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a resource allocation method according to an embodiment of the present application. Referring to FIG. 1, the method includes the following steps:
  • Step 101 After receiving the search service request of the application, allocate the first storage resource to the application, so that the application runs the search function based on the first storage resource, where the first storage resource has the first storage capacity.
  • Step 102 Monitor an actual used capacity of the first storage resource during an application running process.
  • Step 103 Adjust, according to the monitoring result, the first storage resource that has been allocated for the application.
  • the resource allocation method described in the embodiment of the present application is implemented by a resource management server of a search service platform.
  • the application search service request is sent by the application server to the resource management server of the search service platform for requesting storage resources required for implementing the search function of the application.
  • the method further includes:
  • the currently available storage resource is divided into multiple storage resource groups according to multiple storage capacity granularities, and each storage resource group includes multiple storage resources having the same storage capacity;
  • allocating the first storage resource to the application includes:
  • a storage resource is selected from a plurality of storage resource groups and assigned to the application as the first storage resource.
  • adjusting the first storage resource that has been allocated for the application according to the monitoring result includes:
  • the application is allocated a second storage resource, the second storage resource has a second storage capacity, and the second storage capacity is greater than the first storage capacity.
  • the method further includes:
  • the step of allocating the second storage resource to the application is performed.
  • the method before the second storage resource is allocated to the application, the method further includes:
  • redundant data is included, the redundant data is deleted, and the storage resources occupied by the redundant data are released;
  • allocating the second storage resource to the application includes:
  • the first storage resource that has been allocated for the application is expanded to obtain the second storage resource, so that the application runs the search function based on the second storage resource.
  • the method further includes:
  • the prompt information that the actual usage capacity has reached the upper limit is displayed.
  • adjusting the first storage resource that has been allocated for the application according to the monitoring result includes:
  • the actual usage capacity of the application after the resource allocation continues to be less than the third storage capacity and greater than zero in the specified time period, allocate the third storage resource for the application, and release the first storage resource, where the capacity of the third storage resource is the third.
  • Storage capacity the third storage capacity being less than a specified percentage of the first storage capacity
  • FIG. 2 is a flowchart of another resource allocation method provided by an embodiment of the present application.
  • the method is implemented by a resource management server of a search service platform. Hereinafter, it may also be simply referred to as a resource management server. Referring to Figure 2, the method includes the following steps:
  • Step 201 Obtain a currently available storage resource, according to a plurality of storage capacity granularities, The storage resource is divided into multiple storage resource groups.
  • the search service platform can provide a search service for different applications developed by the application developer, and implement a search function for the different applications.
  • the different applications may include shopping applications, medical applications, instant messaging applications, and game applications.
  • the application developer needs to submit the search service request of the application to the resource management server of the search service platform through the application server, so that the resource management server of the search service platform allocates the storage resource to the application, and implements the corresponding Search function.
  • the search service request includes at least the requested storage capacity.
  • the search service platform may also set a minimum storage capacity requested, that is, the storage capacity requested by the application developer cannot be less than the minimum storage capacity.
  • the minimum storage capacity can be set as needed, for example, 50M, 100M, 200M, 500M, and the like.
  • the resource management server allocates the storage resource to the application, it usually obtains the currently available storage resource after receiving the search service request of the application, and allocates the storage resource to the application in the currently available storage resource.
  • this method leads to a long time spent allocating storage resources, which is likely to cause a loss of users of the search service platform.
  • the embodiment of the present application may perform the operation of dividing the current storage resource when the search service platform is initialized. The specific process is as follows:
  • the resource management server divides the currently available storage resources into multiple storage resource groups according to multiple storage capacity granularities, and each storage resource group includes multiple storage resources having the same storage capacity.
  • the resource management server of the search service platform can directly select a storage resource for the application in the plurality of divided storage resource groups, and allocate the storage resource to the application, thereby shortening the The amount of time it takes for an application to allocate storage resources.
  • the plurality of storage capacity granularities may be set as needed, for example, 50M, 100M, 200M, 500M, 1G, 2G, 5G, 10G, 50G, and the like.
  • Step 202 After receiving the search service request of the application, assign the first storage to the application.
  • the resource causes the application to run a search function based on the first storage resource.
  • the embodiment of the present application After receiving the search service request of the application, the embodiment of the present application first allocates the first storage resource to the application. That is, the resource management server selects the first storage resource for the application from the plurality of storage resource groups obtained in the above step 201, and allocates the first storage resource, so that the application runs the search function based on the first storage resource.
  • the first storage resource may be an initial storage resource allocated for the application.
  • the first storage resource has a first storage capacity, and the first storage capacity may be 50M, 100M, 200M, 500M, or the like.
  • the first storage capacity may be a statistically calculated storage capacity that satisfies the business needs of most applications. Then, the resource management server adjusts the allocated first storage resource according to the actual usage capacity of the application. For details, refer to steps 203 and 204 below.
  • the search service request may further include search template information, where the search template information includes a display category, a sorting manner, and the like of the search result.
  • the resource management server of the search service platform allocates the first storage resource to the application, the data resource related to the application is obtained.
  • the data resource is all the video summary information included in the video application, and the summary information includes the name, category, duration, and score of the video.
  • the resource management server of the search service platform can provide a personalized search service for the application according to the acquired data resources and the search template information, and realize the search function of the application.
  • the resource management server of the search service platform may generate search service data of the application that meets the search template information requirement according to the acquired data resource and the search template information, and store the search service data to the first storage.
  • the resource in turn, enables the application to run a search function based on the first storage resource.
  • the resource management server of the search service platform may provide a search service interface for the application, and when detecting that the application uses the search service through the search service interface The search result corresponding to the search keyword is obtained in the search service data stored in the first storage resource, and the search result is fed back to the application server, and the search result is displayed by the application server.
  • Step 203 Monitor an actual use capacity of the first storage resource during an application running process.
  • the actual use capacity of the first storage resource is dynamically changed during the application running process.
  • the first storage capacity of the first storage resource allocated by the resource management server of the search service platform for the application may far exceed the actual use capacity, thereby causing waste of storage resources.
  • the actual used capacity of the first storage resource may soon exceed the first storage capacity, which may result in the application's search function not functioning properly due to insufficient storage capacity.
  • the embodiment of the present application monitors the actual use capacity of the application in real time after allocating the first storage resource to the application. Then, according to the monitoring result, the resource management server adjusts the first storage resource that has been allocated for the application, and the specific adjustment process is as follows.
  • Step 204 Adjust, according to the monitoring result, the first storage resource that has been allocated for the application.
  • the resource management server adjusts the first storage resource that has been allocated for the application, and the adjustment condition may be used to measure whether the first storage resource is sufficient to provide a search service for the application.
  • the adjustment process of the first storage resource is as follows:
  • the resource management server determines whether the actual used capacity of the first storage resource is greater than a specified percentage of the first storage capacity. If the actual usage capacity is greater than the specified percentage of the first storage capacity, the first storage resource allocated for the application may not meet the actual usage requirement during the application running process, which may cause the application search function to fail to operate normally.
  • the embodiment of the present application re-allocates the second storage resource for the application.
  • the second storage resource has a second storage capacity, and the second storage capacity is greater than the first storage capacity, so that the redistributed second storage resource can meet actual usage requirements during application operation.
  • the specified percentage may be set as needed, for example, may be 70%, 80%, 90%, or the like.
  • the actual use capacity is greater than the specified percentage of the first storage capacity, such as the first storage capacity is 500M and the specified percentage is 80%, then when the actual use capacity is 450M, it is greater than 80% of the 500M. At this time, it is considered that the actual use capacity of the application is likely to exceed the first storage capacity in a short time, so it is necessary to allocate more storage capacity to the application to meet the business needs of the application.
  • allocating the second storage resource to the application may be implemented in the following two manners:
  • the second storage resource is allocated for the application, and the first storage resource is released, so that the application runs the search function based on the second storage resource.
  • the resource management server migrates the data stored in the first storage resource to the second storage resource before the first storage resource is released, so that the application can run normally, stably, and continuously.
  • the resource management server allocates the second storage resource to the application, because the storage address of the second storage resource is different from the storage address of the first storage resource, in order to avoid an error when migrating data, Re-acquiring the data related to the application, first storing the re-acquired data in the second storage resource, deleting the data in the first storage resource, and releasing the first storage resource to ensure normal and stable operation of the application.
  • the first storage resource that has been allocated for the application is expanded on the basis of the first storage resource, and the second storage resource is obtained, so that the application runs the search function based on the second storage resource.
  • the resource management server since the resource management server receives the search service of the application, please Before the request, the currently available storage resource is divided into a plurality of storage resource groups, each storage resource group includes a plurality of storage resources having the same storage capacity, and thus the first storage resource allocated for the application is determined. After the storage capacity is used, the first storage capacity can be used as a basic unit of capacity expansion, that is, when the storage resource is newly allocated for the application, the storage resource having the first storage capacity is added to the application on the basis of the first storage resource.
  • the resource management server allocates the first storage resource with a storage capacity of 500M to the application, and increases the storage capacity allocated for the application when the actual used capacity of the application is greater than 80% of the 500M. Up to 1000M, the storage capacity of the application is extended by 500M.
  • the 1000M corresponding storage resource is the newly allocated second storage resource.
  • the first mode may be used for reallocation, that is, the application may be re-allocated 1000M of the second storage resource in addition to the 500M storage space occupied by the first storage resource, when the application is to be in the first storage resource. After the data in the data is smoothly migrated to the second storage resource, the first storage resource is released.
  • the second method may be used for reallocation, that is, the second 500M storage resource is re-allocated for the application based on the 500M storage space occupied by the first storage resource, and the second 500M is used.
  • the storage resource and the first storage resource form a second storage resource, so that after the storage resource is reallocated, the storage resource allocated for the application is a total of 1000M.
  • the search service platform limits the maximum storage capacity allocated for the application, in order to prevent the resource management server of the search service platform from providing storage resources for the application without limitation, thereby causing waste of storage resources and management resource storage.
  • the maximum storage capacity may be the storage capacity requested by the application developer in the search service request. Therefore, after the resource management server determines that the actual usage capacity is greater than a specified percentage of the first storage capacity, it is further determined whether the actual usage capacity is less than the storage capacity requested in the search service request. If the actual usage capacity is less than the storage capacity requested in the search service request, the step of reallocating the second storage resource for the application is performed. If the actual usage capacity is equal to the search service request The requested storage capacity indicates that the storage resource requested by the application developer has been used up.
  • the resource management server instructs the application server to display the prompt information that the actual usage capacity has reached the upper limit.
  • the prompt information may be “Your actual usage capacity has reached the upper limit. Whether it needs to be expanded” and so on.
  • the storage capacity requested in the search service request may be the storage capacity filled by the application developer in the search service request, and may also be the selected storage capacity among the plurality of optional storage capacities, and may also be in the request with the search service. The storage capacity corresponding to the amount included.
  • the resource management server detects whether the stored data in the first storage resource includes redundancy before reallocating the second storage resource for the application. Remaining data; if redundant data is included, the redundant data is deleted and the storage resources occupied by the redundant data are released.
  • the resource management server determines whether the actual used capacity after the release is greater than a specified percentage of the first storage capacity, and if the actual used capacity after the release is greater than the first storage capacity The specified percentage, then the step of reassigning the second storage resource for the application.
  • the actual storage capacity of the first storage resource is small during the application running process, for example, less than 20% or 10% of the first storage capacity, etc. A serious waste of storage resources.
  • the application is allocated a third. Store resources and release the first storage resource.
  • the capacity of the third storage resource is a third storage capacity, and the third storage capacity is less than a specified percentage of the first storage capacity.
  • the actual use capacity continues to be less than the third storage capacity and is greater than zero, which means that the actual used capacity obtained by the monitoring is less than the third storage capacity and greater than zero within the specified time period, the designation
  • the time period can be set as needed, for example, 15 days, 30 days, and the like.
  • the actual usage capacity of the monitoring application is less than 50M in the specified time period, for example, less than 50M in 15 days, and the currently available storage resources are divided according to step 201.
  • a third storage resource with a granularity of 50M is allocated to the user according to the actual use capacity of the application. After the third storage resource is allocated, the data in the first storage resource is migrated to the third storage resource, and then the first storage resource is released to ensure the stability of the application running.
  • the resource management server when applying for a search service for an application, many application developers only want to experience the search service application process of the search service platform, and do not want to actually use the search service, and the application does not use the search service.
  • some applications may have a short life cycle, no longer use the search service at the end of their life cycle, or the search service is no longer used because the application cancels the search function, but the application also occupies resources of the search service platform.
  • the first storage resource allocated by the management server for it thereby causing waste of storage resources.
  • the search service for the application is stopped, and the application is applied.
  • the data stored in the first storage resource is migrated to another storage resource, which is not a storage resource used to provide a search service, and releases the first storage resource.
  • the actual use capacity of the storage resource allocated to the application is monitored in real time during the application running process, and the actual use capacity is determined. By reallocating storage resources, this avoids the waste of storage resources, improves resource utilization, and reduces the cost of providing search services by the search service platform. Further, before receiving the search service request of the application, dividing the currently available storage resource into multiple storage resource groups, so as to select a storage for the application directly in the multiple storage resource groups after receiving the search service request of the application. Resources, and allocate the storage resources to the application, which greatly reduces the time to allocate storage resources to the application.
  • FIG. 3 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present application.
  • the device may be a resource management server of the search service platform.
  • the device includes a resource allocation module 301, a monitoring module 302, and an adjustment module 303.
  • the resource allocation module 301 is connected to the monitoring module 302, and is configured to allocate a first storage resource to the application after receiving the search service request of the application, so that the application runs the search function based on the first storage resource, where the first storage resource has the first storage capacity;
  • the monitoring module 302 is connected to the adjustment module 303, and is configured to monitor the actual usage capacity of the first storage resource during the running of the application;
  • the adjusting module 303 is configured to adjust, according to the monitoring result, the first storage resource that has been allocated for the application.
  • the device further includes:
  • a dividing module configured to divide the currently available storage resource into multiple storage resource groups according to multiple storage capacity granularities, where each storage resource group includes multiple storage resources having the same storage capacity;
  • the resource allocation module 301 is configured to select a storage resource from the plurality of storage resource groups and allocate the same as the first storage resource to the application.
  • the adjusting module 303 is configured to determine whether the actual used capacity is greater than a specified percentage of the first storage capacity; if the actual used capacity is greater than a specified percentage of the first storage capacity, the second storage resource is allocated for the application, The second storage resource has a second storage capacity And the second storage capacity is greater than the first storage capacity.
  • the device further includes:
  • a determining module configured to determine, when the actual usage capacity is greater than a specified percentage of the first storage capacity, whether the actual usage capacity is less than the storage capacity requested in the search service request;
  • the adjusting module 303 is configured to perform a step of allocating a second storage resource for the application if the actual usage capacity is less than the storage capacity requested in the search service request.
  • the device further includes:
  • a detecting module configured to detect whether the stored data in the first storage resource includes redundant data
  • the determining module is configured to determine whether the actual used capacity after the storage resource occupied by the redundant data is greater than a specified percentage of the first storage capacity, and the actual used capacity after the storage resource occupied by the redundant data is released is greater than the first storage capacity The specified percentage, the step of assigning the second storage resource to the application.
  • the adjustment module 303 is configured to allocate a second storage resource to the application, and release the first storage resource, so that the application runs the search function based on the second storage resource, in addition to the storage space occupied by the first storage resource. Or, the first storage resource that has been allocated for the application is expanded to obtain the second storage resource, so that the application runs the search function based on the second storage resource.
  • the device further includes:
  • the display module is configured to display a prompt message that the actual use capacity has reached the upper limit if the actual use capacity is equal to the storage capacity requested in the search service request.
  • the adjusting module 303 is configured to apply if the actual used capacity after the resource allocation continues to be less than the third storage capacity and greater than zero within a specified time period. Allocating a third storage resource, and releasing the first storage resource, the capacity of the third storage resource is a third storage capacity, the third storage capacity is less than a specified percentage of the first storage capacity; if the actual usage capacity is zero, releasing the first storage Resources.
  • the real-time monitoring of the actual use capacity of the storage resource allocated to the application is performed in real time during the application running process, and the storage resource is re-allocated according to the actual use capacity, which avoids the storage resource. Waste, improve resource utilization, and reduce the cost of search services provided by search service platforms.
  • the resource allocation apparatus provided in the foregoing embodiment is only illustrated by the division of the foregoing functional modules when allocating resources.
  • the function allocation may be completed by different functional modules as needed.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the resource allocation device and the resource allocation method embodiment provided by the foregoing embodiments are in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
  • FIG. 4 is a schematic structural diagram of another resource allocation apparatus according to an embodiment of the present application.
  • the device 400 can be a server, and specifically, can be a resource management server of a search service platform.
  • apparatus 400 includes a processing component 422 that further includes one or more processors, and memory resources represented by memory 432 for storing machine readable instructions executable by a processor in processing component 422, such as application.
  • Memory 432 can be a non-transitory computer readable storage medium.
  • An application stored in memory 432 may include one or more modules each corresponding to a set of instructions.
  • processing component 422 is configured to execute instructions to perform the resource allocation method described above.
  • the machine readable instructions stored by the memory 432 include a resource allocation instruction, a monitoring instruction, and an adjustment instruction.
  • the processor in the processing component 422 is configured to read the resource allocation instruction, the monitoring instruction, and the adjustment instruction stored in the memory 432 to implement the following steps:
  • the machine readable instructions further include a division instruction, a judgment instruction, a detection instruction, a deletion instruction, and a display instruction.
  • the processor in processing component 422 is operative to read the machine readable instructions described above to implement the steps of the resource allocation method of the embodiment illustrated in Figures 1 and 2 and the functions of the various modules in the resource allocation apparatus illustrated in Figure 3.
  • Apparatus 400 can also include a power supply component 426 configured to perform power management of apparatus 400, a wired or wireless network interface 450 configured to connect apparatus 400 to the network, and an input/output (I/O) interface 458.
  • Device 400 can operate based on an operating system stored in memory 432, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种资源分配方法及装置。所述方法包括:在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量(101);在所述应用运行过程中,监控所述第一存储资源的实际使用容量(102);根据监控结果,对已为所述应用分配的第一存储资源进行调整(103)。

Description

资源分配方法及装置
本申请要求于2016年2月25日提交中国专利局、申请号为201610103795.8、发明名称为“资源分配方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,特别涉及一种资源分配方法及装置。
发明背景
随着互联网技术的迅速发展,不同类型的网站和应用层出不穷,比如购物类、即时通讯类和游戏类等。为了满足人们的需求,这些网站或应用通常具有搜索功能,使得人们可以在繁多的信息中快速定位到自己需要的信息。由于实现搜索功能需要专业的开发人员,而且存储成本高,因此,一些网站或应用在实际开发过程中,通常会将搜索功能的实现托管给搜索服务平台,由搜索服务平台为网站或应用分配存储资源,以实现相应网站或应用的搜索功能。
搜索服务平台在为网站或应用分配存储资源时,首先由应用开发商向搜索服务平台提交搜索服务请求,该搜索服务请求中包含应用开发商需要的存储容量。搜索服务平台在接收到应用开发商的搜索服务请求后,按照应用开发商请求的存储容量,为应用开发商分配与请求的存储容量相等的存储资源,使得相应的网站或应用实现搜索功能。
可见,搜索服务平台在分配存储资源时,是根据应用开发商请求的存储容量的大小来进行的,即分配与请求的存储容量相等的存储资源。然而,在实际应用中,有些应用开发商实际使用的存储资源往往远远小于分配的存储资源,这样就造成了存储资源的严重浪费,导致资源利用 率降低。
发明内容
本申请实施例提供了一种资源分配方法及装置,能够避免存储资源的浪费、提高资源利用率。所述技术方案如下:
本申请实施例提供了一种资源分配方法,所述方法包括:
在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量;
在所述应用运行过程中,监控所述第一存储资源的实际使用容量;
根据监控结果,对已为所述应用分配的第一存储资源进行调整。
本申请实施例提供了一种资源分配装置,所述装置包括:
资源分配模块,用于在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量;
监控模块,用于在所述应用运行过程中,监控所述第一存储资源的实际使用容量;
调整模块,用于根据监控结果,对已为所述应用分配的第一存储资源进行调整。
在本申请实施例提供的技术方案中,通过在应用运行过程中,对分配给应用的存储资源的实际使用容量进行实时监控,根据实际使用容量为应用重新分配存储资源,这既避免了存储资源的浪费、提高了资源利用率,又降低了搜索服务平台提供搜索服务的成本。
附图简要说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种资源分配方法的流程图;
图2是本申请实施例提供的另一种资源分配方法的流程图;
图3是本申请实施例提供的一种资源分配装置的结构示意图;
图4是本申请实施例提供的另一种资源分配装置的结构示意图。
实施本发明的方式
为使本申请的技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
图1是本申请实施例提供的一种资源分配方法的流程图,参见图1,该方法包括以下步骤:
步骤101、在接收到应用的搜索服务请求后,为应用分配第一存储资源,使得应用基于第一存储资源运行搜索功能,第一存储资源具有第一存储容量。
步骤102、在应用运行过程中,监控第一存储资源的实际使用容量。
步骤103、根据监控结果,对已为应用分配的第一存储资源进行调整。
本申请实施例中所述的资源分配方法由搜索服务平台的资源管理服务器实现。其中,应用的搜索服务请求是由应用服务器发送给搜索服务平台的资源管理服务器的,用于请求实现应用的搜索功能所需要的存储资源。
在本申请实施例提供的方法中,通过在应用运行过程中,对分配给应用的存储资源的实际使用容量进行实时监控,根据实际使用容量为应用重新分配存储资源,这既避免了存储资源的浪费、提高了资源利用率,又降低了搜索服务平台提供搜索服务的成本。
在本申请实施例中,该方法还包括:
按照多个存储容量粒度,将当前可用的存储资源划分成多个存储资源组,每个存储资源组中包括多个具有相同存储容量的存储资源;
相应地,为应用分配第一存储资源包括:
从多个存储资源组中选择存储资源,并将其作为第一存储资源分配给应用。
在本申请实施例中,根据监控结果,对已为应用分配的第一存储资源进行调整包括:
判断实际使用容量是否大于第一存储容量的指定百分比;
若实际使用容量大于第一存储容量的指定百分比,则为应用分配第二存储资源,第二存储资源具有第二存储容量,且第二存储容量大于第一存储容量。
在本申请实施例中,若实际使用容量大于第一存储容量的指定百分比,该方法还包括:
判断实际使用容量是否小于搜索服务请求中所请求的存储容量;
若实际使用容量小于搜索服务请求中所请求的存储容量,则执行为应用分配第二存储资源的步骤。
在本申请实施例中,为应用分配第二存储资源之前,该方法还包括:
检测第一存储资源中已存储的数据中是否包含冗余数据;
若包含冗余数据,则删除冗余数据,并释放冗余数据所占用的存储资源;
判断释放冗余数据所占用的存储资源后的实际使用容量是否大于第一存储容量的指定百分比,若释放冗余数据所占用的存储资源后的实际使用容量大于第一存储容量的指定百分比,则执行为应用分配第二存储资源的步骤。
在本申请实施例中,为应用分配第二存储资源包括:
在第一存储资源占用的存储空间之外,为应用分配第二存储资源,并释放第一存储资源,使得应用基于第二存储资源运行搜索功能;或,
对已为应用分配的第一存储资源进行扩容,得到第二存储资源,使得应用基于第二存储资源运行搜索功能。
在本申请实施例中,判断实际使用容量是否小于搜索服务请求中所请求的存储容量之后,该方法还包括:
若实际使用容量等于搜索服务请求中所请求的存储容量,则显示实际使用容量已达上限的提示信息。
在本申请实施例中,根据监控结果,对已为应用分配的第一存储资源进行调整包括:
若应用在资源分配后的实际使用容量在指定时间段内持续小于第三存储容量且大于零,则为应用分配第三存储资源,并释放第一存储资源,第三存储资源的容量为第三存储容量,第三存储容量小于第一存储容量的指定百分比;
若实际使用容量为零,则释放第一存储资源。
上述所有的实施例可以任意结合以形成本申请的新的实施例。
图2是本申请实施例提供的另一种资源分配方法的流程图,该方法由搜索服务平台的资源管理服务器实现,下文中看,也可简称为资源管理服务器。参见图2,该方法包括以下步骤:
步骤201、获取当前可用的存储资源,按照多个存储容量粒度,将 存储资源划分成多个存储资源组。
在本申请实施例中,搜索服务平台可为应用开发商开发的不同应用提供搜索服务,为该不同应用实现搜索功能。其中,该不同应用可包括购物类应用、医疗类应用、即时通讯类应用和游戏类应用等。搜索服务平台在向应用提供搜索服务之前,需要应用开发商通过应用服务器向搜索服务平台的资源管理服务器提交应用的搜索服务请求,以便搜索服务平台的资源管理服务器为该应用分配存储资源,实现相应的搜索功能。其中,搜索服务请求中至少包括请求的存储容量。在具体实施时,搜索服务平台还可设置请求的最小存储容量,即应用开发商请求的存储容量不能小于该最小存储容量。该最小存储容量可根据需要设置,例如为50M、100M、200M、500M等。
资源管理服务器在为应用分配存储资源时,通常会在接收到应用的搜索服务请求后,获取当前可用的存储资源,并在当前可用的存储资源中为应用分配存储资源。但这种方式导致分配存储资源时耗费的时间过长,容易造成搜索服务平台的用户量的流失。为了缩短为应用分配存储资源时耗费的时间,本申请实施例可在对搜索服务平台进行初始化时,对当前存储资源进行划分操作,具体过程如下:
资源管理服务器按照多个存储容量粒度,将当前可用的存储资源划分成多个存储资源组,每个存储资源组中包括多个具有相同存储容量的存储资源。当搜索服务平台的资源管理服务器接收到应用的搜索服务请求后,便可直接在划分好的多个存储资源组中,为应用选择一个存储资源,并分配该存储资源给应用,从而缩短了为应用分配存储资源时耗费的时间。其中,多个存储容量粒度可以根据需要设置,例如为50M、100M、200M、500M、1G、2G、5G、10G、50G等。
步骤202、在接收到应用的搜索服务请求后,为应用分配第一存储 资源,使得应用基于第一存储资源运行搜索功能。
对于应用开发商来说,为了保证请求的存储资源能够满足应用的搜索功能的正常运行,其在应用的搜索服务请求中请求的存储容量往往大于应用的实际使用容量。因此,为了避免为应用分配比应用实际使用容量更大的存储资源,导致存储资源的浪费,本申请实施例在接收到应用的搜索服务请求后,先为应用分配第一存储资源。即,资源管理服务器从上述步骤201中得到的多个存储资源组中,为应用选择第一存储资源,并分配该第一存储资源,使得应用基于第一存储资源运行搜索功能。其中,第一存储资源可以是为应用分配的初始存储资源。第一存储资源具有第一存储容量,该第一存储容量可为50M、100M、200M、500M等。该第一存储容量可为经过统计得到的能够满足大多数应用的业务需求的存储容量。之后,资源管理服务器再根据应用的实际使用容量来对分配的第一存储资源进行调整,具体过程可以详见下述步骤203和204。
在本申请实施例中,搜索服务请求中还可包括搜索模板信息,该搜索模板信息包括搜索结果的显示类别、排序方式等。在搜索服务平台的资源管理服务器为应用分配第一存储资源后,获取与该应用相关的数据资源。以视频应用为例,该数据资源即为该视频应用中包含的全部视频摘要信息,该摘要信息包括视频的名称、类别、时长、评分等。搜索服务平台的资源管理服务器根据获取到的数据资源以及搜索模板信息,可为应用提供个性化的搜索服务,实现应用的搜索功能。具体实施过程中,搜索服务平台的资源管理服务器可根据获取到的数据资源以及搜索模板信息,生成满足该搜索模板信息要求的该应用的搜索服务数据,并将该搜索服务数据存储至第一存储资源中,进而使得该应用可基于第一存储资源运行搜索功能。进一步地,搜索服务平台的资源管理服务器可为应用提供搜索服务接口,当检测到应用通过该搜索服务接口使用搜索服 务时,在第一存储资源存储的搜索服务数据中获取与搜索关键词相符的搜索结果,并将搜索结果反馈给应用服务器,由应用服务器显示该搜索结果。
步骤203、在应用运行过程中,监控第一存储资源的实际使用容量。
在本申请实施例中,在应用运行过程中,第一存储资源的实际使用容量是动态变化的。搜索服务平台的资源管理服务器为应用分配的第一存储资源的第一存储容量可能远远超过实际使用容量,进而造成存储资源浪费。或者,第一存储资源的实际使用容量可能即将超过第一存储容量,这会造成由于存储容量不足使得应用的搜索功能不能正常运行的后果。为了避免存储资源的浪费,或者避免由于存储容量不足而造成应用的搜索功能不能正常的运行,本申请实施例在为应用分配了第一存储资源后,对应用的实际使用容量进行实时监控。之后根据监控结果,资源管理服务器对已为应用分配的第一存储资源进行调整,具体调整过程详见下述步骤204。
步骤204、根据监控结果,对已为该应用分配的第一存储资源进行调整。
在本申请实施例中,在对第一存储资源的实际使用容量进行监控后,根据监控结果判断是否符合调整条件。如果符合调整条件,资源管理服务器对已为应用分配的第一存储资源进行调整,该调整条件可以用于衡量该第一存储资源是否足以为应用提供搜索服务。具体地,该第一存储资源的调整过程如下:
资源管理服务器判断该第一存储资源的实际使用容量是否大于第一存储容量的指定百分比。若该实际使用容量大于第一存储容量的指定百分比,则说明为应用分配的第一存储资源可能不能够满足应用运行过程中的实际使用需求,很可能会造成应用的搜索功能不能正常运行,因此 本申请实施例为应用重新分配第二存储资源。其中,第二存储资源具有第二存储容量,且第二存储容量大于第一存储容量,使得重新分配的第二存储资源能够满足应用运行过程中的实际使用需求。在本申请实施例中,指定百分比可根据需要设置,例如可以为70%、80%、90%等。当实际使用容量大于第一存储容量的指定百分比时,比如第一存储容量为500M,指定百分比为80%,则当实际使用容量为450M时便大于了500M的80%。此时,认为应用的实际使用容量很可能在短时间内超过第一存储容量,因此需要为应用分配更多的存储容量,以满足应用的业务需求。
在本申请实施例中,为应用分配第二存储资源可通过以下两种方式实现:
在第一种方式中,在第一存储资源占用的存储空间之外,为应用分配第二存储资源,并释放第一存储资源,使得应用基于第二存储资源运行搜索功能。
在本申请实施例中,资源管理服务器在释放第一存储资源之前,将应用在第一存储资源中存储的数据迁移到第二存储资源中,使得应用可以正常、稳定且不间断的运行。在本申请另一实施例中,资源管理服务器在为应用分配第二存储资源后,由于第二存储资源的存储地址与第一存储资源的存储地址不同,为了避免在迁移数据时发生错误,可重新获取与应用相关的数据,先将重新获取的数据存储到第二存储资源中,再将第一存储资源中的数据进行删除,并释放第一存储资源,以保证应用正常稳定运行。
在第二种方式中,在第一存储资源的基础上,对已为应用分配的第一存储资源进行扩容,得到第二存储资源,使得应用基于第二存储资源运行搜索功能。
在本申请实施例中,由于资源管理服务器在接收应用的搜索服务请 求之前,就将当前可用的存储资源划分成了多个存储资源组,每个存储资源组中包含多个具有相同存储容量的存储资源,因此在确定为应用分配的第一存储资源的第一存储容量后,可将该第一存储容量作为扩容的基本单位,即为应用重新分配存储资源时,在第一存储资源的基础上,为应用增加具有第一存储容量的存储资源。
例如,资源管理服务器在接收到应用的搜索服务请求后,为应用分配了存储容量为500M的第一存储资源,当应用的实际使用容量大于500M的80%后,将为应用分配的存储容量增加至1000M,即为应用的存储容量扩展了500M。该1000M对应的存储资源即为重新分配的第二存储资源。在具体实施过程中,可采用上述第一种方式进行重新分配,即在第一存储资源占用的500M存储空间之外,为应用重新分配1000M的第二存储资源,当将应用在第一存储资源中的数据平稳迁移到第二存储资源中后,释放第一存储资源。在具体实施过程中,还可采用上述第二种方式进行重新分配,即在第一存储资源占用的500M存储空间的基础上,为应用重新分配第二个500M的存储资源,该第二个500M的存储资源与第一存储资源组成第二存储资源,使得重新分配存储资源后,为应用分配的的存储资源一共为1000M。
在另一实施例中,为了避免搜索服务平台的资源管理服务器无限制的为应用提供存储资源,而造成存储资源浪费以及存储资源管理上的困难,搜索服务平台限制了为应用分配的最大存储容量,该最大存储容量可以为应用开发商在搜索服务请求中请求的存储容量。因此,资源管理服务器在判断该实际使用容量大于第一存储容量的指定百分比之后,还需判断该实际使用容量是否小于搜索服务请求中所请求的存储容量。若该实际使用容量小于搜索服务请求中所请求的存储容量,则执行为应用重新分配第二存储资源的步骤。若实际使用容量等于搜索服务请求中所 请求的存储容量,则说明应用开发商所请求的存储资源已经用完,资源管理服务器指示应用服务器显示实际使用容量已达上限的提示信息,该提示信息可为“您的实际使用容量已达上限,是否需要扩容”等。其中,搜索服务请求中所请求的存储容量可为应用开发商在搜索服务请求中填写的存储容量,还可为多个可选存储容量中被选中的存储容量,还可为与搜索服务请求中包含的金额对应的存储容量。
在另一实施例中,由于搜索功能运行的过程中会产生很多冗余数据,比如在对占用第一存储资源的某一数据进行更新时,仍然保留了更新前的数据,从而造成数据的冗余。因此,为了减少数据冗余,释放更多的存储资源以便提高存储资源的利用率,在为应用重新分配第二存储资源之前,资源管理服务器检测第一存储资源中已存储的数据中是否包含冗余数据;若包含冗余数据,则删除冗余数据,并释放冗余数据所占用的存储资源。之后,基于释放冗余数据所占用的存储资源后的实际使用容量,资源管理服务器判断释放后的实际使用容量是否大于第一存储容量的指定百分比,若释放后的实际使用容量大于第一存储容量的指定百分比,则执行为应用重新分配第二存储资源的步骤。
在本申请实施例中,由于有些应用比较简单,应用运行过程中,第一存储资源的实际使用容量很小,比如小于第一存储容量的20%或10%等,此时便会造成第一存储资源的严重浪费。为了避免在上述情况下造成存储资源的浪费,在对应用的实际使用容量进行监控后,若应用在存储资源分配后的实际使用容量持续小于第三存储容量且大于零,则为应用分配第三存储资源,并释放第一存储资源。其中,第三存储资源的容量为第三存储容量,第三存储容量小于第一存储容量的指定百分比。其中,实际使用容量持续小于第三存储容量且大于零,指的是在指定时间段内,监控得到的实际使用容量均小于第三存储容量且大于零,该指定 时间段可根据需要设置,例如为15天、30天等。例如,为应用分配了500M的第一存储资源后,监控得到应用的实际使用容量在指定时间段内持续小于50M,比如15天内均小于50M,而根据步骤201对当前可用的存储资源进行划分后,包含粒度为50M的第三存储资源,则为了提高资源的利用率,避免资源的浪费,根据应用的实际使用容量为用户分配粒度为50M的第三存储资源。在分配第三存储资源后,将应用在第一存储资源中的数据迁移到第三存储资源中,之后再释放第一存储资源,以保证应用运行的稳定性。
在另一实施例中,很多应用开发商在为应用申请搜索服务时,仅为了体验一下搜索服务平台的搜索服务申请流程,而并不想真正使用该搜索服务,此时应用并不会使用搜索服务平台的资源管理服务器为其分配的第一存储资源。为了避免该种情况下造成的存储资源的浪费,若资源管理服务器监控得到应用的实际使用容量为零,则释放第一存储资源。当再次接收到应用的搜索服务请求后,资源管理服务器执行为应用分配第一存储资源的步骤。
在另一实施例中,有些应用的生命周期可能很短,在其生命周期结束时不再使用搜索服务,或者由于应用取消了搜索功能不再使用搜索服务,但应用还占用搜索服务平台的资源管理服务器为其分配的第一存储资源,进而造成存储资源的浪费。为了避免该种情况下存储资源的浪费,若资源管理服务器监控得到应用的实际使用容量不为零,但应用在指定时间段内未使用过搜索服务,则停止对应用提供搜索服务,将应用在第一存储资源中存储的数据迁移至其他存储资源,该其他存储资源不是用来提供搜索服务的存储资源,并释放第一存储资源。
在本申请实施例提供的方法中,通过在应用运行过程中,对分配给应用的存储资源的实际使用容量进行实时监控,根据实际使用容量为应 用重新分配存储资源,这既避免了存储资源的浪费、提高了资源利用率,又降低了搜索服务平台提供搜索服务的成本。进一步的,在接收应用的搜索服务请求之前,将当前可用的存储资源划分成多个存储资源组,以便在接收到应用的搜索服务请求之后,直接在多个存储资源组中为应用选择一个存储资源,并分配该存储资源给应用,从而大大缩短了为应用分配存储资源的时间。
图3是本申请实施例提供的一种资源分配装置的结构示意图。在本实施例中,该装置可以为搜索服务平台的资源管理服务器。参见图3,该装置包括资源分配模块301、监控模块302和调整模块303。
其中,资源分配模块301与监控模块302连接,用于在接收到应用的搜索服务请求后,为应用分配第一存储资源,使得应用基于第一存储资源运行搜索功能,第一存储资源具有第一存储容量;
监控模块302与调整模块303连接,用于在应用运行过程中,监控第一存储资源的实际使用容量;
调整模块303,用于根据监控结果,对已为应用分配的第一存储资源进行调整。
在本申请实施例中,该装置还包括:
划分模块,用于按照多个存储容量粒度,将当前可用的存储资源划分成多个存储资源组,每个存储资源组中包括多个具有相同存储容量的存储资源;
相应地,资源分配模块301,用于从多个存储资源组中选择存储资源,并将其作为第一存储资源分配给应用。
在本申请实施例中,调整模块303,用于判断实际使用容量是否大于第一存储容量的指定百分比;若实际使用容量大于第一存储容量的指定百分比,则为应用分配第二存储资源,第二存储资源具有第二存储容 量,且第二存储容量大于第一存储容量。
在本申请实施例中,该装置还包括:
判断模块,用于在实际使用容量大于第一存储容量的指定百分比时,判断实际使用容量是否小于搜索服务请求中所请求的存储容量;
调整模块303,用于若实际使用容量小于搜索服务请求中所请求的存储容量,则执行为应用分配第二存储资源的步骤。
在本申请实施例中,该装置还包括:
检测模块,用于检测第一存储资源中已存储的数据中是否包含冗余数据;
删除模块,用于若包含冗余数据,则删除冗余数据,并释放冗余数据所占用的存储资源;
判断模块,用于判断释放冗余数据所占用的存储资源后的实际使用容量是否大于第一存储容量的指定百分比,若释放冗余数据所占用的存储资源后的实际使用容量大于第一存储容量的指定百分比,则执行为应用分配第二存储资源的步骤。
在本申请实施例中,调整模块303,用于在第一存储资源占用的存储空间之外,为应用分配第二存储资源,并释放第一存储资源,使得应用基于第二存储资源运行搜索功能;或,对已为应用分配的第一存储资源进行扩容,得到第二存储资源,使得应用基于第二存储资源运行搜索功能。
在本申请实施例中,该装置还包括:
显示模块,用于若实际使用容量等于搜索服务请求中所请求的存储容量,则显示实际使用容量已达上限的提示信息。
在本申请实施例中,调整模块303,用于若应用在资源分配后的实际使用容量在指定时间段内持续小于第三存储容量且大于零,则为应用 分配第三存储资源,并释放第一存储资源,第三存储资源的容量为第三存储容量,第三存储容量小于第一存储容量的指定百分比;若实际使用容量为零,则释放第一存储资源。
在本申请实施例提供的装置中,通过在应用运行过程中,对分配给应用的存储资源的实际使用容量进行实时监控,根据实际使用容量为应用重新分配存储资源,这既避免了存储资源的浪费、提高了资源利用率,又降低了搜索服务平台提供搜索服务的成本。
在本申请实施例中,上述实施例提供的资源分配装置在分配资源时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的资源分配装置与资源分配方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图4是本申请实施例提供的另一种资源分配装置的结构示意图。例如,装置400可以为一服务器,具体地,可以为搜索服务平台的资源管理服务器。参照图4,装置400包括处理组件422,其进一步包括一个或多个处理器,以及由存储器432所代表的存储器资源,用于存储可由处理组件422中的处理器执行的机器可读指令,例如应用程序。存储器432可以为非易失性计算机可读存储介质。存储器432中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件422被配置为执行指令,以执行上述资源分配方法。
在本申请实施例中,存储器432存储的机器可读指令包括资源分配指令、监控指令和调整指令。
在本申请实施例中,处理组件422中的处理器用于读取存储器432中存储的资源分配指令、监控指令和调整指令,以实现以下步骤:
在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量;
在所述应用运行过程中,监控所述第一存储资源的实际使用容量;
根据监控结果,对已为所述应用分配的第一存储资源进行调整。
在本申请实施例中,所述机器可读指令还包括划分指令、判断指令、检测指令、删除指令和显示指令。
处理组件422中的处理器用于读取上述机器可读指令,以实现图1和2所示的实施例中资源分配方法的步骤以及图3所示的资源分配装置中各模块的功能。
装置400还可以包括:一个电源组件426,被配置为执行装置400的电源管理,一个有线或无线网络接口450,被配置为将装置400连接到网络,和一个输入输出(I/O)接口458。装置400可以操作基于存储在存储器432的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (16)

  1. 一种资源分配方法,其特征在于,所述方法包括:
    在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量;
    在所述应用运行过程中,监控所述第一存储资源的实际使用容量;
    根据监控结果,对已为所述应用分配的第一存储资源进行调整。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    按照多个存储容量粒度,将当前可用的存储资源划分成多个存储资源组,每个存储资源组中包括多个具有相同存储容量的存储资源;
    所述为所述应用分配第一存储资源包括:
    从所述多个存储资源组中选择存储资源,并将其作为第一存储资源分配给所述应用。
  3. 根据权利要求1所述的方法,其特征在于,所述根据监控结果,对已为所述应用分配的第一存储资源进行调整包括:
    判断所述实际使用容量是否大于所述第一存储容量的指定百分比;
    若所述实际使用容量大于所述第一存储容量的指定百分比,则为所述应用分配第二存储资源,所述第二存储资源具有第二存储容量,且所述第二存储容量大于所述第一存储容量。
  4. 根据权利要求3所述的方法,其特征在于,若所述实际使用容量大于所述第一存储容量的指定百分比,所述方法还包括:
    判断所述实际使用容量是否小于所述搜索服务请求中所请求的存储容量;
    若所述实际使用容量小于所述搜索服务请求中所请求的存储容量, 则执行所述为所述应用分配第二存储资源的步骤。
  5. 根据权利要求3或4所述的方法,其特征在于,所述为所述应用分配第二存储资源之前,所述方法还包括:
    检测所述第一存储资源中已存储的数据中是否包含冗余数据;
    若包含所述冗余数据,则删除所述冗余数据,并释放所述冗余数据所占用的存储资源;
    判断释放所述冗余数据所占用的存储资源后的实际使用容量是否大于所述第一存储容量的指定百分比,若释放所述冗余数据所占用的存储资源后的实际使用容量大于所述第一存储容量的指定百分比,则执行为所述应用分配第二存储资源的步骤。
  6. 根据权利要求5所述的方法,其特征在于,所述为所述应用分配第二存储资源包括:
    在所述第一存储资源占用的存储空间之外,为所述应用分配所述第二存储资源,并释放所述第一存储资源,使得所述应用基于所述第二存储资源运行搜索功能;或,
    对已为所述应用分配的第一存储资源进行扩容,得到第二存储资源,使得所述应用基于所述第二存储资源运行搜索功能。
  7. 根据权利要求4所述的方法,其特征在于,所述判断所述实际使用容量是否小于所述搜索服务请求中所请求的存储容量之后,所述方法还包括:
    若所述实际使用容量等于所述搜索服务请求中所请求的存储容量,则显示实际使用容量已达上限的提示信息。
  8. 根据权利要求1所述的方法,其特征在于,所述根据监控结果,对已为所述应用分配的第一存储资源进行调整包括:
    若所述应用在资源分配后的实际使用容量在指定时间段内持续小于 第三存储容量且大于零,则为所述应用分配第三存储资源,并释放所述第一存储资源,所述第三存储资源的容量为所述第三存储容量,所述第三存储容量小于所述第一存储容量的指定百分比;
    若所述实际使用容量为零,则释放所述第一存储资源。
  9. 一种资源分配装置,其特征在于,所述装置包括:
    资源分配模块,用于在接收到应用的搜索服务请求后,为所述应用分配第一存储资源,使得所述应用基于所述第一存储资源运行搜索功能,所述第一存储资源具有第一存储容量;
    监控模块,用于在所述应用运行过程中,监控所述第一存储资源的实际使用容量;
    调整模块,用于根据监控结果,对已为所述应用分配的第一存储资源进行调整。
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:
    划分模块,用于按照多个存储容量粒度,将当前可用的存储资源划分成多个存储资源组,每个存储资源组中包括多个具有相同存储容量的存储资源;
    所述资源分配模块,用于从所述多个存储资源组中选择存储资源,并将其作为第一存储资源分配给所述应用。
  11. 根据权利要求9所述的装置,其特征在于,所述调整模块用于判断所述实际使用容量是否大于所述第一存储容量的指定百分比;若所述实际使用容量大于所述第一存储容量的指定百分比,则为所述应用分配第二存储资源,所述第二存储资源具有第二存储容量,且所述第二存储容量大于所述第一存储容量。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    判断模块,用于在所述实际使用容量大于所述第一存储容量的指定 百分比时,判断所述实际使用容量是否小于所述搜索服务请求中所请求的存储容量;
    所述调整模块,用于若所述实际使用容量小于所述搜索服务请求中所请求的存储容量,则执行所述为所述应用分配第二存储资源的步骤。
  13. 根据权利要求11或12所述的装置,其特征在于,所述装置还包括:
    检测模块,用于检测所述第一存储资源中已存储的数据中是否包含冗余数据;
    删除模块,用于若包含所述冗余数据,则删除所述冗余数据,并释放所述冗余数据所占用的存储资源;
    所述判断模块,用于判断释放所述冗余数据所占用的存储资源后的实际使用容量是否大于所述第一存储容量的指定百分比,若释放所述冗余数据所占用的存储资源后的实际使用容量大于所述第一存储容量的指定百分比,则执行为所述应用分配第二存储资源的步骤。
  14. 根据权利要求13所述的装置,其特征在于,所述调整模块用于:
    在所述第一存储资源占用的存储空间之外,为所述应用分配所述第二存储资源,并释放所述第一存储资源,使得所述应用基于所述第二存储资源运行搜索功能;或,对已为所述应用分配的第一存储资源进行扩容,得到第二存储资源,使得所述应用基于所述第二存储资源运行搜索功能。
  15. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    显示模块,用于若所述实际使用容量等于所述搜索服务请求中所请求的存储容量,则显示实际使用容量已达上限的提示信息。
  16. 根据权利要求9所述的装置,其特征在于,所述调整模块用于若所述应用在资源分配后的实际使用容量在指定时间段内持续小于第 三存储容量且大于零,则为所述应用分配第三存储资源,并释放所述第一存储资源,所述第三存储资源的容量为所述第三存储容量,所述第三存储容量小于所述第一存储容量的指定百分比;若所述实际使用容量为零,则释放所述第一存储资源。
PCT/CN2017/074737 2016-02-25 2017-02-24 资源分配方法及装置 WO2017144011A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610103795.8 2016-02-25
CN201610103795.8A CN105653373A (zh) 2016-02-25 2016-02-25 资源分配方法及装置

Publications (1)

Publication Number Publication Date
WO2017144011A1 true WO2017144011A1 (zh) 2017-08-31

Family

ID=56488777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074737 WO2017144011A1 (zh) 2016-02-25 2017-02-24 资源分配方法及装置

Country Status (2)

Country Link
CN (1) CN105653373A (zh)
WO (1) WO2017144011A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835521A (zh) * 2021-02-01 2021-05-25 杭州宏杉科技股份有限公司 一种存储空间分配方法、装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653373A (zh) * 2016-02-25 2016-06-08 腾讯科技(深圳)有限公司 资源分配方法及装置
CN108399102A (zh) * 2017-02-08 2018-08-14 阿里巴巴集团控股有限公司 一种资源分配方法和装置
CN110648158B (zh) * 2018-06-27 2022-07-19 阿里巴巴(中国)有限公司 资源分配方法及装置
CN112148469B (zh) * 2019-06-28 2024-02-20 杭州海康威视数字技术股份有限公司 管理资源的方法、装置及计算机存储介质
CN110333953A (zh) * 2019-07-11 2019-10-15 中国工商银行股份有限公司 数据存储资源调度方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049229A1 (en) * 2005-12-09 2009-02-19 Matsushita Electric Industrial Co., Ltd. Nonvolatile memory device, method of writing data,and method of reading out data
CN102685219A (zh) * 2012-04-27 2012-09-19 浪潮电子信息产业股份有限公司 San存储系统中通过动态扩容提高存储资源利用率的方法
CN104348887A (zh) * 2013-08-09 2015-02-11 中国电信股份有限公司 云管理平台中的资源分配方法与装置
CN105653373A (zh) * 2016-02-25 2016-06-08 腾讯科技(深圳)有限公司 资源分配方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103595815A (zh) * 2013-11-25 2014-02-19 广东电网公司汕头供电局 基于云计算的存储资源分配方法
CN104778244B (zh) * 2015-04-09 2018-08-24 天脉聚源(北京)传媒科技有限公司 数据的搜索方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049229A1 (en) * 2005-12-09 2009-02-19 Matsushita Electric Industrial Co., Ltd. Nonvolatile memory device, method of writing data,and method of reading out data
CN102685219A (zh) * 2012-04-27 2012-09-19 浪潮电子信息产业股份有限公司 San存储系统中通过动态扩容提高存储资源利用率的方法
CN104348887A (zh) * 2013-08-09 2015-02-11 中国电信股份有限公司 云管理平台中的资源分配方法与装置
CN105653373A (zh) * 2016-02-25 2016-06-08 腾讯科技(深圳)有限公司 资源分配方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835521A (zh) * 2021-02-01 2021-05-25 杭州宏杉科技股份有限公司 一种存储空间分配方法、装置
CN112835521B (zh) * 2021-02-01 2022-02-18 杭州宏杉科技股份有限公司 一种存储空间分配方法、装置

Also Published As

Publication number Publication date
CN105653373A (zh) 2016-06-08

Similar Documents

Publication Publication Date Title
WO2017144011A1 (zh) 资源分配方法及装置
JP6215715B2 (ja) クラウドコンピューティング環境を管理する方法およびシステム
US8046764B2 (en) Redistribution of unused resources assigned to a first virtual computer having usage below a predetermined threshold to a second virtual computer
JP6219512B2 (ja) 仮想ハドゥープマネジャ
US9588789B2 (en) Management apparatus and workload distribution management method
US9262192B2 (en) Virtual machine data store queue allocation
JP5368285B2 (ja) 計算機システム、計算機リソースの管理方法及びプログラム
US8756599B2 (en) Task prioritization management in a virtualized environment
TWI228656B (en) Procedure for dynamic reconfiguration of resources of logical partitions
JP5510556B2 (ja) 仮想マシンのストレージスペースおよび物理ホストを管理するための方法およびシステム
JP7074302B2 (ja) 仮想マシン管理方法、仮想マシン管理システム、仮想マシン管理装置、不揮発性コンピュータ可読記憶媒体およびコンピュータプログラム
JP2007115246A (ja) ソフトウェアによって使用される資源を動的に割り当てるための方法及び装置
JP2014520346A5 (zh)
US10884468B2 (en) Power allocation among computing devices
TWI755415B (zh) 雲端環境下應用集群資源分配的方法、裝置和系統
JP2012094030A (ja) 計算機システム及び処理制御方法
TW201636838A (zh) 資源處理方法及裝置
US10419305B2 (en) Visualization of workload distribution on server resources
WO2016041446A1 (zh) 一种资源分配方法、装置及设备
JP6653710B2 (ja) 計算機および計算機の制御方法
AU2017232694A1 (en) Method, apparatus, server and storage medium of erasing cloud host in cloud-computing environment
US8977752B2 (en) Event-based dynamic resource provisioning
JP2019008454A (ja) 情報処理システムおよびリソース割り当て方法
TW201324129A (zh) 動態資源規劃分配系統及方法
US20190114079A1 (en) Apparatus for managing disaggregated memory and method thereof

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17755840

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17755840

Country of ref document: EP

Kind code of ref document: A1