CN112650576A - Resource scheduling method, device, equipment, storage medium and computer program product - Google Patents

Resource scheduling method, device, equipment, storage medium and computer program product Download PDF

Info

Publication number
CN112650576A
CN112650576A CN202110089644.2A CN202110089644A CN112650576A CN 112650576 A CN112650576 A CN 112650576A CN 202110089644 A CN202110089644 A CN 202110089644A CN 112650576 A CN112650576 A CN 112650576A
Authority
CN
China
Prior art keywords
resource
available
target
queue
node
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
CN202110089644.2A
Other languages
Chinese (zh)
Other versions
CN112650576B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110089644.2A priority Critical patent/CN112650576B/en
Publication of CN112650576A publication Critical patent/CN112650576A/en
Application granted granted Critical
Publication of CN112650576B publication Critical patent/CN112650576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

The embodiment of the application discloses a resource scheduling method, a resource scheduling device, electronic equipment, a computer readable storage medium and a computer program product, and relates to the technical field of cloud platforms and cloud services. One embodiment of the method comprises: receiving an incoming resource application request; determining a target resource in an available resource queue maintained by a main node according to a resource application request, and maintaining the available resource queue by the main node according to a log which records whether the previously applied available resource is successfully called or not; and in response to the target resource being successfully called, recording a new log entry of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log entry in the log. According to the method, the main node for maintaining the available resource queue based on the call log is additionally arranged at the front end of the resource pool, so that the traversing operation of each resource state in the resource pool is avoided when the available resource is subsequently reapplied, and the scheduling efficiency of the resource is improved.

Description

Resource scheduling method, device, equipment, storage medium and computer program product
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of artificial intelligence technologies such as cloud services and cloud platforms, and in particular, to a resource scheduling method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of the productivity of the current society and the improvement of the electronic informatization degree, the cloud technology and the cloud service are widely applied, a user can transfer a calculation task to the cloud terminal to do the calculation task in a cloud service application mode through equipment with weak computing capability, and therefore reasonable allocation and reasonable use of resources are achieved.
When a large number of users apply various cloud resources to the cloud to realize cloud service, how to effectively schedule the cloud resources to meet the requirements of the large number of users as much as possible is a key research object of technical personnel in the field.
Disclosure of Invention
The embodiment of the application provides a resource scheduling method, a resource scheduling device, electronic equipment, a computer-readable storage medium and a computer program product.
In a first aspect, an embodiment of the present application provides a resource scheduling method, including: receiving an incoming resource application request; determining a target resource in an available resource queue maintained by a master node according to a resource application request; the main node obtains an available resource queue according to log maintenance which records whether the available resources which are applied for in advance are successfully called or not; and in response to the target resource being successfully called, recording a new log entry of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log entry in the log.
In a second aspect, an embodiment of the present application provides a resource scheduling apparatus, including: a resource application request receiving unit configured to receive an incoming resource application request; a target resource determination unit configured to determine a target resource in an available resource queue maintained by a master node according to a resource application request; the main node obtains an available resource queue according to log maintenance which records whether the available resources which are applied for in advance are successfully called or not; and the log entry adding and queue updating unit is configured to respond to the target resource being successfully called, record a new log entry of the target resource being successfully called in the log, and control the main node to update the available resource queue by reading the new log entry in the log.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to implement the resource scheduling method as described in any one of the implementations of the first aspect when executed.
In a fourth aspect, the present application provides a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement the resource scheduling method as described in any implementation manner of the first aspect when executed.
In a fifth aspect, the present application provides a computer program product including a computer program, where the computer program is capable of implementing the resource scheduling method described in any implementation manner of the first aspect when executed by a processor.
According to the resource scheduling method, the resource scheduling device, the electronic equipment, the computer-readable storage medium and the computer program product, after an incoming resource application request is received, an execution main body firstly determines a target resource in an available resource queue maintained by a main node according to the resource application request, and the main node maintains the available resource queue according to a log which records whether the previously applied available resource is successfully called or not; and after the main body is executed, responding to the target resource being successfully called, recording a new log item of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log item in the log.
According to the resource scheduling method and device, the main node is additionally arranged at the front end of the resource pool used for storing all available resources and unavailable resources, and the main node is used for maintaining the available resource queue by reading the log information of whether the resources which are applied to be called are successfully called or not, so that the information indicating which resources are the current available resources is used for avoiding traversing operation of each resource state in the resource pool when the available resources are re-applied subsequently, and the resource scheduling efficiency is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture to which the present application may be applied;
fig. 2 is a flowchart of a resource scheduling method according to an embodiment of the present application;
fig. 3 is a flowchart of another resource scheduling method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a resource scheduling method in an application scenario according to an embodiment of the present application;
fig. 5 is a block diagram of a resource scheduling apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device adapted to execute a resource scheduling method according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the resource scheduling methods, apparatuses, electronic devices and computer-readable storage media of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105, and a resource pool 1051 carried on the server 105, where the resource pool 1051 stores resources available for application. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various applications for realizing information communication between the terminal devices 101, 102, and 103 and the server 105 may be installed on the terminal devices 101, 102, and 103, for example, a cloud service application, a cloud storage application, a data communication application, and the like.
The terminal apparatuses 101, 102, 103 and the server 105 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like; when the terminal devices 101, 102, and 103 are software, they may be installed in the electronic devices listed above, and they may be implemented as multiple software or software modules, or may be implemented as a single software or software module, and are not limited in this respect. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of multiple servers, or may be implemented as a single server; when the server is software, the server may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, which is not limited herein.
The server 105 may provide various services through various built-in applications, and taking a cloud service application that may provide cloud resources to an applicant as an example, the server 105 may implement the following effects when running the cloud service application: firstly, receiving an incoming resource application request from the terminal equipment 101, 102, 103 through the network 104; then, according to the resource application request, determining a target resource in an available resource queue maintained by the master node, where the master node obtains the available resource queue (all resources including available resources and unavailable resources are stored in a resource pool 1051) according to log maintenance that records whether the previously applied available resource is successfully called; and after the main body is executed, responding to the target resource being successfully called, recording a new log item of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log item in the log.
It should be noted that the resource application request may be acquired from the terminal devices 101, 102, and 103 through the network 104, or may be stored locally in the server 105 in advance in various ways. Thus, when the server 105 detects that such data is already stored locally (e.g., pending resource application requests that remain before processing is started), it may choose to retrieve such data directly from locally, in which case the exemplary system architecture 100 may also not include the terminal devices 101, 102, 103 and the network 104.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring to fig. 2, fig. 2 is a flowchart of a resource scheduling method according to an embodiment of the present application, where the process 200 includes the following steps:
step 201: receiving an incoming resource application request;
this step is intended to receive an incoming resource application request by an executing agent of the resource scheduling method, such as the server 105 shown in fig. 1. The resource application request may be directly received from the user terminal, or may be sent to the execution main body through at least one forwarding device having one end connected to the user terminal and the other end connected to the execution main body when the user terminal cannot directly send the resource application request to the execution main body.
The resource application request may be used to indicate a desire of a request initiator or a request initiator user to apply for a resource, and may generally include a description of relevant attributes of a target resource that the request initiator or the request initiator user thinks of acquiring, such as a resource type, a resource performance, a resource usage, and the like, where the resource type may include a cloud mobile phone resource, a cloud storage resource, and the like.
Further, after receiving the resource application request, the method may further determine whether the request immediately satisfies the relevant requirements recorded in the request by combining with the identity information of the request initiating terminal or the request initiating user included in the resource application request, for example, determine the application user according to the resource application request, and perform the subsequent step 202 when determining that the application user is a preset legal user, thereby preventing illegal occupation of the limited resource by an illegal user.
Step 202: determining a target resource in an available resource queue maintained by a master node according to a resource application request;
on the basis of step 201, this step is intended to determine the target resource in the available resource queue maintained by the master node according to the resource application request by the executing agent.
The main node maintains and obtains an available resource queue according to a log recording whether the available resource which is previously applied is successfully called, namely, after each available resource is distributed to a request initiating terminal or a request initiating user by the execution main body in response to an incoming resource application request, the main node is controlled to maintain the available resource queue according to returned or monitored log information whether the resource is successfully called or not, and as the name suggests, at least resource information which is currently in an available state is recorded in the available resource queue and is stored in a queue form.
Therefore, this step is equivalent to the step in which the execution main body determines, according to the resource application request, a target resource suitable for being allocated to the request initiator or the request initiator of the resource application request in the available resource queue. It should be understood that, due to the existence of the master node and the available resource queue that the master node is responsible for maintaining, the execution main body does not need to directly request a resource pool storing all available resources and non-available resources each time when processing a resource application request, but may determine an available target resource according to the available resource queue, so as to directly call the target resource from the resource pool. Based on the above, the available resource queue maintained by the master node should be set at the front end of the resource pool.
Furthermore, besides the resource information in the available state, the resource information in the unavailable state may be recorded in the available resource queue, so as to perform difference comparison between the resource information in the available state and the total resource information in the resource pool, and to more accurately determine whether the information recorded in the queue is consistent with the actual situation. In addition, some attributes of each resource and the number of times of being called or applied historically can be recorded so as to meet the personalized requirements of the applicant.
Step 203: and in response to the target resource being successfully called, recording a new log entry of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log entry in the log.
On the basis of step 202, this step is intended to determine that the target resource has been successfully called or successfully occupied by the request initiating terminal or the request initiating user who has initiated the resource application request, record a new log entry in the log that the target resource was successfully called, and control the master node to update the available resource queue by reading the new log entry in the log.
The log is used for recording the information about the success or failure of calling each applied resource, and can be added at the bottom of the log in a manner of adding one log entry each time. And the master node will be able to continually update the available resource queue by keeping up with each new log entry that appears.
Specifically, the frequency of the master node updating the available resource queue may be set by itself, for example, when it is monitored that a new log entry is written into the log, the log is updated immediately according to the written new log entry, or a fixed time interval between checking the new log entry and updating may be set, which is specifically selected and may be flexibly selected according to a requirement under an actual situation, and no specific limitation is made here.
According to the resource scheduling method provided by the embodiment of the application, the main node is additionally arranged at the front end of the resource pool for storing all available resources and unavailable resources, and the main node is used for reading the log information of whether the previously applied and called resources are successfully called to maintain the available resource queue, so that the information for marking which resources are the current available resources is used for avoiding traversing operation of each resource state in the resource pool when the available resources are subsequently reapplied, and the resource scheduling efficiency is improved.
Referring to fig. 3, fig. 3 is a flowchart of another resource scheduling method according to an embodiment of the present application, where the process 300 includes the following steps:
step 301: receiving an incoming resource application request;
step 302: determining an application user according to the resource application request;
step 303: in response to the application user being a preset legal user, determining a target resource in an available resource queue maintained by the master node according to the resource application request;
the step 301-.
Step 304: in response to the target resource being successfully called, recording a new log item of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log item in the log;
step 304 is identical to step 203 shown in fig. 2, and will not be repeated here.
Step 305: traversing each available resource and each unavailable resource stored in the virtual resource pool at preset time intervals to obtain an actual available resource and an actual unavailable resource;
due to complexity and instability in an actual situation, it is possible that information in the available resource queue maintained only by information whether the log is successfully called or not is inconsistent with the actual situation due to unknown reasons or position factors, and therefore, the actual states of all resources in the resource pool are periodically traversed in the step, and accurate actual available resources and actual unavailable resources are obtained.
Step 306: comparing the actual available resources, the actual unavailable resources and the current available resource queue to determine abnormal resources;
on the basis of step 305, this step is intended to finally determine the abnormal resource by the executing body through comparing the actual available resource, the actual unavailable resource and the current available resource queue. The abnormal resources include multiple types, such as partially available resources that are not recorded in the available resource queue, partially unavailable resources that are recorded in the available resource queue, and the available resource queue records that the resources that are not included in the actually available resources or the actually unavailable resources, and so on, that is, the resources that do not meet the expected status all belong to the abnormal resources.
Furthermore, the related information recorded in the available resource queue can be corrected according to the determined abnormal resource, so that at least the related information of the resource in the available state, which is consistent with the actual situation, is recorded in the available resource queue.
Step 307: and responding to the abnormal resource as a target actual available resource which is not recorded in the available resource queue, supplementing the target actual available resource into the available resource queue, and sending an unsuccessful calling notification to an application terminal which calls the target available resource first.
On the basis of step 306, this step is intended to make up the target actually available resource into the available resource queue by the execution subject for the target actually available resource that is not recorded in the available resource queue, and send an unsuccessful invocation notification to the application end that invoked the target available resource first. Namely, a specific abnormal resource processing mode is provided so as to correct error information as much as possible.
In this embodiment, a judgment mechanism for inserting an identity authentication mechanism is provided through steps 301 to 303, respectively, so as to avoid the situation that limited resources are illegally occupied by an illegal user as much as possible; a scheme for verifying whether the related information recorded in the available resource queue is consistent with the actual situation is provided through steps 305 to 306, so that the occurrence of abnormalities caused by unstable factors and unknown factors is eliminated as much as possible through the two-phase verification mode, and the accuracy of the related information recorded in the available resource queue is improved; step 307 is to correct the error information as much as possible by a processing method given for a specific abnormal resource type based on the determination of the abnormal resource in step 306.
It should be understood that there is no causal and dependency relationship between the preferred implementation schemes given in steps 301 to 303 and the preferred implementation schemes given in steps 305 to 306, and it is quite possible to form two separate embodiments based on the embodiment shown in fig. 2, respectively, and a separate embodiment may not include step 307 at all, so that the present embodiment is only a preferred embodiment that combines the above preferred implementation schemes together, depending on whether step 306 is included or not, step 307 is included, and the present embodiment may be divided into two separate embodiments.
On the basis of any embodiment, in order to avoid the phenomenon that the amount of circulating resources is gradually reduced due to the fact that a certain user occupies a certain resource for a long time, the target unavailable resource with the actual occupied duration exceeding the required duration can be released, and the released target unavailable resource is initialized and then recorded in the available resource queue again; wherein, the required duration is recorded in the resource application request.
On the basis of any embodiment, when the execution main body finds that the main node is in an abnormal state, the execution main body can control the main node to transfer the maintenance authority of the available resource queue to a preset secondary node; wherein the secondary node synchronizes a copy of the most recent available resource queue from the primary node when the secondary node does not hold the maintenance rights. Namely, the uninterrupted maintenance of the available resource queue is ensured as much as possible through the backup mechanism of the primary node and the secondary node.
For deepening understanding, the present application further provides a specific implementation scheme in combination with a specific application scenario, please refer to schematic diagram 400 shown in fig. 4, as shown in schematic diagram 400, in this scenario, in order to meet a requirement that a user requests a cloud mobile phone resource from a cloud end (a cloud mobile phone resource usually appears as an example, and thus may also become a cloud mobile phone example), and a resource application request initiated by a user device in the system hierarchy needs to be transferred to a cloud mobile phone connection pool through a service node, where the cloud mobile phone connection pool includes a Redis database, a master node, and a cloud mobile phone example pool. In the specific application scenario given by the schematic diagram 400, the process 200 shown in fig. 2 can be adaptively adjusted to the following steps:
receiving a cloud mobile phone application request forwarded from a target application terminal by a target service node;
determining target cloud mobile phone resources in an available cloud mobile phone resource queue maintained by a master node according to a cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the master node according to a service end node log which records whether the previously applied available cloud mobile phone resources are successfully called or not;
and in response to the target cloud mobile phone resource being successfully called, controlling the target service node to record a new log item of the target cloud mobile phone being successfully called in a service end node log of the target service node, and controlling the master node to update the available cloud mobile phone resource queue by reading the service end node log.
The following description will be developed separately:
1. service end node
1) When a resource application request transmitted by user equipment is received, acquiring available cloud mobile phone resources from a Redis queue (namely an available resource queue maintained by a main node);
2) connecting a corresponding cloud mobile phone example according to the acquired information;
3) when the connection is abnormal, recording the log and re-executing 1);
4) when the connection is successful, recording a log and executing operation;
5) when the execution is finished, recording the log, releasing the connection and putting the connection resource back to the queue;
6) collecting logs of the service nodes through a collector, transmitting the logs to an aggregation layer for aggregation and writing the logs into a database;
7) synchronizing strategy configuration and a blacklist IP or user name and other user information list from a database regularly;
8) the strategy comprises the adjustment of the upper limit of the connection duration and some changeable configurations;
9) for the connection exceeding the specified connection duration, directly releasing the connection, and putting the connection resource back to the queue, so as to avoid some abnormal users from occupying the resource for a long time;
10) for blacklisted users, service is refused;
2. master node
1) Acquiring instance information such as AKSK (signature authentication algorithm) and the like connected with all cloud mobile phone instances of a formulated account and information such as an occupation state of the cloud mobile phone instances through an Application Programming Interface (API);
2) for the instances which do not exist in the current database, executing instance data information and inserting the instance data information into the database, and simultaneously inserting instance connection information into a Redis queue;
3) for the existing instance in the database, only updating the state (idle/occupied, etc.) of the instance, if the instance is in the idle state, detecting whether the latest record in the database is an abnormal connection record, if so, detecting and verifying the current state of the cloud mobile phone instance, and if so, inserting the current state into a Redis queue; if not, judging whether the queue is lost or not, and if the queue is lost, reinserting the queue;
4) if all the steps are inserted into Redis operation, the operation is required to be recorded into a database, and the recording rule is consistent with the log processing of the service end node;
5) periodic steps 1) to 4);
6) how to determine if a node is lost?
Analyzing all recent example connection occupation and release logs from a mysql (relational database), counting all recently executed connections, comparing with all obtained example connections, screening out example connections which do not exist in recent records, judging whether data are lost possibly, and inserting the example connections into a Redis queue.
With further reference to fig. 5, as an implementation of the methods shown in the above diagrams, the present application provides an embodiment of a resource scheduling apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the resource scheduling apparatus 500 of the present embodiment may include: a resource application request receiving unit 501, a target resource determining unit 502, and a log entry adding and queue updating unit 503. The resource application request receiving unit 501 is configured to receive an incoming resource application request; a target resource determining unit 502 configured to determine a target resource in an available resource queue maintained by the master node according to the resource application request; the main node obtains an available resource queue according to log maintenance which records whether the available resources which are applied for in advance are successfully called or not; and a log entry adding and queue updating unit 503 configured to record a new log entry in the log, in response to the target resource being successfully called, of the target resource, and control the master node to update the available resource queue by reading the new log entry in the log.
In this embodiment, in the resource scheduling apparatus 500: the detailed processing and the technical effects thereof of the resource application request receiving unit 501, the target resource determining unit 502, the log entry adding and queue updating unit 503 can refer to the related descriptions of step 201 and 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
the resource actual condition period traversing unit is configured to traverse each available resource and each unavailable resource stored in the virtual resource pool at preset time intervals to obtain an actual available resource and an actual unavailable resource;
and the abnormal resource determining unit is configured to compare the actual available resource, the actual unavailable resource and the current available resource queue and determine the abnormal resource.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
and the abnormal resource processing unit is configured to respond to the fact that the abnormal resource is a target actual available resource which is not recorded in the available resource queue, supplement the target actual available resource into the available resource queue, and send an unsuccessful calling notification to an application end which calls the target available resource first.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
the occupation overtime resource processing unit is configured to release the target unavailable resource of which the actual occupation duration exceeds the required duration, and record the released target unavailable resource in the available resource queue after initialization; wherein, the required duration is recorded in the resource application request.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
the master-slave node right transfer unit is configured to respond to the current abnormal state of the master node, and control the master node to transfer the maintenance right of the available resource queue to a preset slave node; wherein the secondary node synchronizes a copy of the most recent available resource queue from the primary node when the secondary node does not hold the maintenance rights.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
an application user determination unit configured to determine an application user from the resource application request after receiving an incoming resource application request and before determining a target resource from the resource application request in an available resource queue maintained by the master node;
and the legal user judging and executing unit is configured to respond to the fact that the application user is a preset legal user, and execute the step of determining the target resource in the available resource queue maintained by the main node according to the resource application request.
In some optional implementations of this embodiment, the resource application request receiving unit 501 may be further configured to:
the cloud mobile phone receives a cloud mobile phone application request forwarded from a target application terminal by a target service node;
correspondingly, the target resource determining unit 502 may be further configured to:
determining target cloud mobile phone resources in an available cloud mobile phone resource queue maintained by a master node according to a cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the master node according to a service end node log which records whether the previously applied available cloud mobile phone resources are successfully called or not;
correspondingly, the log entry adding and queue updating unit 503 may be further configured to:
and in response to the target cloud mobile phone resource being successfully called, controlling the target service node to record a new log item of the target cloud mobile phone being successfully called in a service end node log of the target service node, and controlling the master node to update the available cloud mobile phone resource queue by reading the service end node log.
The resource scheduling apparatus provided in this embodiment adds a master node at the front end of a resource pool for storing all available resources and unavailable resources, and maintains an available resource queue by reading log information of whether a resource requested to be called is successfully called before through the master node, thereby avoiding traversal operation of each resource state in the resource pool when the available resource is requested to be called again subsequently by means of the information indicating which resources are currently available resources, and increasing the scheduling efficiency of the resources.
There is also provided, in accordance with an embodiment of the present application, an electronic device, a readable storage medium, and a computer program product.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 601 performs the respective methods and processes described above, such as the resource scheduling method. For example, in some embodiments, the resource scheduling method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the resource scheduling method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the resource scheduling method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in the conventional physical host and Virtual Private Server (VPS) service.
According to the technical scheme provided by the embodiment of the application, the main node is additionally arranged at the front end of the resource pool for storing all available resources and unavailable resources, and the main node is used for reading the log information of whether the previously applied and called resources are successfully called to maintain the available resource queue, so that the information for marking which resources are the current available resources is used for avoiding traversing operation of each resource state in the resource pool when the available resources are subsequently reapplied, and the scheduling efficiency of the resources is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (17)

1. A resource scheduling method comprises the following steps:
receiving an incoming resource application request;
determining a target resource in an available resource queue maintained by a master node according to the resource application request; the main node maintains and obtains the available resource queue according to a log which records whether the available resources which are applied for in the past are successfully called or not;
and responding to the target resource being successfully called, recording a new log item of the target resource being successfully called in the log, and controlling the main node to update the available resource queue by reading the new log item in the log.
2. The method of claim 1, further comprising:
traversing each available resource and each unavailable resource stored in the virtual resource pool at preset time intervals to obtain an actual available resource and an actual unavailable resource;
and comparing the actual available resources, the actual unavailable resources and the current available resource queue to determine abnormal resources.
3. The method of claim 2, further comprising:
responding to the abnormal resource as a target actual available resource which is not recorded in the available resource queue, supplementing the target actual available resource into the available resource queue, and sending an unsuccessful calling notification to an application end which calls the target available resource first.
4. The method of claim 1, further comprising:
releasing target unavailable resources with actual occupied duration exceeding required duration, and recording the released target unavailable resources in the available resource queue after initialization; wherein the required duration is recorded in the resource application request.
5. The method of claim 1, further comprising:
responding to the current abnormal state of the main node, and controlling the main node to transfer the maintenance authority of the available resource queue to a preset auxiliary node; wherein the secondary node synchronizes a copy of the most recent available resource queue from the primary node when the secondary node does not hold the maintenance rights.
6. The method of claim 1, wherein, after receiving an incoming resource application request, prior to determining a target resource in an available resource queue maintained by a master node from the resource application request, further comprising:
determining an application user according to the resource application request;
and responding to the application user as a preset legal user, and executing the step of determining the target resource in the available resource queue maintained by the main node according to the resource application request.
7. The method of any of claims 1-6, wherein the receiving an incoming resource application request comprises:
receiving a cloud mobile phone application request forwarded from a target application terminal by a target service node;
correspondingly, the determining, by the master node, a target resource in an available resource queue maintained by the master node according to the resource application request, where the master node maintains the available resource queue according to a log that records whether the previously applied available resource is successfully called includes:
determining a target cloud mobile phone resource in an available cloud mobile phone resource queue maintained by the master node according to the cloud mobile phone application request, wherein the master node obtains the available cloud mobile phone resource queue according to a service end node log which records whether the previously applied available cloud mobile phone resource is successfully called;
correspondingly, the recording, in response to the target resource being successfully called, a new log entry of the target resource being successfully called in the log, and controlling the master node to update the available resource queue by reading the new log entry in the log includes:
and in response to the target cloud mobile phone resource being successfully called, controlling the target service node to record a new log item of the target cloud mobile phone being successfully called in a service end node log of the target service node, and controlling the master node to update the available cloud mobile phone resource queue by reading the service end node log.
8. A resource scheduling apparatus, comprising:
a resource application request receiving unit configured to receive an incoming resource application request;
a target resource determination unit configured to determine a target resource in an available resource queue maintained by a master node according to the resource application request; the main node maintains and obtains the available resource queue according to a log which records whether the available resources which are applied for in the past are successfully called or not;
and the log entry adding and queue updating unit is configured to respond to the target resource being successfully called, record a new log entry of the target resource being successfully called in the log, and control the main node to update the available resource queue by reading the new log entry in the log.
9. The apparatus of claim 8, further comprising:
the resource actual condition period traversing unit is configured to traverse each available resource and each unavailable resource stored in the virtual resource pool at preset time intervals to obtain an actual available resource and an actual unavailable resource;
and the abnormal resource determining unit is configured to compare the actual available resource, the actual unavailable resource and the current available resource queue and determine the abnormal resource.
10. The apparatus of claim 9, further comprising:
and the abnormal resource processing unit is configured to respond to the fact that the abnormal resource is a target actual available resource which is not recorded in the available resource queue, patch the target actual available resource into the available resource queue, and send an unsuccessful calling notification to an application end which calls the target available resource first.
11. The apparatus of claim 8, further comprising:
the occupation overtime resource processing unit is configured to release the target unavailable resource of which the actual occupation duration exceeds the required duration, and record the released target unavailable resource in the available resource queue after initialization; wherein the required duration is recorded in the resource application request.
12. The apparatus of claim 8, further comprising:
a master-slave node right transfer unit configured to control the master node to transfer the maintenance right of the available resource queue to a preset slave node in response to the master node being currently in an abnormal state; wherein the secondary node synchronizes a copy of the most recent available resource queue from the primary node when the secondary node does not hold the maintenance rights.
13. The apparatus of claim 8, further comprising:
an application user determination unit configured to determine an application user from an incoming resource application request after receiving the resource application request and before determining a target resource from the resource application request in an available resource queue maintained by a master node;
and the legal user judging and executing unit is configured to respond to the application user as a preset legal user, and execute the step of determining the target resource in the available resource queue maintained by the main node according to the resource application request.
14. The apparatus according to any one of claims 8-13, wherein the resource application request receiving unit is further configured to:
the cloud mobile phone receives a cloud mobile phone application request forwarded from a target application terminal by a target service node;
correspondingly, the target resource determining unit is further configured to:
determining a target cloud mobile phone resource in an available cloud mobile phone resource queue maintained by the master node according to the cloud mobile phone application request, wherein the master node obtains the available cloud mobile phone resource queue according to a service end node log which records whether the previously applied available cloud mobile phone resource is successfully called;
correspondingly, the log entry adding and queue updating unit is further configured to:
and in response to the target cloud mobile phone resource being successfully called, controlling the target service node to record a new log item of the target cloud mobile phone being successfully called in a service end node log of the target service node, and controlling the master node to update the available cloud mobile phone resource queue by reading the service end node log.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of resource scheduling of any of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the resource scheduling method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the resource scheduling method according to any one of claims 1-7.
CN202110089644.2A 2021-01-22 2021-01-22 Resource scheduling method, device, equipment, storage medium and computer program product Active CN112650576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110089644.2A CN112650576B (en) 2021-01-22 2021-01-22 Resource scheduling method, device, equipment, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110089644.2A CN112650576B (en) 2021-01-22 2021-01-22 Resource scheduling method, device, equipment, storage medium and computer program product

Publications (2)

Publication Number Publication Date
CN112650576A true CN112650576A (en) 2021-04-13
CN112650576B CN112650576B (en) 2023-12-29

Family

ID=75370660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110089644.2A Active CN112650576B (en) 2021-01-22 2021-01-22 Resource scheduling method, device, equipment, storage medium and computer program product

Country Status (1)

Country Link
CN (1) CN112650576B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608856A (en) * 2021-08-12 2021-11-05 杭州萤石软件有限公司 Node scheduling method, system and device
CN113673890A (en) * 2021-08-26 2021-11-19 北京百度网讯科技有限公司 Cloud mobile phone resource order processing method, related device and computer program product
CN113742174A (en) * 2021-08-31 2021-12-03 北京百度网讯科技有限公司 Cloud mobile phone application monitoring method and device, electronic equipment and storage medium
CN114189702A (en) * 2021-12-07 2022-03-15 广州市百果园网络科技有限公司 Resource object allocation method, device, equipment and storage medium based on live broadcast room
CN114185688A (en) * 2022-02-14 2022-03-15 维塔科技(北京)有限公司 Physical resource occupation state correction method, scheduler and readable storage medium
CN115225487A (en) * 2022-07-25 2022-10-21 天翼云科技有限公司 Cloud service opening method and device
CN115269207A (en) * 2022-09-29 2022-11-01 浙江省公众信息产业有限公司无线运营分公司 Method and system for allocating resources to vCPE network elements

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144742A1 (en) * 2007-11-30 2009-06-04 International Business Machines Corporation Method, system and computer program to optimize deterministic event record and replay
CN101976205A (en) * 2010-05-27 2011-02-16 福州开睿动力通信科技有限公司 Electronic map technology-based talkback mobile phone task scheduling management system and method
CN102447582A (en) * 2011-12-31 2012-05-09 中兴通讯股份有限公司 Resource synchronization method and device
CN102467369A (en) * 2010-11-03 2012-05-23 北京普源精电科技有限公司 Measurement resource control system and measurement resource control method
CN103002043A (en) * 2012-12-14 2013-03-27 百度在线网络技术(北京)有限公司 Method and system used for resource management of cloud environment
CN108121599A (en) * 2016-11-30 2018-06-05 杭州海康威视数字技术股份有限公司 A kind of method for managing resource, apparatus and system
CN108200111A (en) * 2016-12-08 2018-06-22 中国移动通信集团山西有限公司 Resource allocation information update method, device and resource interface equipment
CN108897626A (en) * 2018-07-20 2018-11-27 浪潮电子信息产业股份有限公司 A kind of resource regulating method and server

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144742A1 (en) * 2007-11-30 2009-06-04 International Business Machines Corporation Method, system and computer program to optimize deterministic event record and replay
CN101976205A (en) * 2010-05-27 2011-02-16 福州开睿动力通信科技有限公司 Electronic map technology-based talkback mobile phone task scheduling management system and method
CN102467369A (en) * 2010-11-03 2012-05-23 北京普源精电科技有限公司 Measurement resource control system and measurement resource control method
CN102447582A (en) * 2011-12-31 2012-05-09 中兴通讯股份有限公司 Resource synchronization method and device
CN103002043A (en) * 2012-12-14 2013-03-27 百度在线网络技术(北京)有限公司 Method and system used for resource management of cloud environment
CN108121599A (en) * 2016-11-30 2018-06-05 杭州海康威视数字技术股份有限公司 A kind of method for managing resource, apparatus and system
CN108200111A (en) * 2016-12-08 2018-06-22 中国移动通信集团山西有限公司 Resource allocation information update method, device and resource interface equipment
CN108897626A (en) * 2018-07-20 2018-11-27 浪潮电子信息产业股份有限公司 A kind of resource regulating method and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘一田;刘士进;: "多租户高可用并行任务调度框架", 《计算机系统应用》, vol. 25, no. 12, pages 280 - 284 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608856A (en) * 2021-08-12 2021-11-05 杭州萤石软件有限公司 Node scheduling method, system and device
CN113673890A (en) * 2021-08-26 2021-11-19 北京百度网讯科技有限公司 Cloud mobile phone resource order processing method, related device and computer program product
CN113742174A (en) * 2021-08-31 2021-12-03 北京百度网讯科技有限公司 Cloud mobile phone application monitoring method and device, electronic equipment and storage medium
CN113742174B (en) * 2021-08-31 2024-04-02 北京百度网讯科技有限公司 Cloud mobile phone application monitoring method and device, electronic equipment and storage medium
CN114189702A (en) * 2021-12-07 2022-03-15 广州市百果园网络科技有限公司 Resource object allocation method, device, equipment and storage medium based on live broadcast room
CN114185688A (en) * 2022-02-14 2022-03-15 维塔科技(北京)有限公司 Physical resource occupation state correction method, scheduler and readable storage medium
CN114185688B (en) * 2022-02-14 2023-03-10 维塔科技(北京)有限公司 Physical resource occupation state correction method, scheduler and readable storage medium
CN115225487A (en) * 2022-07-25 2022-10-21 天翼云科技有限公司 Cloud service opening method and device
CN115269207A (en) * 2022-09-29 2022-11-01 浙江省公众信息产业有限公司无线运营分公司 Method and system for allocating resources to vCPE network elements
CN115269207B (en) * 2022-09-29 2022-12-23 浙江省公众信息产业有限公司无线运营分公司 Method and system for allocating resources to vCPE network element

Also Published As

Publication number Publication date
CN112650576B (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN112650576B (en) Resource scheduling method, device, equipment, storage medium and computer program product
US10536416B2 (en) Intelligent message queue management
JP4760491B2 (en) Event processing system, event processing method, event processing apparatus, and event processing program
US20180248940A1 (en) Distributed data management
US9497138B2 (en) Managing capacity in a data center by suspending tenants
CN113590329A (en) Resource processing method and device
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN114051029B (en) Authorization method, authorization device, electronic equipment and storage medium
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN113765871B (en) Method and device for managing fort machine
US11494239B2 (en) Method for allocating computing resources, electronic device, and computer program product
US20220276901A1 (en) Batch processing management
US20210117253A1 (en) Method, device, and computer program product for managing processes
CN114374657A (en) Data processing method and device
CN109903022B (en) Resource distribution method, device, equipment and computer readable storage medium
CN113742355A (en) Method, device, equipment and computer readable medium for updating inventory
CN112306371A (en) Method, apparatus and computer program product for storage management
CN114546705B (en) Operation response method, operation response device, electronic apparatus, and storage medium
CN113886078B (en) Method and device for realizing quota unified management based on dynamic threshold mechanism, electronic equipment and computer readable storage medium
US11687269B2 (en) Determining data copy resources
CN111179097B (en) Method, device, electronic equipment and storage medium for modifying warranty
CN114138538A (en) Abnormal instance processing method and device and electronic equipment
CN117632492A (en) Resource management method and device, storage medium and electronic equipment
CN114491674A (en) Log processing method, device and equipment based on block chain
CN115145725A (en) Cloud equipment distribution method and device, electronic equipment and storage medium

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