CN112650576B - 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
CN112650576B
CN112650576B CN202110089644.2A CN202110089644A CN112650576B CN 112650576 B CN112650576 B CN 112650576B CN 202110089644 A CN202110089644 A CN 202110089644A CN 112650576 B CN112650576 B CN 112650576B
Authority
CN
China
Prior art keywords
resource
available
target
queue
log
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.)
Active
Application number
CN202110089644.2A
Other languages
Chinese (zh)
Other versions
CN112650576A (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

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 fields of cloud platforms and cloud services. One embodiment of the 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 a resource application request, and maintaining the available resource queue by the master node according to a log recorded with whether the available resource which is applied before is successfully called; and in response to the successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item 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 resources are applied for later, and the scheduling efficiency of the resources is improved.

Description

Resource scheduling method, device, equipment, storage medium and computer program product
Technical Field
The present disclosure 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, a resource scheduling device, an electronic device, a computer readable storage medium, and a computer program product.
Background
With the development of the productivity and the improvement of the electronic informatization degree of the current society, the cloud technology and the cloud service are widely applied, and a user can transfer a calculation task to a cloud end through equipment with weak calculation capability in a mode of applying for the cloud service, so that reasonable configuration and reasonable use of resources are realized.
When a wide variety of cloud resources are applied to the cloud to realize cloud service by a wide variety of users, how to effectively schedule the cloud resources to meet the demands of the wide variety of users as much as possible is an important research object of the technicians 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 the master node according to the resource application request; the method comprises the steps that a master node obtains an available resource queue according to log maintenance recorded with whether available resources which are applied before are successfully called or not; and in response to the successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item in the log.
In a second aspect, an embodiment of the present application proposes a resource scheduling device, including: a resource application request receiving unit configured to receive an incoming resource application request; a target resource determining unit configured to determine a target resource in an available resource queue maintained by the master node according to the resource application request; the method comprises the steps that a master node obtains an available resource queue according to log maintenance recorded with whether available resources which are applied before are successfully called or not; and the log entry adding and queue updating unit is configured to respond to successful call of the target resource, record a new log entry of the successful call of the target resource in the log, and control the master 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 a resource scheduling method as described in any one of the implementations of the first aspect when executed.
In a fourth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement a resource scheduling method as described in any one of the implementations of the first aspect when executed.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, is capable of implementing a resource scheduling method as described in any of the implementations of the first aspect.
After receiving an incoming resource application request, 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 obtains the available resource queue according to log maintenance recording whether the available resource which is applied before is successfully invoked; after the execution body responds to successful call of the target resource, a new log item of the successful call of the target resource is recorded in the log, and the master node is controlled to update the available resource queue by reading the new log item in the log.
According to the method and the system, the master node is additionally arranged at the front end of the resource pool for storing all available resources and unavailable resources, and the available resource queue is maintained by reading the log information of whether the previously applied and called resources are successfully called or not through the master node, so that the traversing operation of each resource state in the resource pool is avoided when the available resources are applied again later by means of the information indicating which resources are current available resources, and the scheduling efficiency of the resources is improved.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is an exemplary system architecture in which the present application may be applied;
fig. 2 is a flowchart of a resource scheduling method provided in 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 flow chart of a resource scheduling method under an application scenario according to an embodiment of the present application;
fig. 5 is a block diagram of a resource scheduling device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device adapted to perform a resource scheduling method according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the resource scheduling methods, apparatus, 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 available resources. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various applications for implementing information communication between the terminal devices 101, 102, 103 and the server 105, such as a cloud service application, a cloud storage application, a data communication application, and the like, may be installed on the terminal devices.
The terminal devices 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 smartphones, tablets, laptop and desktop computers, etc.; when the terminal devices 101, 102, 103 are software, they may be installed in the above-listed electronic devices, which 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 particularly limited herein. When the server 105 is hardware, it may be implemented as a distributed server cluster formed by a plurality of 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 particularly limited herein.
The server 105 can provide various services through various built-in applications, for example, a cloud service application that can provide cloud resources for an applicant, and when the server 105 runs the cloud service application, the following effects can be achieved: firstly, receiving an incoming resource application request from terminal devices 101, 102, 103 through a network 104; then, determining a target resource in an available resource queue maintained by a master node according to the resource application request, wherein the master node obtains the available resource queue according to log maintenance recorded whether the available resource which is applied before is successfully invoked (all resources including available resources and unavailable resources are stored in a resource pool 1051); after the execution body responds to successful call of the target resource, a new log item of the successful call of the target resource is recorded in the log, and the master node is controlled 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 stored in advance in the server 105 in various ways, in addition to being acquired from the terminal apparatuses 101, 102, 103 through the network 104. Thus, when the server 105 detects that such data has been stored locally (e.g., a pending resource application request that was left until processing was initiated), it may choose to retrieve such data directly from the local, in which case the exemplary system architecture 100 may not include the terminal devices 101, 102, 103 and 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 flowchart 200 includes the following steps:
step 201: receiving an incoming resource application request;
this step is intended for receiving an incoming resource application request by an executing body 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 body through at least one forwarding device with one end connected to the user terminal and one end connected to the execution body when the user terminal cannot directly send the resource application request to the execution body.
The resource application request may be used to indicate a request initiator or a request initiator user's desire to apply for a resource, and may further generally include a description of related attributes of the target resource that the request initiator or the request initiator thinks about is acquired, for example, 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 combine the identity information of the request initiating terminal or the request initiating user included in the resource application request to determine whether the related requirements recorded in the request are immediately met, for example, determine the application user according to the resource application request, and execute the subsequent step 202 when the application user is determined to be a preset legal user, thereby preventing the illegal occupation of the limited resources by the illegal user.
Step 202: determining a target resource in an available resource queue maintained by the master node according to the resource application request;
on the basis of step 201, this step aims at determining, by the above-mentioned executing body, a target resource in an available resource queue maintained by the master node according to a resource application request.
The master node maintains an available resource queue according to a log recorded whether the available resource which is applied before is successfully invoked, 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 master node is controlled to maintain the available resource queue according to the returned or monitored log information whether the available resource is actually successfully invoked, and at least the resource information in the available state is recorded in the available resource queue and is stored in a queue form as the name implies.
Therefore, this step corresponds to the execution body determining, from the resource application request, a target resource suitable for allocation to the request initiator or the request initiator user in the available resource queue. It should be understood that, due to the existence of the master node and the available resource queues that are responsible for maintenance, the executing body does not need to directly request the resource pool storing all available resources and unavailable resources each time when processing the resource application request, but can determine the available target resources according to the available resource queues, so that the target resources can be directly called from the resource pool. Based on the foregoing, it will be appreciated that the available resource queue maintained by the master node should be located at the front end of the resource pool.
Furthermore, in addition to the resource information in the available state, the available resource queue may also record the resource information in the unavailable state, so as to match the available resource information with the total resource information of the resource pool for difference comparison, so as to determine more accurately whether the information recorded in the queue is consistent with the actual situation. In addition, some attributes of each resource, the number of times that each resource is called or applied for historically, and the like can be recorded so as to meet the personalized requirements of the applicant.
Step 203: and in response to the successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item in the log.
Based on step 202, this step aims at determining, by the execution body, that the target resource has been successfully invoked or successfully occupied by the request initiator or the request initiator user that sent the resource application request, recording a new log entry of the target resource that is successfully invoked in the log, and controlling the master node to update the available resource queue by reading the new log entry in the log.
The log is used for recording related information about whether each applied resource is successfully invoked or not, and the log can be added to the lowest part of the log in a mode of newly adding one log item each time. While the master node will be able to continually update the available resource queue by the new log entry per occurrence.
Specifically, the frequency of updating the available resource queue by the master node may be set by itself, for example, when it can be monitored that the log writes a new log entry, the master node may immediately update according to the written new log entry, or may set a fixed time interval for checking the new log entry and updating, and specifically, which may be flexibly selected according to the actual requirement, which is not specifically limited herein.
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 available resource queue is maintained by reading the log information of whether the previously applied and called resources are successfully called or not through the main node, so that the traversing operation on each resource state in the resource pool is avoided when the available resources are applied for later by means of the information indicating which resources are current available resources, and the scheduling efficiency of the resources is increased.
Referring to fig. 3, fig. 3 is a flowchart of another resource scheduling method according to an embodiment of the present application, where the flowchart 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: responding to the application user as a preset legal user, and determining a target resource in an available resource queue maintained by the main node according to a resource application request;
the steps 301 to 303 are added with the step of extracting identity information to determine whether the applied user is a legal user based on the steps 201 to 202 shown in fig. 2, and the subsequent processing steps are executed only when the applied user is determined to be the legal user, so that the situation that limited resources are illegally occupied by illegal users is avoided as much as possible.
Step 304: responding to successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item in the log;
step 304 corresponds to step 203 shown in fig. 2, and the detailed description is not repeated here.
Step 305: traversing each available resource and unavailable resource stored in the virtual resource pool at preset time intervals to obtain actual available resources and actual unavailable resources;
because of complexity and instability under actual conditions, the information in the available resource queue which is obtained by the information maintenance of successful call or not in the log is inconsistent with the actual conditions, which is most likely caused by unknown reasons or position factors, so that the accurate actual available resources and actual unavailable resources are obtained by periodically traversing the actual states of all resources in the resource pool.
Step 306: comparing the actual available resources, the actual unavailable resources and the current available resource queue to determine abnormal resources;
based on step 305, this step aims at determining, by the execution body, the abnormal resources by comparing the actual available resources, the actual unavailable resources and the current available resource queue. The abnormal resources include various types, such as a part of the actual available resources which are not recorded in the available resource queue, a part of the actual unavailable resources which are recorded in the available resource queue, the available resource queue records the resources which are not contained in the actual available resources or the actual unavailable resources, and the like, i.e. the resources which do not conform to the expected state belong to the abnormal resources.
Furthermore, the related information recorded in the available resource queue can be corrected according to the determined abnormal resources, so that at least the related information of the resources in the available state consistent with the actual situation is recorded in the available resource queue.
Step 307: and responding to the abnormal resources as target actual available resources which are not recorded in the available resource queue, supplementing the target actual available resources into the available resource queue, and sending an unsuccessful call notification to an application terminal which calls the target available resources.
Based on step 306, this step aims at the execution subject to patch the target actual available resources into the available resource queue for the target actual available resources not recorded in the available resource queue, and sends an unsuccessful call notification to the application terminal that calls the target available resources first. That is, a specific processing mode of the abnormal resource is provided 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-303, so as to avoid the situation that limited resources are illegally occupied by an illegal user as far as possible; step 305-step 306 provides a scheme for verifying whether the related information recorded in the available resource queue is consistent with the actual situation, so that the abnormal occurrence caused by unstable factors and unknown factors is removed as much as possible in the two-phase verification mode, and the accuracy of the related information recorded in the available resource queue is improved; step 307 provides a processing manner for one specific abnormal resource type based on the abnormal resource determination in step 306, so as to implement correction of error information as much as possible.
It should be understood that there is no causal or dependency between the preferred implementation presented in steps 301-303 and the preferred implementation presented in steps 305-306, and that two separate embodiments may be formed based on the embodiments shown in fig. 2, respectively, and that step 307 may not be included in a separate embodiment at all, so that step 307 may be included in a separate embodiment, depending on whether step 306 is included or not, and may be divided into two separate embodiments, which is only one preferred embodiment that sums the above-mentioned multiple preferred implementations together.
On the basis of any embodiment, in order to avoid the phenomenon that the amount of circulated resources gradually decreases due to the fact that a certain user occupies a certain resource for a long time, the target unavailable resources with the actual occupied time exceeding the required time can be released, and the released target unavailable resources are recorded in an available resource queue again after being initialized; the required time length is recorded in the resource application request.
On the basis of any embodiment, when the executing main body finds that the main node is in an abnormal state currently, the main node is controlled to transfer the maintenance authority of the available resource queue to a preset auxiliary node; wherein the secondary node synchronizes copies of the latest available resource queues from the primary node when the maintenance rights are not held. Namely, uninterrupted maintenance of the available resource queues is ensured as far as possible through a backup mechanism of the primary node and the secondary node.
In order to deepen understanding, a specific implementation scheme is provided in combination with a specific application scenario, please refer to a schematic diagram shown in fig. 4, and as shown in the schematic diagram, in the scenario, in order to meet a requirement that a user requests cloud mobile phone resources from a cloud (a cloud mobile phone resource usually appears as an instance and can be a cloud mobile phone instance), a resource application request initiated by user equipment in the system level needs to be transferred to a cloud mobile phone connection pool through a service node, and the cloud mobile phone connection pool comprises a dis database, a main node and a cloud mobile phone instance pool. In the specific application scenario shown in the schematic diagram, the process 200 shown in fig. 2 may 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 main node according to a cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the main node according to a server node log recorded with whether the available cloud mobile phone resources which are applied before are successfully invoked;
and in response to successful invocation of the target cloud mobile phone resources, controlling the target service node to record new log entries successfully invoked by the target cloud mobile phone in a service end node log thereof, and controlling the main node to update an available cloud mobile phone resource queue by reading the service end node log.
The following will be described separately:
1. service end node
1) When a resource application request transmitted by user equipment is received, available cloud mobile phone resources are obtained from a Redis queue (namely an available resource queue maintained by a main node);
2) Connecting corresponding cloud mobile phone examples according to the acquired information;
3) When a connection abnormality occurs, logging and re-executing 1);
4) When the connection is successful, recording a log and executing an operation;
5) When execution is completed, recording a log, releasing connection, and putting the connection resource back to a 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) Periodically synchronizing a policy configuration and a blacklist IP or user information list such as a user name from a database;
8) The policy includes adjustment of the upper limit of the connection duration and some changeable configurations;
9) For the connection exceeding the appointed connection duration, directly releasing the connection, and putting the connection resource back to the queue, so that certain abnormal users are prevented from occupying the resource for a long time;
10 For blacklisted users, refusing service;
2. main node
1) Acquiring instance information such as AKSK (a signature authentication algorithm) and the like of all cloud mobile phone instance connections of a formulated account and information such as occupation state thereof through an API (Application Programming Interface, application program interface);
2) For the examples which do not exist in the current database, executing the insertion of the example data information into the database, and simultaneously inserting the example connection information into a Redis queue;
3) For the example existing in the database, only updating the state (idle/occupied, etc.), if the example 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 example, and if so, inserting the cloud mobile phone example into a Redis queue; if not, judging whether the data is lost, and if so, reinserting the data into a queue;
4) If the execution of the operations inserted into the Redis exists in all the steps, the operations must be recorded into a database, and the recording rules and the log processing of the server node are kept consistent;
5) Periodic steps 1) to 4);
analyzing the occupation and release log of all recent instance connections from mysql (relational database), counting all connections which are executed recently, comparing with all acquired instance connections, screening out instance connections which do not exist in recent records, judging that the instance connections are likely to be data loss, and inserting the instance connections into a Redis queue.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of a resource scheduling apparatus, where an 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, a log entry adding and queue updating unit 503. Wherein 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 method comprises the steps that a master node obtains an available resource queue according to log maintenance recorded with whether available resources which are applied before are successfully called or not; the log entry adding and queue updating unit 503 is configured to record a new log entry of the target resource that is successfully invoked in the log in response to the target resource being successfully invoked, and control the master node to update the available resource queue by reading the new log entry in the log.
In the present embodiment, in the resource scheduling apparatus 500: the specific processing and the technical effects of the resource application request receiving unit 501, the target resource determining unit 502, the log entry adding and queue updating unit 503 may refer to the relevant descriptions of steps 201 to 203 in the corresponding embodiment of fig. 2, and are not repeated here.
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 unavailable resource stored in the virtual resource pool at preset time intervals to obtain actual available resources and actual unavailable resources;
the abnormal resource determining unit is configured to compare the actual available resources, the actual unavailable resources and the current available resource queue to determine abnormal resources.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
the abnormal resource processing unit is configured to respond to the abnormal resource as the target actual available resource which is not recorded in the available resource queue, to patch the target actual available resource into the available resource queue, and to send an unsuccessful call notification to the 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 occupied time-out resource processing unit is configured to release target unavailable resources with actual occupied time exceeding the required time, and re-record the released target unavailable resources in an available resource queue after initializing; the required time length is recorded in the resource application request.
In some optional implementations of this embodiment, the resource scheduling apparatus 500 may further include:
the main and auxiliary node weight transfer unit is configured to control the main node to transfer the maintenance authority of the available resource queue to a preset auxiliary node in response to the main node being in an abnormal state currently; wherein the secondary node synchronizes copies of the latest available resource queues from the primary node when the maintenance rights are not held.
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 a resource application request after receiving an incoming resource application request, 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 application user being a preset legal user, and execute the step of determining the target resource in the available resource queue maintained by the master node according to the resource application request.
In some optional implementations of the present 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 determination unit 502 may be further configured to:
determining target cloud mobile phone resources in an available cloud mobile phone resource queue maintained by a main node according to a cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the main node according to a server node log recorded with whether the available cloud mobile phone resources which are applied before are successfully invoked;
correspondingly, the log entry increment and queue update unit 503 may be further configured to:
and in response to successful invocation of the target cloud mobile phone resources, controlling the target service node to record new log entries successfully invoked by the target cloud mobile phone in a service end node log thereof, and controlling the main node to update an available cloud mobile phone resource queue by reading the service end node log.
The embodiment exists as an embodiment of the device corresponding to the embodiment of the method, and the resource scheduling device provided by the 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 the master node by reading log information of whether the previously applied to call resources are successfully called, so that the traversing operation of each resource state in the resource pool is avoided when the available resources are applied again later by means of the information indicating which resources are current available resources, and the scheduling efficiency of the resources is increased.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
Fig. 6 shows a schematic block diagram of an example electronic device 600 that may 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that 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 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; 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 computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as a resource scheduling method. For example, in some embodiments, the resource scheduling method may be implemented as a computer software program tangibly embodied on 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 circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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 can be a cloud server, 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 large management difficulty and weak service expansibility in the traditional physical host and virtual private server (VPS, virtual Private Server) 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 available resource queue is maintained by the main node through reading the log information of whether the resources which are applied to be invoked before are successfully invoked, so that the traversing operation on the state of each resource in the resource pool is avoided when the available resources are applied for later by means of the information indicating which resources are current available resources, and the scheduling efficiency of the resources is increased.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application are achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (12)

1. A method of resource scheduling, comprising:
receiving an incoming resource application request;
determining a target resource in an available resource queue maintained by the master node according to the resource application request; the master node maintains the available resource queue according to a log recorded with whether the available resource which is applied before is successfully called or not, and the available resource queue records historical called or applied times information of the available resource;
responding to successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item in the log;
traversing each available resource and unavailable resource stored in the virtual resource pool at preset time intervals to obtain actual available resources and actual unavailable resources; comparing the actual available resources, the actual unavailable resources and the current available resource queue to determine abnormal resources;
and responding to the abnormal resource as the 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 call notification to an application end which calls the target actual available resource.
2. The method of claim 1, further comprising:
releasing target unavailable resources with actual occupied time exceeding the required time, initializing the released target unavailable resources, and recording the initialized target unavailable resources in the available resource queue again; the required time length is recorded in the resource application request.
3. The method of claim 1, further comprising:
responding to the current abnormal state of the master node, and controlling the master node to transfer the maintenance authority of the available resource queue to a preset auxiliary node; wherein the secondary node synchronizes copies of the latest available resource queues from the primary node when the maintenance rights are not held.
4. The method of claim 1, wherein after receiving an incoming resource application request, before 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, executing the step of determining the target resource in an available resource queue maintained by the master node according to the resource application request.
5. The method of any of claims 1-4, 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, according to the resource application request, a target resource in an available resource queue maintained by a master node, where the master node obtains the available resource queue according to log maintenance recorded with whether the available resource previously applied is successfully invoked, and the method includes:
determining target cloud mobile phone resources in an available cloud mobile phone resource queue maintained by the master node according to the cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the master node according to a server node log recorded with whether the available cloud mobile phone resources which are applied before are successfully invoked;
correspondingly, the responding to the successful call of the target resource, recording a new log item of the successful call of the target resource in the log, and controlling the master node to update the available resource queue by reading the new log item in the log, including:
and responding to successful call of the target cloud mobile phone resource, controlling the target service node to record a new log item of the target cloud mobile phone which is successfully called in a service end node log of the target service node, and controlling the main node to update the available cloud mobile phone resource queue by reading the service end node log.
6. A resource scheduling apparatus comprising:
a resource application request receiving unit configured to receive an incoming resource application request;
a target resource determining unit configured to determine a target resource in an available resource queue maintained by the master node according to the resource application request; the master node maintains the available resource queue according to a log recorded with whether the available resource which is applied before is successfully called or not, and the available resource queue records historical called or applied times information of the available resource;
a log entry adding and queue updating unit configured to record a new log entry successfully invoked by the target resource in the log in response to the successful invocation of the target resource, and control the master node to update the available resource queue by reading the new log entry in the log;
the resource actual condition period traversing unit is configured to traverse each available resource and unavailable resource stored in the virtual resource pool at preset time intervals to obtain actual available resources and actual unavailable resources;
an abnormal resource determining unit configured to compare the actually available resources, the actually unavailable resources, and a current available resource queue, and determine an abnormal resource;
And the abnormal resource processing unit is configured to respond to the abnormal resource as 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 call notification to an application end which previously calls the target actual available resource.
7. The apparatus of claim 6, further comprising:
the occupied time-out resource processing unit is configured to release target unavailable resources with actual occupied time exceeding the required time, and re-record the released target unavailable resources in the available resource queue after initializing; the required time length is recorded in the resource application request.
8. The apparatus of claim 6, further comprising:
a master-slave node weight transfer unit configured to control the master node to transfer maintenance rights 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 copies of the latest available resource queues from the primary node when the maintenance rights are not held.
9. The apparatus of claim 6, 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, before determining a target resource in an available resource queue maintained by a master node from the resource application request;
and the legal user judging and executing unit is configured to respond to the application user being a preset legal user, and execute the step of determining the target resource in the available resource queue maintained by the master node according to the resource application request.
10. The apparatus according to any of claims 6-9, 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 determination unit is further configured to:
determining target cloud mobile phone resources in an available cloud mobile phone resource queue maintained by the master node according to the cloud mobile phone application request, and maintaining the available cloud mobile phone resource queue by the master node according to a server node log recorded with whether the available cloud mobile phone resources which are applied before are successfully invoked;
Correspondingly, the log entry increment and queue update unit is further configured to:
and responding to successful call of the target cloud mobile phone resource, controlling the target service node to record a new log item of the target cloud mobile phone which is successfully called in a service end node log of the target service node, and controlling the main node to update the available cloud mobile phone resource queue by reading the service end node log.
11. An electronic device, comprising:
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 perform the resource scheduling method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the resource scheduling method of any one of claims 1-5.
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 CN112650576A (en) 2021-04-13
CN112650576B true 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)

Families Citing this family (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
CN113742174B (en) * 2021-08-31 2024-04-02 北京百度网讯科技有限公司 Cloud mobile phone application monitoring method and device, electronic equipment and storage medium
CN114189702B (en) * 2021-12-07 2023-09-26 广州市百果园网络科技有限公司 Resource object allocation method, device, equipment and storage medium based on live broadcast room
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
CN115269207B (en) * 2022-09-29 2022-12-23 浙江省公众信息产业有限公司无线运营分公司 Method and system for allocating resources to vCPE network element

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446909B (en) * 2007-11-30 2011-12-28 国际商业机器公司 Method and system for managing task events

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
多租户高可用并行任务调度框架;刘一田;刘士进;;《计算机系统应用》;第25卷(第12期);第280-284页 *

Also Published As

Publication number Publication date
CN112650576A (en) 2021-04-13

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
CN110210845B (en) Method, apparatus, medium, and computing device for blockchain data migration
CN113364877A (en) Data processing method, device, electronic equipment and medium
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN113760982A (en) Data processing method and device
CN110912949B (en) Method and device for submitting sites
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN114374657A (en) Data processing method and device
CN115310096A (en) Security vulnerability processing method, device, equipment and medium
CN109903022B (en) Resource distribution method, device, equipment and computer readable storage medium
CN113765871B (en) Method and device for managing fort machine
US20210117253A1 (en) Method, device, and computer program product for managing processes
CN113726885A (en) Method and device for adjusting flow quota
CN113742355A (en) Method, device, equipment and computer readable medium for updating inventory
CN114546705B (en) Operation response method, operation response device, electronic apparatus, and storage medium
CN112306371A (en) Method, apparatus and computer program product for storage management
CN111179097B (en) Method, device, electronic equipment and storage medium for modifying warranty
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
CN110262756B (en) Method and device for caching data
CN116594764A (en) Application program updating method and device, electronic equipment and storage medium
CN114138538A (en) Abnormal instance processing method and device and electronic equipment
CN117743467A (en) Agent node replacement method, device, 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