CN118229423A - Task scheduling method and device - Google Patents

Task scheduling method and device Download PDF

Info

Publication number
CN118229423A
CN118229423A CN202410638110.4A CN202410638110A CN118229423A CN 118229423 A CN118229423 A CN 118229423A CN 202410638110 A CN202410638110 A CN 202410638110A CN 118229423 A CN118229423 A CN 118229423A
Authority
CN
China
Prior art keywords
date
transaction
card
day
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410638110.4A
Other languages
Chinese (zh)
Other versions
CN118229423B (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.)
China Securities Co Ltd
Original Assignee
China Securities 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 China Securities Co Ltd filed Critical China Securities Co Ltd
Priority to CN202410638110.4A priority Critical patent/CN118229423B/en
Publication of CN118229423A publication Critical patent/CN118229423A/en
Application granted granted Critical
Publication of CN118229423B publication Critical patent/CN118229423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a task scheduling method and device, and relates to the technical field of data processing, wherein the method comprises the following steps: maintaining a timer object bound to a task to be scheduled and a card object with a card value; obtaining a target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment; generating a first execution instance of the task to be scheduled marked with the target board value; and dispatching the first execution instance to obtain transaction data generated at the target card value, and carrying out data processing on the obtained data. By applying the task scheduling scheme provided by the embodiment of the invention, the flexibility of task scheduling can be improved.

Description

Task scheduling method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a task scheduling method and apparatus.
Background
In the financial industry, financial platforms may provide a variety of financial services to users who may generate transaction data when transacting through the financial services. In order to maintain the normal operation of the financial platform, the data processing task needs to be scheduled to carry out data treatment on the generated transaction data after the transaction is completed, for example, the scheduling data collecting task collects the transaction data, the scheduling data statistics task statistics transaction data quantity and the like.
The existing task scheduling scheme is to schedule data processing tasks to process transaction data which is generated when the transaction is completed on the same day. However, due to the variety of financial services, the date the transaction was completed and the date the transaction data was generated may not be the same day on which the data processing task was scheduled. For example, in some financial services, the date of transaction completion is not the same as the date of transaction data generation, which results in the need to schedule data processing tasks to process transaction data generated on other days before the date of transaction completion after transaction completion.
Disclosure of Invention
The embodiment of the invention aims to provide a task scheduling method and device so as to improve the flexibility of task scheduling. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a task scheduling method, where the method includes:
maintaining a timer object bound with a task to be scheduled and a card object with a card value, wherein the timer object is used for monitoring whether the system time reaches the task scheduling time, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to the creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
Obtaining a target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment;
Generating a first execution instance of the task to be scheduled marked with the target board value;
and dispatching the first execution instance to obtain transaction data generated at the target card value, and carrying out data processing on the obtained data.
In one embodiment of the present invention, the scheduling the first execution instance to obtain transaction data generated at the target card value and perform data processing on the obtained data includes:
Determining a first execution instance of a plurality of tasks to be scheduled with the same corresponding target label value as a second execution instance with a dependency relationship;
Determining the execution sequence of each second execution instance;
And sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
In one embodiment of the present invention, the timer object is created according to the transaction day calendar, and the timer object is specifically configured to monitor whether the system date belongs to the transaction day and whether the system time reaches the task scheduling time;
the obtaining the target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment comprises the following steps:
And after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling moment, obtaining the target card value of the card object.
In one embodiment of the present invention, the obtaining the target card value of the card object after the timer object monitors that the system date belongs to a transaction day and the system time reaches the task scheduling time includes:
If the timer object monitors that the system complete time is in a time range determined according to any transaction day and the system time reaches the task scheduling time, a target card value of the card object is obtained, wherein the system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day cut time of the transaction day to the preset day cut time of the second day.
In one embodiment of the invention, the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
In one embodiment of the invention, the method further comprises:
acquiring date description information input by a user;
Determining a first date described by the date description information in the transaction date calendar;
the scheduling the first execution instance to obtain transaction data generated at the target card value and perform data processing on the obtained data comprises the following steps:
and scheduling the first execution instance to obtain the transaction data generated at the target card value and the transaction data generated at the first date, and carrying out data processing on the obtained data.
In one embodiment of the present invention, the date description information includes a reference date, a date format, a unit offset, and a day offset;
The determining, in the transaction day calendar, a first date described by the date description information includes:
If the date format is a week format, determining a reference week number of the week where the reference date is located in the transaction date calendar; shifting the reference number of weeks according to the unit offset to obtain a shifted number of weeks, and determining a daily offset number of weeks of a second shifted number of weeks as the first date;
If the date format is a month format, determining a reference month of the month in which the reference date is located in the transaction date calendar; shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of a first shifted month as the first date;
If the date format is a quaternary format, determining a reference quarter of the quarter where the reference date is located in the transaction date calendar; and shifting the reference quarter according to the unit offset to obtain a shifted quarter, and determining a daily offset date of a third quarter of the shifted quarter as the first date.
In one embodiment of the invention, the method further comprises:
obtaining a supplementary scheduling time range input by a user;
Determining a second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range based on the task scheduling record;
obtaining a historical card value of the card object when a system date is the second date;
generating a third execution instance of the task to be scheduled marked with the second date;
And scheduling the third execution instance to obtain the transaction data generated on the second date, and carrying out data processing on the obtained data.
In a second aspect, an embodiment of the present invention provides a task scheduling device, where the device includes:
The system comprises an object maintenance module, a card object management module and a card management module, wherein the object maintenance module is used for maintaining a timer object bound with a task to be scheduled and a card object with a card value, the timer object is used for monitoring whether the system time reaches the task scheduling moment, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to the creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
the target value obtaining module is used for obtaining the target value of the card object after the timer object monitors that the system time reaches the task scheduling moment;
a first instance generating module, configured to generate a first execution instance of the task to be scheduled marked with the target board value;
and the first instance scheduling module is used for scheduling the first execution instance to obtain the transaction data generated at the target card value and processing the obtained data.
In one embodiment of the present invention, the example scheduling module is specifically configured to:
Determining a first execution instance of a plurality of tasks to be scheduled with the same corresponding target label value as a second execution instance with a dependency relationship;
Determining the execution sequence of each second execution instance;
And sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
In one embodiment of the present invention, the timer object is created according to the transaction day calendar, and the timer object is specifically configured to monitor whether the system date belongs to the transaction day and whether the system time reaches the task scheduling time;
The card value obtaining module comprises:
And the card value obtaining sub-module is used for obtaining the target card value of the card object after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling moment.
In one embodiment of the present invention, the card value obtaining submodule is specifically configured to:
If the timer object monitors that the system complete time is in a time range determined according to any transaction day and the system time reaches the task scheduling time, a target card value of the card object is obtained, wherein the system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day cut time of the transaction day to the preset day cut time of the second day.
In one embodiment of the invention, the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
In one embodiment of the invention, the apparatus further comprises:
The information acquisition module is used for acquiring date description information input by a user;
A first date determining module, configured to determine a first date described by the date description information in the transaction date calendar;
the example scheduling module is specifically configured to:
and scheduling the first execution instance to obtain the transaction data generated at the target card value and the transaction data generated at the first date, and carrying out data processing on the obtained data.
In one embodiment of the present invention, the date description information includes a reference date, a date format, a unit offset, and a day offset;
the date determining module is specifically configured to:
If the date format is a week format, determining a reference week number of the week where the reference date is located in the transaction date calendar; shifting the reference number of weeks according to the unit offset to obtain a shifted number of weeks, and determining a daily offset number of weeks of a second shifted number of weeks as the first date;
If the date format is a month format, determining a reference month of the month in which the reference date is located in the transaction date calendar; shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of a first shifted month as the first date;
If the date format is a quaternary format, determining a reference quarter of the quarter where the reference date is located in the transaction date calendar; and shifting the reference quarter according to the unit offset to obtain a shifted quarter, and determining a daily offset date of a third quarter of the shifted quarter as the first date.
In one embodiment of the invention, the apparatus further comprises:
the range obtaining module is used for obtaining the supplementary scheduling time range input by the user;
The second date determining module is used for determining a second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range based on the task scheduling record;
a historical card value obtaining module, configured to obtain a historical card value of the card object when the system date is the second date;
a second instance generating module, configured to generate a third execution instance of the task to be scheduled marked with the second date;
And the second instance scheduling module is used for scheduling the third execution instance to obtain the transaction data generated on the second date and processing the obtained data.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
A memory for storing a computer program;
a processor configured to implement the method according to any one of the first aspect when executing a program stored in the memory.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having a computer program stored therein, which when executed by a processor implements the method of any of the first aspects.
The embodiment of the invention has the beneficial effects that:
From the above, when the scheme provided by the embodiment of the invention is applied to task scheduling, the initial value of the card object is determined according to the creation date and the transaction date difference value of the card object, and the card object can adjust the card value according to the card turning period, namely, the card value can be adjusted once every time a card turning period is passed, so that the transaction date difference value can be always ensured between the card value and the current date, and the transaction date difference value is determined according to the task to be scheduled, and the difference value of the transaction date between the transaction completion date of the task to be scheduled and the transaction data generation date can be understood, so that after the timer object monitors that the system time reaches the task scheduling time, the target card value of the card object is obtained, and the transaction data generated by the target card value, namely, the transaction data to be processed by the task to be scheduled before the system date, can be accurately and flexibly set according to the task to be scheduled, so that the first instance of the task to be scheduled can obtain the transaction data to be processed, thereby improving the flexibility of the task to be scheduled, and being applicable to the financial task to be scheduled.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1a is a schematic diagram of a transaction calendar according to an embodiment of the present invention;
FIG. 1b is a schematic diagram of a card object switching card value process according to an embodiment of the present invention;
fig. 2 is a flow chart of a first task scheduling method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a second task scheduling method according to an embodiment of the present invention;
fig. 4 is a flow chart of a third task scheduling method according to an embodiment of the present invention;
fig. 5 is a flow chart of a fourth task scheduling method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of relationships between various objects in a task scheduling process according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a task scheduling method according to an embodiment of the present invention;
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by the person skilled in the art based on the present invention are included in the scope of protection of the present invention.
First, some concepts mentioned in the embodiments of the present invention will be explained.
1. Trade date
In the financial industry, a trade can be performed only during the trade market, and thus, the trade market date is the trade date.
2. Transaction day calendar
The trade date is marked in the trade calendar, and whether each date belongs to the trade date can be determined by detecting whether each date in the trade calendar has a mark.
Fig. 1a shows a calendar of transaction days of month 10 of 2023, in fig. 1a, no. 9-13, no. 16-20, no. 23-27, no. 30 and No. 31 are transaction days, and other days are non-transaction days.
3. Timer object
The timer object is a process created by the financial platform and is used for monitoring whether the system time reaches the task scheduling moment.
The system time is the actual time recorded by the system of the financial platform.
The task scheduling time is a preset time.
In one embodiment of the invention, when the timer object is created, a Cron expression can be configured for the timer object, and a time element in the expression is set, so that the task configuration time is set.
4. Card object
The card object is a process created by the financial platform according to the transaction day calendar.
The card object has attribute information of a card value, the card object is configured to adjust the card value according to a card turning period, the specific attribute value of the card value is a transaction date, and when the system time reaches one card turning period, the card value is adjusted from one transaction date to another transaction date.
The card turning period may be a preset time period, and the amplitude of the card value adjustment may also be a preset amplitude.
The initial value of the card value is determined according to the creation date of the card object and the transaction date difference value, and the transaction date difference value is determined according to the task to be scheduled.
The transaction daily difference value is actually the number of days of the transaction day that is the difference between the date of generation of the transaction data to be processed by the task to be scheduled and the date of completion of the transaction in which the transaction data is located.
For example, in the transaction date calendar shown in fig. 1a, if the date of generation of transaction data is 10 months 10 and the date of completion of transaction is 10 months 10, the number of days of transaction date between these two dates is 0 days.
If the date of generation of the transaction data is 10 months 9 and the date of completion of the transaction is 10 months 11, the number of days of transaction between the two dates is 2 days.
If the date of generation of the transaction data is 10 months 13, the date of completion of the transaction is 10 months 18, the number of days of transaction between the two dates is 3 days.
Because financial services have diversity, transaction daily difference values corresponding to different tasks to be scheduled can be different, and the transaction daily difference values need to be determined according to transaction items where data processed by the tasks to be scheduled are located.
For example, in the case of an fund purchase request item, the date of transaction data generation is the date on which the purchase request was submitted, and the exchange checks whether the purchase request passes or not on two transaction days, and the pass of the purchase request indicates that the purchase transaction is completed, that is, if the purchase request passes, the date of the completion of the purchase transaction is the last two transaction days of the date on which the purchase request was submitted.
In the creation process of the card object, according to the corresponding relation between the preset transaction item and the transaction date difference, the transaction date difference corresponding to the transaction item where the data processed by the task to be scheduled bound by the card object are located is determined, and the creation date of the card object is subtracted by the determined transaction date difference to obtain the date after subtracting the difference as the initial value of the card value.
In one embodiment of the present invention, the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
The preset time is any time preset.
In this case, since not every natural day is a trade day, when a natural day belonging to a non-trade day is reached, the card object does not switch the card value, and the card value belongs to a trade day, and when the card value is switched, it is also switched from one trade day to the next trade day, and not to the next natural day of the current day.
In the transaction day calendar shown in fig. 1a, if the creation date of the card object is 10 months 12 days, the initial value of the card value is 10 months 11 days, the preset time is 16 points, the card value starts on 10 months 13 days, and when the card value reaches 16 points of the next transaction day, that is, 16 points of 10 months 16 days, the card value is switched from 10 months 12 days to 10 months 13 days; when 16 points of 10 months 14 days are reached, since the 10 months 14 days are not transaction days, the card objects do not switch the card value, and the card value is still 10 months 12 days; when 16 points of the trade day of 10 months and 17 days are reached, the card value is switched from 10 months and 13 days to the next trade day, namely to 10 months and 16 days, instead of 10 months and 14 days or 10 months and 15 days.
In the scheme, the card object is configured to switch the card value to the next transaction day of the current value every time a preset time of one transaction day is reached from the creation date, so that the day number of the transaction day, which is different between the target value obtained by the financial platform and the current date, is always the transaction day difference value after the preset time of each transaction day, and therefore, when the first execution instance is scheduled, the first execution instance can accurately obtain the transaction data to be processed, and the obtained data is processed, so that the accuracy of data processing and task scheduling can be improved.
In addition to the configurations provided in the foregoing embodiments, the card object may be configured according to other card flipping periods and card value adjustment ranges, for example, the card flipping periods may be one or two transaction days each, the card value adjustment ranges may be two or three transaction days, and the like, which is not limited by the embodiments of the present invention.
For example, fig. 1b shows a schematic diagram of a card object switching card value, in fig. 1b, when a turn-over period is reached, the card object switches from the object shown on the left side to the object shown on the right side.
In the card object shown on the left side, the name of the card object is a card of A-strand transaction date T-1, which indicates that the transaction date difference value configured in the card object is 1 transaction date, and the calendar used by the card object creation is an A-strand transaction date calendar, and the card offset is turned over. The card value is adjusted to be 1 day, the card value is 2023, 9 and 29 days, and the card turning period is 16 points of each A-strand trade day.
When the system time reaches 16 days, 10/9/2023, the card object adjusts the card value. As can be seen from the card objects shown on the right, the card values in the card objects shown on the right are adjusted to 2023, 10, 9 days, as compared to the card objects shown on the left.
Next, a task scheduling method and apparatus provided by the embodiment of the present invention are described in detail.
Referring to fig. 2, fig. 2 is a flow chart of a first task scheduling method according to an embodiment of the present invention, and in this embodiment, the method includes the following steps S201 to S204.
Step S201: a timer object to which the task to be scheduled is bound is maintained, and a card object having a card value.
The task to be scheduled may be a task for performing various processes on transaction data, such as a data collection task, a data statistics task, a data analysis task, and the like.
The process of creating the timer object and the card object for the financial platform, maintaining the timer object and the card object, can be understood as maintaining the two processes of creating the timer object and the card object to run, that is, the timer object always keeps monitoring whether the system time reaches the task scheduling moment along with the continuous transition of the system time, and the card value of the card object is adjusted once every time the system time reaches a card turning period.
Step S202: and obtaining the target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment.
Specifically, when the system time reaches the task scheduling time, for example, when the task scheduling time is 16, and when the system time also reaches 16, the timer object may monitor the event and notify the financial platform that the task scheduling time has been reached, so that the financial platform obtains the target card value of the card object at the task scheduling time.
Step S203: a first execution instance of the task to be scheduled marked with a target card value is generated.
Specifically, task information of a task to be scheduled may be recorded in the financial platform, and after the target value is obtained, a task execution process for executing the task to be scheduled may be created as the first execution instance according to the task information of the task to be scheduled and the target value.
Step S204: and scheduling the first execution instance to obtain the transaction data generated at the target card value, and performing data processing on the obtained data.
Specifically, in the process of carrying out a transaction by a financial platform, the financial platform can correspondingly store transaction data generated by the transaction and transaction data generation date, namely, the financial platform stores the transaction data and also stores the transaction data generation date, and the stored transaction data corresponds to the stored transaction data generation date. When the financial platform generates the first execution instance, the first execution instance can be scheduled or run, so that the first execution instance obtains transaction data corresponding to the date from a database of the financial platform according to the date of the destination label value, and performs data processing on the obtained data.
For example, the database of the financial platform stores transaction data M1 generated on the transaction date D1 and transaction data M2 generated on the transaction date D2, and if the task to be scheduled is a data analysis task and the target value is the transaction date D1, the first execution instance is scheduled, and the first execution instance obtains the transaction data M1 and performs data analysis on the transaction data M1.
From the above, when the scheme provided by the embodiment of the invention is applied to task scheduling, the initial value of the card object is determined according to the creation date and the transaction date difference value of the card object, and the card object can adjust the card value according to the card turning period, namely, the card value can be adjusted once every time a card turning period is passed, so that the transaction date difference value can be always ensured between the card value and the current date, and the transaction date difference value is determined according to the task to be scheduled, and the difference value of the transaction date between the transaction completion date of the task to be scheduled and the transaction data generation date can be understood, so that after the timer object monitors that the system time reaches the task scheduling time, the target card value of the card object is obtained, and the transaction data generated by the target card value, namely, the transaction data to be processed by the task to be scheduled before the system date, can be accurately and flexibly set according to the task to be scheduled, so that the first instance of the task to be scheduled can obtain the transaction data to be processed, thereby improving the flexibility of the task to be scheduled, and being applicable to the financial task to be scheduled.
In the supervision reporting scenario, the supervision department may require the financial platform to report some data, where the data may be obtained after the financial platform is scheduled to perform data processing, and the supervision department may require that the date of reporting the data by the financial platform is usually not fixed. In the task scheduling scheme provided by the embodiment of the invention, the task scheduling time is configurable, so that the task scheduling time can be set according to the time limit required by the supervision department, and the financial platform can be ensured to accurately and timely acquire the data expected by the supervision department and report the data to the supervision department.
The data processing tasks are generally multiple, and when the financial platform performs task scheduling, the financial platform needs to schedule the multiple data processing tasks.
In this case, the financial platform may maintain the timer object and the card object bound to each task to be scheduled, obtain the target card value of the card object bound to each task to be scheduled, and generate the first execution instance of each task to be scheduled.
In one embodiment of the present invention, when a first execution instance is scheduled to obtain transaction data generated at a target value and data processing is performed on the obtained data, it may be determined that the first execution instance of a plurality of tasks to be scheduled having the same corresponding target value is a second execution instance having a dependency relationship; determining the execution sequence of each second execution instance; and sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
Specifically, each first execution instance is marked with a target value corresponding to each task to be scheduled, and if the target values of the different first execution instance marks are the same, the different first execution instances can be determined to be second execution instances with a dependency relationship.
Because the financial platform needs to consider the upstream and downstream relations among various data processing tasks when creating various data processing tasks, the financial platform can preset the upstream and downstream relations among various data processing tasks, so that after determining the second execution examples with the dependency relations, the financial platform can determine the execution sequence among the tasks to be scheduled of each second execution example according to the upstream and downstream relations, the execution sequence of the second execution example is the same as the execution sequence of the tasks to be scheduled of the second execution example, the execution sequence among the tasks to be scheduled of each second execution example is determined, the execution sequence can be determined to be the execution sequence of the second execution example, and accordingly transaction data generated at corresponding target card values can be obtained by sequentially scheduling each second execution example according to the determined execution sequence, and data processing is performed on the obtained data.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, since the data processed by the execution instance with the dependency relationship is derived from the data generated on the same day in the task scheduling process, and the target card value of the execution instance mark is just the transaction data to be processed by the execution instance, and the transaction data generated on the same transaction day are processed by the execution instance with the same target card value, the second execution instance with the dependency relationship can be accurately determined according to the target card value of the first execution instance, and then the execution sequence of the second execution instance is determined, and each second execution instance is sequentially scheduled according to the execution sequence, so that the accuracy of task scheduling can be improved. And because the execution instance with the dependency relationship can be accurately determined by the corresponding card value of the execution instance of the scheme, no manual intervention is needed, the labor cost of task scheduling can be reduced, and the task scheduling efficiency is improved.
Since transaction data is generated every transaction day in the financial industry, as transaction data is generated, the financial platform also needs to continuously schedule tasks to process the transaction data.
In view of this, in one embodiment of the present invention, a timer object is created from the transaction day calendar, and the timer object is specifically used to monitor whether the system date belongs to the transaction day and whether the system time reaches the task scheduling time.
The system date is the actual date recorded by the system of the financial platform.
Because the transaction day calendar is marked with the transaction day, the timer object can determine which day in the calendar belongs to the transaction day according to the transaction day calendar, thereby monitoring whether the system date belongs to the transaction day or not, and also monitoring whether the system time reaches the task scheduling moment or not.
In this case, when the target value of the card object is obtained, the target value of the card object may be obtained after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling time.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, after the timer object monitors that the system date belongs to the transaction day and the system time reaches the task scheduling time, the target plate value of the plate object is obtained, and therefore, the task scheduling scheme provided by the embodiment of the invention actually triggers to obtain the target plate value at the task scheduling time of each transaction day and executes the operation of subsequent task scheduling, so that the periodic task scheduling can be realized, the data continuously generated in the financial platform can be processed, and the stable and normal operation of the financial platform can be ensured.
In obtaining a target card value of a card object, the target card value of the card object may be obtained in a manner mentioned in the following embodiments, in addition to the manner mentioned in the foregoing embodiments.
In one embodiment of the present invention, when the target card value of the card object is obtained, the target card value of the card object may be obtained after the timer object monitors that the system complete time is within a time range determined according to any transaction day and the system time reaches the task scheduling moment.
The system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day-cut time of the transaction day to a preset day-cut time of the second day.
The clock time is the time of the electronic clock of the financial platform, and the time is counted in units of time minutes and seconds. The system date is counted by the unit of year, month and day.
The system complete time includes a system date and a clock time, and thus, the system complete time is counted in units of year, month, day, minute, and second.
The time of day is the time of dividing the time line between two adjacent days.
The day cut time of the natural day is 24 points, namely, after the time passes the 24 points of the day, the date is the next day. For example, if the time is 4 months and 29 days today, the time is 24 days today, and the date is 4 months and 25 days later.
In this embodiment, the day cutting time is a preset time, for example, 8 points, 9 points, and so on.
The following describes the above-described time range determined by one transaction day, taking the transaction day of 4 months 29 days and the day cut time of 8 points as an example.
In this time range, the start date is the preset date cut time of the trade day, that is, the 4 month 29 day 8 point, and the end date is the preset date cut time of the second day, that is, the 4 month 30 day 8 point, so the time range from the 4 month 29 day 8 point to the 4 month 30 day 8 point is divided into trade days belonging to the 4 month 29 day. In this case, even if the system time is any time between 0 point on day 4 month 30 and 8 points on day 4 month 30, the financial platform still considers this time to be 4 month 29, and the system time is considered to be any time between 0 point on day 4 month 29 and 8 points on day 4 month 29.
In this case, if the task scheduling time is set to 7 on day 4 month 29, when the actual time reaches 7 on day 4 month 29, the financial platform considers that this time belongs to day 4 month 28 because the time is earlier than 8 on day cut time, and therefore, even though the system time has reached 7, the operation of obtaining the target value is not triggered, and only when the actual time reaches 7 on day 4 month 30, the financial platform considers that this time belongs to day 4 month 29, and thus the operation of obtaining the target value is triggered.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, the time window of the transaction day can be flexibly adjusted by presetting the day-cut time, so that the flexibility of task scheduling can be improved.
For example, if monday to friday in the week is a trading day, friday and sunday are non-trading days, by setting the day-to-day time, the task originally scheduled in the time period from the monday zero point to the day-to-day time can be changed into the time period from the friday zero point to the day-to-day time, the task originally scheduled in the time period from the friday zero point to the day-to-day time is changed into the time period from the friday zero point to the day-to-day time, and so on, until the task originally scheduled in the time period from the friday zero point to the day-to-day time is changed into the time period from the friday zero point to the day-to-day time, the financial platform can flexibly set the day-to-day time according to actual demands, so that the time window of the trading day can be adjusted, and the task can be flexibly scheduled according to actual demands.
There may be a plurality of date parameters related to the task to be scheduled, in which case, in addition to the target value, other date parameters required for the task to be scheduled need to be obtained.
In an embodiment of the present invention, referring to fig. 3, a flowchart of a second task scheduling method is provided, where the method further includes the following step S205, and the step S204 may be implemented by the following step S204A.
Step S205: and acquiring the date description information input by the user, and determining a first date described by the date description information in the transaction date calendar.
The date description information can be various, and the date description information can be different in date description information description modes, so that the financial platform can calculate the date according to the types of various date description information by adopting a corresponding date calculation mode.
For example, the date description information may include a first parameter, where the first parameter indicates a date of a transaction in a month of a year in which the user is currently located, and if the parameter value of the first parameter input by the user is 2, the financial platform may determine, according to the first parameter and a date of the transaction, that the first date is all dates belonging to the transaction date in 2 months of the year in which the user is currently located;
For another example, the date description information may include a second parameter and a third parameter, where the second parameter represents a trade day in a first month of the current month, the third parameter represents a trade day in a month, and if the user inputs a parameter value of 3 for the second parameter and a parameter value of 7 for the third parameter, the financial platform may determine the current month, for example, 4 months, and determine, according to the second parameter and the third parameter, a date on which the 7 th trade day in 1 month of the present year is located for the first date.
After determining the first date and obtaining the signage value, the scheduling of the first execution instance to obtain and process the transaction data may be performed by the following step S204A.
Step S204A: the first execution instance is scheduled to obtain transaction data generated at the target card value and transaction data generated at the first date, and the obtained data is subjected to data processing.
The implementation manner of scheduling the first execution instance to obtain the transaction data generated at the first date is the same as the implementation manner of scheduling the first execution instance to obtain the transaction data generated at the target card value, and is not described herein in detail.
After the first execution instance finishes obtaining the transaction data, the obtained data can be processed according to the data processing logic of the task to be scheduled.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, the first date described by the date description information input by the user is determined in the transaction date calendar, so that when the first execution example is scheduled, the first execution example can be scheduled to obtain not only the transaction data generated at the target card value, but also the transaction data generated at the first date, and therefore, when the task to be scheduled involves a plurality of date parameters, the first execution example can be accurately scheduled to obtain the transaction data, and the obtained data is subjected to data processing.
The above-described date description information may include various parameters, and may include other parameters for describing the date in addition to the first parameter, the second parameter, and the third parameter mentioned in the above-described embodiments.
In one embodiment of the present invention, the date description information includes a reference date, a date format, a unit offset, and a day offset.
The reference date is a date which is a basis for estimation when estimating the first date.
The date format may include a season, month, week.
The unit offset is a size that is offset based on a unit indicated by the date format.
The day offset is used to indicate the date of the transaction within a time range determined after the first date is offset by the unit offset.
In this case, when determining the date of the data described by the date description information, it is possible to identify which of the above-described date formats is, and determine the first date in a manner of determination corresponding to the identified date format.
The following describes a specific implementation manner of determining the first date when the date format is in three formats of week, month and season.
First case: date format Zhou Geshi
In this case, the reference number of weeks on which the reference date is located may be determined in the trade day calendar; the reference number of weeks is shifted according to the unit offset to obtain the number of shifted weeks, and the date offset of the number of weeks of the second offset is determined as the first date.
For example, if the reference date in the date description information input by the user is 2024, 1 month and 22 days, the date format is week format, the unit offset is 1, and the day offset is 2, the reference number of weeks at 2024, can be determined as 4, and the reference number of weeks can be offset according to the unit offset, that is, the reference number of weeks minus the unit offset, to obtain the offset number of weeks as 3, and thus the 2 nd transaction day of 3 weeks at 2024, that is, 1 month and 16 days, can be determined as the first date.
In the second case, the date format is a month format
In this case, the reference month of the month in which the reference date is located may be determined in the trade day calendar; and (3) shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of the shifted month as a first date.
In the third case, the date format is a quaternary format
In this case, the reference quarter of the quarter in which the reference date is located may be determined in the trade day calendar; and shifting the reference quarter according to the unit offset to obtain an offset quarter, and determining a date offset of the third quarter of the offset quarter as a first date.
The manner of calculating the first date in the second case and the third case is similar to that in the first case, and will not be described here.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, the date description information comprises the reference date, the date format, the unit offset and the daily offset, and according to these parameters, the first date can be accurately determined according to the manner of determining the date format, so that the first execution instance is scheduled to obtain and process the transaction data generated in the target card value and the first date, and the accuracy of task scheduling can be improved.
From the foregoing, as transaction data is continually generated, financial platforms need to continually schedule tasks to process the transaction data. In a multiple task scheduling process, the financial platform may be left unscheduled for tasks due to various factors.
In view of this, in an embodiment of the present invention, referring to fig. 4, a flow chart of a third task scheduling method is provided, and in this embodiment, the method further includes the following steps S206-S210.
Step S206: and obtaining the supplementary scheduling time range input by the user.
The supplemental schedule time range described above may be understood as a time range that the user believes includes a date when there was a task miss schedule.
For example, the user may input the last month, or the last year, time frame as the supplemental schedule time frame.
Step S207: and determining a second date of the missed scheduling task to be scheduled in the supplementary scheduling time range based on the task scheduling record.
Specifically, the financial platform may generate a task scheduling record in the task scheduling process, for example, the task scheduling record may be a log, a target value corresponding to an execution instance that the data processing task is scheduled, etc., and the financial platform may plan an expected scheduling time of the data processing task, for example, plan that the data processing task is scheduled on each transaction day, or schedule according to other preset expected scheduling time. Therefore, after the above-mentioned supplementary scheduling time range is obtained, the actual scheduled time of the task to be scheduled in the supplementary scheduling time range and the expected scheduling time in the supplementary scheduling time range recorded in the task scheduling record can be compared, so that the second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range can be obtained.
Step S208: a historical tile value for the tile object is obtained when the system date is the second date.
According to the foregoing embodiments, it is known that the card object adjusts the card value according to the card turning period, and the number of days of the transaction day that differ between the system time and the card value of the card object is always the transaction day difference value, so that, after the second date is determined, the date, which is the transaction day difference value before the second date and between the second date, can be determined in the transaction day calendar as the history card value.
For example, if the second date is 2023, 10, 19, and the trade date difference is 2 days, 2023, 10, 17, and 17 may be determined as the history card value.
Step S209: a third execution instance of the task to be scheduled is generated, marked with the second date.
Step S210: and scheduling a third execution instance to obtain transaction data generated on the second date, and performing data processing on the obtained data.
Steps S209 and S210 are similar to steps S203 and S204, respectively, and are not repeated here.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, the second date of the task to be scheduled which is not scheduled can be determined in the supplementary scheduling time range, and the task scheduling is carried out based on the second date supplement, so that the defect that the task is scheduled by a building is overcome, and therefore, the reliability and the integrity of the task scheduling can be improved by applying the task scheduling scheme provided by the embodiment of the invention.
In an embodiment of the present invention, referring to fig. 5, a flowchart of a fourth task scheduling method is provided, and in this embodiment, the method includes the following steps S501 to S506.
Step S501: a transaction day calendar marked with transaction days is obtained.
Step S502: creating a card object based on a trade day calendar, wherein the card object has a card value, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to a creation date of the card object and a trade day difference value, and the trade day difference value is determined according to a task to be scheduled.
Step S503: based on the transaction day calendar, a timer object is created, which is used to monitor whether the system time reaches the task scheduling instant.
Step S504: the task to be scheduled is respectively bound with the card object and the timer object, and when the timer object monitors that the system time reaches the task scheduling moment, the card value of the card object at the moment is obtained; and if the task to be scheduled needs to use other date parameters, configuring a calendar function for the task to be scheduled.
The calendar function is used for calculating the date described by the date description information according to the date description information input by the user.
Step S505: an execution instance of the task to be scheduled marked with the date parameter is generated.
Wherein the date parameter comprises the obtained card value and the date calculated by the calendar function.
Step S506: and in the multiple execution examples, determining that the execution examples with the same marked card value are the execution examples with the dependency relationship, determining the execution sequence of the execution examples with the dependency relationship according to the upstream-downstream relationship between the tasks to be scheduled corresponding to the execution examples, and scheduling each execution example to obtain and process transaction data generated by respective date parameters according to the determined execution sequence.
In one embodiment of the invention, referring to FIG. 6, the relationship between various objects in a task scheduling process is shown. In fig. 6, a transaction day calendar is used to create a timer object as well as a card object.
For the timer object, the timer object is used for monitoring whether the system time reaches 18 points of the transaction day of A strands, the day-cut time of the timer object is configured to be 0 point, and the timing expression is a Cron expression.
For the card object, the card object is a card of A-strand trading day T-1, the card turning offset is 1 day, the current card value is 2023, 9 and 29 days, and the card turning period is 16 points of A-strand trading day. The card object is bound with the task A so that the card object can provide card value information for the task A, and in addition, the task A is also provided with a calendar function, and the calendar function is used for calculating other date parameters required by the task A except the card value according to the reference date, the offset and the transaction calendar.
When the timer object monitors that the system time reaches 18 points of the transaction day, the timer object triggers an instruction for generating a task A instance at fixed time. The generated task a instance is marked with the card value 20230929 provided by the card object and other date parameters provided by the calendar function, such as the current month 202309. Thus, after the financial platform generates the task A instance, the task A instance can be scheduled. Likewise, the financial platform may schedule other instances of tasks, such as task B instances.
Since data processing tasks generally need to be periodically scheduled, each data processing task generates a task instance at a different task scheduling time, and different instances of the same data processing task have different corresponding tile values, for example, in fig. 6, task a has one instance with a marked tile value of 20230309, and task B has three instances with marked tile values of 20230928, 20230929, 20231009, respectively. Since the task a instance and the second task B instance have the same card value, the two instances also achieve a dependency, i.e., the two instances have a dependency relationship.
Corresponding to the task scheduling method, the embodiment of the invention also provides a task scheduling device.
In one embodiment of the present invention, referring to fig. 7, there is provided a schematic structural diagram of a task scheduling device, where in this embodiment, the device includes:
An object maintenance module 701, configured to maintain a timer object bound to a task to be scheduled and a card object having a card value, where the timer object is configured to monitor whether a system time reaches a task scheduling time, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to a creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
A target value obtaining module 702, configured to obtain a target value of the card object after the timer object monitors that the system time reaches the task scheduling time;
a first instance generating module 703, configured to generate a first execution instance of the task to be scheduled marked with the target board value;
And a first instance scheduling module 704, configured to schedule the first execution instance to obtain transaction data generated at the target card value, and perform data processing on the obtained data.
From the above, when the scheme provided by the embodiment of the invention is applied to task scheduling, the initial value of the card object is determined according to the creation date and the transaction date difference value of the card object, and the card object can adjust the card value according to the card turning period, namely, the card value can be adjusted once every time a card turning period is passed, so that the transaction date difference value can be always ensured between the card value and the current date, and the transaction date difference value is determined according to the task to be scheduled, and the difference value of the transaction date between the transaction completion date of the task to be scheduled and the transaction data generation date can be understood, so that after the timer object monitors that the system time reaches the task scheduling time, the target card value of the card object is obtained, and the transaction data generated by the target card value, namely, the transaction data to be processed by the task to be scheduled before the system date, can be accurately and flexibly set according to the task to be scheduled, so that the first instance of the task to be scheduled can obtain the transaction data to be processed, thereby improving the flexibility of the task to be scheduled, and being applicable to the financial task to be scheduled.
In the supervision reporting scenario, the supervision department may require the financial platform to report some data, where the data may be obtained after the financial platform is scheduled to perform data processing, and the supervision department may require that the date of reporting the data by the financial platform is usually not fixed. In the task scheduling scheme provided by the embodiment of the invention, the task scheduling time is configurable, so that the task scheduling time can be set according to the time limit required by the supervision department, and the financial platform can be ensured to accurately and timely acquire the data expected by the supervision department and report the data to the supervision department.
In one embodiment of the present invention, the first instance scheduling module 704 is specifically configured to:
Determining a first execution instance of a plurality of tasks to be scheduled with the same corresponding target label value as a second execution instance with a dependency relationship;
Determining the execution sequence of each second execution instance;
And sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, since the data processed by the execution instance with the dependency relationship is derived from the data generated on the same day in the task scheduling process, and the target card value of the execution instance mark is just the transaction data to be processed by the execution instance, and the transaction data generated on the same transaction day are processed by the execution instance with the same target card value, the second execution instance with the dependency relationship can be accurately determined according to the target card value of the first execution instance, and then the execution sequence of the second execution instance is determined, and each second execution instance is sequentially scheduled according to the execution sequence, so that the accuracy of task scheduling can be improved. And because the execution instance with the dependency relationship can be accurately determined by the corresponding card value of the execution instance of the scheme, no manual intervention is needed, the labor cost of task scheduling can be reduced, and the task scheduling efficiency is improved.
In one embodiment of the present invention, the timer object is created according to the transaction day calendar, and the timer object is specifically configured to monitor whether the system date belongs to the transaction day and whether the system time reaches the task scheduling time;
the signage value obtaining module 702 includes:
And the card value obtaining sub-module is used for obtaining the target card value of the card object after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling moment.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, after the timer object monitors that the system date belongs to the transaction day and the system time reaches the task scheduling time, the target plate value of the plate object is obtained, and therefore, the task scheduling scheme provided by the embodiment of the invention actually triggers to obtain the target plate value at the task scheduling time of each transaction day and executes the operation of subsequent task scheduling, so that the periodic task scheduling can be realized, the data continuously generated in the financial platform can be processed, and the stable and normal operation of the financial platform can be ensured.
In one embodiment of the present invention, the card value obtaining submodule is specifically configured to:
If the timer object monitors that the system complete time is in a time range determined according to any transaction day and the system time reaches the task scheduling time, a target card value of the card object is obtained, wherein the system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day cut time of the transaction day to the preset day cut time of the second day.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, the time window of the transaction day can be flexibly adjusted by presetting the day-cut time, so that the flexibility of task scheduling can be improved.
In one embodiment of the invention, the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
In the scheme, the card object is configured to switch the card value to the next transaction day of the current value every time a preset time of one transaction day is reached from the creation date, so that the day number of the transaction day, which is different between the target value obtained by the financial platform and the current date, is always the transaction day difference value after the preset time of each transaction day, and therefore, when the first execution instance is scheduled, the first execution instance can accurately obtain the transaction data to be processed, and the obtained data is processed, so that the accuracy of data processing and task scheduling can be improved.
In one embodiment of the invention, the apparatus further comprises:
The information acquisition module is used for acquiring date description information input by a user;
A first date determining module, configured to determine a first date described by the date description information in the transaction date calendar;
the first instance scheduling module 704 is specifically configured to:
and scheduling the first execution instance to obtain the transaction data generated at the target card value and the transaction data generated at the first date, and carrying out data processing on the obtained data.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, the first date described by the date description information input by the user is determined in the transaction date calendar, so that when the first execution example is scheduled, the first execution example can be scheduled to obtain not only the transaction data generated at the target card value, but also the transaction data generated at the first date, and therefore, when the task to be scheduled involves a plurality of date parameters, the first execution example can be accurately scheduled to obtain the transaction data, and the obtained data is subjected to data processing.
In one embodiment of the present invention, the date description information includes a reference date, a date format, a unit offset, and a day offset;
the first date determining module is specifically configured to:
If the date format is a week format, determining a reference week number of the week where the reference date is located in the transaction date calendar; shifting the reference number of weeks according to the unit offset to obtain a shifted number of weeks, and determining a daily offset number of weeks of a second shifted number of weeks as the first date;
If the date format is a month format, determining a reference month of the month in which the reference date is located in the transaction date calendar; shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of a first shifted month as the first date;
If the date format is a quaternary format, determining a reference quarter of the quarter where the reference date is located in the transaction date calendar; and shifting the reference quarter according to the unit offset to obtain a shifted quarter, and determining a daily offset date of a third quarter of the shifted quarter as the first date.
From the above, when the task is scheduled by applying the scheme provided by the embodiment of the invention, the date description information comprises the reference date, the date format, the unit offset and the daily offset, and according to these parameters, the first date can be accurately determined according to the manner of determining the date format, so that the first execution instance is scheduled to obtain and process the transaction data generated in the target card value and the first date, and the accuracy of task scheduling can be improved.
In one embodiment of the invention, the apparatus further comprises:
the range obtaining module is used for obtaining the supplementary scheduling time range input by the user;
The second date determining module is used for determining a second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range based on the task scheduling record;
a historical card value obtaining module, configured to obtain a historical card value of the card object when the system date is the second date;
a second instance generating module, configured to generate a third execution instance of the task to be scheduled marked with the second date;
And the second instance scheduling module is used for scheduling the third execution instance to obtain the transaction data generated on the second date and processing the obtained data.
From the above, when the task scheduling scheme provided by the embodiment of the invention is applied, the second date of the task to be scheduled which is not scheduled can be determined in the supplementary scheduling time range, and the task scheduling is carried out based on the second date supplement, so that the defect that the task is scheduled by a building is overcome, and therefore, the reliability and the integrity of the task scheduling can be improved by applying the task scheduling scheme provided by the embodiment of the invention.
The embodiment of the invention also provides an electronic device, as shown in fig. 8, which comprises a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 complete communication with each other through the communication bus 804.
A memory 803 for storing a computer program;
The processor 801, when executing the program stored in the memory 803, implements the following steps:
maintaining a timer object bound with a task to be scheduled and a card object with a card value, wherein the timer object is used for monitoring whether the system time reaches the task scheduling time, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to the creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
Obtaining a target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment;
Generating a first execution instance of the task to be scheduled marked with the target board value;
and dispatching the first execution instance to obtain transaction data generated at the target card value, and carrying out data processing on the obtained data.
The above-mentioned specific description of the processor 801 executing the program stored in the memory 803 to implement other task scheduling schemes provided by the embodiments of the present invention can be referred to the above-mentioned method embodiments, and will not be repeated here.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the task scheduling methods described above.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the task scheduling methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, system, electronic device, computer readable storage medium, computer program product embodiment, the description is relatively simple as it is substantially similar to the method embodiment, and relevant places are referred to in the partial description of the method embodiment.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (18)

1. A method of task scheduling, the method comprising:
maintaining a timer object bound with a task to be scheduled and a card object with a card value, wherein the timer object is used for monitoring whether the system time reaches the task scheduling time, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to the creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
Obtaining a target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment;
Generating a first execution instance of the task to be scheduled marked with the target board value;
and dispatching the first execution instance to obtain transaction data generated at the target card value, and carrying out data processing on the obtained data.
2. The method of claim 1, wherein the scheduling the first execution instance to obtain transaction data generated at the target tile value and to process the obtained data comprises:
Determining a first execution instance of a plurality of tasks to be scheduled with the same corresponding target label value as a second execution instance with a dependency relationship;
Determining the execution sequence of each second execution instance;
And sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
3. The method according to claim 1 or 2, characterized in that the timer object is created from the transaction day calendar, the timer object being specifically used for monitoring whether a system date belongs to a transaction day and whether a system time reaches a task scheduling moment;
the obtaining the target card value of the card object after the timer object monitors that the system time reaches the task scheduling moment comprises the following steps:
And after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling moment, obtaining the target card value of the card object.
4. A method according to claim 3, wherein said obtaining a target tile value for said tile object after said timer object monitors that said system date belongs to a transaction day and said system time reaches said task scheduling instant comprises:
If the timer object monitors that the system complete time is in a time range determined according to any transaction day and the system time reaches the task scheduling time, a target card value of the card object is obtained, wherein the system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day cut time of the transaction day to the preset day cut time of the second day.
5. The method of claim 1 or 2, wherein the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
6. The method according to claim 1, wherein the method further comprises:
acquiring date description information input by a user;
Determining a first date described by the date description information in the transaction date calendar;
the scheduling the first execution instance to obtain transaction data generated at the target card value and perform data processing on the obtained data comprises the following steps:
and scheduling the first execution instance to obtain the transaction data generated at the target card value and the transaction data generated at the first date, and carrying out data processing on the obtained data.
7. The method of claim 6, wherein the date description information includes a reference date, a date format, a unit offset, and a day offset;
The determining, in the transaction day calendar, a first date described by the date description information includes:
If the date format is a week format, determining a reference week number of the week where the reference date is located in the transaction date calendar; shifting the reference number of weeks according to the unit offset to obtain a shifted number of weeks, and determining a daily offset number of weeks of a second shifted number of weeks as the first date;
If the date format is a month format, determining a reference month of the month in which the reference date is located in the transaction date calendar; shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of a first shifted month as the first date;
If the date format is a quaternary format, determining a reference quarter of the quarter where the reference date is located in the transaction date calendar; and shifting the reference quarter according to the unit offset to obtain a shifted quarter, and determining a daily offset date of a third quarter of the shifted quarter as the first date.
8. The method according to claim 1 or 2, characterized in that the method further comprises:
obtaining a supplementary scheduling time range input by a user;
Determining a second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range based on the task scheduling record;
obtaining a historical card value of the card object when a system date is the second date;
generating a third execution instance of the task to be scheduled marked with the second date;
And scheduling the third execution instance to obtain the transaction data generated on the second date, and carrying out data processing on the obtained data.
9. A task scheduling device, the device comprising:
The system comprises an object maintenance module, a card object management module and a card management module, wherein the object maintenance module is used for maintaining a timer object bound with a task to be scheduled and a card object with a card value, the timer object is used for monitoring whether the system time reaches the task scheduling moment, the card object is created according to a transaction day calendar marked with a transaction day, the card object is configured to adjust the card value according to a card turning period, an initial value of the card value is determined according to the creation date of the card object and a transaction day difference value, and the transaction day difference value is determined according to the task to be scheduled;
the target value obtaining module is used for obtaining the target value of the card object after the timer object monitors that the system time reaches the task scheduling moment;
a first instance generating module, configured to generate a first execution instance of the task to be scheduled marked with the target board value;
and the first instance scheduling module is used for scheduling the first execution instance to obtain the transaction data generated at the target card value and processing the obtained data.
10. The apparatus of claim 9, wherein the first instance scheduling module is specifically configured to:
Determining a first execution instance of a plurality of tasks to be scheduled with the same corresponding target label value as a second execution instance with a dependency relationship;
Determining the execution sequence of each second execution instance;
And sequentially scheduling each second execution instance according to the determined execution sequence to obtain transaction data generated at the corresponding target card value, and carrying out data processing on the obtained data.
11. The apparatus according to claim 9 or 10, wherein the timer object is created from the transaction day calendar, the timer object being specifically configured to monitor whether a system date belongs to a transaction day and whether a system time reaches a task scheduling instant;
The target value obtaining module comprises:
And the card value obtaining sub-module is used for obtaining the target card value of the card object after the timer object monitors that the system date belongs to the transaction date and the system time reaches the task scheduling moment.
12. The apparatus of claim 11, wherein the card value obtaining submodule is specifically configured to:
If the timer object monitors that the system complete time is in a time range determined according to any transaction day and the system time reaches the task scheduling time, a target card value of the card object is obtained, wherein the system complete time comprises a system date and a clock time, and the time range determined according to one transaction day is as follows: a time range from a preset day cut time of the transaction day to the preset day cut time of the second day.
13. The apparatus of claim 9 or 10, wherein the card object is configured to: and switching the card value to the next trade date of the current value every time a preset time of one trade date is reached from the creation date.
14. The apparatus of claim 9, wherein the apparatus further comprises:
The information acquisition module is used for acquiring date description information input by a user;
A first date determining module, configured to determine a first date described by the date description information in the transaction date calendar;
The first instance scheduling module is specifically configured to:
and scheduling the first execution instance to obtain the transaction data generated at the target card value and the transaction data generated at the first date, and carrying out data processing on the obtained data.
15. The apparatus of claim 14, wherein the date description information includes a reference date, a date format, a unit offset, and a day offset;
the first date determining module is specifically configured to:
If the date format is a week format, determining a reference week number of the week where the reference date is located in the transaction date calendar; shifting the reference number of weeks according to the unit offset to obtain a shifted number of weeks, and determining a daily offset number of weeks of a second shifted number of weeks as the first date;
If the date format is a month format, determining a reference month of the month in which the reference date is located in the transaction date calendar; shifting the reference month according to the unit offset to obtain a shifted month, and determining a transaction day of a day offset of a month of a first shifted month as the first date;
If the date format is a quaternary format, determining a reference quarter of the quarter where the reference date is located in the transaction date calendar; and shifting the reference quarter according to the unit offset to obtain a shifted quarter, and determining a daily offset date of a third quarter of the shifted quarter as the first date.
16. The apparatus according to claim 9 or 10, characterized in that the apparatus further comprises:
the range obtaining module is used for obtaining the supplementary scheduling time range input by the user;
The second date determining module is used for determining a second date of the task to be scheduled which is not scheduled in the supplementary scheduling time range based on the task scheduling record;
a historical card value obtaining module, configured to obtain a historical card value of the card object when the system date is the second date;
a second instance generating module, configured to generate a third execution instance of the task to be scheduled marked with the second date;
And the second instance scheduling module is used for scheduling the third execution instance to obtain the transaction data generated on the second date and processing the obtained data.
17. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
A memory for storing a computer program;
A processor for implementing the method of any of claims 1-8 when executing a program stored on a memory.
18. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-8.
CN202410638110.4A 2024-05-22 2024-05-22 Task scheduling method and device Active CN118229423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410638110.4A CN118229423B (en) 2024-05-22 2024-05-22 Task scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410638110.4A CN118229423B (en) 2024-05-22 2024-05-22 Task scheduling method and device

Publications (2)

Publication Number Publication Date
CN118229423A true CN118229423A (en) 2024-06-21
CN118229423B CN118229423B (en) 2024-07-16

Family

ID=91506750

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410638110.4A Active CN118229423B (en) 2024-05-22 2024-05-22 Task scheduling method and device

Country Status (1)

Country Link
CN (1) CN118229423B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235284A1 (en) * 2009-03-13 2010-09-16 Gidah, Inc. Method and systems for generating and using tokens in a transaction handling system
CN111897702A (en) * 2020-07-16 2020-11-06 中国工商银行股份有限公司 Early warning processing method and device for business system, computer system and medium
CN114090605A (en) * 2021-11-30 2022-02-25 中国建设银行股份有限公司 Daily cutting method and device, computer equipment and storage medium
CN114219318A (en) * 2021-12-17 2022-03-22 中国建设银行股份有限公司 Data processing method, device, equipment and computer storage medium
CN114579555A (en) * 2022-04-28 2022-06-03 梅州客商银行股份有限公司 Real-time data calibration method and system based on 7 x 24 hours
CN116450311A (en) * 2023-02-28 2023-07-18 中国建设银行股份有限公司 Decision task processing method, device, equipment and storage medium
CN117194376A (en) * 2023-09-07 2023-12-08 中国银行股份有限公司 Method, device, equipment and storage medium for acquiring time after system date switching
CN117193975A (en) * 2023-09-05 2023-12-08 中国平安财产保险股份有限公司 Task scheduling method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235284A1 (en) * 2009-03-13 2010-09-16 Gidah, Inc. Method and systems for generating and using tokens in a transaction handling system
CN111897702A (en) * 2020-07-16 2020-11-06 中国工商银行股份有限公司 Early warning processing method and device for business system, computer system and medium
CN114090605A (en) * 2021-11-30 2022-02-25 中国建设银行股份有限公司 Daily cutting method and device, computer equipment and storage medium
CN114219318A (en) * 2021-12-17 2022-03-22 中国建设银行股份有限公司 Data processing method, device, equipment and computer storage medium
CN114579555A (en) * 2022-04-28 2022-06-03 梅州客商银行股份有限公司 Real-time data calibration method and system based on 7 x 24 hours
CN116450311A (en) * 2023-02-28 2023-07-18 中国建设银行股份有限公司 Decision task processing method, device, equipment and storage medium
CN117193975A (en) * 2023-09-05 2023-12-08 中国平安财产保险股份有限公司 Task scheduling method, device, equipment and storage medium
CN117194376A (en) * 2023-09-07 2023-12-08 中国银行股份有限公司 Method, device, equipment and storage medium for acquiring time after system date switching

Also Published As

Publication number Publication date
CN118229423B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
Babai et al. On the empirical performance of (T, s, S) heuristics
Englberger et al. Two-stage stochastic master production scheduling under demand uncertainty in a rolling planning environment
CN113888235A (en) Training method of sales forecasting model, sales forecasting method and related device
Li et al. Optimal batch ordering policies for assembly systems with guaranteed service
CN102542437B (en) Task expiration reminding method and device
CN110781235A (en) Big data based purchase data processing method and device, terminal and storage medium
CN117540870A (en) Product shortage prediction method, system, equipment and readable medium
CN118229423B (en) Task scheduling method and device
CN114091770A (en) Prediction analysis method, device, equipment and storage medium for material demand plan
Overbeck et al. Development and analysis of digital twins of production systems
CN114372735A (en) Method and device for determining buffer stock quantity data in logistics supply chain
US20100082405A1 (en) Multi-period-ahead Forecasting
CN115471092A (en) Food production work reporting method and device, electronic equipment and storage medium
CN114092275A (en) Enterprise operation abnormity monitoring method and device, computer equipment and storage medium
JP2500194B2 (en) Product ordering system
CN113592381A (en) Method and device for configuring safety stock
CN111179084A (en) Method and device for predicting futures market trading index
US7299156B2 (en) Method for estimating a maintenance date and apparatus using the same
JP2006331312A (en) Data prediction device and program
EP2568434A1 (en) Data processing method and system
EP3944038A1 (en) Production management device, production management method, and production management program
US11789789B2 (en) Proactive request communication system with improved data prediction using event-to-status transformation
US20230214746A1 (en) Proactive request communication system with improved data prediction with time of day adjustment
US20230214457A1 (en) Proactive request communication system with improved data prediction based on anticipated events
CN113592380B (en) Method and device for configuring safety stock

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