CN114356521A - Task scheduling method and device, electronic equipment and storage medium - Google Patents

Task scheduling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114356521A
CN114356521A CN202111659878.2A CN202111659878A CN114356521A CN 114356521 A CN114356521 A CN 114356521A CN 202111659878 A CN202111659878 A CN 202111659878A CN 114356521 A CN114356521 A CN 114356521A
Authority
CN
China
Prior art keywords
task
actuator
isolation
executor
target
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.)
Pending
Application number
CN202111659878.2A
Other languages
Chinese (zh)
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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou 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 Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202111659878.2A priority Critical patent/CN114356521A/en
Publication of CN114356521A publication Critical patent/CN114356521A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a task scheduling method, a task scheduling device, electronic equipment and a storage medium, wherein the method comprises the following steps: performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; acquiring identification information and operating environment parameters of each isolation actuator to be selected, and updating the identification information and the operating environment parameters into an actuator management list; when the task processing request is received, a target task executor corresponding to the task processing request is determined, and when the target task executor is determined to be in isolated operation based on the executor management list, the target task executor is enabled to execute a task corresponding to the task processing request in a corresponding isolated environment. According to the technical scheme of the embodiment of the invention, the online environment and the isolation environment are distinguished in a plurality of actuators in an automatic mode, so that the requirement of the task in a specific scene on the isolation environment is met.

Description

Task scheduling method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of task processing, in particular to a task scheduling method and device, electronic equipment and a storage medium.
Background
With the development of internet technology and the increasing of enterprise traffic, multi-task and highly-concurrent scenes have become very common, so that a distributed task scheduling system needs to be adopted to deploy multiple machines in multiple machine rooms to process requests of various services.
In the prior art, after the distributed task scheduling system is built, although task scheduling and task execution are decoupled depending on a plurality of machines, the distributed tasks are executed regularly through a remote scheduling actuator. However, for some tasks, it may be necessary to perform based on isolated environments, and the executors in the rooms cannot support business differentiation of various environments when automatically registering. Therefore, in the solutions provided by the related arts, the distributed task scheduling system lacks a way of automatically allocating a specific executor in an isolation environment to a task to execute, and cannot meet the requirement of many scenarios on task isolation.
Disclosure of Invention
The invention provides a task scheduling method, a task scheduling device, electronic equipment and a storage medium, which are used for distinguishing an online environment from an isolation environment in a plurality of actuators in an automatic mode, so that the requirement of a task in a specific scene on the isolation environment is met.
In a first aspect, an embodiment of the present invention provides a task scheduling method, where the method includes:
performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; wherein the environment configuration file comprises an isolation operation environment parameter;
acquiring identification information and operating environment parameters of each isolation actuator to be selected, and updating the identification information and the operating environment parameters into an actuator management list;
when a task processing request is received, determining a target task executor corresponding to the task processing request, and enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment when the target task executor is determined to be in isolated operation based on the executor management list.
In a second aspect, an embodiment of the present invention further provides a task scheduling apparatus, where the apparatus includes:
the device comprises an isolation actuator to be selected determining module, a data configuration module and a data configuration module, wherein the isolation actuator to be selected determining module is used for carrying out data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; wherein the environment configuration file comprises an isolation operation environment parameter;
the actuator management list updating module is used for acquiring identification information and operating environment parameters of each isolation actuator to be selected and updating the identification information and the operating environment parameters into an actuator management list;
and the target task executor determining module is used for determining a target task executor corresponding to the task processing request when the task processing request is received, determining that the target task executor is in isolated operation based on the executor management list, and enabling the target task executor to execute the task corresponding to the task processing request in a corresponding isolated environment.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the task scheduling method according to any of the embodiments of the present invention.
In a fourth aspect, the embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the task scheduling method according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, data configuration is carried out on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured, namely the isolation environment required by the service for the actuator to be configured; the method comprises the steps of obtaining identification information and operating environment parameters of isolation executors to be selected, updating the identification information and the operating environment parameters into an executor management list, further, when a task processing request is received, determining a target task executor corresponding to the task processing request, determining that the target task executor is in isolated operation based on the executor management list, enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment, and distinguishing an on-line environment from an isolated environment in a plurality of executors in an automatic mode, so that the requirement of the task in a specific scene on the isolated environment is met, and meanwhile, the efficiency of the distributed task scheduling system is further enhanced through a simple and clear executor configuration mode.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart illustrating a task scheduling method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a task scheduling method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a task scheduling device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a task scheduling method according to an embodiment of the present invention, where the method may be applied to automatically distinguish an online environment and an isolated environment according to an identifier of an executor when the executor is automatically registered in a distributed task scheduling system, and the method may be executed by a task scheduling apparatus, where the apparatus may be implemented in a form of software and/or hardware, and the hardware may be an electronic device, such as a mobile terminal, a PC terminal, or a server.
As shown in fig. 1, the method specifically includes the following steps:
and S110, performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured.
In this embodiment, in order to process tasks related to each service, it is first necessary to build a distributed task scheduling platform, and at the same time, a plurality of corresponding execution machines are deployed in a plurality of machine rooms, and the machines are associated with the distributed task scheduling platform. The distributed task scheduling platform can be a platform with multiple open sources, for example, xxl-joba platform, the platform has a set of remote procedure call mechanism, and the distributed scheduling processing of tasks can be realized only by providing system resources such as extra ports, and the components of the platform are divided into a scheduling center and an executor. Specifically, the scheduling center can provide a background interface, in which the staff can create and modify the scheduling task according to the actual requirement, and can also specify different actuators to execute the corresponding scheduling task according to the actual scene; correspondingly, the executor provides an environment for executing the task, which can be understood as that, according to different requirements of various businesses of an enterprise, executors in different environments can be deployed, and when the executor is deployed in the executor cluster, service expansion can be more conveniently realized.
Based on this, in this embodiment, when configuring the environment of the executor, data configuration may be performed on at least one executor to be configured based on each environment configuration file. The environment configuration file is a file containing various operating environment parameters, different environment parameters reflect requirements of various tasks on various environments, and it can be understood that the corresponding environment can be constructed by the actuator based on the received environment configuration file. In an actual application process, the environments required by the service include an online environment and an isolated environment (i.e., a non-online environment), and therefore, when the isolated environment is configured for a part of the executors associated with the distributed task scheduling system, the corresponding environment configuration file includes isolated operating environment parameters, for example, a plurality of environment variables corresponding to the isolated environment are included, and based on the environment variables, the corresponding system, platform, server, and the like can be determined.
In this embodiment, after at least one executor in the executor cluster constructs a corresponding isolation environment based on the received environment configuration file, for the distributed task scheduling system, an isolation executor to be selected is determined. It should be noted that the isolation environment configured by the isolation executor to be selected may be understood as a pre-release environment, that is, the isolation environment is used for the last test before the product is formally released, functions, configuration, and a database of the isolation environment are all highly similar to the on-line environment, only the function code that needs to be on-line is permitted in this time, and a tester confirms that the code can be submitted to the pre-release environment to test the product after the test environment is tested by the test case, that is, after the isolation executor to be selected is obtained, when some tasks need to run in the isolation environment, the configured isolation executor to be selected may execute corresponding tasks.
And S120, acquiring identification information and operating environment parameters of each isolation actuator to be selected, and updating the identification information and the operating environment parameters to an actuator management list.
In this embodiment, after at least one to-be-selected isolation executor is configured in the distributed task scheduling system, information of the to-be-selected isolation executor may be updated to the scheduling center.
Specifically, it is first required to obtain identification information and operating environment parameters of each isolation actuator to be selected, where the identification information is information that reflects a machine identifier of the isolation actuator to be selected and an actuator cluster to which the actuator belongs, and the operating environment parameters include an Internet Protocol (IP) address and a port number corresponding to each isolation actuator to be selected. In an actual application process, for a scheduling center of a distributed task scheduling platform, a corresponding query instruction may be sent to each actuator based on a trigger operation or a preset time interval, and corresponding identification information and operating environment parameters may be obtained based on information fed back by the actuators, or identification information and operating environment parameters sent by the actuators may be passively obtained after configuration of an isolation actuator to be selected is completed.
In this embodiment, the identification information and the operating environment parameter of each actuator may be displayed in a page corresponding to the scheduling center in a form of a list, so that after the information of the isolation actuator to be selected is acquired, the information of the actuator list in the page may be updated based on the information. It can be understood that the list in the page corresponding to the scheduling center is the executor management list, and after the executor management list is updated, the worker can also perform checking, editing and deleting operations on each executor in the page.
S130, when the task processing request is received, determining a target task executor corresponding to the task processing request, and enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolation environment when the target task executor is determined to be in isolation operation based on the executor management list.
In this embodiment, at least one to-be-selected isolation executor is configured in an executor cluster associated with the distributed task scheduling system, and after the identification information and the operating environment parameter of the isolation executor are updated to an executor management list of the scheduling center, the executor can be used to process corresponding tasks.
Specifically, when a task processing request is received, a target task executor corresponding to the request may be determined in the executor cluster. The task processing request can be a task processing request related to a specific business of an enterprise, meanwhile, the task processing request can also carry a corresponding identifier, and the distributed task scheduling system can determine a corresponding target task executor based on the identifier carried by the request. It will be appreciated that the operating environment may be differently required for different tasks. For example, during the initial development period of a product, each task may need to be executed by a test environment, during the period when the product is formally on-line and provides application services to users, each task may need to be executed by an on-line environment, and during the pre-release period of the product, each task needs to be executed by an isolation environment.
In this embodiment, after receiving the task processing request and determining the target task executor among the plurality of executors of the executor cluster, it may be further determined whether the executor is in an isolated operation state, and when determining that the executor is in the isolated operation state, it indicates that the executor is a to-be-selected isolated executor obtained by pre-configuration. Further, the distributed task scheduling platform may issue the task based on the IP address and the port number in the operating environment parameter of the executor, so as to instruct the executor to execute the task corresponding to the task processing request in the isolated environment.
According to the technical scheme of the embodiment, data configuration is carried out on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured, namely the isolation environment required by the actuator for configuring the service; the method comprises the steps of obtaining identification information and operating environment parameters of isolation executors to be selected, updating the identification information and the operating environment parameters into an executor management list, further, when a task processing request is received, determining a target task executor corresponding to the task processing request, determining that the target task executor is in isolated operation based on the executor management list, enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment, and distinguishing an on-line environment from an isolated environment in a plurality of executors in an automatic mode, so that the requirement of the task in a specific scene on the isolated environment is met, and meanwhile, the efficiency of the distributed task scheduling system is further enhanced through a simple and clear executor configuration mode.
Example two
Fig. 2 is a schematic flowchart of a task scheduling method according to a second embodiment of the present invention, in which, based on the foregoing embodiment, an isolation operating environment parameter is determined based on an environment identifier of an environment configuration file, and a corresponding target field is configured for each to-be-selected isolation executor in a configuration file of a target database, so that when the executor automatically registers, an online environment and an isolation environment are automatically distinguished according to the environment identifier; in the task management page, by adding a routing strategy of an appointed address and determining the IP address and the port number of a target task executor when the strategy is selected, a service party can carry out task scheduling by the appointed address, thereby executing more flexible debugging. The specific implementation manner can be referred to the technical scheme of the embodiment. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method specifically includes the following steps:
s210, determining isolated operation environment parameters according to environment identifiers carried by each environment configuration file; and performing data configuration on at least one to-be-configured actuator in a non-online state based on each isolation operation environment parameter to obtain a corresponding to-be-selected isolation actuator, so that each to-be-selected isolation actuator operates in a corresponding isolation environment.
In this embodiment, after a distributed task scheduling platform is built and a plurality of to-be-configured actuators are deployed in a plurality of machine rooms, operation and maintenance related staff can provide each environment configuration file to configure each to-be-configured actuator. Meanwhile, for each pre-edited environment configuration file, each file also carries an environment identifier, wherein the environment identifier is an identifier reflecting whether the task operation environment is an online environment or an isolation environment, and specifically comprises an online environment identifier and an isolation environment identifier. It can be understood that when it is determined that some environment configuration files carry isolation environment identifiers, it may be determined that the files contain corresponding isolation operating environment parameters at the same time.
Furthermore, after each to-be-configured actuator receives the environment configuration file carrying the isolation environment identifier, data configuration may be performed on a corresponding environment variable based on the isolation operating environment parameter in the file, it should be noted that, when the to-be-configured actuator is configured based on the environment configuration file carrying the isolation environment identifier, it is also necessary to determine that the actuator is in a non-online state, for example, when the actuator is determined to be in a local area network, data configuration may be performed on the actuator based on the environment configuration file. After the configuration of each environment variable configured by the actuator to be configured is finished, the actuator can operate in the corresponding isolation environment, and process the received task processing request in the subsequent process.
S220, adding corresponding target fields for the isolation actuators to be selected in the configuration file of the target database, storing the identification information and the operating environment parameters of the isolation actuators to be selected in the target database according to the target fields after the identification information and the operating environment parameters of the isolation actuators to be selected are obtained, and updating the actuator management list based on the target database.
In this embodiment, in order to display information related to each executor in the scheduling center of the distributed task scheduling system, it is also necessary to configure corresponding fields in the configuration file of the target database in advance. The target database is a database associated with the distributed task scheduling system, and the configuration file of the target database may be an sql file that needs to configure various parameters after the distributed task scheduling platform is imported into idea. It can be understood that in the sql file, various parameters such as the executor AppName, the executor name, the executor address type, the executor address list, the account, the password, the authority, and the like can be configured.
In this embodiment, further, in order to update the identification information and the environment operating parameters of the isolation executor to be selected to the executor management list of the scheduling center, it is necessary to configure corresponding target fields, such as an executor identification field, an IP address field, a port number field, and the like, in the sql file of the target database for the executor that constructs the isolation environment in advance.
And S230, acquiring identification information and operating environment parameters of each isolation actuator to be selected.
S240, determining a corresponding actuator cluster in the actuator management list according to each identification information, and updating the operating environment parameters associated with each identification information to an isolated machine list of the corresponding actuator cluster.
In this embodiment, since the distributed task scheduling system is associated with at least one executor cluster, and each task is executed based on a specific execution machine in the executor cluster, after acquiring the identification information and the operating environment parameter of each to-be-selected isolation executor, it is necessary to determine the executor cluster to which the executor belongs based on the identification information, and store the identification information and the operating environment parameter into a target field of a target database, so as to update the list of isolation machines in the scheduling center page.
For example, after configuring a target field for an actuator for constructing an isolation environment in an sql file, after obtaining related information of an isolation actuator to be selected, determining an actuator cluster to which the isolation actuator belongs according to identification information of the isolation actuator to be selected, and adding an app name "dp-priority-service" and an online isolation machine address "19.20.91.35: 9999 "are stored in the target database, and after the actuator management list is updated based on the information stored in the target database, the identification information and the operating environment parameters related to the isolation actuator to be selected can be displayed in the page corresponding to the scheduling center. It can be understood that, for each actuator, a "registration mode", "Online machine address", "isolated machine registration mode", and corresponding editing operation control, deleting operation control, etc. may also be displayed, which is not described herein again in the embodiments of the present disclosure.
S250, when a task processing request is received, determining a task identifier to be processed carried by the task processing request; and determining a corresponding target Internet protocol address and a target port number in the pre-constructed task management information according to the to-be-processed task identifier, and determining a target task executor according to the target Internet protocol address and the target port number.
In this embodiment, when a task processing request is received, a to-be-processed task identifier carried by the request needs to be analyzed first, so that a service corresponding to the request can be further determined, for example, based on the to-be-processed task identifier obtained through analysis, it may be determined that an application service corresponding to the to-be-processed task identifier is "module-operation-web". Further, based on the determined identifier of the task to be processed, an IP address and a port number of an executor configured to process the task may be determined based on the pre-configured task management information, and based on the IP address and the port number, the distributed task scheduling platform may issue the task corresponding to the request to the corresponding executor.
Before receiving a task processing request, tasks associated with the application services need to be created and configured on the task management page. Optionally, according to the detected trigger operation, a target policy is determined from at least one executor selection policy for each task to be processed, and an operating environment parameter is configured for the corresponding task to be processed based on the target policy; task management information is constructed based on the to-be-processed task identification, the target strategy and the operating environment parameters of each to-be-processed task, so that when a task processing request is received, a target task executor is determined based on the task management information.
Specifically, on a task management page of the distributed task scheduling platform, a worker may configure tasks associated with a plurality of application services through an input operation or a selection operation, for example, configure parameters such as a routing policy, an address list, an operation mode, a task description, a blocking processing policy, a task name, a subtask ID, and a task timeout time of a certain task. Specifically, when the routing policies are different, the manner in which the distributed task scheduling platform remotely schedules the executor to execute the task also differs, and for the existing xxl-jobplatform, the routing policies include a first policy, a last policy, polling, random, consistent Hash, least frequently used, least recently used, failover, busy transfer, and other policies, which are not described herein again in the embodiments of the present disclosure.
In this embodiment, in order to execute a corresponding task by the to-be-selected isolation executor, a "specified address" policy also needs to be deployed in advance in the routing policy. It can be understood that, after selecting the "address assignment" policy in the task management page for a certain task, the scheduling center may issue the task to the designated to-be-selected isolation executor to execute when receiving a task processing request related to the task in the following. That is, for the distributed task scheduling platform, the target executor may be determined by an address list associated with an address-specifying policy, for example, when an "address-specifying" policy is selected for a certain service, one of the operating environment parameters (i.e., IP address and port number) of the existing multiple isolation executors to be selected needs to be selected, and when a corresponding task processing request is received, based on the selected IP address and port number, the scheduling center may determine the target task executor for the task and issue the task to the target task executor.
It should be noted that, in the actual application process, when an "address assignment" policy is selected for a specific service, an IP address and a port number of each isolation executor to be selected may be preferentially selected in an address list, and a service party may assign an address to perform task scheduling through the address assignment routing policy, thereby flexibly debugging a related service.
And S260, determining that the target task executor is in isolated operation based on the executor management list, and enabling the target task executor to execute the task corresponding to the task processing request in the corresponding isolated environment.
And S270, monitoring the target task executor, acquiring an execution log corresponding to the task processing request after the task corresponding to the task processing request is executed, and storing the execution log in a target database.
In this embodiment, when the scheduling center issues the task corresponding to the task processing request to the target task executor to execute, the execution process of the executor may also be monitored, and when it is determined that the task is completely executed, the corresponding execution log may be obtained based on the target task executor. The execution log is a record of various detailed conditions when the executor executes the task. Furthermore, after the scheduling center acquires the execution log, the recorded information can be stored in a specific position in the target database for a worker to call and query.
According to the technical scheme of the embodiment, the parameters of the isolation operation environment are determined based on the environment identification of the environment configuration file, and corresponding target fields are configured for each isolation actuator to be selected in the configuration file of the target database, so that the online environment and the isolation environment are automatically distinguished according to the environment identification when the actuators are automatically registered; in the task management page, by adding a routing strategy of an appointed address and determining the IP address and the port number of a target task executor when the strategy is selected, a service party can carry out task scheduling by the appointed address, thereby executing more flexible debugging.
EXAMPLE III
Fig. 3 is a block diagram of a task scheduling apparatus according to a third embodiment of the present invention, which is capable of executing a task scheduling method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the apparatus specifically includes: an isolated executor to be selected determination module 310, an executor management list update module 320, and a target task executor determination module 330.
The to-be-selected isolation actuator determining module 310 is configured to perform data configuration on at least one to-be-configured actuator based on each environment configuration file to obtain a to-be-selected isolation actuator corresponding to the at least one to-be-configured actuator; wherein, the environment configuration file comprises the parameter of the isolation operation environment.
The executor management list updating module 320 is configured to obtain identification information and operating environment parameters of each to-be-selected isolation executor, and update the identification information and the operating environment parameters to an executor management list.
The target task executor determining module 330 is configured to, when a task processing request is received, determine a target task executor corresponding to the task processing request, and cause the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment when the target task executor is determined to be an isolated run based on the executor management list.
On the basis of the above technical solutions, the to-be-selected isolation actuator determining module 310 includes an isolation operating environment parameter determining unit and a to-be-selected isolation actuator determining unit.
And the isolated operation environment parameter determining unit is used for determining isolated operation environment parameters according to environment identifiers carried by the environment configuration files, wherein the environment identifiers comprise online environment identifiers and isolated environment identifiers.
And the to-be-selected isolation actuator determining unit is used for carrying out data configuration on at least one to-be-configured actuator in a non-online state based on each isolation operating environment parameter to obtain a corresponding to-be-selected isolation actuator so as to enable each to-be-selected isolation actuator to operate in a corresponding isolation environment.
Optionally, the executor management list updating module 320 is further configured to determine a corresponding executor cluster in the executor management list according to each identification information, and update an operating environment parameter associated with each identification information to an isolated machine list of the corresponding executor cluster; the operating environment parameters comprise internet protocol addresses and port numbers corresponding to the isolation executors to be selected.
On the basis of the technical schemes, the task scheduling device further comprises a database configuration module.
The database configuration module is used for adding corresponding target fields for the isolation actuators to be selected in a configuration file of a target database, storing the identification information and the operating environment parameters of the isolation actuators to be selected in the target database according to the target fields after the identification information and the operating environment parameters of the isolation actuators to be selected are obtained, and updating an actuator management list based on the target database.
On the basis of the above technical solutions, the target task executor determining module 330 includes a task identifier determining unit and a target task executor determining unit.
And the task identifier determining unit is used for determining the to-be-processed task identifier carried by the task processing request when the task processing request is received.
And the target task executor determining unit is used for determining a corresponding target Internet protocol address and a target port number in the pre-constructed task management information according to the to-be-processed task identifier, and determining the target task executor according to the target Internet protocol address and the target port number.
On the basis of the technical solutions, the task scheduling device further includes a target policy determination module.
The target strategy determining module is used for determining a target strategy from at least one executor selection strategy aiming at each task to be processed according to the detected trigger operation and configuring operating environment parameters for the corresponding task to be processed based on the target strategy; task management information is constructed based on the to-be-processed task identification, the target strategy and the operating environment parameters of each to-be-processed task, so that when a task processing request is received, the target task executor is determined based on the task management information.
On the basis of the technical solutions, the task scheduling device further includes an execution log obtaining module.
And the execution log acquisition module is used for monitoring the target task executor, acquiring an execution log corresponding to the task processing request after the execution of the task corresponding to the task processing request is finished, and storing the execution log in a target database.
According to the technical scheme provided by the embodiment, data configuration is carried out on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured, namely the isolation environment required by the actuator to configure the service; the method comprises the steps of obtaining identification information and operating environment parameters of isolation executors to be selected, updating the identification information and the operating environment parameters into an executor management list, further, when a task processing request is received, determining a target task executor corresponding to the task processing request, determining that the target task executor is in isolated operation based on the executor management list, enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment, and distinguishing an on-line environment from an isolated environment in a plurality of executors in an automatic mode, so that the requirement of the task in a specific scene on the isolated environment is met, and meanwhile, the efficiency of the distributed task scheduling system is further enhanced through a simple and clear executor configuration mode.
The task scheduling device provided by the embodiment of the invention can execute the task scheduling method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 40 suitable for use in implementing embodiments of the present invention. The electronic device 40 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 4, electronic device 40 is embodied in the form of a general purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The electronic device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the electronic device 40, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, the electronic device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 412. As shown, the network adapter 412 communicates with the other modules of the electronic device 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement a task scheduling method provided by an embodiment of the present invention.
EXAMPLE five
Fifth, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a task scheduling method.
The method comprises the following steps:
performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; wherein the environment configuration file comprises an isolation operation environment parameter;
acquiring identification information and operating environment parameters of each isolation actuator to be selected, and updating the identification information and the operating environment parameters into an actuator management list;
when a task processing request is received, determining a target task executor corresponding to the task processing request, and enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment when the target task executor is determined to be in isolated operation based on the executor management list.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable item code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
The item code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer project code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The project code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for task scheduling, comprising:
performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; wherein the environment configuration file comprises an isolation operation environment parameter;
acquiring identification information and operating environment parameters of each isolation actuator to be selected, and updating the identification information and the operating environment parameters into an actuator management list;
when a task processing request is received, determining a target task executor corresponding to the task processing request, and enabling the target task executor to execute a task corresponding to the task processing request in a corresponding isolated environment when the target task executor is determined to be in isolated operation based on the executor management list.
2. The method according to claim 1, wherein the performing data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured comprises:
determining an isolation operation environment parameter according to an environment identifier carried by each environment configuration file, wherein the environment identifier comprises an online environment identifier and an isolation environment identifier;
and performing data configuration on at least one to-be-configured actuator in a non-online state based on each isolation operation environment parameter to obtain a corresponding to-be-selected isolation actuator, so that each to-be-selected isolation actuator operates in a corresponding isolation environment.
3. The method of claim 1, wherein updating the identification information and the operating environment parameter to an actuator management list comprises:
determining a corresponding actuator cluster in the actuator management list according to each identification information, and updating the operating environment parameters associated with each identification information into an isolated machine list of the corresponding actuator cluster;
the operating environment parameters comprise internet protocol addresses and port numbers corresponding to the isolation executors to be selected.
4. The method according to claim 3, wherein before the obtaining of the identification information and the operating environment parameters of each isolation actuator to be selected, the method further comprises:
in a configuration file of a target database, adding a corresponding target field for each to-be-selected isolation actuator, so that after identification information and operating environment parameters of each to-be-selected isolation actuator are acquired, storing the identification information and the operating environment parameters in the target database according to the target field, and updating an actuator management list based on the target database.
5. The method of claim 3, wherein determining a target task executor corresponding to a task processing request upon receiving the task processing request comprises:
when a task processing request is received, determining a task identifier to be processed carried by the task processing request;
and determining a corresponding target Internet protocol address and a target port number in the pre-constructed task management information according to the to-be-processed task identifier, and determining the target task executor according to the target Internet protocol address and the target port number.
6. The method of claim 5, further comprising, prior to receiving a task processing request:
according to the detected trigger operation, determining a target strategy from at least one executor selection strategy aiming at each task to be processed, and configuring operating environment parameters for the corresponding task to be processed based on the target strategy;
task management information is constructed based on the to-be-processed task identification, the target strategy and the operating environment parameters of each to-be-processed task, so that when a task processing request is received, the target task executor is determined based on the task management information.
7. The method of claim 1, further comprising:
monitoring the target task executor, acquiring an execution log corresponding to the task processing request after the execution of the task corresponding to the task processing request is finished, and storing the execution log in a target database.
8. A task scheduling apparatus, comprising:
the device comprises an isolation actuator to be selected determining module, a data configuration module and a data configuration module, wherein the isolation actuator to be selected determining module is used for carrying out data configuration on at least one actuator to be configured based on each environment configuration file to obtain an isolation actuator to be selected corresponding to the at least one actuator to be configured; wherein the environment configuration file comprises an isolation operation environment parameter;
the actuator management list updating module is used for acquiring identification information and operating environment parameters of each isolation actuator to be selected and updating the identification information and the operating environment parameters into an actuator management list;
and the target task executor determining module is used for determining a target task executor corresponding to the task processing request when the task processing request is received, determining that the target task executor is in isolated operation based on the executor management list, and enabling the target task executor to execute the task corresponding to the task processing request in a corresponding isolated environment.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a task scheduling method as recited in any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the method of task scheduling as claimed in any one of claims 1-7 when executed by a computer processor.
CN202111659878.2A 2021-12-30 2021-12-30 Task scheduling method and device, electronic equipment and storage medium Pending CN114356521A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111659878.2A CN114356521A (en) 2021-12-30 2021-12-30 Task scheduling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111659878.2A CN114356521A (en) 2021-12-30 2021-12-30 Task scheduling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114356521A true CN114356521A (en) 2022-04-15

Family

ID=81104770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111659878.2A Pending CN114356521A (en) 2021-12-30 2021-12-30 Task scheduling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114356521A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454606A (en) * 2022-09-27 2022-12-09 天翼数字生活科技有限公司 Task scheduling method, device, medium and related equipment under remote multi-activity architecture
CN116049000A (en) * 2023-01-19 2023-05-02 中国人民财产保险股份有限公司 Environment parameter configuration method, device, equipment, storage medium and product
CN116305288A (en) * 2023-04-25 2023-06-23 北京轻松筹信息技术有限公司 Method, device, equipment and storage medium for isolating database resources
CN116382814A (en) * 2023-03-31 2023-07-04 杭州端点网络科技有限公司 Unified system scheduling adaptation method, device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454606A (en) * 2022-09-27 2022-12-09 天翼数字生活科技有限公司 Task scheduling method, device, medium and related equipment under remote multi-activity architecture
CN116049000A (en) * 2023-01-19 2023-05-02 中国人民财产保险股份有限公司 Environment parameter configuration method, device, equipment, storage medium and product
CN116382814A (en) * 2023-03-31 2023-07-04 杭州端点网络科技有限公司 Unified system scheduling adaptation method, device, computer equipment and storage medium
CN116382814B (en) * 2023-03-31 2024-03-12 杭州端点网络科技有限公司 Unified system scheduling adaptation method, device, computer equipment and storage medium
CN116305288A (en) * 2023-04-25 2023-06-23 北京轻松筹信息技术有限公司 Method, device, equipment and storage medium for isolating database resources
CN116305288B (en) * 2023-04-25 2023-09-22 北京轻松筹信息技术有限公司 Method, device, equipment and storage medium for isolating database resources

Similar Documents

Publication Publication Date Title
CN110297689B (en) Intelligent contract execution method, device, equipment and medium
CN108537543B (en) Parallel processing method, device, equipment and storage medium for blockchain data
CN114356521A (en) Task scheduling method and device, electronic equipment and storage medium
US20190245911A1 (en) Address space management with respect to a coherent accelerator processor interface architecture
CN108513657B (en) Data conversion method and backup server
CN109672722B (en) Data deployment method and device, computer storage medium and electronic equipment
CN110706148B (en) Face image processing method, device, equipment and storage medium
US10282120B2 (en) Method, apparatus and system for inserting disk
CN110221910B (en) Method and apparatus for performing MPI jobs
CN111414391A (en) Method and system for accessing multiple data sources
US20130311632A1 (en) Cloud computing data center machine monitor and control
CN110555072A (en) Data access method, device, equipment and medium
US8832215B2 (en) Load-balancing in replication engine of directory server
CN109298937A (en) Document analysis method and the network equipment
CN111818145B (en) File transmission method, device, system, equipment and storage medium
CN110677307B (en) Service monitoring method, device, equipment and storage medium
CN113836237A (en) Method and device for auditing data operation of database
CN114443294B (en) Big data service component deployment method, system, terminal and storage medium
CN109657167B (en) Data acquisition method, device, server and storage medium
US9513948B2 (en) Automated virtual machine provisioning based on defect state
CA3183412A1 (en) Methods and systems for managing computing virtual machine instances
CN113778527A (en) Method and apparatus for controlling state of pipeline task
CN116820958A (en) Agent-based multi-environment automation test method and system
CN109120433B (en) Method and apparatus for containerized deployment of hosts
WO2022206242A1 (en) Multi-tenant operation and maintenance management method, apparatus and system

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