CN110597611B - Task scheduling method and device - Google Patents

Task scheduling method and device Download PDF

Info

Publication number
CN110597611B
CN110597611B CN201910889072.9A CN201910889072A CN110597611B CN 110597611 B CN110597611 B CN 110597611B CN 201910889072 A CN201910889072 A CN 201910889072A CN 110597611 B CN110597611 B CN 110597611B
Authority
CN
China
Prior art keywords
task
task information
information
configuration file
flow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910889072.9A
Other languages
Chinese (zh)
Other versions
CN110597611A (en
Inventor
陈国杰
罗建林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201910889072.9A priority Critical patent/CN110597611B/en
Publication of CN110597611A publication Critical patent/CN110597611A/en
Application granted granted Critical
Publication of CN110597611B publication Critical patent/CN110597611B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a task scheduling method, which comprises the following steps: when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table; verifying each task information according to a configuration rule; when the task information passes the verification, forming the task information into at least one task flow according to the associated identification carried by each task information; for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow; and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table. The method and the device can generate each configuration file based on the task information of each task flow, call each configuration file to execute the task operation corresponding to the task scheduling table, avoid hard coding during task scheduling at each time, effectively reduce the risk of code errors, and improve the efficiency of system development.

Description

Task scheduling method and device
Technical Field
The invention relates to the technical field of program development, in particular to a task scheduling method and device.
Background
With the development of information technology, network technology has been widely used in various fields, for example, in banking. In order to meet the requirements of the business scene of the bank, in the process of program development, each task corresponding to the business scene needs to be determined, and the corresponding task is executed according to the execution sequence of each task and the execution relation among each task, so that each function of the business scene can be realized.
In the prior art, a technician is required to adjust tasks in a hard coding manner, however, in order to improve the operation efficiency of banking services and improve the service quality of users, frequent adjustment of service scenarios is often required, and each time a service scenario is adjusted, the execution order of each task and the execution relationship among tasks in the service scenario need to be adjusted, that is, each time a service scenario is adjusted, task scheduling needs to be performed in a manner that a technician writes codes, which easily causes risks caused by imprecise codes, and system development efficiency is low.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a task scheduling method, which can generate each configuration file based on task information in each task flow, and call each configuration file to execute task operation corresponding to the task scheduling table, thereby avoiding hard coding when the task is called every time, effectively reducing the risk of code error, and improving the efficiency of system development.
The invention also provides a task scheduling device used for ensuring the realization and the application of the method in practice.
A task scheduling method comprises the following steps:
when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table;
verifying each task information according to a preset configuration rule;
when the task information passes the verification, forming at least one task flow by the task information according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information;
for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow;
and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table.
Optionally, the verifying the task information according to a preset configuration rule includes:
analyzing the configuration rule to determine a check field of each task information;
judging whether a legal value exists in the check field of each task information;
if the check field of each task information has a legal value, determining that the task information passes the verification;
otherwise, the task information is not verified.
Optionally, in the method, the forming at least one task stream from the task information according to the association identifier carried by each task information includes:
determining each associated task information set according to the associated identifier carried by each task information, wherein the associated task information set comprises each task information with an associated relation;
determining the task priority of each task information in each associated task information set according to the state information represented by the associated identifier carried by each task information, wherein if the state information is represented as a dependent state, the task priority of the task information is determined to be lower than that of the target task information, and if the state information of the associated identifier is a depended state, the task priority of the task information is determined to be higher than that of the target task information;
and for each associated task information set, forming task streams by all task information in the associated task information set according to the task priority.
Optionally, in the method, generating a configuration file corresponding to the task flow according to each piece of task information included in the task flow includes:
acquiring an identity identifier and a change identifier contained in each task information in the task flow;
determining a change type corresponding to each change identifier;
determining a code module corresponding to each task information based on the identity and the change type;
compiling each code module to generate a sub-configuration file of each task information;
and forming the sub configuration files into configuration files according to the task priority.
Optionally, in the method, the invoking each configuration file according to the invoking sequence to execute the task operation corresponding to the task schedule includes:
for each task flow, obtaining change time contained in each task information in the task flow, and determining the change time closest to the current time as target change time in each change time;
sequencing the target change time of each task flow to determine the calling sequence of each task flow;
and calling each configuration file based on the calling sequence, wherein in the process of calling each configuration file, a database corresponding to the currently called configuration file is determined, and data in the database is configured based on the configuration files.
A task scheduling apparatus comprising:
the system comprises a receiving unit, a scheduling unit and a processing unit, wherein the receiving unit is used for acquiring each task information contained in a task scheduling table when the task scheduling table configured by a user is received;
the verification unit is used for verifying each task information according to a preset configuration rule;
the execution unit is used for forming at least one task flow by each piece of task information according to the associated identification carried by each piece of task information when the task information passes the verification; the association identifier is an identity identifier of target task information which has an association relation with the task information;
the generating unit is used for generating a configuration file corresponding to the task flow according to the task information contained in the task flow for each task flow;
and the calling unit is used for determining the calling sequence of each configuration file and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table.
Optionally, the task scheduling apparatus described above, the verifying unit includes:
the analysis subunit is used for analyzing the configuration rule to determine the check field of each piece of task information;
the judging subunit is used for judging whether a legal value exists in the check field of each task information;
and the verification subunit is used for determining that the task information is verified to be passed when the verification field of each task information has a legal value, and otherwise, determining that the task information is not verified to be passed.
Optionally, the task scheduling apparatus described above, the execution unit includes:
the first determining subunit is configured to determine each associated task information set according to an associated identifier carried by each piece of task information, where the associated task information set includes each piece of task information having an association relationship;
the second determining subunit is configured to determine, according to state information represented by the association identifier carried by each piece of task information, a task priority of each piece of task information in each association task information set, where if the state information is represented as a dependent state, it is determined that the task priority of the piece of task information is lower than target task information, and if the state information of the association identifier is a dependent state, it is determined that the task priority of the piece of task information is higher than the target task information;
and the first execution subunit is used for forming a task stream by the task information in the associated task information set according to the task priority for each associated task information set.
The task scheduling apparatus described above may be optionally, wherein the generating unit includes:
the first acquiring subunit is configured to acquire an identity identifier and a change identifier included in each piece of task information in the task stream;
a third determining subunit, configured to determine a change type corresponding to each change identifier;
a fourth determining subunit, configured to determine, according to the identity and the change type, a code module corresponding to each piece of task information;
the compiling subunit is used for compiling each code module to generate a sub-configuration file of each task information;
and the second execution subunit is used for forming the configuration files by the sub configuration files according to the task priority.
Optionally, the task scheduling apparatus described above, where the invoking unit includes:
a second acquiring subunit configured to acquire, for each of the task flows, change times included in the respective pieces of task information in the task flow, and determine, as a target change time, a change time closest to a current time among the change times;
the fifth determining subunit is configured to sequence the target change time of each task flow to determine a call sequence of each task flow;
and the calling subunit is used for calling each configuration file according to the calling sequence, wherein in the process of calling each configuration file, a database corresponding to the currently called configuration file is determined, and data in the database is configured based on the configuration files.
Compared with the prior art, the invention has the following advantages:
the invention provides a task scheduling method, which comprises the following steps: when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table; verifying each task information according to a preset configuration rule; when the task information passes the verification, forming at least one task flow by the task information according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information; for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow; and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table. By applying the method provided by the embodiment of the invention, each configuration file can be generated based on the task information in each task flow, and each configuration file is called to execute the task operation corresponding to the task scheduling table, so that the hard coding is avoided when the task is called every time, the risk of code errors is effectively reduced, and the efficiency of system development is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for task scheduling according to the present invention;
FIG. 2 is a flowchart of another method of a task scheduling method according to the present invention;
FIG. 3 is a flowchart of another method of a task scheduling method according to the present invention;
FIG. 4 is a flowchart of another method of a task scheduling method according to the present invention;
FIG. 5 is a schematic structural diagram of a task scheduling device according to the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the invention provides a task scheduling method, which can be applied to various system platforms, wherein an execution main body of the method can be a computer terminal or a processor of various mobile devices, and a flow chart of the method is shown in fig. 1, and the method specifically comprises the following steps:
s101: and when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table.
In the method provided by the embodiment of the invention, a user can configure the task scheduling table through the visual page; the task scheduling table can contain a plurality of task information; the information of each task comprises an identity mark of the task, a Chinese name of the task, an English name of the task, change time, a change mark, an associated mark and the like.
In the method provided by the embodiment of the invention, the task can be determined to be a data deleting task, a data adding task or a data changing task through the change identifier.
In the method provided by the embodiment of the invention, each task information in the task scheduling table can be acquired by analyzing the task scheduling table.
In the method provided by the embodiment of the invention, the type of the task scheduling table can be an EXCEL table.
S102: and verifying each task information according to a preset configuration rule.
In the method provided by the embodiment of the invention, integrity verification is carried out on each task information according to a preset configuration rule, namely whether each task information is complete or not is judged.
In the method provided by the embodiment of the invention, when at least one task information fails to pass the verification, the identity of each task information failing to pass the verification is determined, and the prompt information is generated and fed back to the user based on the identity to prompt the user that the verification fails, so that the user can modify the task scheduling table according to the prompt information.
S103: when the task information passes the verification, forming at least one task flow by the task information according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information.
In the method provided by the embodiment of the invention, the number of the associated identifiers can be one or more, the associated relationship between the task information and the target task information can be determined through the associated identifiers, and the task priority between the task information and the target task information can be determined based on the associated relationship.
In the method provided by the embodiment of the invention, the task information with the incidence relation is combined into a task flow.
In the method provided by the embodiment of the invention, the target task information is the task information in the task scheduling table.
S104: and for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow.
In the method provided by the embodiment of the present invention, the configuration file may be a script file or an XML configuration file.
In the method provided by the embodiment of the invention, the task priority among the task information in the task flow is determined based on the incidence relation among the task information in the task flow. And generating a configuration file according to the task priority of each task information in the task flow and each task information in the task flow.
In the method provided by the embodiment of the invention, the configuration file can be generated based on the change identifier and the identity identifier of each task information.
S105: and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table.
In the method provided by the embodiment of the invention, the calling sequence of each task flow is determined according to the change time information contained in each task information.
The task scheduling method provided by the embodiment of the invention comprises the following steps: when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table; verifying each task information according to a preset configuration rule; when the task information passes the verification, forming at least one task flow by the task information according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information; for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow; and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table. By applying the method provided by the embodiment of the invention, each configuration file can be generated based on the task information in each task flow, and each configuration file is called to execute the task operation corresponding to the task scheduling table, so that the hard coding is avoided when the task is called every time, the risk of code errors is effectively reduced, and the efficiency of system development is improved.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the process of verifying each piece of task information may include, as shown in fig. 2:
s201: and analyzing the configuration rule to determine the check field of each piece of task information.
In the method provided by the embodiment of the invention, each piece of verification condition information contained in the configuration rule can be acquired by analyzing the configuration rule; each authentication condition information may correspond to one check field.
In the method provided by the embodiment of the invention, aiming at each task information, one or more of an identity identification field, a Chinese name field of the task, an English name field of the task, a change time field, a change identification field, an associated identification field and the like in the task information are detected to judge whether the task information meets the configuration rule or not.
S202: and judging whether the check fields of each piece of task information have legal values, if so, executing step S203, and if not, executing step S204.
In the method provided by the embodiment of the invention, each task information comprises one or more check fields, and the legal value represents that the value contained in the check field meets the corresponding verification condition information.
In the method provided by the embodiment of the invention, if the associated identification field in the task information is detected, whether the associated identification exists in the associated identification field is detected, and if the associated identification exists, the target task information corresponding to the identification is determined; and detecting whether the target task information exists in the task scheduling table, if so, determining that a legal value exists in the associated identification field, and if not, determining that a legal value does not exist in the associated identification field.
S203: and verifying the task information.
In the method provided by the embodiment of the invention, when each check field of each task information accords with the verification condition information, the task information is determined to pass verification.
S204: and verifying each task information to be failed.
In the method provided by the embodiment of the invention, if the value contained in any check field does not meet the corresponding verification condition information, the task information is determined not to pass the verification, if at least one task information is determined not to pass the verification, the identity of the task information which is not verified to pass is determined, verification failure prompt information is generated based on each identity and is sent to the user, so that the user is prompted to modify the task scheduling table based on the identity.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the forming at least one task flow from the task information according to the association identifier carried by each task information includes:
determining each associated task information set according to the associated identification carried by each task information, wherein the associated task information set comprises each task information with an association relation;
determining the task priority of each task information in each associated task information set according to the state information represented by the associated identifier carried by each task information, wherein if the state information is represented as a dependent state, the task priority of the task information is determined to be lower than that of the target task information, and if the state information of the associated identifier is a depended state, the task priority of the task information is determined to be higher than that of the target task information;
and for each associated task information set, forming task streams by all task information in the associated task information set according to the task priority.
In the method provided by the embodiment of the present invention, based on the state information of each association identifier, the state information is used to represent an association relationship between task information and target task information, that is, a task priority, and if the state information of the association identifier is a dependent state, it is determined that the task priority of the task information is lower than the target task information. And if the state information of the associated identifier is the depended state, determining that the task priority of the task information is higher than that of the target task information.
In the method provided in the embodiment of the present invention, the process of forming at least one task flow from each piece of task information according to the association identifier carried by each piece of task information may further be:
judging whether an association relation exists between the task information or not based on the association identifications;
and forming the task information with the incidence relation into a task flow.
In the method provided by the embodiment of the invention, the task priority of each task information in the task flow can be determined by the change time.
In the method provided by the embodiment of the invention, the task priority of each task information in the task flow can be determined according to the sequence of the change time from first to last, and the closer the change time is to the current moment, the higher the task priority is.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, the generating a configuration file corresponding to the task flow according to each piece of task information included in the task flow may include, as shown in fig. 3:
s301: and acquiring an identity identifier and a change identifier contained in each task information in the task flow.
In the method provided by the embodiment of the invention, each task information comprises an identity identifier and a change identifier.
S302: and determining the change type corresponding to each change identifier.
In the method provided by the embodiment of the invention, the change type can be a data addition type, a data deletion type or a data change type.
In the method provided by the embodiment of the present invention, optionally, each piece of task information corresponds to one change type.
S303: and determining a code module corresponding to each task information based on the identity and the change type.
In the method provided by the embodiment of the invention, the code module corresponding to the task information can be determined by determining the identity and the change type of the task information, and the code module is a pre-configured code module.
In the method provided by the embodiment of the invention, one code module can be determined by one identity and one change type.
S304: compiling each code module to generate a sub-configuration file of each task information.
In the method provided by the embodiment of the invention, each piece of task information corresponds to one code module, and the configuration file of each piece of task information can be generated by compiling each code module.
S305: and forming the sub-configuration files into configuration files according to the task priority.
In the method provided by the embodiment of the invention, each sub-configuration file is combined into the configuration file based on the task priority of each task information in the task flow.
In the method provided by the embodiment of the invention, the task priority can be determined by the change time of each task information in the task flow, and also can be determined by the associated identifier of each task information in the task flow.
In the method provided by the embodiment of the invention, the preset code module corresponding to each task information is determined, and each code module is compiled, so that when a service scene needs to be switched, the code does not need to be rewritten, the condition of code error can be effectively avoided, and the system maintenance efficiency of technicians is greatly improved.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the invoking each configuration file according to the invocation sequence to execute the task operation corresponding to the task schedule table may include, as shown in fig. 4:
s401: and for each task flow, acquiring change time contained in each piece of task information in the task flow, and determining the change time closest to the current time as a target change time in each change time.
In the method of the embodiment of the invention, each task information comprises the change time, and the change time can represent the effective time of the task.
According to the method provided by the embodiment of the invention, the change time closest to the current time can be determined as the target change time by comparing the closeness degree of each change time with the current time.
S402: and sequencing the target change time of each task flow to determine the calling sequence of each task flow.
In the method provided by the embodiment of the invention, the current time is taken as a reference, the target change times are sequenced according to the time sequence, and the sequence of each task flow is determined according to the sequence of each target change time, namely, the closer the target change time is to the current time, the higher the priority of the task flow corresponding to the target change time is.
S403: and calling each configuration file based on the calling sequence, wherein in the process of calling each configuration file, a database corresponding to the currently called configuration file is determined, and data in the database is configured based on the configuration files.
In the method provided by the embodiment of the invention, when each configuration file is called, a database corresponding to the currently called configuration file is determined; configuring data in the database based on the configuration file.
In the method provided by the embodiment of the invention, the configuration of each configuration file can be configured with the same or different databases.
In the method provided by the embodiment of the invention, the address information of the database corresponding to the currently called configuration file is acquired; and establishing a communication connection with the database based on the address information, executing the configuration file, and configuring the data in the database through the communication connection.
In the method provided by the embodiment of the present invention, the process of configuring data in the database based on the configuration file may be that, in the database and the data to be configured corresponding to the configuration file, the configuration file is analyzed to obtain the configuration operation corresponding to the configuration file, and the configuration operation may be adding data, deleting data, modifying data, or the like, and the data to be configured is configured based on the configuration operation.
The task scheduling method provided by the embodiment of the invention can be applied to a plurality of fields, and the following examples are given:
the method comprises the steps that execution codes required by each operation of a database are packaged in advance, a plurality of service functions are supposed to be realized in one service scene, the execution code required by each execution function is determined, task information required for calling the execution code is determined, when the service functions in the service scene need to be adjusted, a user can configure each task information in a visual page, the task information can comprise a task identity identifier, a task Chinese name, a task English name, change time, an association identifier, a change identifier, task modifier information and the like, and the change identifier can represent that the task is a data deleting task, a data adding task or a data changing task; when a configuration completion instruction of a user is received, analyzing the configuration completion instruction to obtain a task scheduling table configured by the user and acquiring each task information contained in the task scheduling table; verifying each task information according to a preset configuration rule; when the verification of each task information is passed, forming each task information into at least one task flow according to the associated identification carried by each task information; the association identifier is an identity identifier of target task information which has an association relation with the task information; for each task flow, according to each task information contained in the task flow, calling a code module corresponding to each task information to generate a configuration file corresponding to the task flow; and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table. By determining the preset code module corresponding to each task information and compiling each code module, when a service scene needs to be switched, the codes do not need to be rewritten, the error condition of the codes can be effectively avoided, and the system maintenance efficiency of technicians is greatly improved.
The above specific implementations and the derivation processes of the implementations are all within the scope of the present invention.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a task scheduling apparatus, which is used for specifically implementing the method in fig. 1, where the task scheduling apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the task scheduling apparatus is shown in fig. 5, and specifically includes:
a receiving unit 501, configured to, when a task scheduling table configured by a user is received, acquire each piece of task information included in the task scheduling table;
a verification unit 502, configured to verify each piece of task information according to a preset configuration rule;
the execution unit 503 is configured to, when the task information passes the verification, combine the task information into at least one task stream according to the association identifier carried by each task information; the association identifier is an identity identifier of target task information which has an association relation with the task information;
a generating unit 504, configured to generate, for each task stream, a configuration file corresponding to the task stream according to each piece of task information included in the task stream;
and the calling unit 505 is configured to determine a calling sequence of each configuration file, and call each configuration file according to the calling sequence to execute a task operation corresponding to the task scheduling table.
The task scheduling device provided by the embodiment of the invention acquires each task information contained in the task scheduling table when receiving the task scheduling table configured by a user; verifying each task information according to a preset configuration rule; when the task information passes the verification, the task information is combined into at least one task flow according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information; for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow; and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table. By applying the task scheduling device provided by the embodiment of the invention, each configuration file can be generated based on the task information in each task flow, and each configuration file is called to execute the task operation corresponding to the task scheduling table, so that the hard coding is avoided when the task is called every time, the risk of code error is effectively reduced, and the efficiency of system development is improved.
In the task scheduling apparatus provided in the embodiment of the present invention, the verification unit 502 includes:
the analysis subunit is used for analyzing the configuration rule to determine the check field of each piece of task information;
the judging subunit is used for judging whether a legal value exists in the check field of each task information;
and the verification subunit is used for determining that the task information is verified to be passed when the verification field of each task information has a legal value, and otherwise, determining that the task information is not verified to be passed.
In the task scheduling apparatus provided in the embodiment of the present invention, the execution unit 503 includes:
the first determining subunit is configured to determine each associated task information set according to an associated identifier carried by each piece of task information, where the associated task information set includes each piece of task information having an association relationship;
the second determining subunit is configured to determine, according to state information represented by the association identifier carried by each piece of task information, a task priority of each piece of task information in each association task information set, where if the state information is represented as a dependent state, it is determined that the task priority of the piece of task information is lower than target task information, and if the state information of the association identifier is a dependent state, it is determined that the task priority of the piece of task information is higher than the target task information;
and the first execution subunit is used for forming a task stream by each task information in the associated task information set according to the task priority for each associated task information set.
In the task scheduling apparatus provided in the embodiment of the present invention, the generating unit 504 includes:
the first acquiring subunit is configured to acquire an identity identifier and a change identifier included in each piece of task information in the task stream;
a third determining subunit, configured to determine a change type corresponding to each change identifier;
a fourth determining subunit, configured to determine, according to the identity and the change type, a code module corresponding to each piece of task information;
the compiling subunit is used for compiling each code module to generate a sub-configuration file of each task information;
and the second execution subunit is used for forming the configuration files by the sub configuration files according to the task priority.
In the task scheduling apparatus provided in the embodiment of the present invention, the invoking unit 505 includes:
a second acquiring unit configured to acquire, for each of the task flows, change times included in the task information in the task flow, and determine, as a target change time, a change time that is closest to a current time among the change times;
a fifth determining subunit, configured to sort the target change time of each task flow, so as to determine a call order of each task flow;
and the calling subunit is used for calling each configuration file according to the calling sequence, determining a database corresponding to the currently called configuration file in the process of calling each configuration file, and configuring data in the database based on the configuration files.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the task scheduling method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 6, which specifically includes a memory 601 and one or more instructions 602, where the one or more instructions 602 are stored in the memory 601 and configured to be executed by one or more processors 603 to perform the following operations on the one or more instructions 602:
when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table;
verifying each task information according to a preset configuration rule;
when the task information passes the verification, the task information is combined into at least one task flow according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information;
for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow;
and determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in one or more of software and/or hardware in implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The task scheduling method and device provided by the present invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method for task scheduling, comprising:
when a task scheduling table configured by a user is received, acquiring each task information contained in the task scheduling table; the task schedule includes a plurality of task information; each task information at least comprises an identity mark, change time, a change mark and an associated mark of the task;
carrying out integrity verification on each task information according to a preset configuration rule;
when the task information passes the verification, forming at least one task flow by the task information according to the associated identification carried by the task information; the association identifier is an identity identifier of target task information which has an association relation with the task information;
for each task flow, generating a configuration file corresponding to the task flow according to each task information contained in the task flow;
determining the calling sequence of each configuration file, and calling each configuration file according to the calling sequence so as to execute task operation corresponding to the task scheduling table;
the step of forming each task information into at least one task flow according to the associated identifier carried by each task information includes:
determining each associated task information set according to the associated identification carried by each task information, wherein the associated task information set comprises each task information with an association relation;
determining task priority of each task information in each associated task information set according to state information represented by an associated identifier carried by each task information, wherein if the state information is represented as a dependent state, the task priority of the task information is determined to be lower than that of target task information, and if the state information of the associated identifier is represented as a dependent state, the task priority of the task information is determined to be higher than that of the target task information;
and for each associated task information set, forming task streams by all task information in the associated task information set according to the task priority.
2. The method according to claim 1, wherein the verifying each piece of task information according to a preset configuration rule comprises:
analyzing the configuration rule to determine a check field of each task information;
judging whether a legal value exists in the check field of each task information;
if the check field of each task information has a legal value, determining that the task information passes the verification;
otherwise, the task information is not verified.
3. The method according to claim 1, wherein generating a configuration file corresponding to the task flow according to each piece of task information included in the task flow comprises:
acquiring an identity identifier and a change identifier contained in each task information in the task flow;
determining a change type corresponding to each change identifier;
determining a code module corresponding to each task information based on the identity and the change type;
compiling each code module to generate a sub-configuration file of each task information;
and forming the sub configuration files into configuration files according to the task priority.
4. The method of claim 1, wherein said calling each of said configuration files in accordance with said calling order to perform task operations corresponding to said task schedule comprises:
for each task flow, obtaining change time contained in each task information in the task flow, and determining the change time closest to the current time as target change time in each change time;
sequencing the target change time of each task flow to determine the calling sequence of each task flow;
and calling each configuration file based on the calling sequence, wherein in the process of calling each configuration file, a database corresponding to the currently called configuration file is determined, and data in the database is configured based on the configuration files.
5. A task scheduling apparatus, comprising:
the receiving unit is used for acquiring each task information contained in the task scheduling table when the task scheduling table configured by a user is received; the task scheduling table comprises a plurality of task information; each task information at least comprises an identity mark, a change time, a change mark and an associated mark of the task;
the verification unit is used for verifying the integrity of each task information according to a preset configuration rule;
the execution unit is used for forming at least one task flow by each piece of task information according to the associated identification carried by each piece of task information when the task information passes the verification; the association identifier is an identity identifier of target task information which has an association relation with the task information;
the generating unit is used for generating a configuration file corresponding to each task flow according to each task information contained in the task flow;
the calling unit is used for determining the calling sequence of each configuration file and calling each configuration file according to the calling sequence so as to execute the task operation corresponding to the task scheduling table;
the execution unit includes:
the first determining subunit is configured to determine each associated task information set according to an associated identifier carried by each piece of task information, where the associated task information set includes each piece of task information having an association relationship;
the second determining subunit is configured to determine, according to state information represented by the association identifier carried by each piece of task information, a task priority of each piece of task information in each association task information set, where if the state information is represented as a dependent state, it is determined that the task priority of the piece of task information is lower than target task information, and if the state information of the association identifier is a dependent state, it is determined that the task priority of the piece of task information is higher than the target task information;
and the first execution subunit is used for forming a task stream by the task information in the associated task information set according to the task priority for each associated task information set.
6. The task scheduler of claim 5, wherein the validation unit comprises:
the analysis subunit is used for analyzing the configuration rule to determine the check field of each piece of task information;
the judging subunit is used for judging whether a legal value exists in the check field of each task information;
and the verification subunit is used for determining that the task information is verified to be passed when the verification field of each task information has a legal value, and otherwise, determining that the task information is not verified to be passed.
7. The task scheduler according to claim 5, wherein the generation unit includes:
the first acquiring subunit is configured to acquire an identity identifier and a change identifier included in each piece of task information in the task stream;
a third determining subunit, configured to determine a change type corresponding to each change identifier;
a fourth determining subunit, configured to determine, according to the identity and the change type, a code module corresponding to each piece of task information;
the compiling subunit is used for compiling each code module to generate a sub-configuration file of each task information;
and the second execution subunit is used for forming the configuration files by the sub configuration files according to the task priority.
8. The task scheduler according to claim 5, wherein the call unit includes:
a second acquiring unit configured to acquire, for each of the task flows, change times included in the task information in the task flow, and determine, as a target change time, a change time that is closest to a current time among the change times;
a fifth determining subunit, configured to sort the target change time of each task flow, so as to determine a call order of each task flow;
and the calling subunit is used for calling each configuration file according to the calling sequence, wherein in the process of calling each configuration file, a database corresponding to the currently called configuration file is determined, and data in the database is configured based on the configuration files.
CN201910889072.9A 2019-09-19 2019-09-19 Task scheduling method and device Active CN110597611B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910889072.9A CN110597611B (en) 2019-09-19 2019-09-19 Task scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910889072.9A CN110597611B (en) 2019-09-19 2019-09-19 Task scheduling method and device

Publications (2)

Publication Number Publication Date
CN110597611A CN110597611A (en) 2019-12-20
CN110597611B true CN110597611B (en) 2022-08-19

Family

ID=68861483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910889072.9A Active CN110597611B (en) 2019-09-19 2019-09-19 Task scheduling method and device

Country Status (1)

Country Link
CN (1) CN110597611B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111291051B (en) * 2020-01-22 2023-06-16 中国民航信息网络股份有限公司 Freight rate data processing method and device, storage medium and electronic equipment
CN111273962B (en) * 2020-02-14 2022-02-18 腾讯科技(深圳)有限公司 Configuration management method, device, computer readable storage medium and computer equipment
CN112579275A (en) * 2020-12-23 2021-03-30 苏州三六零智能安全科技有限公司 Task execution method, device, equipment and storage medium
CN112965793B (en) * 2021-01-21 2023-11-21 中国互联网络信息中心 Identification analysis data-oriented data warehouse task scheduling method and system
CN116680063B (en) * 2023-08-03 2023-11-03 苏州浪潮智能科技有限公司 Task scheduling method, device, computing system, electronic equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008225769A (en) * 2007-03-12 2008-09-25 Ricoh Co Ltd Workflow management system
CN101478431A (en) * 2009-02-10 2009-07-08 浪潮通信信息***有限公司 Task scheduling system for management by visible process
CN102867219B (en) * 2012-09-27 2016-04-06 乐华建科技(北京)有限公司 A kind of business automatic arrangement program system and method
CN103034554B (en) * 2012-12-30 2015-11-18 焦点科技股份有限公司 The ETL dispatching system that a kind of error correction is restarted and automatic decision starts and method
CN104679482A (en) * 2013-11-27 2015-06-03 北京拓尔思信息技术股份有限公司 OSGI (Open Service Gateway Initiative)-based ETL (Extraction-Transformation-Loading) processing device and method
CN105630581A (en) * 2014-11-07 2016-06-01 南京南瑞继保电气有限公司 Task processing method and device, and computer storage medium
CN106933857B (en) * 2015-12-30 2020-12-29 创新先进技术有限公司 Method and device for scheduling tasks in data warehouse
CN108845798A (en) * 2018-05-30 2018-11-20 安徽四创电子股份有限公司 A kind of visualization big data task cradle and processing method
CN109636301A (en) * 2018-10-16 2019-04-16 深圳壹账通智能科技有限公司 Workflow configuration method, system, terminal and the readable storage medium storing program for executing of financial business
CN110187958B (en) * 2019-06-04 2020-05-05 上海燧原智能科技有限公司 Task processing method, device, system, equipment and storage medium

Also Published As

Publication number Publication date
CN110597611A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN110597611B (en) Task scheduling method and device
CN109033772B (en) Verification information input method and device
CN106815031B (en) Kernel module loading method and device
CN108459964B (en) Test case selection method, device, equipment and computer readable storage medium
WO2021114672A1 (en) Method, apparatus and device for generating bare metal server linux system mirror
CN110825634A (en) Parameter quality checking method, device and equipment and computer readable storage medium
CN110955409B (en) Method and device for creating resources on cloud platform
CN106055375B (en) Application program installation method and device
CN111367531B (en) Code processing method and device
CN108089887B (en) Starting control method and device for newly added page
CN111831300A (en) APP updating method and device, electronic equipment and computer readable storage medium
CN106708897B (en) Data warehouse quality guarantee method, device and system
CN111935107B (en) Identity authentication method, device, system, electronic equipment and storage medium
CN111538530A (en) Page jump method and system, storage medium and electronic equipment
CN109298928B (en) Service processing method and device
CN114661826A (en) Data processing method, device and equipment based on block chain
CN110955464A (en) Service processing method and device, computer equipment and storage medium
CN110780983A (en) Task exception handling method and device, computer equipment and storage medium
CN117556809B (en) Parameter verification result generation method and device, verification platform and storage medium
CN112235255B (en) Voice data processing method and device and server
CN111984427B (en) Non-intrusive Web system mutual exclusion lock implementation method
CN111475289B (en) Load balancing method and device
CN111580834B (en) Method and device for generating application installation package
CN114327602B (en) Information processing method, device, electronic equipment and storage medium
CN115361446A (en) Transaction message processing method and device, storage medium and electronic equipment

Legal Events

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