WO2017166584A1 - 一种资源分配的方法、装置和电子设备 - Google Patents

一种资源分配的方法、装置和电子设备 Download PDF

Info

Publication number
WO2017166584A1
WO2017166584A1 PCT/CN2016/095974 CN2016095974W WO2017166584A1 WO 2017166584 A1 WO2017166584 A1 WO 2017166584A1 CN 2016095974 W CN2016095974 W CN 2016095974W WO 2017166584 A1 WO2017166584 A1 WO 2017166584A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resources
attribute
amount
function attribute
Prior art date
Application number
PCT/CN2016/095974
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 WO2017166584A1 publication Critical patent/WO2017166584A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Definitions

  • the present invention relates to the field of computer technology, and in particular to a method, device and electronic device for resource allocation.
  • the resource management system can integrate resources on all machines to virtualize hardware resources.
  • machine resources are differentiated according to different usage functions. Each type of machine resource is isolated and resources are not shared. For example, the uploader is only used for video uploading, the transcoder is only used for video transcoding, and the CDN machine is only used for video distribution. In the course of use, some types of machines are idle, and some types of machines are very busy. The idle machine resources cannot be fully utilized, and the busy machines cause a short life after use.
  • the object of the present invention is to provide a method, an apparatus, and an electronic device for resource allocation, which solve the problem that different types of resources are isolated and cannot be shared when resource allocation is performed.
  • the present invention provides a method for resource allocation, including the steps of:
  • the selection can be used for the at least one The remaining resources of the functional attributes are allocated.
  • the request instruction includes a user level, and when receiving a request instruction for applying for a resource, extracting a preset level resource allocation table; wherein the level resource allocation table stores a user level and each The functional attributes allow the correspondence of the allocated resources;
  • Determining, according to the requested resource, the applied function attribute and the amount of resources required for each function attribute further includes: searching for a quantity of resources allowed to be allocated by each function attribute of the user level application in the request instruction;
  • each resource is configured with an IP address, and all resources in the resource pool are partitioned according to a region to which the IP address belongs; the request instruction includes a user IP address;
  • the resource library is extracted, and resources of the partition to which the user IP address belongs are obtained for allocation.
  • selecting the remaining resources that can be used for the at least one functional attribute for allocation includes:
  • Obtaining a preset replacement table determining whether other functional attributes having a remaining amount of resources can replace the at least one functional attribute, and if yes, selecting remaining resources that can replace the functional attributes of the at least one functional attribute for allocation;
  • the request fails or is allocated according to the amount of resources of the at least one functional attribute.
  • the method further includes:
  • the present invention also provides a method and apparatus for resource allocation, including:
  • a request receiving unit configured to determine, according to the applied resource, the requested function attribute and the amount of resources required for each function attribute when receiving the request instruction for applying for the resource;
  • a resource allocation unit configured to search the resource library, allocate resources for each function attribute of the application according to the resource quantity required by each function attribute; when the resource quantity of at least one function attribute in the resource library cannot satisfy the resource quantity
  • searching for other functional attributes in the resource library to satisfy the remaining resources after the application and selecting remaining resources that can be used for the at least one functional attribute for allocation;
  • a resource storage unit for setting a function attribute for each resource, and then storing the resource information and the corresponding function attribute into the resource library.
  • the request instruction includes a user level; when the request receiving unit receives the request instruction for applying for a resource, the request receiving unit is further configured to:
  • level resource allocation table stores a correspondence relationship between the user level and the allowed resource amount of each function attribute
  • the resource allocation unit allocates the amount of resources required for each functional attribute of the application.
  • each resource is configured with an IP address
  • the resource storage unit partitions all resources in the resource pool according to a region to which the IP address belongs
  • the request instruction includes a user IP address; the request receiving unit is further configured to:
  • the resource library is extracted, and resources of the partition to which the user IP address belongs are obtained for allocation.
  • the method when the resource allocation unit selects remaining resources that can be used for the at least one function attribute to be allocated, the method includes:
  • Obtaining a preset replacement table determining whether other functional attributes having a remaining amount of resources can replace the at least one functional attribute, and if yes, selecting remaining resources that can replace the functional attributes of the at least one functional attribute for allocation;
  • the request fails or is allocated according to the amount of resources of the at least one functional attribute.
  • the request receiving unit is further configured to:
  • Embodiments of the present invention also provide an electronic device including at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, The instructions are executed by the at least one processor to enable the at least one processor to: set a functional attribute for each resource, and then store the resource information and corresponding functional attributes into a repository; when the application resource is received When requesting the instruction, determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource; searching the resource library, and the amount of resources required according to each function attribute is each of the applications
  • the function attribute allocates a resource; when the resource quantity of the at least one function attribute in the resource library cannot satisfy the resource quantity of the application, the other resource attributes in the resource library are searched for, and the remaining resources are satisfied after the application, and the selection can be used. Allocating the remaining resources of the at least one functional attribute.
  • the request instruction includes a user level
  • the request instruction when receiving a request instruction for applying for a resource, extracting a preset hierarchical resource allocation table, wherein the hierarchical resource allocation table stores a user level and Each function attribute allows a corresponding relationship of resource quantities to be allocated
  • determining the requested function attribute and the amount of resources required for each function attribute according to the applied resource further includes: searching for each user level application in the request instruction The amount of resources allowed by the functional attributes; whether the amount of resources required for each functional attribute of the application is greater than the amount of resources that can be allocated, and if the request is greater than, the request fails or is allocated according to the amount of resources allowed to be allocated. ; otherwise, it is allocated according to the amount of resources required for each functional attribute of the application.
  • each resource is set with an IP address, and all resources in the resource pool are partitioned according to a region to which the IP address belongs, wherein the request instruction includes a user IP address; when receiving the application resource When the instruction is requested, the IP address of the user is obtained; the resource library is extracted, and resources of the partition to which the user IP address belongs are obtained for allocation.
  • selecting a remaining resource that can be used for the at least one function attribute to perform allocation includes: acquiring a preset replacement table, and determining whether other functional attributes having a remaining amount of resources can replace the at least one a function attribute, if yes, selecting a remaining resource capable of replacing the function attribute of the at least one function attribute for allocation; otherwise the request fails or is allocated according to a resource amount of the at least one function attribute.
  • An embodiment of the present invention further provides a non-volatile computer storage medium, wherein the storage medium Storing computer executable instructions that, when executed by an electronic device, enable the electronic device to: set functional attributes for each resource, then store the resource information and corresponding functional attributes into a repository; When requesting the resource request instruction, determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource; searching for the resource library, and the amount of resources required according to each function attribute is the application Each function attribute allocates a resource; when the resource quantity of at least one function attribute in the resource library cannot satisfy the resource quantity of the application, the resource library searches for other function attributes to satisfy the remaining resources after the application, A remaining resource that can be used for the at least one functional attribute is selected for allocation.
  • the non-volatile computer storage medium wherein the request instruction includes a user level, and when receiving a request instruction for applying for a resource, extracting a preset level resource allocation table, wherein the level resource allocation table is Storing a user level and a correspondence relationship of each function attribute to allow allocation of resources; determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource further includes: searching for the request instruction Each function attribute of the user level application allows the amount of resources to be allocated; whether the amount of resources required for each function attribute of the application is greater than the amount of the allocateable resources, and if it is greater than the request, the request fails or is allocated according to the permission The amount of resources is allocated; otherwise, it is allocated according to the amount of resources required for each functional attribute of the application.
  • each resource is provided with an IP address, and all resources in the resource pool are partitioned according to the territory to which the IP address belongs, and the request instruction includes a user IP address;
  • the IP address of the user is obtained; the resource library is extracted, and the resource of the partition to which the user IP address belongs is obtained for allocation.
  • selecting a remaining resource that can be used for the at least one function attribute for allocation includes: obtaining a preset replacement table, and determining whether other functional attributes having a remaining amount of resources can be replaced And the at least one function attribute, if yes, selecting a remaining resource that can replace the function attribute of the at least one function attribute for allocation; otherwise the request fails or is allocated according to the resource quantity of the at least one function attribute.
  • Embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer Causing the computer to perform any of the above Methods.
  • the method and apparatus for resource allocation provided by the present invention may adopt other functions if the resource amount of at least one functional attribute fails to satisfy the resource amount of the application in the process of resource allocation.
  • the attribute is used for resource allocation of the at least one functional attribute after the amount of remaining resources after the application is satisfied. Thereby, it is ensured that the number of each functional attribute resource of the application can be satisfied.
  • FIG. 1 is a schematic flowchart of a method for resource allocation in a first embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for resource allocation in an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of hardware of an electronic device according to an embodiment of the present invention.
  • installation is to be understood broadly, and may be fixed connections, for example, or It is a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected, or may be indirectly connected through an intermediate medium, or may be an internal connection between two components, and may be a wireless connection, It can be a wired connection.
  • the specific meaning of the above terms in the present invention can be understood in a specific case by those skilled in the art.
  • FIG. 1 is a schematic flowchart of a method for resource allocation in a first embodiment of the present invention, where the method for resource allocation includes:
  • Step 101 Receive a request instruction for applying for a resource.
  • the user level may be included in the request instruction. Further, when the step 101 receives the request for requesting the resource, the preset level resource allocation table may be extracted.
  • the hierarchical resource allocation table stores a correspondence between a user level and an allowed resource amount of each function attribute.
  • Step 102 Determine the applied function attribute and the amount of resources required for each function attribute according to the applied resource.
  • a function attribute is set for each resource, and the requested function attribute and the amount of resources required for each function attribute are included in the request instruction.
  • Step 103 Find the resource library, and allocate resources for each function attribute of the application according to the amount of resources required for each function attribute.
  • the resource library is preset, and resource information of each resource and corresponding function attributes are stored.
  • each of the resource settings is further provided with an IP address, and all resources in the resource pool may be partitioned according to the region to which the IP address belongs.
  • the request instruction includes a user IP address.
  • step 101 receives a request for a request for a resource, then The IP address of the user may be obtained, and then the resource library is extracted, and resources of the partition to which the user IP address belongs are obtained for allocation. Therefore, the present invention can divide the resources into all the resources according to the IP address, and can match the IP address in the request with the area in the resource library. Once the match is successful, the resources can be allocated. Thereby, the allocated resources can be made closer to the user, and the result of the distribution is more reasonable and better.
  • Step 104 When the resource quantity of the at least one function attribute in the resource pool cannot satisfy the resource quantity of the application, look for other function attributes in the resource library to satisfy the remaining resources after the application, and select the The remaining resources of the at least one functional attribute are allocated.
  • the resource quantity of the at least one function attribute in the process of resource allocation cannot satisfy the resource quantity of the application, the remaining function quantity of the other function attribute after the application is satisfied may be used. Resource allocation of the at least one functional attribute. Thereby, it is ensured that the number of each functional attribute resource of the application can be satisfied.
  • the remaining resources that can be used for the at least one function attribute are selected for allocation, and the specific implementation process includes: acquiring a preset replacement table, and determining whether other functional attributes having the remaining resource amount can replace the At least one functional attribute. According to the judgment result, if there are other functional attributes that can be replaced, the remaining resources that can replace the functional attributes of the at least one functional attribute are selected for allocation. That is, the remaining resources of the other functional attributes may be used for resource allocation of the at least one functional attribute. Further, if at least two of the other functional attributes are available to replace the at least one function attribute, then one other function attribute with the largest remaining number of resources may be used for resource allocation of the at least one function attribute. Therefore, the remaining resources of other functional attributes can be used more reasonably for the resource allocation of the at least one functional attribute.
  • the request fails or is allocated according to the resource amount of the at least one functional attribute. That is, the number of resources of the at least one functional attribute cannot be supplemented with the number of remaining resources of other functional attributes. It can be seen that the method adopts two measures for the case that the quantity of resource allocation is insufficient, one can fail to return the user to the request, and the other allocates the quantity of resources of the at least one functional attribute. Give this user.
  • step 101 may further receive a request for resource release, and the specific implementation process includes: acquiring a function attribute of a resource in the request instruction, and then storing the released resource to the resource library. in. Thereby, the used resources can be re-stored to the In the repository, the number in the repository is supplemented. At the same time, the process of cyclical allocation of resources is realized, and the continuous resource allocation work can be guaranteed.
  • the method for resource allocation may specifically adopt the following steps:
  • Step 201 Receive a request instruction for applying for a resource.
  • Step 202 Extract a preset level resource allocation table, and search for the amount of resources allowed for each function attribute of the user level application in the request instruction.
  • the request instruction includes a user level
  • the step 201 receives the request instruction for applying for a resource
  • the preset level resource allocation table is extracted.
  • the hierarchical resource allocation table stores a correspondence between a user level and an allowed resource amount of each function attribute.
  • Step 203 Determine whether the amount of resources required for each function attribute of the application is greater than the amount of the allocateable resources. If yes, proceed to step 204. If not, proceed to step 205.
  • Step 204 Perform the step 206 by using the amount of resources allowed to be allocated as the amount of resources to be allocated.
  • step 204 may be that when the amount of resources required for each functional attribute of the application is greater than the amount of the allocateable resources, the request fails and the process is exited.
  • Step 205 Perform the step 206 by using the amount of resources required for each function attribute of the application as the amount of resources to be allocated.
  • Step 206 Obtain an IP address of the user.
  • each resource is set with an IP address, and all resources in the resource pool are partitioned according to the territory to which the IP address belongs.
  • the request instruction in step 201 may include a user IP address.
  • Step 207 Extract the resource library, obtain the resource of the partition to which the user IP address belongs, and allocate according to the resource quantity to be allocated.
  • Step 208 When the resource quantity of the at least one function attribute in the resource pool cannot satisfy the resource quantity of the application, look for other function attributes in the resource library to satisfy the remaining resources after the application. the amount.
  • Step 209 Acquire a preset replacement table, and determine whether other functional attributes having the remaining resource amount can replace the at least one functional attribute. If yes, go to step 210, otherwise go to step 211.
  • Step 210 Select a remaining resource that can replace the function attribute of the at least one function attribute for allocation, and exit the process.
  • Step 211 Perform allocation according to the quantity of resources of the at least one function attribute, and exit the process.
  • step 211 may also be to find that there is no function attribute capable of replacing the at least one function attribute, and the request fails, and the process is exited.
  • step 201 may also receive a resource release request instruction to obtain a function attribute of the resource in the request instruction.
  • the released resources are then stored into the repository. Therefore, the release process of the resource is completed in this embodiment, that is, the method of the present invention can not only allocate resources, but also receive release requests of resources and release resources.
  • this embodiment is capable of re-storing resources that do not require work into the repository, continuously replenishing resources for the repository to continuously allocate resources.
  • the resource allocation apparatus includes a request receiving unit 301 and a resource storage unit 303 respectively connected to the resource allocation unit 302.
  • the request receiving unit 301 is configured to, when receiving the request instruction for applying for a resource, determine the applied function attribute and the amount of resources required for each function attribute according to the applied resource.
  • the resource allocation unit 302 is configured to search the resource library, and allocate resources for each function attribute of the application according to the resource quantity required by each function attribute; when the resource quantity of at least one function attribute in the resource library cannot be When the resource amount of the application is satisfied, the remaining resource amounts of the other functional attributes satisfying the application are searched in the resource library, and the remaining resources that can be used for the at least one functional attribute are selected for allocation.
  • the resource storage unit 303 is configured to set a function attribute for each resource, and then store the resource information and the corresponding function attribute into the resource library.
  • the user level may be included in the request instruction.
  • the request receiving unit 301 receives the request instruction for applying for a resource
  • the preset level resource allocation table may be extracted. Finding an amount of resources allowed for each function attribute of the user level application in the request instruction, and determining whether the amount of resources required for each function attribute of the application is greater than the amount of the allocateable resources. If big Then, the resource allocating unit 302 fails the request or allocates according to the amount of resources allowed to be allocated, otherwise the resource allocating unit 302 allocates according to the amount of resources required for each functional attribute of the application.
  • the hierarchical resource allocation table stores a correspondence between a user level and an allowed resource amount of each function attribute. That is, each user level corresponds to at least one functional attribute, and each functional attribute corresponds to an amount of resources allowed to be allocated.
  • the request receiving unit 301 may further receive a request for releasing a resource, and then acquire a function attribute of the resource in the request instruction, and store the released resource into the resource library. Therefore, the device in this embodiment can re-storage the allocated resources into the resource library, that is, realize resource release.
  • each resource may be set with an IP address
  • the resource storage unit 303 partitions all resources in the resource pool according to the region to which the IP address belongs.
  • the request instruction may further include a user IP address.
  • the request receiving unit 301 can acquire the IP address of the user when receiving the request instruction for applying for the resource. Then, the resource library is extracted, and resources of the partition to which the user IP address belongs are obtained for allocation.
  • the resource allocation unit 302 selects the remaining resources that can be used for the at least one function attribute for allocation.
  • the specific implementation process is as follows:
  • a preset replacement table may be obtained to determine whether other functional attributes having the remaining amount of resources can replace the at least one functional attribute. According to the judgment result, if yes, the remaining resources capable of replacing the functional attributes of the at least one functional attribute are selected for allocation. Otherwise the request fails or is allocated according to the amount of resources of the at least one functional attribute.
  • the method, device, and electronic device for resource allocation provided by the present invention are creatively capable of efficiently and reasonably allocating resources in a resource management system according to a received resource request request; Differentiating between resources, different types of resources are allocated according to the request; and when one type of resource cannot satisfy the requested resource amount, other types of resources that can replace the type of resource can be automatically and intelligently used for supplementation.
  • an embodiment of the present invention further discloses an electronic device including at least one processor 810; and a memory 800 communicably connected to the at least one processor 810; wherein the memory 800 stores An instruction executed by the at least one processor 810, the instructions being executed by the at least one processor 810 to enable the at least one processor 810 to: set a functional attribute for each resource, and then to resource information and correspondence
  • the function attribute is stored in the resource library; when receiving the request instruction for requesting the resource, determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource; searching the resource library according to each The amount of resources required by the function attribute allocates resources for each function attribute of the application; when the resource quantity of at least one function attribute in the resource library cannot satisfy the resource quantity of the application, other attribute attributes are searched in the resource library.
  • the remaining resources that can be used for the at least one functional attribute are selected for allocation after the amount of remaining resources after the application is satisfied.
  • the electronic device also includes an input device 830 and an output device 840 that are electrically coupled to the memory 800 and the processor, the electrical connections preferably being connected by a bus.
  • the request instruction includes a user level, and when receiving a request instruction for applying for a resource, extracting a preset level resource allocation table, where the level resource allocation table is stored
  • the user level and each function attribute allow a corresponding relationship of the allocated resource amount
  • the determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource further includes: searching for the user level in the request instruction The amount of resources allowed for each functional attribute of the application; whether the amount of resources required for each functional attribute of the application is greater than the amount of the allocateable resource, and if the request is greater than the resource that is allowed to be allocated
  • the quantity is allocated; otherwise it is allocated according to the amount of resources required for each functional attribute of the application.
  • each resource is set with an IP address, and all resources in the resource pool are partitioned according to the region to which the IP address belongs, and the request instruction includes a user IP address;
  • the request for the resource is requested, the IP address of the user is obtained; the resource library is extracted, and the resource of the partition to which the user IP address belongs is obtained for allocation.
  • selecting the remaining resources that can be used for the at least one function attribute to perform the allocation includes: acquiring a preset replacement table, and determining whether other functional attributes having the remaining resource amount can replace the At least one functional attribute, if yes, selecting a remaining resource capable of replacing the functional attribute of the at least one functional attribute for allocation; otherwise the request fails or is allocated according to a resource amount of the at least one functional attribute.
  • the electronic device of this embodiment preferably acquires when a request for resource release is received
  • the function attribute of the resource in the request instruction stores the released resource into the resource library.
  • Embodiments of the present invention also disclose a non-volatile computer storage medium, wherein the storage medium stores computer-executable instructions that, when executed by an electronic device, enable the electronic device to: when received When requesting the resource request instruction, determining the applied function attribute and the amount of resources required for each function attribute according to the applied resource; searching for the resource library, and the amount of resources required according to each function attribute is the application
  • Each function attribute allocates a resource; when the resource quantity of at least one function attribute in the resource library cannot satisfy the resource quantity of the application, searching for the remaining function quantity of the other function attribute in the resource library after satisfying the application, and selecting The remaining resources that can be used for the at least one functional attribute are allocated.
  • the request instruction includes a user level, and when receiving a request instruction for applying for a resource, extracting a preset level resource allocation table, wherein the level resource is The allocation table stores a correspondence between the user level and each function attribute to allow the amount of resources to be allocated; determining, according to the requested resource, the applied function attribute and the amount of resources required for each function attribute further includes: searching for the request The amount of resources allowed in each function attribute of the user level application in the instruction; determining whether the amount of resources required for each functional attribute of the application is greater than the amount of the allocateable resource; if the request is greater than the request, the request fails or follows The amount of resources allowed to be allocated is allocated; otherwise, it is allocated according to the amount of resources required for each functional attribute of the application.
  • each resource is set with an IP address, and all resources in the resource library are partitioned according to the region to which the IP address belongs, and the request instruction includes the user IP.
  • the remaining resources that can be used for the at least one function attribute are selected for allocation, including: acquiring a preset replacement table, and determining other functional attributes having the remaining resource amount. Whether it is possible to replace the at least one functional attribute, and if so, to select a remaining resource capable of replacing the functional attribute of the at least one functional attribute for allocation; otherwise the request fails or is allocated according to the resource quantity of the at least one functional attribute .
  • the non-volatile computer storage medium of the embodiment preferably, when a request for releasing a resource is received, a function attribute of a resource in the request instruction is acquired, and the released resource is stored in the resource library.
  • the embodiment of the invention further provides a computer program product, the computer program product comprising A computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the method described in the above embodiments.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种资源分配的方法、装置和电子设备,包括当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。因此,所述资源分配的方法和装置解决在进行资源分配时不同类型的资源之间处于隔离状态,不能共享的问题。

Description

一种资源分配的方法、装置和电子设备
交叉引用
本申请要求在2016年03月30日提交中国专利局、申请号为201610195829.0、发明名称为“一种资源分配的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域,特别是指一种资源分配的方法、装置和电子设备。
背景技术
目前,资源管理系统可以对所有机器进行资源整合,使硬件资源虚拟化。
但是,现有的机器资源是按照不同的使用功能而进行区分的,各类型机器资源是隔离的,资源不共享。例如:上传机只用于视频上传,转码机只用于视频转码,CDN机器只用于视频分发。在使用过程中会出现某类机器很空闲,某类机器很繁忙的情况,空闲的机器资源不能充分利用,繁忙的机器使用后造成寿命变短。
发明内容
有鉴于此,本发明的目的在于提出一种资源分配的方法、装置和电子设备,解决在进行资源分配时不同类型的资源之间处于隔离状态,不能共享的问题。
基于上述目的本发明提供资源分配的方法,包括步骤:
对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;
当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;
当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
在一些实施例中,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表;其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;
判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
在一些实施例中,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区;所述请求指令中包括用户IP地址;
当接收到申请资源的请求指令时,获取用户的IP地址;
提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
在一些实施例中,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:
获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
在一些实施例中,还包括:
当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
在另一方面,本发明还提供了一种资源分配的方法和装置,包括:
请求接收单元,用于当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
资源分配单元,用于查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配;
资源存储单元,用于对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中。
在一些实施例中,所述请求指令中包括用户等级;所述请求接收单元当接收到申请资源的请求指令时,还用于:
提取预设的等级资源分配表;其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;
判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则所述资源分配单元该请求失败或按照所述允许分配的资源量进行分配;否则所述资源分配单元按照申请的每个功能属性所需的资源量进行分配。
在一些实施例中,所述每个资源设置有IP地址,所述资源存储单元根据IP地址所属地域将所述资源库中的所有资源进行分区;
所述请求指令中包括用户IP地址;所述请求接收单元,还用于:
当接收到申请资源的请求指令时,获取用户的IP地址;
提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
在一些实施例中,所述资源分配单元选择能够用于所述至少一种功能属性的剩余资源进行分配时,包括:
获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
在一些实施例中,所述请求接收单元,还用于:
当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
本发明实施例还提供一种电子设备,包括至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
上述的电子设备,其中,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
上述的电子设备,其中,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;当接收到申请资源的请求指令时,获取用户的IP地址;提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
上述的电子设备,其中,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
上述的电子设备,其中,当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
本发明实施例还提供一种非易失性计算机存储介质,其中,所述存储介 质存储有计算机可执行指令,所述计算机可执行指令当由电子设备执行时使得电子设备能够:对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
上述的非易失性计算机存储介质,其中,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
上述的非易失性计算机存储介质,其中,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;当接收到申请资源的请求指令时,获取用户的IP地址;提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
上述的非易失性计算机存储介质,其中,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
上述的非易失性计算机存储介质,其中,当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
本发明实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任一所述 的方法。
从上面所述可以看出,本发明提供的资源分配的方法和装置,资源分配的过程中若出现至少一种功能属性的资源量不能满足所述申请的资源量时,则可以采用将其他功能属性在满足所述申请后的剩余资源量用于该至少一种功能属性的资源分配。从而,保证了申请的每种功能属性资源的数量都能够得到满足。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明第一实施例中资源分配的方法流程示意图;
图2为本发明可参考实施例中资源分配的方法流程示意图;
图3为本发明实施例中资源分配装置的结构示意图;
图4为本发明实施例的电子设备的硬件结构示意图。
具体实施方式
下面将结合附图对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在本发明的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。
在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以 是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,还可以是两个元件内部的连通,可以是无线连接,也可以是有线连接。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。
此外,下面所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。
参阅图1所示,为本发明第一实施例中资源分配的方法流程示意图,所述资源分配的方法包括:
步骤101,接收到申请资源的请求指令。
在实施例中,所述请求指令中可以包括用户等级。进一步地,当步骤101接收到申请资源的请求指令时,便可以提取预设的等级资源分配表。其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系。
之后,查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量,判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量。根据判断结果,若大于则该请求失败或按照所述允许分配的资源量进行分配,否则按照申请的每个功能属性所需的资源量进行分配。从而,在该实施例中可以限制不同等级的用户申请每种类型资源的数量,防止过度的资源申请以及资源的浪费。同时,也可以对整个资源的分配过程更具掌控性。
步骤102,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量。
其中,对每个资源设置功能属性,在所述请求指令中包括所申请的功能属性以及每个功能属性所需的资源量。
步骤103,查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源。
其中,所述的资源库为预先设置,且存储有每个资源的资源信息和对应的功能属性。
在另一个实施例中,所述每个资源设置还设置有IP地址,根据IP地址所属地域可以将所述资源库中的所有资源进行分区。同时,所述请求指令中包括用户IP地址。进一步地,当步骤101接收到申请资源的请求指令时,则 可以获取用户的IP地址,然后提取所述资源库,获取该用户IP地址所属分区的资源进行分配。因此,本发明能够将所述的资源库按照IP地址将所有资源进行区域划分,并可以将请求中的IP地址与所述资源库中区域进行匹配。匹配成功后,便可以进行资源的分配。从而,可以使得分配的资源离该用户更近,分配的结果更合理、更佳。
步骤104,当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
在该实施例中,资源分配的过程中若出现至少一种功能属性的资源量不能满足所述申请的资源量时,则可以采用将其他功能属性在满足所述申请后的剩余资源量用于该至少一种功能属性的资源分配。从而,保证了申请的每种功能属性资源的数量都能够得到满足。
在实施例中,选择能够用于所述至少一种功能属性的剩余资源进行分配,其具体的实施过程包括:获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性。根据判断结果,若具有可以替换的其他功能属性,则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配。也就是说,可以将所述其他功能属性的剩余资源用于所述至少一种功能属性的资源分配。进一步地,若所述的其他功能属性中存在至少两个可以替换所述至少一个功能属性时,则可以将剩余资源数量最多的一个其他功能属性用于所述至少一种功能属性的资源分配。因此,可以更佳合理地将其他功能属性的剩余资源用于所述至少一种功能属性的资源分配。
另外,若不具有可以替换的其他功能属性,则该请求失败或按照所述至少一种功能属性的资源量进行分配。也就是说,无法用其他功能属性的剩余资源的数量来补充所述至少一种功能属性的资源数量。可以看出,本方法对于资源分配的数量不够用的情况,采取了两种措施——一种可以返给用户该次请求失败,另一种就将所述至少一种功能属性的资源数量分配给该用户即可。
作为本方法的另一个实施例,步骤101还可以接收到资源释放的请求,其具体的实施过程包括:获取该请求指令中资源的功能属性,然后将所述释放的资源存储到所述资源库中。从而,可以将使用完的资源重新存储到所述 资源库中,补充了资源库中数量。与此同时,实现了资源的循环分配的过程,且保证了可以进行持续的资源分配工作。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
作为一个可参考的实施例,参阅图2所示,所述资源分配的方法具体可采用如下步骤:
步骤201,接收到申请资源的请求指令。
步骤202,提取预设的等级资源分配表,查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量。
在实施例中,所述请求指令中包括用户等级,当步骤201接收到申请资源的请求指令时,则提取预设的等级资源分配表。其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系。
步骤203,判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则进行步骤204,若小于则进行步骤205。
步骤204,将所述允许分配的资源量作为要分配的资源量,进行步骤206。
在另一个实施例中,步骤204还可以是当所述申请的每个功能属性所需的资源量大于所述可分配的资源量时则该次请求失败,退出该流程。
步骤205,将所述申请的每个功能属性所需的资源量作为要分配的资源量,进行步骤206。
步骤206,获取用户的IP地址。
在该实施例中,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区。同时,步骤201中的所述请求指令可以包括用户IP地址。
步骤207,提取资源库,获取该用户IP地址所属分区的资源,根据所述要分配的资源量进行分配。
步骤208,当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源 量。
步骤209,获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性。若是则进行步骤210,否则进行步骤211。
步骤210,选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配,退出该流程。
步骤211,按照所述至少一种功能属性的资源数量进行分配,退出该流程。
在实施例中,步骤211还可以是查找不存在能够替换所述至少一种功能属性的功能属性则该请求失败,退出该流程。
作为另一个可参考的实施例,步骤201还可以接收到资源释放的请求指令,获取该请求指令中资源的功能属性。然后,将所述释放的资源存储到所述资源库中。从而,在该实施例中完成了资源的释放过程,即本发明所述的方法不仅能够分配资源,还可以接收资源的释放请求并释放资源。因此,该实施例能够将不需要工作的资源重新存储到所述资源库中,为所述资源库不断补充资源,以便持续不断的进行资源的分配。
在本发明的另一方面,还提供了一种资源分配的装置,如图3所示,所述资源分配的装置包括与资源分配单元302分别连接的请求接收单元301和资源存储单元303。其中,请求接收单元301用于当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量。然后,资源分配单元302用于查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源量进行分配。而资源存储单元303用于对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中。
在一个实施例中,所述请求指令中可以包括用户等级。所述请求接收单元301接收到申请资源的请求指令时,可以提取预设的等级资源分配表。查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量,判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量。若大 于则所述资源分配单元302该请求失败或按照所述允许分配的资源量进行分配,否则所述资源分配单元302按照申请的每个功能属性所需的资源量进行分配。
其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系。即,每一种用户等级对应具有至少一个功能属性,而每一个功能属性对应有允许分配的资源量。
另外,所述请求接收单元301还可以接收到资源释放的请求指令,然后获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。从而,该实施例中的装置能够将分配出去的资源重新存储到资源库中,即实现资源释放。
作为本装置的一个实施例,所述每个资源可以设置有IP地址,所述资源存储单元303根据IP地址所属地域将所述资源库中的所有资源进行分区。同时,所述请求指令中还可以包括用户IP地址。并且,所述请求接收单元301当接收到申请资源的请求指令时,可以获取用户的IP地址。然后,提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
作为另一个实施例,所述资源分配单元302选择能够用于所述至少一种功能属性的剩余资源进行分配时,具体的实施过程如下:
可以获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性。根据判断结果,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配。否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
需要说明的是,在本发明所述的资源分配的装置的具体实施内容,在上面所述的资源分配的方法中已经详细说明了,故在此重复内容不再说明。
综上所述,本发明提供的资源分配的方法、装置和电子设备,创造性地能够根据接收到的资源申请请求,将资源管理系统中的资源高效、合理的进行分配;其中,实现了不同种类资源的区分,根据请求分别对不同种类的资源进行分配;并且,当一种类型的资源不能够满足请求的资源量时,可以自动、智能地将可以替换该类型资源的其他类型资源用于补充无法满足的资源量;从而,优化了分配的过程和结果,提高了分配效率;与此同时,本发明具有广泛、重大的推广意义;最后,整个所述资源分配的方法、装置和电子设备紧凑,易于控制。
如图4所示,本发明实施例又公开了一种电子设备,包括至少一个处理器810;以及,与所述至少一个处理器810通信连接的存储器800;其中,所述存储器800存储有可被所述至少一个处理器810执行的指令,所述指令被所述至少一个处理器810执行,以使所述至少一个处理器810能够:对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。所述电子设备还包括与所述存储器800和所述处理器电连接的输入装置830和输出装置840,所述电连接优选为通过总线连接。
本实施例的电子设备,优选地,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
本实施例的电子设备,优选地,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;当接收到申请资源的请求指令时,获取用户的IP地址;提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
本实施例的电子设备,优选地,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
本实施例的电子设备,优选地,当接收到资源释放的请求指令时,获取 该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
本发明实施例还公开了一种非易失性计算机存储介质,其中,所述存储介质存储有计算机可执行指令,所述计算机可执行指令当由电子设备执行时使得电子设备能够:当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
本实施例的非易失性计算机存储介质,优选地,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
本实施例的非易失性计算机存储介质,优选地,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;当接收到申请资源的请求指令时,获取用户的IP地址;提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
本实施例的非易失性计算机存储介质,优选地,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
本实施例的非易失性计算机存储介质,优选地,当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
本发明实施例还提供了一种计算机程序产品,所述计算机程序产品包括 存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述实施例所述的方法。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保护范围之中。

Claims (21)

  1. 一种资源分配的方法,应用于终端,其特征在于,包括:
    对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;
    当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
    查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;
    当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
  2. 根据权利要求1所述的方法,其特征在于,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
    所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
  3. 根据权利要求1所述的方法,其特征在于,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;
    当接收到申请资源的请求指令时,获取用户的IP地址;
    提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
  4. 根据权利要求1所述的方法,其特征在于,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:
    获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属 性的资源量进行分配。
  5. 根据权利要求1至4任意一项所述的方法,其特征在于,还包括:
    当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
  6. 一种资源分配的装置,其特征在于,包括:
    请求接收单元,用于当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
    资源分配单元,用于查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配;
    资源存储单元,用于对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中。
  7. 根据权利要求6所述的装置,其特征在于,所述请求指令中包括用户等级;所述请求接收单元当接收到申请资源的请求指令时,还用于:
    提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
    查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;
    判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
  8. 根据权利要求6所述的装置,其特征在于,所述每个资源设置有IP地址,所述资源存储单元根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;所述请求接收单元,还用于:
    当接收到申请资源的请求指令时,获取用户的IP地址;
    提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
  9. 根据权利要求6所述的装置,其特征在于,所述资源分配单元选择能够用于所述至少一种功能属性的剩余资源进行分配时,包括:
    获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够 替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
  10. 根据权利要求6至9任意一项所述的装置,其特征在于,所述请求接收单元,还用于:
    当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
  11. 一种电子设备,其特征在于,包括至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
    对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;
    当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
    查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;
    当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
  12. 根据权利要求11所述的电子设备,其特征在于,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
    所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
  13. 根据权利要求11所述的电子设备,其特征在于,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所 述请求指令中包括用户IP地址;
    当接收到申请资源的请求指令时,获取用户的IP地址;
    提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
  14. 根据权利要求11所述的电子设备,其特征在于,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:
    获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
  15. 根据权利要求11至14中任意一项所述的电子设备,其特征在于,当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
  16. 一种非易失性计算机存储介质,其特征在于,所述存储介质存储有计算机可执行指令,所述计算机可执行指令当由电子设备执行时使得电子设备能够:
    对每个资源设置功能属性,然后将资源信息和对应的功能属性存储至资源库中;
    当接收到申请资源的请求指令时,根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量;
    查找所述资源库,根据每个功能属性所需的资源量为所述申请的每个功能属性分配资源;
    当该资源库中至少一种功能属性的资源量不能满足所述申请的资源量时,在资源库中查找其他功能属性在满足所述申请后的剩余资源量,选择能够用于所述至少一种功能属性的剩余资源进行分配。
  17. 根据权利要求16所述的非易失性计算机存储介质,其特征在于,所述请求指令中包括用户等级,当接收到申请资源的请求指令时,提取预设的等级资源分配表,其中,所述的等级资源分配表中存储有用户等级和每个功能属性允许分配资源量的对应关系;
    所述根据所申请的资源确定所申请的功能属性以及每个功能属性所需的资源量还包括:查找所述请求指令中该用户等级申请的每个功能属性允许分配的资源量;判断所述申请的每个功能属性所需的资源量是否大于所述可分 配的资源量,若大于则该请求失败或按照所述允许分配的资源量进行分配;否则按照申请的每个功能属性所需的资源量进行分配。
  18. 根据权利要求16所述的非易失性计算机存储介质,其特征在于,所述每个资源设置有IP地址,根据IP地址所属地域将所述资源库中的所有资源进行分区,所述请求指令中包括用户IP地址;
    当接收到申请资源的请求指令时,获取用户的IP地址;
    提取所述资源库,获取该用户IP地址所属分区的资源进行分配。
  19. 根据权利要求16所述的非易失性计算机存储介质,其特征在于,选择能够用于所述至少一种功能属性的剩余资源进行分配,包括:
    获取预先设置的替换表,判断具有剩余资源量的其他功能属性是否能够替换所述至少一种功能属性,若是则选择能够替换所述至少一种功能属性的功能属性的剩余资源进行分配;否则该请求失败或按照所述至少一种功能属性的资源量进行分配。
  20. 根据权利要求16至19中任意一项所述的非易失性计算机存储介质,其特征在于,当接收到资源释放的请求指令时,获取该请求指令中资源的功能属性,将所述释放的资源存储到所述资源库中。
  21. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,其特征在于,当所述程序指令被计算机执行时,使所述计算机执行上述任一权利要求所述的方法。
PCT/CN2016/095974 2016-03-30 2016-08-19 一种资源分配的方法、装置和电子设备 WO2017166584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610195829.0 2016-03-30
CN201610195829.0A CN105848012A (zh) 2016-03-30 2016-03-30 实时转码速率控制方法及装置

Publications (1)

Publication Number Publication Date
WO2017166584A1 true WO2017166584A1 (zh) 2017-10-05

Family

ID=56596304

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095974 WO2017166584A1 (zh) 2016-03-30 2016-08-19 一种资源分配的方法、装置和电子设备

Country Status (2)

Country Link
CN (1) CN105848012A (zh)
WO (1) WO2017166584A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727701A (zh) * 2019-09-06 2020-01-24 深圳壹账通智能科技有限公司 申请自动分配方法、装置、终端以及存储介质
CN110968416A (zh) * 2018-09-29 2020-04-07 中兴通讯股份有限公司 资源分配方法、装置、设备以及计算机可读存储介质
CN113485827A (zh) * 2021-06-30 2021-10-08 上海森浦信息服务有限公司 用于实现自动配置下发功能的数据处理方法、装置及存储介质
CN113721855A (zh) * 2021-09-01 2021-11-30 中国建设银行股份有限公司 存储资源的存储方法、装置、电子设备及计算机存储介质
CN113938392A (zh) * 2020-07-09 2022-01-14 亚信科技(南京)有限公司 资源分配方法、装置、电子设备及计算机可读存储介质
CN115269207A (zh) * 2022-09-29 2022-11-01 浙江省公众信息产业有限公司无线运营分公司 一种用于vCPE网元分配资源的方法和系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878703B (zh) * 2017-03-14 2019-01-04 珠海全志科技股份有限公司 一种行车记录仪录像检测方法
CN107038736B (zh) * 2017-03-17 2021-07-06 腾讯科技(深圳)有限公司 一种基于帧率的动画展示方法及终端设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761469A (zh) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 一种资源池的分配方法和装置
US20130283286A1 (en) * 2012-04-23 2013-10-24 Electronics And Telecommunications Research Institute Apparatus and method for resource allocation in clustered computing environment
CN104796355A (zh) * 2008-01-10 2015-07-22 苹果公司 用于网络资源分配的装置和方法
US20150326495A1 (en) * 2012-12-14 2015-11-12 Nec Corporation System construction device and system construction method
CN105827539A (zh) * 2016-03-30 2016-08-03 乐视控股(北京)有限公司 一种资源分配的方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104796355A (zh) * 2008-01-10 2015-07-22 苹果公司 用于网络资源分配的装置和方法
CN102761469A (zh) * 2011-04-27 2012-10-31 阿里巴巴集团控股有限公司 一种资源池的分配方法和装置
US20130283286A1 (en) * 2012-04-23 2013-10-24 Electronics And Telecommunications Research Institute Apparatus and method for resource allocation in clustered computing environment
US20150326495A1 (en) * 2012-12-14 2015-11-12 Nec Corporation System construction device and system construction method
CN105827539A (zh) * 2016-03-30 2016-08-03 乐视控股(北京)有限公司 一种资源分配的方法和装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968416A (zh) * 2018-09-29 2020-04-07 中兴通讯股份有限公司 资源分配方法、装置、设备以及计算机可读存储介质
CN110727701A (zh) * 2019-09-06 2020-01-24 深圳壹账通智能科技有限公司 申请自动分配方法、装置、终端以及存储介质
CN113938392A (zh) * 2020-07-09 2022-01-14 亚信科技(南京)有限公司 资源分配方法、装置、电子设备及计算机可读存储介质
CN113938392B (zh) * 2020-07-09 2023-11-14 亚信科技(南京)有限公司 资源分配方法、装置、电子设备及计算机可读存储介质
CN113485827A (zh) * 2021-06-30 2021-10-08 上海森浦信息服务有限公司 用于实现自动配置下发功能的数据处理方法、装置及存储介质
CN113721855A (zh) * 2021-09-01 2021-11-30 中国建设银行股份有限公司 存储资源的存储方法、装置、电子设备及计算机存储介质
CN115269207A (zh) * 2022-09-29 2022-11-01 浙江省公众信息产业有限公司无线运营分公司 一种用于vCPE网元分配资源的方法和系统

Also Published As

Publication number Publication date
CN105848012A (zh) 2016-08-10

Similar Documents

Publication Publication Date Title
WO2017166584A1 (zh) 一种资源分配的方法、装置和电子设备
WO2016202123A1 (zh) 文件推送方法、装置和系统
KR101791594B1 (ko) 저장 네트워크 내의 저장 관리
KR101885688B1 (ko) 낮은 지연속도 데이터 액세스를 위한 데이터 스트림의 분할
US20140173614A1 (en) Sending tasks between virtual machines based on expiration times
WO2017107414A1 (zh) 文件操作方法和装置
US20180075050A1 (en) Indexing implementing method and system in file storage
JP6001690B2 (ja) クラスタコンピューティングシステム用のマスタデバイス、スレーブデバイスおよびそのコンピューティング方法
WO2013078583A1 (zh) 优化数据访问的方法及装置、优化数据存储的方法及装置
WO2017005094A1 (zh) 一种数据查询方法和装置
CN105843819B (zh) 一种数据导出方法及装置
US11287999B2 (en) Multi-instance 2LM architecture for SCM applications
US20140047059A1 (en) Method for improving mobile network performance via ad-hoc peer-to-peer request partitioning
WO2016101799A1 (zh) 一种基于分布式系统的业务分配方法及装置
TW201545117A (zh) 縮圖影像建立
CN105677751B (zh) 关系型数据库的调度方法及系统
TW201702870A (zh) 一種資源分配方法和裝置
CN111782134A (zh) 数据处理方法、装置、系统和计算机可读存储介质
US9716666B2 (en) Process cage providing attraction to distributed storage
WO2023051228A1 (zh) 样例数据的处理方法、装置、设备和存储介质
KR20140145748A (ko) 다중 코어 환경에서 프로세스의 할당 방법 및 장치
WO2021179170A1 (zh) 数据推送方法、装置、服务器及存储介质
WO2015058594A1 (zh) 一种进程加载方法、装置及系统
TWI706343B (zh) 樣本回放資料存取方法、裝置及電腦設備
CN111090653A (zh) 一种数据缓存方法、装置及相关产品

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: 16896356

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896356

Country of ref document: EP

Kind code of ref document: A1