Task scheduling method, system, cluster server and readable storage medium
By using the scheduling field to identify the task status in the task database, and update and load the corresponding tasks in the distributed system, the problem of missing tasks after the server is down in the distributed system is solved, and the system stability is improved.
Patent Information
- Application Number
- CN201910787447.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-22
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2039-08-22
AI Technical Summary
In distributed systems, when using distributed locks to solve task scheduling problems, tasks may be lost after server downtime, resulting in poor system stability.
By using the scheduling field in the task database to identify the state of the task, the current server access the task database one by one to determine whether the scheduling field is a preset free standard. Target scheduling task.
After the server is down, it can re -obtain the unacceptable target scheduling task by occupying the logo, continue to execute, avoids the missing tasks of manual query, and improves the stability of the system.
Smart Images

Figure CN110489222B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task scheduling method, system, cluster server and readable storage medium. Background Art
[0002] With the rapid development of computer technology and Internet technology, users can easily access the Internet and submit tasks to servers on the Internet. The servers can then provide users with corresponding services by executing the tasks submitted by users. In practical applications, when the number of users is very large, a server consisting of a single machine can no longer meet the processing tasks of a large amount of data. Therefore, a distributed system consisting of multiple machines has become the mainstream solution today. However, in a distributed system, concurrent scheduling will lead to repeated processing of tasks.
[0003] Currently, a third-party system (Redis) has been introduced to solve this problem through distributed locks. However, in the process of applying distributed locks, it is possible that when the server locks the scheduling task, the server crashes, and the scheduling task locked by the server will be lost. It is necessary to manually query the scheduling task lost before the server crashes, resulting in poor system stability. Summary of the invention
[0004] The main purpose of the present invention is to provide a task scheduling method, system, cluster server and readable storage medium, aiming to solve the technical problem that referencing distributed locks in a distributed system will lead to poor system stability.
[0005] To achieve the above object, the present invention provides a task scheduling method, which includes:
[0006] Access the scheduled tasks in the task database one by one;
[0007] According to the accessed scheduling task, determining whether the scheduling field used to identify the scheduling task is a preset idle flag;
[0008] If the scheduling field is the preset idle flag, updating the scheduling field to an occupied flag associated with the current server;
[0009] The target scheduling task mapped with the occupancy identifier is loaded and executed.
[0010] Further, after the step of judging whether the scheduling field used to identify the scheduling task is a preset idle identifier according to the accessed scheduling task, the following steps are included:
[0011] If the scheduling field is the preset idle flag, the access permission of the accessed scheduling task is updated to be accessible only by the current server.
[0012] Furthermore, after the step of loading and executing the target scheduling task mapped to the occupancy identifier, the following steps are included:
[0013] After the target scheduling task is executed, the mapping relationship between the occupancy identifier and the target scheduling task is released;
[0014] The target scheduling task whose mapping relationship has been released is given access rights.
[0015] Furthermore, after the step of opening access rights to the target scheduling task whose mapping relationship is released, the following steps are included:
[0016] The scheduling field of the target scheduling task after releasing the mapping relationship is assigned the preset idle flag.
[0017] Furthermore, before the step of accessing the scheduled tasks in the task database one by one, the following steps are included:
[0018] Maintaining and managing the scheduling tasks according to the task database, the maintenance and management including: querying the scheduling tasks, adding the scheduling tasks, deleting the scheduling tasks or modifying the scheduling tasks;
[0019] The scheduling field of each of the scheduling tasks in the task database is assigned the preset idle flag.
[0020] Furthermore, the step of accessing the scheduled tasks in the task database one by one includes:
[0021] The scheduling task list in the task database is accessed one by one, and no more than a preset number of the scheduling tasks in the scheduling task list are accessed.
[0022] Furthermore, the step of loading and executing the target scheduling task mapped to the occupancy identifier includes:
[0023] Calling the target scheduling task mapped with the occupancy identifier to a cache area;
[0024] Determine whether the target scheduling task is stored in the cache area;
[0025] If the target scheduling task is stored in the buffer area, the target scheduling task is executed.
[0026] The present invention also provides a task scheduling system, the task scheduling system comprising:
[0027] An access module, used to access the scheduled tasks in the task database one by one;
[0028] A judgment module, used for judging whether the scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling task;
[0029] An updating module, configured to update the scheduling field to an occupied flag associated with the current server if the scheduling field is the preset idle flag;
[0030] A loading module is used to load and execute the target scheduling task mapped with the occupancy identifier.
[0031] The present invention also provides a cluster server, which includes one or more servers, and the server includes: a memory, a processor, and a task scheduling program stored in the memory and executable on the processor, and the task scheduling program implements the steps of the task scheduling method described above when executed by the processor.
[0032] The present invention also provides a readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the task scheduling method as described above are implemented.
[0033] The task scheduling method proposed in the embodiment of the present invention accesses the scheduling tasks in the task database one by one through the current server, and judges whether the scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling tasks. If the scheduling field is a preset idle flag, the scheduling field is updated to an occupied flag associated with the current server, and the current server loads and executes the target scheduling task mapped to the occupied flag. In this way, if the current server crashes and there are still unexecuted target scheduling tasks, after the current server is restarted, the unexecuted target scheduling tasks can be retrieved according to the occupied flag and continued to be executed. In the technical solution of this embodiment, there is no need to manually query the unexecuted target scheduling tasks that were lost before the current server crashed, thereby improving the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic diagram of the structure of a single server running on hardware involved in an embodiment of the present invention;
[0035] Figure 2 It is a flowchart of a first embodiment of a task scheduling method of the present invention;
[0036] Figure 3 It is a schematic diagram of a scenario in which multiple servers access a task database provided by an embodiment of the present invention;
[0037] Figure 4 It is a schematic diagram of the framework structure of an embodiment of a task scheduling system of the present invention.
[0038] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0040] like Figure 1 As shown, Figure 1 It is a schematic diagram of the structure of a single server in the hardware operating environment involved in the embodiment of the present invention.
[0041] The single server device in the embodiment of the present invention may be a computer or a smart phone.
[0042] like Figure 1 As shown, the server may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0043] Those skilled in the art will understand that Figure 1 The single server structure shown in the figure does not constitute a limitation on the single server device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0044] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a task scheduling processing program.
[0045] exist Figure 1In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the task scheduling program stored in the memory 1005 and perform the following operations:
[0046] Access the scheduled tasks in the task database one by one;
[0047] According to the accessed scheduling task, determining whether the scheduling field used to identify the scheduling task is a preset idle flag;
[0048] If the scheduling field is the preset idle flag, updating the scheduling field to an occupied flag associated with the current server;
[0049] The target scheduling task mapped with the occupancy identifier is loaded and executed.
[0050] Furthermore, the processor 1001 may call the task scheduling program stored in the memory 1005, and further perform the following operations: if the scheduling field is the preset idle flag, the access permission of the accessed scheduling task is updated to be accessible only by the current server.
[0051] Further, the processor 1001 may call the task scheduling program stored in the memory 1005, and further perform the following operations: after executing the target scheduling task, cancel the mapping relationship between the occupancy flag and the target scheduling task;
[0052] The target scheduling task whose mapping relationship has been released is given access rights.
[0053] Furthermore, the processor 1001 may call the task scheduling program stored in the memory 1005, and further perform the following operations: assigning the scheduling field of the target scheduling task after releasing the mapping relationship to the preset idle flag.
[0054] Further, the processor 1001 may call the task scheduling program stored in the memory 1005, and further perform the following operations: perform maintenance management on the scheduling task according to the task database, the maintenance management including: querying the scheduling task, adding the scheduling task, deleting the scheduling task, or modifying the scheduling task;
[0055] The scheduling field of each of the scheduling tasks in the task database is assigned the preset idle flag.
[0056] Furthermore, the scheduling task list in the task database is accessed one by one, and no more than a preset number of the scheduling tasks in the scheduling task list are accessed.
[0057] Further, calling the target scheduling task mapped with the occupancy identifier to a cache area;
[0058] Determine whether the target scheduling task is stored in the cache area;
[0059] If the target scheduling task is stored in the buffer area, the target scheduling task is executed.
[0060] Based on the above hardware structure, various embodiments of the task scheduling method of the present invention are proposed.
[0061] Please refer to Figure 2 In the first embodiment of the task scheduling method of the present invention, the task scheduling method includes:
[0062] Step S10, accessing the scheduled tasks in the task database one by one;
[0063] The current server accesses the scheduled tasks in the task database one by one.
[0064] In this embodiment, the task scheduling method is applied to a cluster server, which includes one or more servers. When one of the servers in the cluster server is accessing the task database, the server is the current server.
[0065] The task database can be set on the current server, or on other servers in the cluster server. Figure 3 As shown, the task database may also be a database server independent of the cluster server, and the cluster server may access data from the database server.
[0066] The task database is a data-sharing database, in which scheduling tasks are stored. For example, when the task database is set on the current server, other servers in the cluster server can access the task database on the current server, where data access refers to accessing the task database, including querying scheduling tasks, adding scheduling tasks, deleting scheduling tasks, or modifying scheduling tasks.
[0067] Step S20, judging whether the scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling task;
[0068] The current server determines whether the scheduling field used to identify the scheduling task is a preset idle flag based on the accessed scheduling task. Among them, the scheduling field is one of the field attributes used to identify the scheduling task. For example, the scheduling field is a string composed of numbers and / or letters. The idle flag can be an empty string or a non-empty string. In this embodiment, when the idle flag is an empty string, it means that the scheduling task is in an idle state, that is, in a waiting state; when the idle flag is a non-empty string, it means that the scheduling task is in an occupied state, that is, in a state of being called and occupied by a server.
[0069] For example, when a new scheduling task is added to the task database, the scheduling field of the scheduling task will be assigned a value. Optionally, the default value of the scheduling field is an empty string: "0". It is understandable that the scheduling field can also be assigned a non-empty string. For example, if the current server is accessing a scheduling task in the task database, it is determined whether the scheduling field of the scheduling task is a preset idle flag. In this embodiment, the preset idle flag is an empty string: "0".
[0070] Step S30: if the scheduling field is a preset idle flag, the scheduling field is updated to an occupied flag associated with the current server;
[0071] If the scheduling field is a preset idle flag, the scheduling field is updated to an occupied flag associated with the current server. If the scheduling field is not a preset idle flag, the scheduling field cannot be updated to an occupied flag associated with the current server. The occupied flag refers to an flag associated with the current server, and the occupied flag can be a string of numbers and / or letters. In this embodiment, the occupied flag is the IP address of the current server, and the IP address refers to the IP address used to identify the current server in the cluster server.
[0072] In this embodiment, if a scheduling field accessed by the current server is a preset idle flag, that is, an empty string, the scheduling field is updated to the IP address of the current server. Otherwise, the current server continues to access the next scheduling task and re-executes step S20.
[0073] Step S40: loading and executing the target scheduling task mapped with the occupancy identifier.
[0074] The current server can load and execute one or more target scheduling tasks mapped to the occupancy identifier. In this embodiment, the current server includes at least two threads, and the two threads can be processed in parallel. For example, the current server includes a first thread and a second thread. The first thread queries and obtains one or more target scheduling tasks from the task database based on the occupancy identifier associated with the current server, and arranges the one or more target scheduling tasks as the front end of the task queue, and the later accessed tasks are located at the tail end of the task queue. The second thread loads and executes the target scheduling tasks in the task queue one by one, that is, the scheduling tasks at the front end of the task queue are loaded and executed first.
[0075] In this embodiment, the current server accesses the scheduling tasks in the task database one by one, and determines whether the scheduling field used to identify the scheduling task is a preset idle flag based on the accessed scheduling tasks. If the scheduling field is a preset idle flag, the scheduling field is updated to an occupied flag associated with the current server, and the current server obtains and executes the target scheduling task mapped to the occupied flag. In this way, if the current server crashes and there are still unexecuted target scheduling tasks, after the current server is restarted, the unexecuted target scheduling tasks can be re-acquired based on the occupied flag and continued to be executed. In the technical solution of this embodiment, there is no need to manually query the unexecuted target scheduling tasks that were lost before the current server crashed, thereby improving the stability of the system.
[0076] Furthermore, in step S10 of the first embodiment, the step of accessing the scheduled tasks in the task database one by one includes:
[0077] Step S11, accessing the scheduling task list in the task database, and accessing scheduling tasks one by one that do not exceed a preset number.
[0078] The scheduling task list refers to a data table composed of multiple scheduling tasks, based on which the scheduling tasks stored in the data table can be queried and accessed.
[0079] In this embodiment, the current server can access the scheduling task list, and then query and access the scheduling tasks stored in the scheduling task list. The current server accesses no more than a preset number of scheduling tasks one by one. For example, the current server accesses no more than 10 scheduling tasks one by one. In this embodiment, according to the processing capacity of the current server, the upper limit of the number of scheduling tasks accessed by the current server is limited, so as to maximize the use of the resources of the current server and avoid causing excessive loading of tasks or insufficient execution of tasks. At the same time, after the current server crashes, the unexecuted target scheduling tasks still need to be loaded and executed. Therefore, limiting the upper limit of the number of scheduling tasks accessed by the current server can effectively prevent the current server from crashing again due to excessive loading of tasks.
[0080] Furthermore, in step S40 of the first embodiment, the step of loading and executing the target scheduling task mapped with the occupancy flag includes:
[0081] Step S41, calling the target scheduling task mapped with the occupation flag to the cache area;
[0082] Step S42, determining whether the cache area stores the target scheduling task;
[0083] Step S43: If the target scheduling task is stored in the buffer area, the target scheduling task is executed.
[0084] In this embodiment, the current server can load and call the target number scheduling task mapped with the occupancy identifier to the cache area based on the occupancy identifier. The cache area is located in the memory of the current server, and it can be queried whether the cache area has a storage record. When the cache area has a storage record, that is, the cache area stores the target scheduling task, the server executes the target scheduling task; when the cache area has no storage record, that is, the cache area does not store the target scheduling task, the current server continues to execute step S41.
[0085] The current server loads the target scheduling task into the cache area based on the occupancy mark and executes the target scheduling task, thereby preventing the current server from directly modifying the data in the task database, thereby avoiding risks such as damage and enhancing the stability of data during sharing.
[0086] In a second embodiment of the task scheduling method of the present invention, before the step of accessing the scheduled tasks in the task database one by one, the method includes:
[0087] Step A, maintaining and managing the scheduling tasks according to the task database, the maintenance and management including: querying the scheduling tasks, adding scheduling tasks, deleting scheduling tasks or modifying scheduling tasks;
[0088] Step B: changing the scheduling field of each scheduling task in the task database to a preset idle field.
[0089] The current server adds scheduling tasks, deletes scheduling tasks or modifies scheduling tasks according to the task database, and sets the scheduling field of each scheduling task in the task database to a preset idle field.
[0090] In this embodiment, the scheduling task is maintained and managed through the task database, and the maintenance and management includes querying the scheduling task, adding the scheduling task, deleting the scheduling task, or modifying the scheduling task. Among them, the scheduling task includes the field attribute of the scheduling field. If the current server accesses one of the scheduling tasks, the current server can assign a value to the scheduling field of the scheduling task, for example, assigning the scheduling field of the scheduling task to a preset idle flag. The current server assigning a value to the scheduling field of the scheduling task is equivalent to initializing the state of the scheduling task, that is, it is equivalent to adjusting the scheduling task to a waiting state.
[0091] In a third embodiment of the task scheduling method of the present invention, after the step of judging whether the scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling task, the method includes:
[0092] Step S21: If the scheduling field is a preset idle flag, the access permission of the accessed scheduling task is updated to be accessible only to the current server.
[0093] In this embodiment, when the current server accesses the scheduled task in the task database, if the scheduling field is a preset idle flag, the access permission of the accessed scheduled task is updated to be accessible only to the current server. That is, after determining that the scheduled task is in a state to be scheduled, the access permission of the scheduled task is locked, and the scheduled task can only be accessed and executed by the current server, thereby preventing other servers from accessing and executing the scheduled task, and also reducing the risk of losing the unexecuted target scheduled task, thereby improving the stability of the system.
[0094] Further, after the step of loading and executing the target scheduling task mapped with the occupancy identifier, the method further comprises:
[0095] After the target scheduling task is executed, the mapping relationship between the occupancy identifier and the target scheduling task is released;
[0096] The target scheduling task whose mapping relationship has been released is given access rights.
[0097] In this embodiment, if the current server completes the execution of the target scheduling task, the mapping relationship between the occupancy identifier and the target scheduling task is released, which is equivalent to releasing the target scheduling task. The target scheduling task whose mapping relationship has been released can be scheduled again in the next scheduling process, and other servers can schedule it.
[0098] Furthermore, when the access permission of the target scheduling task is updated to be accessible only by the current server, other servers can access, schedule or execute the target scheduling task only after the access permission of the target scheduling task is opened.
[0099] In this embodiment, the scheduling task is only accessed and executed by the current server, reducing the risk of losing the unexecuted target scheduling task, thereby improving the stability of the system. In addition, the access rights of the target scheduling task are opened only after the target scheduling task is executed, thereby ensuring that the target scheduling task is only accessed and executed by the current server.
[0100] Further, after the step of opening the access rights to the target scheduling task whose mapping relationship is released, the method further comprises:
[0101] The scheduling field of the target scheduling task after the mapping relationship is released is assigned to the preset idle flag.
[0102] In this embodiment, the current server assigns the scheduling field of the target scheduling task after the mapping relationship is released to a preset idle flag. That is, after the current server accesses and executes the target scheduling task, it updates the target scheduling task to a waiting-to-be-scheduled state, thereby releasing the target scheduling task, and allowing the target scheduling task to be scheduled by the current server or other servers in the next scheduling process.
[0103] In one embodiment, Figure 4 As shown, Figure 4 1 is a schematic diagram of the framework structure of an embodiment of a task scheduling system 50 of the present invention, comprising: an access module 51, a judgment module 52, an update module 53 and a loading module 54, wherein:
[0104] An access module 51 is used to access the scheduled tasks in the task database one by one;
[0105] A judging module 52, configured to judge whether a scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling task;
[0106] An updating module 53, configured to update the scheduling field to an occupied flag associated with the current server if the scheduling field is the preset idle flag;
[0107] The loading module 54 is used to load and execute the target scheduling task mapped with the occupancy identifier.
[0108] For the specific definition of the task scheduling system, please refer to the definition of the task scheduling method above, which will not be repeated here. Each module in the above task scheduling system can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0109] In addition, an embodiment of the present invention further provides a readable storage medium (i.e., a computer readable memory), on which a task scheduling program is stored. When the task scheduling program is executed by a processor, the following operations are implemented:
[0110] Access the scheduled tasks in the task database one by one;
[0111] According to the accessed scheduling task, determining whether the scheduling field used to identify the scheduling task is a preset idle flag;
[0112] If the scheduling field is the preset idle flag, updating the scheduling field to an occupied flag associated with the current server;
[0113] The target scheduling task mapped with the occupancy identifier is loaded and executed.
[0114] Furthermore, when the task scheduling program is executed by the processor, the following operation is also implemented: if the scheduling field is the preset idle flag, the access permission of the accessed scheduling task is updated to be accessible only by the current server.
[0115] Furthermore, when the task scheduling program is executed by the processor, the following operations are also implemented: after the target scheduling task is executed, the mapping relationship between the occupancy flag and the target scheduling task is released;
[0116] The target scheduling task whose mapping relationship has been released is given access rights.
[0117] Furthermore, when the task scheduling program is executed by the processor, the following operations are also implemented: assigning the scheduling field of the target scheduling task after the mapping relationship is released to the preset idle flag
[0118] Furthermore, when the task scheduling program is executed by the processor, the following operations are also implemented: maintaining and managing the scheduling task according to the task database, the maintenance and management including: querying the scheduling task, adding the scheduling task, deleting the scheduling task or modifying the scheduling task;
[0119] The scheduling field of each of the scheduling tasks in the task database is assigned the preset idle flag.
[0120] Furthermore, the scheduling task list in the task database is accessed one by one, and no more than a preset number of the scheduling tasks in the scheduling task list are accessed.
[0121] Further, calling the target scheduling task mapped with the occupancy identifier to a cache area;
[0122] Determine whether the target scheduling task is stored in the cache area;
[0123] If the target scheduling task is stored in the buffer area, the target scheduling task is executed.
[0124] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0125] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0127] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A task scheduling method, characterized in that: The task scheduling method comprises: Access the scheduled tasks in the task database one by one; The step of accessing the scheduled tasks in the task database one by one includes: Accessing the scheduling task list in the task database one by one, and accessing no more than a preset number of the scheduling tasks in the scheduling task list; According to the accessed scheduling task, determining whether the scheduling field used to identify the scheduling task is a preset idle flag; If the scheduling field is the preset idle flag, the scheduling field is updated to an occupied flag associated with the current server, wherein the occupied flag is the IP address of the current server; Loading and executing the target scheduling task mapped to the occupancy identifier; Wherein, after the step of judging whether the scheduling field used to identify the scheduling task is a preset idle identifier according to the accessed scheduling task, the following steps are included: If the scheduling field is the preset idle flag, updating the access permission of the accessed scheduling task to be accessed only by the current server; Wherein, after the step of loading and executing the target scheduling task mapped with the occupancy identifier, the following steps are included: After the target scheduling task is executed, the mapping relationship between the occupancy identifier and the target scheduling task is released; The target scheduling task whose mapping relationship has been released is given access rights.
2. The task scheduling method according to claim 1, characterized in that: After the step of opening access rights to the target scheduling task whose mapping relationship is released, the method further comprises: The scheduling field of the target scheduling task after releasing the mapping relationship is assigned the preset idle flag.
3. The task scheduling method according to claim 1, characterized in that: Before the step of accessing the scheduled tasks in the task database one by one, the method includes: Maintaining and managing the scheduling tasks according to the task database, the maintenance and management including: querying the scheduling tasks, adding the scheduling tasks, deleting the scheduling tasks or modifying the scheduling tasks; The scheduling field of each of the scheduling tasks in the task database is assigned the preset idle flag.
4. The task scheduling method according to claim 1, characterized in that: The step of loading and executing the target scheduling task mapped to the occupancy identifier includes: Calling the target scheduling task mapped with the occupancy identifier to a cache area; Determine whether the target scheduling task is stored in the cache area; If the target scheduling task is stored in the buffer area, the target scheduling task is executed.
5. A task scheduling system, characterized in that: The task scheduling system comprises: An access module, used to access the scheduling task list in the task database one by one, and access no more than a preset number of the scheduling tasks in the scheduling task list; A judgment module, used for judging whether the scheduling field used to identify the scheduling task is a preset idle flag according to the accessed scheduling task; An updating module, configured to update the scheduling field to an occupied identifier associated with the current server if the scheduling field is the preset idle identifier, wherein the occupied identifier is the IP address of the current server; A loading module is used to load and execute the target scheduling task mapped with the occupancy identifier, Wherein, the task scheduling system further comprises: if the scheduling field is the preset idle flag, updating the access permission of the accessed scheduling task to be accessed only by the current server; The task scheduling system further includes: after the target scheduling task is executed, releasing the mapping relationship between the occupancy identifier and the target scheduling task; The target scheduling task whose mapping relationship has been released is given access rights.
6. A cluster server, characterized in that: The cluster server includes one or more servers, and the server includes: a memory, a processor, and a task scheduling program stored in the memory and executable on the processor, and the task scheduling program implements the steps of the task scheduling method as described in any one of claims 1 to 4 when executed by the processor.
7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the task scheduling method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method for determining execution of scheduling task and first host for executing scheduling task
CN105933135A