CN109981310A - Method for managing resource, device and storage medium - Google Patents

Method for managing resource, device and storage medium Download PDF

Info

Publication number
CN109981310A
CN109981310A CN201711445115.1A CN201711445115A CN109981310A CN 109981310 A CN109981310 A CN 109981310A CN 201711445115 A CN201711445115 A CN 201711445115A CN 109981310 A CN109981310 A CN 109981310A
Authority
CN
China
Prior art keywords
resource
computing nodes
version number
target computing
idling
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201711445115.1A
Other languages
Chinese (zh)
Other versions
CN109981310B (en
Inventor
谢忠贤
浦世亮
周明耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201711445115.1A priority Critical patent/CN109981310B/en
Publication of CN109981310A publication Critical patent/CN109981310A/en
Application granted granted Critical
Publication of CN109981310B publication Critical patent/CN109981310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0859Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions

Abstract

The invention discloses a kind of method for managing resource, device and storage mediums, belong to cluster video analysis field.Method includes: when receiving the resource acquisition request of task scheduling apparatus transmission, the target computing nodes of performance objective task are determined to based on the target resource quantity that resource acquisition request carries, idling-resource quantity and corresponding resource version number to target computing nodes in the corresponding relationship of storage are updated, and the resource acquisition of the node identification for carrying target computing nodes and updated resource version number response is sent to task scheduling apparatus, when the resource reporting request for receiving target computing nodes transmission, and when the resource version number carried in resource reporting request and updated resource version number difference, it abandons being updated the idling-resource quantity of target computing nodes in corresponding relationship, the problem of so as to avoid resource management error, improve the efficiency of resource management.

Description

Method for managing resource, device and storage medium
Technical field
The present invention relates to cluster video analysis field, in particular to a kind of method for managing resource, device and storage medium.
Background technique
With the development of network communication technology and video storage technology, cluster analysis is carried out to video or picture and is also more come More important.In order to realize load balancing and improve video or picture cluster analysis dispatching, generally use resource pipe Reason system realizes the resource management and task schedule during video or picture analyzing.
Currently, resource management system usually may include resource management apparatus, at least one task scheduling apparatus and at least One calculate node.Wherein, resource management apparatus is responsible for resource collection and distribution resource, and task scheduling apparatus is responsible for resource request It is distributed with task, calculate node is responsible for reporting resource and execution task.It that is to say, each calculate node is every preset duration to money Source control device reports itself primary current idling-resource quantity, can be with when any task scheduling apparatus receives task Resource acquisition request is sent to resource management apparatus, carries target resource quantity, target resource quantity in resource acquisition request Refer to resource quantity required when executing the task.When resource management apparatus receives resource acquisition request, can be based on The idling-resource quantity of record is determined to execute the target computing nodes of the task from least one calculate node, and will The idling-resource quantity of the target computing nodes of record is updated.Later, resource management apparatus is by the section of target computing nodes Point identification is sent to task scheduling apparatus.In this way, the task and goal resource quantity can be handed down to mesh by task scheduling apparatus Calculate node is marked, executes the task by target computing nodes, meanwhile, target computing nodes are also based on target resource quantity pair The idling-resource quantity of itself is updated, and the idling-resource quantity for reporting itself current to resource management apparatus again.
However, in the actual implementation process, may occur network speed due to poor, Network Abnormal or service crashes etc. Resource request success but generation the case where issue task not in time or issue mission failure, in this way, target computing nodes are just not Meeting is timely or can not receive the task, so that target computing nodes report idling-resource quantity again after preset duration When, the idling-resource quantity of record will be updated to the idling-resource quantity that target computing nodes report by resource management apparatus, And then the problem of just will appear resource management error.
Summary of the invention
In order to solve the problems, such as that resource management in the related technology malfunctions, the embodiment of the invention provides a kind of resource management sides Method, device and storage medium.The technical solution is as follows:
In a first aspect, providing a kind of method for managing resource, it is applied in resource management apparatus, which comprises
When receiving the resource acquisition request of task scheduling apparatus transmission, based on what is carried in resource acquisition request Target resource quantity, and the calculate node of storage identifies, the corresponding pass between idling-resource quantity and resource version number three System is determined to the target computing nodes of performance objective task, when the target resource quantity refers to the execution goal task Required resource quantity;
Based on the target resource quantity to the idling-resource quantity of target computing nodes described in the corresponding relationship and Corresponding resource version number is updated, and by the node identification for carrying the target computing nodes and updated resource version Number resource acquisition response be sent to the task scheduling apparatus so that the task scheduling apparatus issues the goal task It is executed to the target computing nodes;
After sending the resource acquisition response, asked when receiving the resource reporting that the target computing nodes are sent It asks, and when the resource version number carried in resource reporting request and updated resource version number difference, abandons to described The idling-resource quantity of target computing nodes described in corresponding relationship is updated.
Optionally, described to abandon being updated the idling-resource quantity of target computing nodes described in the corresponding relationship Later, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and the target computing nodes described in timing course report When with the updated resource version number difference, by the idling-resource number of target computing nodes described in the corresponding relationship Amount and corresponding resource version number are updated to the idling-resource quantity and corresponding resource version carried in the resource reporting request This number.
Optionally, described to abandon being updated the idling-resource quantity of target computing nodes described in the corresponding relationship Later, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and the target computing nodes described in timing course report When with the updated resource version number difference, by the idling-resource number of target computing nodes described in the corresponding relationship Amount is updated to the idling-resource quantity carried in the resource reporting request, and target described in the corresponding relationship is calculated and is saved The corresponding resource version number of point is sent to the target computing nodes, so that the target computing nodes are by the resource version of record Number it is updated to the resource version number received.
Optionally, described to abandon being updated the idling-resource quantity of target computing nodes described in the corresponding relationship Later, further includes:
Prompt information is sent to the target computing nodes, the prompt information is for prompting the target computing nodes The idling-resource of target computing nodes described in the idling-resource quantity of report and corresponding resource version number and the corresponding relationship Quantity and corresponding resource version number are inconsistent;
The resource updates request that the target computing nodes are sent is received, carries the target in the resource updates request The idling-resource quantity of calculate node record, and resource updates request is that the target computing nodes receive the prompt Start timing when information, and reaches preset duration in timing duration and do not receive the prompt letter of resource consistence in timing course It is sent when breath;
The idling-resource quantity of target computing nodes described in the corresponding relationship is updated to the resource updates request The idling-resource quantity of middle carrying, and the corresponding resource version number of target computing nodes described in the corresponding relationship is sent to The target computing nodes, so that the resource version number of record is updated to the resource version received by the target computing nodes Number.
Optionally, the method also includes:
The resource reporting request requested, and be currently received when receiving the resource reporting that the target computing nodes are sent When carrying idling-resource quantity, corresponding resource version number and required parameter, target described in the corresponding relationship is calculated The idling-resource quantity of node and corresponding resource version number are updated to the sky carried in the resource reporting being currently received request Not busy resource quantity and corresponding resource version number, it is institute that the required parameter, which is used to indicate the resource reporting request being currently received, State the resource reporting request that target computing nodes are sent for the first time after restart.
Second aspect, provides a kind of resource management apparatus, and described device includes:
Determining module, for being obtained based on the resource when receiving the resource acquisition request of task scheduling apparatus transmission Take the target resource quantity carried in request, and calculate node mark, idling-resource quantity and the resource version number three of storage Corresponding relationship between person, is determined to the target computing nodes of performance objective task, and the target resource quantity refers to execution Required resource quantity when the goal task;
First sending module, for being based on the target resource quantity to target computing nodes described in the corresponding relationship Idling-resource quantity and corresponding resource version number be updated, and by carry the target computing nodes node identification and The resource acquisition response of updated resource version number is sent to the task scheduling apparatus, so that the task scheduling apparatus will The goal task is handed down to the target computing nodes to execute;
First update module, for after sending resource acquisition response, when receiving the target computing nodes The resource reporting of transmission is requested, and the resource version number carried in resource reporting request and updated resource version number are not Meanwhile it abandoning being updated the idling-resource quantity of target computing nodes described in the corresponding relationship.
Optionally, described device further include:
Timing module carries out timing for starting;
Second update module, for reaching preset duration and the target computing nodes described in timing course when timing duration The resource version number reported with the updated resource version number difference when, by target described in the corresponding relationship calculate The idling-resource quantity of node and corresponding resource version number are updated to the idling-resource number carried in the resource reporting request Amount and corresponding resource version number.
Optionally, described device further include:
Second timing module carries out timing for starting;
Third update module, for reaching preset duration and the target computing nodes described in timing course when timing duration The resource version number reported with the updated resource version number difference when, by target described in the corresponding relationship calculate The idling-resource quantity of node is updated to the idling-resource quantity carried in resource reporting request, and by the corresponding relationship Described in the corresponding resource version number of target computing nodes be sent to the target computing nodes so that the target computing nodes The resource version number of record is updated to the resource version number received.
Optionally, described device further include:
Second sending module, for sending prompt information to the target computing nodes, the prompt information is for prompting The idling-resource quantity and corresponding resource version number and target described in the corresponding relationship that the target computing nodes report The idling-resource quantity of calculate node and corresponding resource version number are inconsistent;
Receiving module, the resource updates request sent for receiving the target computing nodes, the resource updates request The middle idling-resource quantity for carrying the target computing nodes record, and resource updates request is the target computing nodes Start timing when receiving the prompt information, and reaches preset duration in timing duration and do not receive money in timing course It is sent when the consistent prompt information in source;
4th update module, for the idling-resource quantity of target computing nodes described in the corresponding relationship to be updated to The idling-resource quantity carried in the resource updates request, and target computing nodes described in the corresponding relationship are corresponding Resource version number is sent to the target computing nodes, so that the resource version number of record is updated to by the target computing nodes The resource version number received.
Optionally, described device further include:
5th update module for requesting when the resource reporting for receiving the target computing nodes transmission, and currently connects When the resource reporting request received carries idling-resource quantity, corresponding resource version number and required parameter, by the correspondence The idling-resource quantity of target computing nodes described in relationship and corresponding resource version number are updated to the resource being currently received The idling-resource quantity carried in request and corresponding resource version number are reported, the required parameter, which is used to indicate, to be currently received Resource reporting request be the target computing nodes send for the first time after restart resource reporting request.
The third aspect, provides a kind of resource management system, and the resource management system includes resource management apparatus, at least one A task scheduling apparatus and at least one calculate node;
For any task scheduling apparatus, the task scheduling apparatus is used to send resource to the resource management apparatus and obtain Request is taken, target resource quantity is carried in the resource acquisition request, when the target resource quantity refers to performance objective task Required resource quantity;
The resource management apparatus is based on the target resource quantity for receiving the resource acquisition request, and The calculate node mark of storage, the corresponding relationship between idling-resource quantity and resource version number three are determined to execute institute The target computing nodes of goal task are stated, based on the target resource quantity to target computing nodes described in the corresponding relationship Idling-resource quantity and corresponding resource version number be updated, and by carry the target computing nodes node identification and The resource acquisition response of updated resource version number is sent to the task scheduling apparatus;
The task scheduling apparatus is also used to receive the resource acquisition response, the node based on the target computing nodes The goal task is handed down to the target computing nodes to execute by mark, and by the target when issuing the goal task Resource quantity and updated resource version number are sent to the target computing nodes;
The resource management apparatus is also used to after sending the resource acquisition response, is calculated when receiving the target The resource reporting request that node is sent, and the resource version number carried in resource reporting request and updated resource version When number difference, abandon being updated the idling-resource quantity of target computing nodes described in the corresponding relationship.
Optionally, the target computing nodes are used in the goal task for receiving the task scheduling apparatus and issuing When, according to the resource version number that the task scheduling apparatus is sent, update the resource version number of self record.
Optionally, the target computing nodes are also used in the resource version number sent according to the task scheduling apparatus, Before the resource version number for updating self record, resource version number that the task scheduling apparatus is sent and self record are judged Whether the relationship of resource version number meets preset strategy, if meeting, the resource version number of self record is updated to described appoint The resource version number that business dispatching device is sent;If not meeting, the resource version number of self record is not updated.
Fourth aspect, provides a kind of terminal, and the terminal includes memory, processor and is stored on the memory And the computer program that can be run on the processor, the processor realize above-mentioned first party when executing said program code Method described in face.
5th aspect, provides a kind of computer readable storage medium, finger is stored on the computer readable storage medium The step of enabling, above-mentioned first aspect the method realized when described instruction is executed by processor.
Technical solution provided in an embodiment of the present invention has the benefit that the idling-resource by the way that calculate node is arranged The corresponding resource version number of quantity, when the resource reporting request for receiving target computing nodes transmission, and in resource reporting request When corresponding with target computing nodes in the updated corresponding relationship resource version number difference of the resource version number of carrying, abandon pair The idling-resource quantity of target computing nodes is updated in corresponding relationship, and the received resource reporting of resource management apparatus is avoided to ask When seeking resource version number resource corresponding with target computing nodes in corresponding relationship version number's difference of carrying, to corresponding relationship After the idling-resource quantity of middle target computing nodes is updated, the problem of causing resource management to malfunction, resource pipe is improved The efficiency of reason.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of resource management system structural schematic diagram provided in an embodiment of the present invention;
Fig. 2 is a kind of method for managing resource flow chart provided in an embodiment of the present invention;
Fig. 3 is another method for managing resource flow chart provided in an embodiment of the present invention;
Fig. 4 is a kind of resource management apparatus structural schematic diagram provided in an embodiment of the present invention;
Fig. 5 is another resource management apparatus structural schematic diagram provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
In order to make it easy to understand, before to the embodiment of the present invention carrying out that explanation is explained in detail, first to the embodiment of the present invention System architecture be introduced.
Fig. 1 is a kind of resource management system structural schematic diagram provided in an embodiment of the present invention.Referring to Fig. 1, the resource management System includes resource management apparatus 101, at least one task scheduling apparatus 102 and at least one calculate node 103, resource management Device 101 is responsible for resource and collects and distribute resource, and task scheduling apparatus 102 is responsible for resource request and task distribution, calculate node 103 are responsible for reporting resource and execution task.
For any task scheduling apparatus 102, task scheduling apparatus 102 is used to send resource to resource management apparatus 101 Acquisition request, the resource acquisition request in carry target resource quantity, target resource quantity refers to required when performance objective task Resource quantity;
Resource management apparatus 101 is based on target resource quantity for receiving resource acquisition request, and the meter of storage Corresponding relationship between operator node mark, idling-resource quantity and resource version number three, is determined to performance objective task Target computing nodes 103, based on target resource quantity to the idling-resource quantity of target computing nodes 103 in corresponding relationship and right The resource version number answered is updated, and by carry target computing nodes 103 node identification and updated resource version number Resource acquisition response be sent to task scheduling apparatus 102;
Task scheduling apparatus 102 is also used to receive resource acquisition response, and the node identification based on target computing nodes 103 will Goal task is handed down to target computing nodes 103 to execute, and when issuing goal task by target resource quantity and after updating Resource version number be sent to target computing nodes 103;
Resource management apparatus 101 is also used to after sending resource acquisition response, is sent out when receiving target computing nodes 103 The resource reporting request sent, and when the resource version number carried in resource reporting request and updated resource version number difference, It abandons being updated the idling-resource quantity of target computing nodes 103 in corresponding relationship.
Optionally, target computing nodes 103 are used for the root when receiving the goal task that task scheduling apparatus 102 issues According to the resource version number that task scheduling apparatus 102 is sent, the resource version number of self record is updated.
Optionally, target computing nodes 103 are also used in the resource version number sent according to task scheduling apparatus 102, more Before the resource version number of new self record, the money for the resource version number and self record that task scheduling apparatus 102 is sent is judged Whether the relationship of source version number meets preset strategy, if meeting, the resource version number of self record is updated to task schedule The resource version number that device 102 is sent;If not meeting, the resource version number of self record is not updated.
It should be noted that may include at least one task scheduling apparatus in practical application, in resource management system, with And at least one calculate node, Fig. 1 for a task scheduling apparatus and a calculate node only to be illustrated, not The embodiment of the present invention is constituted and is limited.
Next detailed explanation will be carried out to method for managing resource provided in an embodiment of the present invention in conjunction with attached drawing.Figure 2 be a kind of method for managing resource flow chart provided in an embodiment of the present invention, is applied in resource management apparatus, referring to fig. 2, the party Method includes the following steps:
Step 201: when receiving the resource acquisition request of task scheduling apparatus transmission, based in resource acquisition request The target resource quantity of carrying, and the calculate node of storage identify, between idling-resource quantity and resource version number three Corresponding relationship, is determined to the target computing nodes of performance objective task, and target resource quantity refers to performance objective task when institute The resource quantity needed.
Step 202: based on target resource quantity to the idling-resource quantity and correspondence of target computing nodes in corresponding relationship Resource version number be updated, and the resource of the node identification and updated resource version number of target computing nodes will be carried It obtains response and is sent to the task scheduling apparatus, so that goal task is handed down to target computing nodes by the task scheduling apparatus It executes.
Step 203: after sending resource acquisition response, when the resource reporting for receiving target computing nodes transmission is asked It asks, and when the resource version number carried in resource reporting request and updated resource version number difference, abandons closing to corresponding The idling-resource quantity of target computing nodes is updated in system.
Optionally, it abandons after being updated to the idling-resource quantity of target computing nodes in corresponding relationship, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and target computing nodes report in timing course with When updated resource version number difference, by the idling-resource quantity of target computing nodes in corresponding relationship and corresponding resource version This number is updated to the idling-resource quantity carried in resource reporting request and corresponding resource version number.
Optionally, it abandons after being updated to the idling-resource quantity of target computing nodes in corresponding relationship, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and the target computing nodes described in timing course report When with the updated resource version number difference, by the idling-resource number of target computing nodes described in the corresponding relationship Amount is updated to the idling-resource quantity carried in the resource reporting request, and target described in the corresponding relationship is calculated and is saved The corresponding resource version number of point is sent to the target computing nodes, so that the target computing nodes are by the resource version of record Number it is updated to the resource version number received.
Optionally, it abandons after being updated to the idling-resource quantity of target computing nodes in corresponding relationship, further includes:
Prompt information, the idle money which is used to that target computing nodes to be prompted to report are sent to target computing nodes Source quantity and corresponding resource version number and the idling-resource quantity of target computing nodes in the corresponding relationship and corresponding resource Version number is inconsistent;
The resource updates request that target computing nodes are sent is received, carries target computing nodes note in resource updates request The idling-resource quantity of record, and the resource updates request to start timing when receiving the prompt information for target computing nodes, and The transmission when timing duration reaches preset duration and does not receive the prompt information of resource consistence in timing course;
The idling-resource quantity of target computing nodes in corresponding relationship is updated to the sky carried in resource updates request Not busy resource quantity, and the corresponding resource version number of target computing nodes in corresponding relationship is sent to target computing nodes, so that The resource version number of record is updated to the resource version number received by target computing nodes.
Optionally, this method further include:
When the resource reporting request carrying for receiving the resource reporting request of target computing nodes transmission, and being currently received When idling-resource quantity, corresponding resource version number and required parameter, the idle of target computing nodes in corresponding relationship is provided Source quantity and corresponding resource version number be updated in the resource reporting being currently received request the idling-resource quantity that carries and Corresponding resource version number, it is target computing nodes in weight which, which is used to indicate the resource reporting request being currently received, The resource reporting request sent for the first time after opening.
In conclusion the corresponding resource version number of idling-resource quantity of calculate node is provided in the embodiment of the present invention, When the resource reporting request for receiving target computing nodes transmission, and in the resource reporting request resource version number that carries with more In corresponding relationship after new when the corresponding resource version number difference of the idling-resource quantity of target computing nodes, abandon closing to corresponding The idling-resource quantity of target computing nodes is updated in system, avoids taking in the received resource reporting request of resource management apparatus It is right when corresponding with the idling-resource quantity of target computing nodes in the corresponding relationship resource version number difference of the resource version number of band After the idling-resource quantity of target computing nodes is updated in corresponding relationship, so that resource management apparatus takes for target meter The problem of idling-resource quantity in operator node is more than actual idling-resource quantity, resource management is caused to malfunction, improves money The efficiency of source control.
Fig. 3 is a kind of method for managing resource flow chart provided in an embodiment of the present invention, and the embodiment of the present invention will be in conjunction with Fig. 3 pairs Above-mentioned embodiment shown in Fig. 2 carries out expansion explanation.Referring to Fig. 3, this method comprises the following steps:
Step 301: when task scheduling apparatus receives goal task, determining target resource quantity, and to resource management Device sends resource acquisition request, carries target resource quantity in resource acquisition request, target resource quantity refers to execution mesh Required resource quantity when mark task.
The task scheduling apparatus can be any task scheduling apparatus in resource management system shown in above-mentioned.The task The corresponding relationship being stored in dispatching device between pre-set task parameters and resource quantity, when task scheduling apparatus receives It, can be based on the task parameters of goal task, in the corresponding relationship between task parameters and resource quantity when to goal task Corresponding resource quantity is obtained, the resource quantity that will acquire is determined as target resource quantity.Later, it is sent to resource management apparatus Carry the resource acquisition request of target resource quantity.
For example, the corresponding relationship between the pre-set task parameters stored in the task scheduling apparatus and resource quantity It can be as shown in table 1 below, it is assumed that goal task is one section of video of storage, and the resolution ratio of the video is X, it is assumed that shown in table 1 Determine that range belonging to the resolution ratio of the video is X2 < X≤X3 in corresponding relationship.At this point it is possible to by 1 intermediate-resolution range X2 of table The corresponding resource quantity of < X≤X3 " 3GPU " is determined as target resource quantity.
Table 1
Resolving range Resource quantity
X1<X≤X2 1GPU
X2<X≤X3 2GPU
X3<X≤X4 3GPU
…… ……
It should be noted that the embodiment of the present invention is only with shown in above-mentioned table 1 between resolving range and resource quantity The corresponding relationship between the task parameters of storage and resource quantity is illustrated for corresponding relationship, above-mentioned table 1 is not to this Inventive embodiments, which are constituted, to be limited.
Step 302: when resource management apparatus receives the resource acquisition request of task scheduling apparatus transmission, being based on the money The target resource quantity carried in the acquisition request of source, and calculate node mark, idling-resource quantity and the resource version of storage Corresponding relationship between number three, is determined to the target computing nodes of performance objective task.
Wherein, pre-set calculate node mark, idling-resource quantity and resource version are stored in resource management apparatus Corresponding relationship between this number three can be from corresponding relationship really when resource management apparatus receives resource acquisition request Fixed all calculate nodes for being able to carry out goal task, and select a calculate node as target from determining calculate node Calculate node, wherein the calculate node for being able to carry out goal task refers to all idling-resource quantity not less than target resource quantity Calculate node.
For example, between the calculate node mark of resource management apparatus storage, idling-resource quantity and resource version number three Corresponding relationship can be as shown in table 2 below, it is assumed that target resource quantity is " 3GPU ", at this point it is possible to determine idle money from table 1 There are two calculate node of the source quantity more than or equal to " 3GPU ", respectively " calculate node 2 " and " calculate node 3 ", it is assumed that choosing Selecting " calculate node 2 " is target computing nodes.
Table 2
Calculate node mark Resource quantity Resource version number
Calculate node 1 2GPU 0
Calculate node 2 3GPU 0
Calculate node 3 6GPU 0
…… …… ……
It should be noted that the embodiment of the present invention only with calculate node shown in above-mentioned table 2 mark, idling-resource quantity with Corresponding relationship between resource version number three is illustrated, and above-mentioned table 2 does not constitute the embodiment of the present invention and limits.
In addition, resource management apparatus is receiving resource acquisition request, and according to target resource quantity from the correspondence of storage When determining that the obtained calculate node for being able to carry out goal task has multiple in relationship, in order to guarantee the calculate node maximum free time Resource utilization can determine the idling-resource quantity of the multiple calculate node difference between target resource quantity respectively, Select the smallest calculate node of difference to be used as target computing nodes later so that target computing nodes in performance objective task and When remaining idling-resource lazy weight is to execute other tasks, reduce the waste of resource as far as possible, to the greatest extent benefit Use resource.
In practical application, determine that is obtained is able to carry out goal task from the corresponding relationship of storage in resource management apparatus Calculate node when having multiple, also can choose the maximum calculating section of difference between idling-resource quantity and target resource quantity Point, and the calculate node of selection is determined as target computing nodes, so that target computing nodes are appointed in performance objective When business, still there are enough remaining idling-resources, guarantees that target computing nodes do not influence it in performance objective task and execute other Task.It is of course also possible to determine target computing nodes by other means, this present invention is not limited.
Step 303: resource management apparatus provides the idle of target computing nodes in corresponding relationship based on target resource quantity Source quantity and corresponding resource version number are updated, and by the node identification for carrying target computing nodes and updated resource The resource acquisition response of version number is sent to the task scheduling apparatus.
It should be noted that working as resource management apparatus based on target resource quantity to target computing nodes in corresponding relationship It, can be directly by the sky of target computing nodes in corresponding relationship when idling-resource quantity and corresponding resource version number are updated Not busy resource quantity subtracts target resource quantity, updates obtained surplus resources quantity as target computing nodes in corresponding relationship Idling-resource quantity afterwards, to realize the update to the idling-resource quantity of target computing nodes in corresponding relationship.
And the update for the corresponding resource version number of target computing nodes in corresponding relationship, it can be according to preset strategy It is updated, which can preset, and the preset strategy can be Linear Strategy, such as by current resource version Result after this number plus 1 is as updated resource version number, or result after subtracting 1 for current resource version number is as more Resource version number after new, naturally it is also possible to be other numbers that add deduct;The preset strategy is also possible to other more new strategies, example Such as using the result after current resource version number square as updated resource version number, this present invention is not limited.
Further, resource management apparatus have updated the corresponding resource version number of target computing nodes in corresponding relationship it Afterwards, resource management apparatus needs to carry the node identification of target computing nodes and the corresponding resource version number of target computing nodes It is sent to task scheduling apparatus in resource acquisition response, the resource acquisition request that task scheduling apparatus is sent is responded, Indicate that successfully resource is arrived in application.
Step 304: when task scheduling apparatus receives the resource acquisition response of resource management apparatus transmission, target being appointed Business is handed down to target computing nodes to execute, and sends target resource quantity and updated resource version to target computing nodes Number.
Wherein, when task scheduling apparatus receives the resource acquisition response of resource management apparatus transmission, the resource is obtained The node identification of the target computing nodes carried in acquisition response and updated resource version number, according to the target meter got The node identification of operator node issues goal task to target computing nodes, and sends target resource quantity and updated resource version This number is given target computing nodes.
In addition, target computing nodes are periodically to send resource reporting request to resource management apparatus, and work as target It, can be by updating idling-resource quantity with mode identical in step 303 when calculate node receives goal task, and judge to appoint Whether the relationship of the resource version number of resource version number and self record that business dispatching device is sent meets preset strategy, if symbol It closes, then the resource version number of self record is updated to the resource version number of task scheduling apparatus transmission;If not meeting, not more The resource version number of new self record.To be carried out more to the idling-resource quantity of self record and corresponding resource version number Newly, resource reporting request can be sent to resource management apparatus later, and carries target computing nodes note in resource reporting request The idling-resource quantity of record and corresponding resource version number.
Step 305: after resource management apparatus sends resource acquisition response, being sent when receiving target computing nodes Resource reporting request, and the resource version number that carries and when updated resource version number difference in resource reporting request, It abandons being updated the idling-resource quantity of target computing nodes in corresponding relationship.
Wherein, when the resource version number carried in resource reporting request is identical as updated resource version number, table Show that the resource version number of target computing nodes at this time is consistent, target computing nodes discharge after having executed task in order to prevent The case where resource, the idling-resource quantity of target computing nodes in corresponding relationship can be updated to resource by resource management apparatus Report the idling-resource quantity carried in request.
It should be noted that task scheduling apparatus collapses after requesting resource, task scheduling apparatus and target computing nodes Between Network Abnormal, situations such as task scheduling apparatus logic is abnormal can all target computing nodes be caused to be unsuccessfully received target Task, so that the resource version number that carries and being updated in resource management apparatus in the resource reporting request that target computing nodes are sent The corresponding resource version number of target computing nodes is different in corresponding relationship afterwards.At this moment if having updated resource management apparatus The idling-resource quantity of target computing nodes in corresponding relationship will lead to the problem of resource management malfunctions.Therefore, it needs to put at this time Abandoning is updated the idling-resource quantity of target computing nodes in corresponding relationship.
And in practical application, the idling-resource quantity and corresponding resource version number that target computing nodes report are corresponding with this When the idling-resource quantity of target computing nodes and corresponding resource version number are inconsistent for a long time in relationship, resource pipe will lead to It goes wrong during reason, the embodiment of the present invention reaches preset duration, and timing in timing duration by setting preset duration The resource version number that target computing nodes report in the process money corresponding with target computing nodes in updated corresponding relationship Source version number does not carry out pressure update simultaneously.
Wherein, it abandons being updated the idling-resource quantity of target computing nodes in corresponding relationship in resource management apparatus There are three types of possible implementations for the process carried out later.
The first possible implementation: resource management apparatus starts to carry out timing, when timing duration reaches preset duration And the resource version number that target computing nodes report in timing course with updated resource version number difference when, will correspond to The idling-resource quantity of target computing nodes and corresponding resource version number are updated to carry in resource reporting request in relationship Idling-resource quantity and corresponding resource version number.
It should be noted that the first above-mentioned possible implementation only needs resource management apparatus pressure to update storage The idling-resource quantity of target computing nodes and corresponding resource version number in corresponding relationship, so that target computing nodes reported The idle money of target computing nodes in the corresponding relationship of idling-resource quantity and corresponding resource version number and resource management apparatus Source quantity and corresponding resource version number are consistent, and avoid malfunctioning in resource management process, realize that process is fairly simple, simultaneously Time and resource can also be saved.
Second of possible implementation: resource management apparatus starts to carry out timing, when timing duration reaches preset duration And the resource version number that target computing nodes report in timing course with updated resource version number difference when, will correspond to The idling-resource quantity of target computing nodes is updated to the idling-resource quantity carried in resource reporting request in relationship, and will more Resource version number after new is sent to target computing nodes, so that the resource version number of record is updated to connect by target computing nodes The resource version number received.
It should be noted that the above-mentioned second possible correspondence for being achieved in that resource management apparatus pressure and updating storage The idling-resource quantity of target computing nodes in relationship, so that idling-resource quantity and resource management that target computing nodes report The idling-resource quantity of target computing nodes is consistent in the corresponding relationship of device, and by target computing nodes in corresponding relationship Corresponding resource version number is sent to target computing nodes.And target computing nodes are in the money for receiving resource management apparatus transmission When the version number of source, the resource version number of self record is updated to the resource version number of the resource management apparatus received transmission, So that pair of the idling-resource quantity and corresponding resource version number and resource management apparatus that are recorded in target computing nodes The idling-resource quantity and corresponding resource version number that should be related to middle target computing nodes are consistent, and avoid resource management process Middle error, while time and resource can also be saved.
And above-mentioned second of mode in the cards passes through the interaction between resource management apparatus and target computing nodes, Reaffirm target computing nodes in the idling-resource quantity and corresponding resource version number and corresponding relationship of target computing nodes Idling-resource quantity and corresponding resource version number it is inconsistent so that confirmation result it is more acurrate.It realizes to calculate in target and save The idling-resource quantity of target computing nodes in the idling-resource quantity and corresponding resource version number and corresponding relationship that point reports When inconsistent with corresponding resource version number, and when inconsistent timing duration reaches preset duration, is forced to update, and avoids resource It malfunctions in management process, improves resources management efficiency.
The third possible implementation: resource management apparatus sends prompt information, prompt letter to target computing nodes It ceases in idling-resource quantity and corresponding resource version number and the corresponding relationship by prompting target computing nodes to report based on target The idling-resource quantity of operator node and corresponding resource version number are inconsistent.Later, the resource that target computing nodes are sent is received Request is updated, the idling-resource quantity of target computing nodes record is carried in resource updates request, and the resource updates are requested Start timing when receiving the prompt information for target computing nodes, and in timing duration reaches preset duration and in timing course In transmission when not receiving the prompt information of resource consistence, the idling-resource quantity of target computing nodes in corresponding relationship is updated For the idling-resource quantity that carries in resource updates request, and by the corresponding resource version of target computing nodes in corresponding relationship Number target computing nodes are sent to, so that the resource version number of record is updated to the resource version received by target computing nodes Number.
It should be noted that the resource management apparatus receive target computing nodes transmission resource updates request when, Target, which calculates, in the idling-resource quantity and corresponding resource version number and the corresponding relationship that expression target computing nodes report saves The duration that the idling-resource quantity and corresponding resource version number of point are inconsistent has reached preset duration, directly closes at this time by corresponding The idling-resource quantity of target computing nodes is updated to the idling-resource quantity carried in resource updates request in system, and will be right It should be related to that the corresponding resource version number of the idling-resource quantity of middle target computing nodes is sent to target computing nodes.And target meter Operator node is when receiving the resource version number of resource management apparatus transmission, by the corresponding resource version of the idling-resource quantity of record This number resource version number for being updated to receive, with the idling-resource quantity and corresponding resource for keeping target computing nodes to record Version number is consistent with the idling-resource quantity of target computing nodes in corresponding relationship and corresponding resource version number.
Moreover, the third above-mentioned possible implementation only needs to update mesh in the corresponding relationship of resource management apparatus storage Mark the corresponding resource version of idling-resource quantity stored in the idling-resource quantity and target computing nodes of calculate node Number, by the interaction between resource management apparatus and target computing nodes, reaffirm the idling-resource number of target computing nodes Amount and corresponding resource version number and the idling-resource quantity of target computing nodes in corresponding relationship and corresponding resource version number It is inconsistent, so that confirmation result is more acurrate.Realize the idling-resource quantity and corresponding resource version reported in target computing nodes This number reaches pre- with the idling-resource quantity of target computing nodes in corresponding relationship and the corresponding inconsistent duration of resource version number If forcing to update when duration, avoids malfunctioning in resource management process, improve the efficiency of resource management.
In addition, due in practical application, the case where target computing nodes and resource management apparatus are likely to occur delay machine, work as mesh After marking calculate node and resource management apparatus recovery, at this time, in fact it could happen that the idling-resource quantity that target computing nodes report It can with the idling-resource quantity of target computing nodes in corresponding relationship and corresponding resource version number with corresponding resource version number The inconsistent situation of energy, it is also possible to not have to record the sky of target computing nodes in the corresponding relationship for resource management apparatus storage occur Not busy resource quantity and corresponding resource version number, in order to avoid such case, the embodiment of the present invention is realized in the following way To resource management apparatus storage corresponding relationship in target computing nodes idling-resource quantity and corresponding resource version number into Row updates.
Concrete implementation process can be with are as follows: when receiving the resource reporting request of target computing nodes transmission, and currently connects When the resource reporting request received carries idling-resource quantity, corresponding resource version number and required parameter, by corresponding relationship The idling-resource quantity of middle target computing nodes and corresponding resource version number are updated to the resource reporting being currently received request The idling-resource quantity of middle carrying and corresponding resource version number, the required parameter are used to indicate the resource reporting being currently received Request is the resource reporting request that target computing nodes are sent for the first time after restart.
It should be noted that since the required parameter is intended to indicate that target computing nodes after restart for the first time to resource pipe The resource reporting request that device is sent is managed, when in the resource that resource management apparatus is sent after receiving target computing nodes and restarting It submits a report asking for when asking, at this point, not needing the idling-resource quantity for comparing the target computing nodes received and corresponding resource version number It is whether consistent with the idling-resource quantity of target computing nodes in corresponding relationship and corresponding resource version number, it can directly update The idling-resource quantity of target computing nodes and corresponding resource version number, save the time, simplify operation in corresponding relationship. Therefore, required parameter can be carried in the resource reporting request that target computing nodes are sent for the first time after restart, and if target meter The resource reporting request that operator node is sent is not the resource reporting request sent for the first time after restart, and there is no need to resource pipe The required parameter is carried in the resource reporting request that reason device is sent.
In conclusion indicating to calculate with target after update before updating by the corresponding resource version number of setting calculate node The resource of node is different, when resource management apparatus receives the resource reporting request of target computing nodes transmission, and resource Report the resource version number corresponding with target computing nodes in updated corresponding relationship, resource version number carried in request not Meanwhile abandoning being updated the idling-resource quantity of target computing nodes in corresponding relationship, it prevents due to target computing nodes When corresponding with target computing nodes in the corresponding relationship of the resource management apparatus resource version number difference of the resource version number reported, After idling-resource quantity and corresponding resource version number to target computing nodes in corresponding relationship are updated, so that resource Managing device takes for the idling-resource quantity in target computing nodes and carries out resource allocation more than actual idling-resource quantity, The problem of causing resource management to malfunction.But in practical application, if resource version number that target computing nodes report and resource When the corresponding resource version number of target computing nodes is inconsistent for a long time in the corresponding relationship of managing device, resource pipe is also resulted in Reason error, therefore in the embodiment of the present invention by the way of timing, reach preset duration, and mesh in timing course in timing duration The resource version number corresponding with target computing nodes in updated corresponding relationship, resource version number that mark calculate node reports When different, directly corresponding relationship is updated or the record in corresponding relationship and target computing nodes is all updated, Using force update by the way of, ensure that target computing nodes in the corresponding relationship of resource management apparatus idling-resource quantity and Corresponding resource version number and practical idling-resource quantity and corresponding resource version number consistency in target computing nodes, mention The high efficiency of resource management.
Fig. 4 is a kind of resource management apparatus structural schematic diagram provided in an embodiment of the present invention.Referring to fig. 4, which includes: Determining module 401, the first sending module 402, the first update module 403.
Determining module 401, for being obtained based on the resource when receiving the resource acquisition request of task scheduling apparatus transmission Take the target resource quantity carried in request, and calculate node mark, idling-resource quantity and the resource version number three of storage Corresponding relationship between person, is determined to the target computing nodes of performance objective task, and target resource quantity refers to performance objective Required resource quantity when task;
First sending module 402, for being provided based on target resource quantity to the idle of target computing nodes in corresponding relationship Source quantity and corresponding resource version number are updated, and by the node identification for carrying target computing nodes and updated resource The resource acquisition response of version number is sent to the task scheduling apparatus, so that goal task is handed down to mesh by the task scheduling apparatus Calculate node is marked to execute;
First update module 403, for being sent when receiving target computing nodes after sending resource acquisition response Resource reporting request, and the resource version number that carries and when updated resource version number difference in resource reporting request, It abandons being updated the idling-resource quantity of target computing nodes in corresponding relationship.
Optionally, the device further include:
First timing module carries out timing for starting;
Second update module, for working as, timing duration reaches preset duration and target computing nodes report in timing course Resource version number with updated resource version number difference when, by the idling-resource number of target computing nodes in corresponding relationship Amount and corresponding resource version number are updated to the idling-resource quantity carried in resource reporting request and corresponding resource version number.
Optionally, the device further include:
Second timing module carries out timing for starting;
Third update module, for working as, timing duration reaches preset duration and target computing nodes report in timing course Resource version number with updated resource version number difference when, by the idling-resource number of target computing nodes in corresponding relationship Amount is updated to the idling-resource quantity carried in resource reporting request, and updated resource version number is sent to target and is calculated Node, so that the resource version number of record is updated to the resource version number received by target computing nodes.
Optionally, the device further include:
Second sending module, for sending prompt information to target computing nodes, the prompt information is by prompting based on target The idling-resource of target computing nodes in the idling-resource quantity and corresponding resource version number and corresponding relationship that operator node reports Quantity and corresponding resource version number are inconsistent;
Receiving module carries in resource updates request for receiving the resource updates request of target computing nodes transmission The idling-resource quantity of target computing nodes record, and resource updates request is that target computing nodes receive the prompt information When start timing, and when timing duration reaches preset duration and does not receive the prompt information of resource consistence in timing course It sends;
4th update module, for the idling-resource quantity of target computing nodes in corresponding relationship to be updated to the resource more The idling-resource quantity carried in new request, and the corresponding resource version number of target computing nodes in corresponding relationship is sent to mesh Calculate node is marked, so that the resource version number of record is updated to the resource version number received by target computing nodes.
Optionally, the device further include:
5th update module for requesting when the resource reporting for receiving target computing nodes transmission, and is currently received Resource reporting request carry idling-resource quantity, corresponding resource version number and when required parameter, by mesh in corresponding relationship The idling-resource quantity and corresponding resource version number for marking calculate node are updated to take in the resource reporting being currently received request The idling-resource quantity of band and corresponding resource version number, the required parameter are used to indicate the resource reporting request being currently received The resource reporting request sent for the first time after restart for target computing nodes.
In conclusion the embodiment of the present invention by be arranged calculate node the corresponding resource version number of idling-resource quantity come It indicates to be different before updating with the resource of updated target computing nodes, calculates section when resource management apparatus receives target The resource reporting request that point is sent, and mesh in the resource version number carried in resource reporting request and updated corresponding relationship When marking the corresponding resource version number difference of calculate node, abandon to the idling-resource quantity of target computing nodes in corresponding relationship into Row updates, and avoids target meter in the resource version number carried in the received resource reporting request of resource management apparatus and corresponding relationship When the corresponding resource version number difference of operator node, it is updated to the idling-resource quantity of target computing nodes in corresponding relationship Afterwards, the problem of causing resource management to malfunction, improves the efficiency of resource management.
It should be understood that resource management apparatus provided by the above embodiment is when carrying out resource management, only with above-mentioned each The division progress of functional module can according to need and for example, in practical application by above-mentioned function distribution by different function Energy module is completed, i.e., the internal structure of terminal is divided into different functional modules, to complete whole described above or portion Divide function.In addition, resource management apparatus provided by the above embodiment and method for managing resource embodiment belong to same design, have Body realizes that process is detailed in embodiment of the method, and which is not described herein again.
Fig. 5 is a kind of resource management apparatus schematic diagram provided in an embodiment of the present invention.The device 500 can be terminal.Ginseng See Fig. 5, which may is that smart phone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) player, laptop Or desktop computer.Terminal 500 is also possible to referred to as other names such as user equipment, portable terminal, laptop terminal, terminal console Claim.
In general, terminal 500 includes: processor 501 and memory 502.
Processor 501 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place Reason device 501 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 501 also may include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.? In some embodiments, processor 501 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 501 can also be wrapped AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning Calculating operation.
Memory 502 may include one or more computer readable storage mediums, which can To be non-transient.Memory 502 may also include high-speed random access memory and nonvolatile memory, such as one Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 502 can Storage medium is read for storing at least one instruction, at least one instruction for performed by processor 501 to realize this hair The method for managing resource that bright middle embodiment of the method provides.
In some embodiments, terminal 500 is also optional includes: peripheral device interface 503 and at least one peripheral equipment. It can be connected by bus or signal wire between processor 501, memory 502 and peripheral device interface 503.Each peripheral equipment It can be connected by bus, signal wire or circuit board with peripheral device interface 503.Specifically, peripheral equipment includes: radio circuit 504, at least one of touch display screen 505, camera 506, voicefrequency circuit 507, positioning component 508 and power supply 509.
Peripheral device interface 503 can be used for I/O (Input/Output, input/output) is relevant outside at least one Peripheral equipment is connected to processor 501 and memory 502.In some embodiments, processor 501, memory 502 and peripheral equipment Interface 503 is integrated on same chip or circuit board;In some other embodiments, processor 501, memory 502 and outer Any one or two in peripheral equipment interface 503 can realize on individual chip or circuit board, the present embodiment to this not It is limited.
Radio circuit 504 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.It penetrates Frequency circuit 504 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 504 turns electric signal It is changed to electromagnetic signal to be sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 504 wraps It includes: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, codec chip Group, user identity module card etc..Radio circuit 504 can be carried out by least one wireless communication protocol with other terminals Communication.The wireless communication protocol includes but is not limited to: WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, it penetrates Frequency circuit 504 can also include NFC (Near Field Communication, wireless near field communication) related circuit, this Application is not limited this.
Display screen 505 is for showing UI (User Interface, user interface).The UI may include figure, text, figure Mark, video and its their any combination.When display screen 505 is touch display screen, display screen 505 also there is acquisition to show The ability of the touch signal on the surface or surface of screen 505.The touch signal can be used as control signal and be input to processor 501 are handled.At this point, display screen 505 can be also used for providing virtual push button and/or dummy keyboard, also referred to as soft button and/or Soft keyboard.In some embodiments, display screen 505 can be one, and the front panel of terminal 500 is arranged;In other embodiments In, display screen 505 can be at least two, be separately positioned on the different surfaces of terminal 500 or in foldover design;In still other reality It applies in example, display screen 505 can be flexible display screen, be arranged on the curved surface of terminal 500 or on fold plane.Even, it shows Display screen 505 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 505 can use LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) Etc. materials preparation.
CCD camera assembly 506 is for acquiring image or video.Optionally, CCD camera assembly 506 include front camera and Rear camera.In general, the front panel of terminal is arranged in front camera, the back side of terminal is arranged in rear camera.One In a little embodiments, rear camera at least two is main camera, depth of field camera, wide-angle camera, focal length camera shooting respectively Any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide-angle Camera fusion realizes that pan-shot and VR (Virtual Reality, virtual reality) shooting function or other fusions are clapped Camera shooting function.In some embodiments, CCD camera assembly 506 can also include flash lamp.Flash lamp can be monochromatic warm flash lamp, It is also possible to double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for not With the light compensation under colour temperature.
Voicefrequency circuit 507 may include microphone and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and will Sound wave, which is converted to electric signal and is input to processor 501, to be handled, or is input to radio circuit 504 to realize voice communication. For stereo acquisition or the purpose of noise reduction, microphone can be separately positioned on the different parts of terminal 500 to be multiple.Mike Wind can also be array microphone or omnidirectional's acquisition type microphone.Loudspeaker is then used to that processor 501 or radio circuit will to be come from 504 electric signal is converted to sound wave.Loudspeaker can be traditional wafer speaker, be also possible to piezoelectric ceramic loudspeaker.When When loudspeaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, it can also be by telecommunications Number the sound wave that the mankind do not hear is converted to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 507 can also include Earphone jack.
Positioning component 508 is used for the current geographic position of positioning terminal 500, to realize navigation or LBS (Location Based Service, location based service).Positioning component 508 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 509 is used to be powered for the various components in terminal 500.Power supply 509 can be alternating current, direct current, Disposable battery or rechargeable battery.When power supply 509 includes rechargeable battery, which can be wired charging electricity Pond or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is by wireless The battery of coil charges.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 500 further includes having one or more sensors 510.The one or more sensors 510 include but is not limited to: acceleration transducer 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, Optical sensor 515 and proximity sensor 516.
The acceleration that acceleration transducer 511 can detecte in three reference axis of the coordinate system established with terminal 500 is big It is small.For example, acceleration transducer 511 can be used for detecting component of the acceleration of gravity in three reference axis.Processor 501 can With the acceleration of gravity signal acquired according to acceleration transducer 511, touch display screen 505 is controlled with transverse views or longitudinal view Figure carries out the display of user interface.Acceleration transducer 511 can be also used for the acquisition of game or the exercise data of user.
Gyro sensor 512 can detecte body direction and the rotational angle of terminal 500, and gyro sensor 512 can To cooperate with acquisition user to act the 3D of terminal 500 with acceleration transducer 511.Processor 501 is according to gyro sensor 512 Following function may be implemented in the data of acquisition: when action induction (for example changing UI according to the tilt operation of user), shooting Image stabilization, game control and inertial navigation.
The lower layer of side frame and/or touch display screen 505 in terminal 500 can be set in pressure sensor 513.Work as pressure When the side frame of terminal 500 is arranged in sensor 513, user can detecte to the gripping signal of terminal 500, by processor 501 Right-hand man's identification or prompt operation are carried out according to the gripping signal that pressure sensor 513 acquires.When the setting of pressure sensor 513 exists When the lower layer of touch display screen 505, the pressure operation of touch display screen 505 is realized to UI circle according to user by processor 501 Operability control on face is controlled.Operability control includes button control, scroll bar control, icon control, menu At least one of control.
Fingerprint sensor 514 is used to acquire the fingerprint of user, collected according to fingerprint sensor 514 by processor 501 The identity of fingerprint recognition user, alternatively, by fingerprint sensor 514 according to the identity of collected fingerprint recognition user.It is identifying When the identity of user is trusted identity out, the user is authorized to execute relevant sensitive operation, the sensitive operation packet by processor 501 Include solution lock screen, check encryption information, downloading software, payment and change setting etc..Terminal can be set in fingerprint sensor 514 500 front, the back side or side.When being provided with physical button or manufacturer Logo in terminal 500, fingerprint sensor 514 can be with It is integrated with physical button or manufacturer Logo.
Optical sensor 515 is for acquiring ambient light intensity.In one embodiment, processor 501 can be according to optics The ambient light intensity that sensor 515 acquires controls the display brightness of touch display screen 505.Specifically, when ambient light intensity is higher When, the display brightness of touch display screen 505 is turned up;When ambient light intensity is lower, the display for turning down touch display screen 505 is bright Degree.In another embodiment, the ambient light intensity that processor 501 can also be acquired according to optical sensor 515, dynamic adjust The acquisition parameters of CCD camera assembly 506.
Proximity sensor 516, also referred to as range sensor are generally arranged at the front panel of terminal 500.Proximity sensor 516 For acquiring the distance between the front of user Yu terminal 500.In one embodiment, when proximity sensor 516 detects use When family and the distance between the front of terminal 500 gradually become smaller, touch display screen 505 is controlled from bright screen state by processor 501 It is switched to breath screen state;When proximity sensor 516 detects user and the distance between the front of terminal 500 becomes larger, Touch display screen 505 is controlled by processor 501 and is switched to bright screen state from breath screen state.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal 500 of structure shown in Fig. 5, can wrap It includes than illustrating more or fewer components, perhaps combine certain components or is arranged using different components.The common skill in this field Art personnel are understood that all or part of the steps of realization above-described embodiment may be implemented by hardware, and can also pass through program The relevant hardware is instructed to complete, the program can store in a kind of computer readable storage medium, mentioned above Storage medium can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (15)

1. a kind of method for managing resource is applied to resource management apparatus, which is characterized in that the described method includes:
When receiving the resource acquisition request of task scheduling apparatus transmission, based on the target carried in resource acquisition request Resource quantity, and the calculate node of storage identifies, the corresponding relationship between idling-resource quantity and resource version number three, really Surely it is capable of the target computing nodes of performance objective task, the target resource quantity refers to required when executing the goal task Resource quantity;
Based on the target resource quantity to the idling-resource quantity and correspondence of target computing nodes described in the corresponding relationship Resource version number be updated, and by the node identification for carrying the target computing nodes and updated resource version number Resource acquisition response is sent to the task scheduling apparatus, so that the goal task is handed down to institute by the task scheduling apparatus Target computing nodes are stated to execute;
After sending the resource acquisition response, requested when receiving the resource reporting that the target computing nodes are sent, and When the resource version number carried in the resource reporting request and updated resource version number difference, abandon to the corresponding pass The idling-resource quantity of target computing nodes described in system is updated.
2. the method as described in claim 1, which is characterized in that described to abandon calculating section to target described in the corresponding relationship After the idling-resource quantity of point is updated, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and the target computing nodes described in timing course report with When the updated resource version number difference, by the idling-resource quantity of target computing nodes described in the corresponding relationship and Corresponding resource version number is updated to the idling-resource quantity carried in the resource reporting request and corresponding resource version number.
3. the method as described in claim 1, which is characterized in that described to abandon calculating section to target described in the corresponding relationship After the idling-resource quantity of point is updated, further includes:
Start to carry out timing;
When the resource version number that timing duration reaches preset duration and the target computing nodes described in timing course report with When the updated resource version number difference, more by the idling-resource quantity of target computing nodes described in the corresponding relationship It is newly the idling-resource quantity that carries in resource reporting request, and by target computing nodes pair described in the corresponding relationship The resource version number answered is sent to the target computing nodes so that the target computing nodes by the resource version number of record more The new resource version number to receive.
4. the method as described in claim 1, which is characterized in that described to abandon calculating section to target described in the corresponding relationship After the idling-resource quantity of point is updated, further includes:
Prompt information is sent to the target computing nodes, the prompt information is for prompting the target computing nodes to report The idling-resource quantity of target computing nodes described in idling-resource quantity and corresponding resource version number and the corresponding relationship It is inconsistent with corresponding resource version number;
The resource updates request that the target computing nodes are sent is received, the target is carried in the resource updates request and calculates The idling-resource quantity of nodes records, and resource updates request is that the target computing nodes receive the prompt information When start timing, and when timing duration reaches preset duration and does not receive the prompt information of resource consistence in timing course It sends;
The idling-resource quantity of target computing nodes described in the corresponding relationship is updated to take in the resource updates request The idling-resource quantity of band, and the corresponding resource version number of target computing nodes described in the corresponding relationship is sent to described Target computing nodes, so that the resource version number of record is updated to the resource version number received by the target computing nodes.
5. the method as described in claim 1, which is characterized in that the method also includes:
It is requested when receiving the resource reporting that the target computing nodes are sent, and the resource reporting request being currently received carries When idling-resource quantity, corresponding resource version number and required parameter, by target computing nodes described in the corresponding relationship Idling-resource quantity and corresponding resource version number be updated to the idle money carried in the resource reporting being currently received request Source quantity and corresponding resource version number, it is the mesh that the required parameter, which is used to indicate the resource reporting request being currently received, The resource reporting request that mark calculate node is sent for the first time after restart.
6. a kind of resource management apparatus, which is characterized in that described device includes:
Determining module, for being asked based on the resource acquisition when receiving the resource acquisition request of task scheduling apparatus transmission Seek the target resource quantity of middle carrying, and storage calculate node mark, idling-resource quantity and resource version number three it Between corresponding relationship, be determined to the target computing nodes of performance objective task, the target resource quantity refers to described in execution Required resource quantity when goal task;
First sending module, for the sky based on the target resource quantity to target computing nodes described in the corresponding relationship Node identification and the update that not busy resource quantity and corresponding resource version number are updated, and will carry the target computing nodes The resource acquisition response of resource version number afterwards is sent to the task scheduling apparatus, so that the task scheduling apparatus will be described Goal task is handed down to the target computing nodes to execute;
First update module, for being sent when receiving the target computing nodes after sending the resource acquisition response Resource reporting request, and the resource version number that carries and the updated resource version number be not in resource reporting request Meanwhile it abandoning being updated the idling-resource quantity of target computing nodes described in the corresponding relationship.
7. device as claimed in claim 6, which is characterized in that described device further include:
First timing module carries out timing for starting;
Second update module, for working as, timing duration reaches preset duration and the target computing nodes described in timing course report Resource version number with the updated resource version number difference when, by target computing nodes described in the corresponding relationship Idling-resource quantity and corresponding resource version number be updated to the idling-resource quantity carried in resource reporting request and Corresponding resource version number.
8. device as claimed in claim 6, which is characterized in that described device further include:
Second timing module carries out timing for starting;
Third update module, for working as, timing duration reaches preset duration and the target computing nodes described in timing course report Resource version number with the updated resource version number difference when, by target computing nodes described in the corresponding relationship Idling-resource quantity be updated to the idling-resource quantity carried in resource reporting request, and by institute in the corresponding relationship It states the corresponding resource version number of target computing nodes and is sent to the target computing nodes, so that the target computing nodes will be remembered The resource version number of record is updated to the resource version number received.
9. device as claimed in claim 6, which is characterized in that described device further include:
Second sending module, for sending prompt information to the target computing nodes, the prompt information is described for prompting The idling-resource quantity and corresponding resource version number that target computing nodes report are calculated with target described in the corresponding relationship The idling-resource quantity of node and corresponding resource version number are inconsistent;
Receiving module is requested for receiving the resource updates that the target computing nodes are sent, and is taken in the resource updates request Idling-resource quantity with target computing nodes record, and resource updates request is that the target computing nodes receive Start timing when to the prompt information, and reaches preset duration in timing duration and do not receive resource one in timing course It is sent when the prompt information of cause;
4th update module, it is described for the idling-resource quantity of target computing nodes described in the corresponding relationship to be updated to The idling-resource quantity that carries in resource updates request, and by the corresponding resource of target computing nodes described in the corresponding relationship Version number is sent to the target computing nodes, so that the resource version number of record is updated to receive by the target computing nodes The resource version number arrived.
10. device as claimed in claim 6, which is characterized in that described device further include:
5th update module for requesting when the resource reporting for receiving the target computing nodes transmission, and is currently received Resource reporting request carry idling-resource quantity, corresponding resource version number and when required parameter, by the corresponding relationship Described in target computing nodes idling-resource quantity and corresponding resource version number be updated to the resource reporting being currently received The idling-resource quantity and corresponding resource version number, the required parameter carried in request is used to indicate the money being currently received It is the resource reporting request that the target computing nodes are sent for the first time after restart that source, which reports request,.
11. a kind of resource management system, which is characterized in that the resource management system include resource management apparatus, at least one Task scheduling apparatus and at least one calculate node;
For any task scheduling apparatus, the task scheduling apparatus is used to send resource acquisition to the resource management apparatus and ask It asks, carries target resource quantity in the resource acquisition request, the target resource quantity refers to required when performance objective task Resource quantity;
The resource management apparatus is based on the target resource quantity, and storage for receiving the resource acquisition request Calculate node mark, the corresponding relationship between idling-resource quantity and resource version number three, be determined to execute the mesh The target computing nodes of mark task, based on the target resource quantity to the sky of target computing nodes described in the corresponding relationship Node identification and the update that not busy resource quantity and corresponding resource version number are updated, and will carry the target computing nodes The resource acquisition response of resource version number afterwards is sent to the task scheduling apparatus;
The task scheduling apparatus is also used to receive the resource acquisition response, the node identification based on the target computing nodes By the target resource when goal task being handed down to the target computing nodes to execute, and issuing the goal task Quantity and updated resource version number are sent to the target computing nodes;
The resource management apparatus is also used to after sending resource acquisition response, when receiving the target computing nodes The resource reporting of transmission is requested, and the resource version number carried in resource reporting request and updated resource version number are not Meanwhile it abandoning being updated the idling-resource quantity of target computing nodes described in the corresponding relationship.
12. resource management system as claimed in claim 11, which is characterized in that the target computing nodes are for receiving When the goal task that the task scheduling apparatus issues, according to the resource version number that the task scheduling apparatus is sent, more The resource version number of new self record.
13. resource management system as claimed in claim 12, which is characterized in that the target computing nodes are also used in basis The resource version number that the task scheduling apparatus is sent before the resource version number for updating self record, judges the task tune Whether the relationship of the resource version number of resource version number and self record that degree device is sent meets preset strategy, if meeting, The resource version number of self record is updated to the resource version number that the task scheduling apparatus is sent;If not meeting, not more The resource version number of new self record.
14. a kind of terminal, including memory, processor and it is stored on the memory and can runs on the processor Computer program, which is characterized in that the processor is configured to perform claim requires the step of any one method described in 1-5 Suddenly.
15. a kind of computer readable storage medium, which is characterized in that instruction is stored in the computer readable storage medium, When run on a computer, so that computer executes the method according to claim 1 to 5.
CN201711445115.1A 2017-12-27 2017-12-27 Resource management method, device and storage medium Active CN109981310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711445115.1A CN109981310B (en) 2017-12-27 2017-12-27 Resource management method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711445115.1A CN109981310B (en) 2017-12-27 2017-12-27 Resource management method, device and storage medium

Publications (2)

Publication Number Publication Date
CN109981310A true CN109981310A (en) 2019-07-05
CN109981310B CN109981310B (en) 2022-02-11

Family

ID=67071660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711445115.1A Active CN109981310B (en) 2017-12-27 2017-12-27 Resource management method, device and storage medium

Country Status (1)

Country Link
CN (1) CN109981310B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120226788A1 (en) * 2004-03-13 2012-09-06 Cluster Resources, Inc. System and method for providing multi-resource management support in a compute environment
CN103049334A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Task processing method and virtual machine
CN103810045A (en) * 2012-11-09 2014-05-21 阿里巴巴集团控股有限公司 Resource allocation method, resource manager, resource server and system
CN105005506A (en) * 2015-07-17 2015-10-28 中国人民解放军国防科学技术大学 Virtual cloud fault-tolerant resource supply method
US20160055170A1 (en) * 2014-08-20 2016-02-25 International Business Machines Corporation Sharing resources among remote repositories utilizing a lock file in a shared file system or a node graph in a peer-to-peer system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120226788A1 (en) * 2004-03-13 2012-09-06 Cluster Resources, Inc. System and method for providing multi-resource management support in a compute environment
CN103810045A (en) * 2012-11-09 2014-05-21 阿里巴巴集团控股有限公司 Resource allocation method, resource manager, resource server and system
CN103049334A (en) * 2012-12-14 2013-04-17 华为技术有限公司 Task processing method and virtual machine
US20160055170A1 (en) * 2014-08-20 2016-02-25 International Business Machines Corporation Sharing resources among remote repositories utilizing a lock file in a shared file system or a node graph in a peer-to-peer system
CN105005506A (en) * 2015-07-17 2015-10-28 中国人民解放军国防科学技术大学 Virtual cloud fault-tolerant resource supply method

Also Published As

Publication number Publication date
CN109981310B (en) 2022-02-11

Similar Documents

Publication Publication Date Title
CN111339086B (en) Block processing method, and data query method and device based on block chain
KR20180047800A (en) Device for Performing Wireless Charging and Method thereof
KR20210056434A (en) Assistance function start-up method and apparatus, device and readable storage medium
CN111340482B (en) Conflict detection method, device, node equipment and storage medium
CN109816042B (en) Data classification model training method and device, electronic equipment and storage medium
CN111339181B (en) Block storage method, block storage device, node equipment and storage medium
CN110515688A (en) Page display method, device, terminal and storage medium
CN108897659A (en) Modify journal stage method for distinguishing, device and storage medium
CN110517032A (en) Resource transfers method, system, device, server and storage medium
CN108900925A (en) The method and apparatus of live streaming template are set
CN109017373A (en) Charging method, device and the storage medium of electric car
CN111858382A (en) Application program testing method, device, server, system and storage medium
CN103458362B (en) Numeric value transfer, terminal, server and system
CN111125436A (en) Data management method, device and system
CN110535890A (en) The method and apparatus that file uploads
CN109254775A (en) Image processing method, terminal and storage medium based on face
CN104102560B (en) The method and device of system performance testing
CN108848492A (en) Enabling method, apparatus, terminal and the storage medium of subscriber identification card
CN110062199A (en) Load-balancing method, device and computer readable storage medium
CN109828915A (en) A kind of method, apparatus of debugging utility, equipment and storage medium
CN104391742B (en) Optimizing application method and apparatus
CN109981310A (en) Method for managing resource, device and storage medium
CN108132817A (en) Method for managing object and device
CN110570123B (en) Resource information management method, system and device based on block chain
CN113610357A (en) Transaction flow management method, device, equipment and medium for virtual power plant

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant