Method and apparatus for checking timing tasks
Patent Information
- Application Number
- CN202210140478.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-02-16
AI Technical Summary
[0008]本申请实施例提供了一种定时任务的核查方法、装置、电子设备及可读存储介质,以克服现有技术中采用人工核查定时任务,存在操作复杂、效率低、容易出现核查错误、且成本高、难以满足业务发展需求的缺陷
[0053]This application pre-sets the association information of multiple data center scheduled tasks and generates task association records. Then, in response to a verification request for a first target scheduled task, it determines a second target scheduled task related to the first target scheduled task based on the task association records. Finally, it determines the verification result of the first target scheduled task based on the execution records of the first and second target scheduled tasks. This application records the association of scheduled tasks in each data center, forming task association records. When verifying the first target scheduled task, the second target scheduled task corresponding to the first target scheduled task can be quickly determined by querying the task association records. The verification result of the first target scheduled task is then determined by the execution status of the first and second target scheduled tasks. This application eliminates the need for complex manual analysis and comparison, and the maintenance of a large amount of second target scheduled task information for each data center. It can quickly locate the second target scheduled task corresponding to the first target scheduled task, providing a reliable and accurate basis for data center switching. It is simple to operate, highly efficient in verification, and greatly reduces labor, economic, and time costs. Furthermore, it significantly improves the accuracy of the inspection results, especially meeting the verification needs of scenarios with heavy business volumes, such as large-scale promotional events.
Smart Images

Figure CN116643852B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a method and apparatus for verifying timed tasks. Background Technology
[0002] Settlement and clearing operations utilize scheduled tasks in various scenarios. For example, scheduled tasks are used in the control center's computer room to aggregate settlement results from multiple computer rooms and then periodically reconcile the differences. However, before network failures or large-scale promotional drills, some computer rooms may become unusable due to malfunctions or excessive load. In such cases, it is necessary to switch unusable computer rooms to other available ones, which is the scenario of computer room switching.
[0003] For example, if data center A crashes, all scheduled tasks that were originally running in data center A need to be accessed through the scheduling and management control interface of other data centers. The associated tasks corresponding to the scheduled tasks currently running in data center A must be located, and execution records must be retrieved to verify the execution status of each scheduled task and its associated tasks in order to perform a data center switchover. One problem with data center switchover is that it's not possible to know in advance which data center the associated tasks corresponding to the scheduled tasks currently running in data center A are located in. This requires manual verification of each task, which is not only costly in terms of manpower, resources, and time, but also prone to errors. As a result, some associated tasks that should have been executed may not have been triggered after the data center switchover.
[0004] Furthermore, during the switchover from the source data center to the target data center, scheduled tasks may be interrupted. After the data center switchover is complete, the associated tasks of the scheduled tasks start, and the associated tasks continue to execute the tasks of the scheduled tasks in the source data center. Since data center switchover takes a certain amount of time, this may cause some scheduled tasks that should have been triggered to miss their triggering time, resulting in some scheduled tasks not being executed. Therefore, after the data center switchover, it is necessary to check whether any scheduled tasks missed their triggering time after they stopped executing and before their associated tasks started executing.
[0005] In existing technologies, the verification of whether a scheduled task has been missed is usually done by manually logging into the management and control interface of the scheduled task, confirming or tracing back the business processing flow based on the scheduled task configuration information, and using the business execution records.
[0006] In summary, existing technologies require manual login to the scheduling and management control interface during data center switchover. This method, which involves manually comparing the scheduled task configuration information of two or more data centers, involves numerous steps, is inefficient, impacts the overall business processing flow, and is prone to errors in manual analysis and judgment. Furthermore, analysis and judgment based on business processes and parameters are highly relevant to the business, complex to check, and demanding on maintenance personnel, resulting in high labor costs. In addition, for business scenarios such as clearing and settlement, and reconciliation, multiple scheduled tasks are used to process data for different time periods. After data center switchover, all these scheduled tasks need to be verified, resulting in a huge workload and extremely difficult verification process.
[0007] It should be noted that the statements herein provide only background information relevant to this application and do not necessarily constitute prior art. Summary of the Invention
[0008] This application provides a method, apparatus, electronic device, and readable storage medium for verifying scheduled tasks, in order to overcome the shortcomings of manual verification of scheduled tasks in the prior art, which is complex to operate, inefficient, prone to verification errors, costly, and difficult to meet business development needs.
[0009] The embodiments of this application adopt the following technical solutions:
[0010] In a first aspect, embodiments of this application provide a method for verifying scheduled tasks, wherein the method is executed by a verification server and includes:
[0011] A task association record is generated based on the task association configuration information. The task association record represents the association between multiple scheduled tasks, which are of the same type and are deployed in different data centers.
[0012] In response to the verification request for the first target timed task, read the task association record corresponding to the first target timed task;
[0013] Determine the second target timed task associated with the first target timed task based on the read task association record;
[0014] Obtain the execution records of the first target timed task and the second target timed task;
[0015] The verification result of the first target timed task is determined based on the execution record.
[0016] Optionally, in the above method, the verification request is generated after a data center switching event occurs, and the data center switching event is a switch from the source data center where the first target timed task is located to at least one associated data center where the second target timed task is located.
[0017] The acquisition of the execution records of the first target timed task and the second target timed task includes:
[0018] Obtain the first trigger time of the last execution of the first target timed task in the source data center, and obtain the execution status of the second target timed task in the associated data center;
[0019] The verification result for determining the first target timed task based on the execution record includes:
[0020] Based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task, the verification result of the first target timed task is determined.
[0021] Optionally, in the above method, the preset triggering rule for the scheduled task is:
[0022] The scheduled task is triggered at the expected trigger time, wherein the expected trigger time is determined based on the start trigger time, the preset trigger period, and the number of executions.
[0023] Optionally, in the above method, obtaining the execution status of the associated computer room for the second target scheduled task includes:
[0024] Determine whether the associated computer room has executed the second target scheduled task; if not, obtain the current time.
[0025] The step of determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task includes:
[0026] The first trigger time is used as the starting trigger time, and the first estimated trigger time for the number of executions is determined according to the preset trigger rules;
[0027] If the current time is earlier than the first expected trigger time, then the verification result of the first target timed task is determined to be that there is no missed trigger;
[0028] If the current time is later than the first expected trigger time, then the verification result of the first target timed task is determined to be a missed trigger.
[0029] Optionally, in the above method, obtaining the execution status of the associated computer room for the second target scheduled task includes:
[0030] If it is determined that the associated data center has executed the second target timed task, obtain the second trigger time for the first execution of the second target timed task by the associated data center;
[0031] The step of determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task includes:
[0032] Using the first trigger time as the starting trigger time, a number of expected trigger times are determined according to the preset trigger rules, with each time the execution is performed a certain number of times.
[0033] If the second trigger time is determined to be consistent with the earliest expected trigger time, the verification result of the first target timed task is determined to be that there is no missed trigger;
[0034] If it is determined that the second trigger time is later than the earliest expected trigger time, but earlier than or equal to the latest expected trigger time, the verification result of the first target timed task is determined to be a missed trigger.
[0035] Optionally, in the above method, determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task further includes:
[0036] If the verification result of the first target timed task is determined to be an missed trigger, the number of missed triggers of the first target timed task is determined according to the several expected trigger times, the second trigger time, and the preset trigger rules of the timed task.
[0037] Optionally, in the above method, the type of the first target scheduled task is a backup task;
[0038] The method further includes:
[0039] Based on the task association configuration information, determine the configuration activation status of the first target timed task and the second target timed task;
[0040] Based on the matching of the configuration activation status with the execution record, the verification result of the first target scheduled task is determined.
[0041] Optionally, in the above method, determining the verification result of the first target scheduled task based on the matching of the configuration activation status and the execution record includes:
[0042] If the configuration enable status of the first target scheduled task is inconsistent with the execution record of the first target scheduled task and / or the configuration enable status of the second target scheduled task is inconsistent with the execution record of the second target scheduled task, then the verification result of the first target scheduled task is determined to be a distribution error.
[0043] If the configuration enable status of the first target scheduled task matches the execution record of the first target scheduled task, and the configuration enable status of the second target scheduled task matches the execution record of the second target scheduled task, then the verification result of the first target scheduled task is determined to be that there is no distribution error.
[0044] Optionally, the above method further includes the following step of verifying the task association configuration information before generating the task association record:
[0045] Determine the task logic of each scheduled task to be associated as indicated by the task association configuration information;
[0046] Based on the task logic, determine the verification fields for each scheduled task to be associated.
[0047] If all the verification fields of the scheduled tasks to be associated are consistent, the verification is deemed successful, and the step of generating a task association record based on the task association configuration information is executed; First target scheduled task; Second target scheduled task.
[0048] If the verification fields of at least two scheduled tasks to be associated are inconsistent, the verification is determined to be unsuccessful, and the step of generating a task association record based on the task association configuration information for the first target scheduled task and the second target scheduled task will not be executed.
[0049] Secondly, embodiments of this application also provide a timed task verification device applied to a verification server, wherein the device is used to implement any of the methods described above.
[0050] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform any of the methods described above.
[0051] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform any of the methods described above.
[0052] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0053] This application pre-sets the association information of multiple data center scheduled tasks and generates task association records. Then, in response to a verification request for a first target scheduled task, it determines a second target scheduled task related to the first target scheduled task based on the task association records. Finally, it determines the verification result of the first target scheduled task based on the execution records of the first and second target scheduled tasks. This application records the association of scheduled tasks in each data center, forming task association records. When verifying the first target scheduled task, the second target scheduled task corresponding to the first target scheduled task can be quickly determined by querying the task association records. The verification result of the first target scheduled task is then determined by the execution status of the first and second target scheduled tasks. This application eliminates the need for complex manual analysis and comparison, and the maintenance of a large amount of second target scheduled task information for each data center. It can quickly locate the second target scheduled task corresponding to the first target scheduled task, providing a reliable and accurate basis for data center switching. It is simple to operate, highly efficient in verification, and greatly reduces labor, economic, and time costs. Furthermore, it significantly improves the accuracy of the inspection results, especially meeting the verification needs of scenarios with heavy business volumes, such as large-scale promotional events. Attached Figure Description
[0054] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0055] Figure 1 A flowchart illustrating a method for verifying a timed task according to an embodiment of this application is shown.
[0056] Figure 2 A flowchart illustrating a method for verifying a timed task according to another embodiment of this application is shown.
[0057] Figure 3 A schematic diagram of the structure of a timed task verification device according to an embodiment of this application is shown;
[0058] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0061] In existing technologies, when multiple data centers jointly process clearing and settlement operations, data center switching often occurs due to faults or network unavailability in one data center. During data center switching, since it is impossible to know in advance which data center the scheduled tasks corresponding to the source data center are located in, manual login to the scheduling management control interface of each data center is required to check the execution status of the scheduled tasks one by one, find the corresponding associated tasks, and ensure a smooth data center switching process. On the other hand, because data center switching takes time, scheduled tasks may be missed. In existing technologies, checking for missed triggers also typically involves manually logging into the scheduling management control interface of different data centers, finding the corresponding menus and tasks, and manually comparing the corresponding scheduled task configuration information of two or more data centers for further analysis and judgment to determine whether any scheduled tasks have been missed. This method is complex, inefficient, prone to verification errors, costly, and unsuitable for scenarios with heavy verification workloads.
[0062] To address the aforementioned shortcomings, this application provides a highly efficient and accurate method for verifying scheduled tasks without manual intervention. This method records and stores task association records by recording the associated information of multiple pre-set scheduled tasks in multiple computer rooms. Upon receiving a verification request, the task association record is invoked to quickly identify the second target scheduled task associated with the first target scheduled task to be verified. Furthermore, the verification result of the first target scheduled task is obtained by comparing the execution status of the first and second target scheduled tasks.
[0063] Figure 1 This diagram illustrates a flowchart of a method for verifying a timed task according to an embodiment of this application. Figure 1 As can be seen from the method shown, this application includes at least steps S110 to S150:
[0064] Step S110: Generate task association records based on task association configuration information. The task association records represent the association between multiple scheduled tasks. The multiple scheduled tasks are of the same type and are deployed in different data centers.
[0065] For the same type of scheduled task, although the parameters of the scheduled task are different in different data centers, the business logic is consistent. Scheduled tasks include, but are not limited to, peer tasks, backup tasks, etc. Therefore, the same type of task in different data centers can be associated. When the source data center is unavailable, the task can be switched to another data center, so that the associated task in the other data center can continue to execute the interrupted task in the source data center. Here, the other data center is called the associated data center.
[0066] One difference between peer tasks and backup tasks is that peer tasks have the same business logic, but the task content may not be the same, while backup tasks have the same business logic and the same task content. Another difference between peer tasks and backup tasks is that their execution states are different.
[0067] If the source data center is data center A, and one of the scheduled tasks currently being executed is task a, and the associated data center is data center B, and data center B has a pre-configured task b, and tasks a and b are backup tasks for each other, with the business logic and task content of tasks a and b being consistent, if data center A fails and becomes unusable, task a is suspended. At this time, data center A is switched to data center B, allowing task b to start executing. In other words, tasks a and b do not execute simultaneously; only one of them, the task deployed in the source data center, is executed.
[0068] Peer-to-peer tasks refer to tasks within the same tier in different data centers that use the same protocol, have the same business logic, and the same functionality. Peer-to-peer tasks can be the same program or different programs. For example, if the source data center is data center A, and one of the scheduled tasks currently being executed is task a, and the associated data center is data center B, with task b pre-configured in data center B, and tasks a and b are peer-to-peer tasks, assuming that both tasks a and b are settlement tasks—task a settling orders submitted in Beijing and task b settling orders submitted in Shenzhen—then during data center switching can be performed with tasks a and b performing the same task content. During normal operation in each data center, task a in data center A and task b in data center B are executed independently.
[0069] In existing technologies, task information for each task is stored in different data centers. During data center switching, manual intervention is required to log into the scheduling and management interface of each data center, locate the associated task in each data center according to the task information of the target scheduled task, find the specific data center where the associated task is located, and then perform the data center switch. This manual switching method is time-consuming, labor-intensive, and has a high risk of errors.
[0070] In this application, task association records can be pre-formed based on task association configuration information. These records represent the association between multiple scheduled tasks of the same type, deployed in different data centers. Specifically, the task association records contain information about the scheduled tasks in each data center, as well as the associations between these scheduled tasks. The task association configuration information can be submitted by the user.
[0071] It should be noted that multiple related, or potentially related, scheduled tasks must be of the same type. Here, "type" refers to the tasks having identical business logic and functionality. Whether a task is a peer task or a backup task can be further configured as a task attribute.
[0072] When generating a task association record based on task association configuration information, the system can specifically receive or read task association configuration information. This information includes multiple pre-set scheduled tasks in specified data centers; that is, the user only needs to specify which scheduled task they wish to associate with. In some embodiments of this application, the associated task, i.e., the second target scheduled task, can be one. In other embodiments, there can be multiple second target scheduled tasks, one as the primary associated task and the others as backup associated tasks. This application does not impose any restrictions.
[0073] To facilitate staff operations, this application provides a unified front-end interface. This interface includes configuration interfaces for scheduled tasks in each data center, an execution result viewing interface, and a unified exit point for data modification and maintenance. This improves staff efficiency and reduces the risk of human error. The front-end interface allows access to pre-set scheduled tasks in multiple specified data centers. In this embodiment, the task association configuration information includes pre-set task a in data center A and pre-set task b in data center B.
[0074] This application can also perform verification within a unified integrated operation and maintenance interface for each data center, supporting verification via coding, thus providing more scalability for subsequent business processing. This application does not limit the above implementation method; it can be selected as needed.
[0075] This application is executed through a verification server, which can be set up in any one of multiple data centers and communicate with each of the other data centers separately.
[0076] After obtaining the task association configuration information, you can log in to the data center where the task to be associated is located to obtain the task information. Then, based on the obtained task information, a task association record is generated. Continuing with the above, taking task a in data center A and task b in data center B as an example, after determining task a and task b, you can log in to data center A to obtain the task information of task a, and log in to data center B to obtain the task information of task b, such as task name, task type, timing expression, and task ID, etc. In some embodiments of this application, the task information of each task also includes a unique identification ID. This identification ID can be a string of numbers generated based on time, so that the target timing task can be determined more quickly when reading the task association record later. It should be noted that the task information of task a and task b both contain an association identification field. This association identification field is unique and consistent for task a and task b, and can be used to identify and determine the association relationship between task a and task b.
[0077] Based on the task information of task a and task b, a task association record for task a and task b is formed. Specifically, after obtaining the task association configuration information, that is, after determining that the tasks to be associated are task a and task b, and after obtaining the task information of task a and task b, the association identification field of task a and task b can be obtained from the task information. Assuming that the association identification field of task a is aabb and the association identification field of task b is also aabb, the association identification fields of task a and task b are consistent, then task a and task b can be determined to be associated tasks, and a task association record for task a and task b can be formed. On the other hand, assuming that the association identification field of task a is aabb and the association identification field of task b is also bbaa, the association identification fields of task a and task b are inconsistent, then task a and task b can be determined to be unassociatable tasks, and an association error message can be returned, indicating that a task association record cannot be formed.
[0078] The task association records contain task information for each task in each data center, as well as the relationships between scheduled tasks in different data centers. These task association records can be stored in a database table (DB table), such as a data permissions table, and can be continuously updated based on the task association records.
[0079] Step S120: In response to the verification request for the first target timed task, read the task association record corresponding to the first target timed task.
[0080] When checking a primary target timed task, the task association record corresponding to the primary target timed task is found in the file formed above. The specific search method can be to search for the task information of the primary target timed task, such as the unique identification ID.
[0081] In some embodiments of this application, the first target timed task can be identified based on the task name and other information in the task information. In other embodiments of this application, the task can be identified based on its identity ID. Using the identity ID can help find the first target timed task more quickly and accurately.
[0082] Step S130: Determine the second target timed task associated with the first target timed task based on the read task association record.
[0083] After determining the first target scheduled task, the second target scheduled task associated with it is determined based on the task association record of the first target scheduled task. Specifically, it can be searched in the relevant fields of the record of the first target scheduled task. For example, the second target scheduled task can be found in the backup task or peer task fields of the record of the first target scheduled task. Alternatively, it can be determined based on the association identification field. For example, if task a in data center A is the first target scheduled task and it has the association identification field aabb, a search is performed in the overall file formed by the task association record. In addition to task a in data center A, tasks with the association identification field aabb are found. Taking task b in data center B as an example, task b in data center B is the second target scheduled task.
[0084] Step S140: Obtain the execution records of the first target timed task and the second target timed task.
[0085] After determining the first and second target scheduled tasks, the execution records of the first and second target scheduled tasks are obtained. These execution records include the execution start time, execution time for each task, execution content, execution result, etc. In some embodiments of this application, to prevent the inability to obtain execution records after a data center crash, the execution status of each scheduled task in each data center can be stored in a verification server. This way, regardless of which data center crashes, the execution status of each scheduled task can be obtained from the verification server.
[0086] Step S150: Determine the verification result of the first target timed task based on the execution record.
[0087] The verification result of the first target scheduled task is determined based on the execution records of the first and second target scheduled tasks. For example, the verification result may include which data center the backup task or peer task of the first target scheduled task is located in; or the verification result may also include whether the first target scheduled task has been omitted. Specifically, the omission of the first target scheduled task can be determined based on the last execution time of the first target scheduled task, the first execution time of the second target scheduled task, and the timing expression of the first target scheduled task.
[0088] from Figure 1 As can be seen, this application pre-sets the association information of multiple data center scheduled tasks and generates task association records. Then, in response to a verification request for the first target scheduled task, it determines the second target scheduled task related to the first target scheduled task based on the task association records, and determines the verification result of the first target scheduled task based on the execution records of the first and second target scheduled tasks. This application records the association of scheduled tasks in each data center to form task association records. When verifying the first target scheduled task, the second target scheduled task corresponding to the first target scheduled task can be quickly determined by querying the task association records. Thus, the verification result of the first target scheduled task can be determined by the execution status of the first and second target scheduled tasks. This application can quickly locate the second target scheduled task corresponding to the first target scheduled task without complex manual analysis and comparison, or maintaining a large amount of second target scheduled task information for each data center. This provides a reliable and accurate basis for data center switching, and is simple to operate, highly efficient in verification, and greatly reduces labor, economic, and time costs. It also significantly improves the accuracy of the inspection results, especially meeting the verification needs of scenarios with heavy business volumes, such as large-scale promotional events.
[0089] In some embodiments of this application, the verification request is generated after a data center switching event, which is a switch from the source data center where the first target timed task is located to at least one associated data center where a second target timed task is located. Obtaining the execution records of the first target timed task and the second target timed task includes: obtaining the first trigger time of the last execution of the first target timed task in the source data center, and obtaining the execution status of the second target timed task in the associated data center. Determining the verification result of the first target timed task based on the execution records includes: determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task.
[0090] In some embodiments of this application, the verification request may be issued manually by staff. In other embodiments, the verification request may be automatically generated based on a data center switching event. That is, after each data center switching event, it can automatically verify whether any scheduled tasks originally running in the source data center were missed during the data center switching process. Here, a data center switching event refers to a switch from the source data center where the first target scheduled task is located to at least one associated data center where a second target scheduled task is located.
[0091] In this case, the verification result of the first target timed task can be determined based on the first trigger time of the last execution of the first target timed task in the source data center, the execution status of the second target timed task in the associated data center, and the preset trigger rules of the timed task.
[0092] The preset triggering rule for the scheduled task can be determined, but is not limited to, based on the scheduled task's timing expression. In some embodiments of this application, the preset triggering rule for the scheduled task is: trigger the scheduled task at the expected trigger time, wherein the expected trigger time is determined based on the start trigger time, the preset trigger period, and the number of executions. More specifically, in some embodiments of this application, the expected trigger time is the sum of the products of the start trigger time, the preset trigger period, and the number of executions. For example, if task a triggers every minute, with 12:00:00 as the start time, it will trigger once each at 12:01:00, 12:02:00, 12:03:00, and so on.
[0093] The following scenarios illustrate how to determine the verification results of the first objective timed task.
[0094] In some embodiments of this application, obtaining the execution status of the second target scheduled task in the associated data center includes: determining whether the associated data center has executed the second target scheduled task; if not, obtaining the current time. In this case, determining the verification result of the first target scheduled task based on the first trigger time, the execution status of the second target scheduled task, and the preset triggering rules of the scheduled task includes: taking the first trigger time as the starting trigger time, determining the first estimated trigger time with one execution count according to the preset triggering rules; if the current time is earlier than the first estimated trigger time, determining that the verification result of the first target scheduled task is that there is no missed trigger; if the current time is later than the first estimated trigger time, determining that the verification result of the first target scheduled task is that there is a missed trigger.
[0095] First, determine whether the associated data center has already executed the second target scheduled task. If it has not yet been executed, record the current time. The fact that the associated data center has not executed the second target scheduled task could be due to the task not yet being scheduled for execution, a fault in the associated data center, or other reasons preventing the execution of the second target scheduled task.
[0096] The starting trigger time is the first trigger time of the last execution of the first target scheduled task in the source data center. Based on preset trigger rules, the first estimated trigger time for the next execution of the first target scheduled task in the source data center is determined. This first estimated trigger time is the expected time when the source data center will next execute the first target scheduled task if no data center switch occurs after the last execution of the first target scheduled task. For example, if the first trigger time of the last execution of the first target scheduled task in the source data center is 12:00:00, the first estimated trigger time is determined to be 12:01:00 based on the preset trigger rules.
[0097] It should be noted that determining the last execution of the first target scheduled task in the corresponding source data center requires confirming the completion of the first target scheduled task. If a first target scheduled task is being executed when the data center experiences a system crash, the execution record for that scheduled task has not yet been formed, and this execution cannot be considered the last execution of the first target scheduled task. For example, a scheduled task has an execution cycle of 1 hour, executing once at 10:00 and once at 11:00. However, each execution of the scheduled task takes 30 minutes, meaning the scheduled task completes at 11:30. If the data center where the scheduled task is located experiences a system crash at 11:20, then although the scheduled task was triggered at 11:00, it has not yet completed execution. Therefore, the execution at 11:00 cannot be considered the last execution of the first target scheduled task. Instead, the execution at 10:00 should be considered the last execution of the first target scheduled task in the source data center, meaning 10:00 is the first trigger time.
[0098] Assuming the current time is 12:00:30, and 12:00:30 is earlier than 12:01:00, it means that the first scheduled task of the first target has not yet reached its expected trigger time after the data center switchover is completed. Therefore, the verification result of the first scheduled task of the first target is determined to be that there is no missed trigger.
[0099] Assuming the current time is 12:02:00, which is later than 12:01:00, meaning the first target scheduled task has reached its expected trigger time after the data center switchover is complete, but the second target scheduled task has not been executed, it indicates that there was a problem with the associated data center in executing the second target scheduled task, and the second target scheduled task failed to be executed. Therefore, the verification result of the first target scheduled task is determined to be an erroneous trigger.
[0100] In some other embodiments of this application, obtaining the execution status of the associated data center for the second target timed task includes: if it is determined that the associated data center has executed the second target timed task, obtaining the second trigger time of the first execution of the second target timed task by the associated data center; determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task includes: taking the first trigger time as the starting trigger time, determining several expected trigger times with a certain number of executions according to the preset triggering rules; if it is determined that the second trigger time is consistent with the earliest expected trigger time, determining that the verification result of the first target timed task is that there is no missed trigger; if it is determined that the second trigger time is later than the earliest expected trigger time and earlier than or equal to the latest expected trigger time, determining that the verification result of the first target timed task is that there is a missed trigger.
[0101] If the associated data center has already executed the second target scheduled task, obtain the second trigger time for the first execution of the second target scheduled task in the associated data center. Furthermore, determine whether the first target scheduled task was missed based on the order of the second trigger time and the expected trigger time.
[0102] Specifically, firstly, the first trigger time is used as the starting trigger time. Then, according to the preset trigger rules, several expected trigger times are determined, with a certain number of executions. For example, if the first trigger time for the last execution of the first target timed task in the source computer room is 12:00:00, the multiple expected trigger times determined according to the preset trigger rules are: the first expected trigger time is 12:01:00, the second expected trigger time is 12:02:00, the third expected trigger time is 12:03:00, and the fourth expected trigger time is 12:04:00.
[0103] Assuming the second trigger time for the first execution of the second target timed task in the associated data center is 12:01:00, which is consistent with the first expected trigger time, it indicates that the data center switchover was completed between 12:00:00 and 12:01:00 without delaying the triggering of the second target timed task. Therefore, the verification result of the first target timed task is determined to be that there was no missed triggering.
[0104] Assuming the second trigger time for the first execution of the second target scheduled task in the associated data center is 12:03:00, which is later than the earliest expected trigger time (i.e., the first expected trigger time of 12:01:00) and earlier than the latest expected trigger time (i.e., the fourth expected trigger time of 12:04:00), this indicates that the data center switchover was completed between 12:01:00 and 12:03:00, or more specifically, between 12:02:00 and 12:03:00. In this case, the verification result of the first target scheduled task is determined to be a missed trigger.
[0105] Furthermore, the number of missed triggers of the first target timed task can be determined based on several expected trigger times, a second trigger time, and preset trigger rules for the timed task. In this embodiment, the number of missed triggers of the first target timed task can be determined to be 2.
[0106] In some embodiments of this application, the type of the first target scheduled task is a backup task, and the method further includes: determining the configuration enable status of the first target scheduled task and / or the second target scheduled task according to the task association configuration information; and determining the verification result of the first target scheduled task according to the matching of the configuration enable status and the execution record.
[0107] It should be noted that backup tasks refer to task types, such as task a and task b being backup tasks for each other, as mentioned above; rather than task a or task b backing up data.
[0108] In this embodiment, it is also possible to check whether there is a distribution error in the first target scheduled task. Specifically, based on the task association configuration information, the configuration activation status of the first target scheduled task and the second target scheduled task is determined. For example, the first target scheduled task is task c in computer room C, and the second target scheduled task of task c is the second target scheduled task d in computer room D. That is, the second target scheduled task d is a backup task of task c. The task association configuration information includes that the configuration startup status of task c in computer room C is "started", and the configuration startup status of the second target scheduled task d in computer room D is "disabled".
[0109] Obtain the execution records of the first and second target scheduled tasks. The execution records can determine whether task c and the second target scheduled task d have started. If the configuration enable status of the first target scheduled task is inconsistent with its execution record and / or the configuration enable status of the second target scheduled task is inconsistent with its execution record, then the verification result of the first target scheduled task is determined to be a distribution error. If the configuration enable status of the first target scheduled task is consistent with its execution record, and the configuration enable status of the second target scheduled task is consistent with its execution record, then the verification result of the first target scheduled task is determined to be no distribution error.
[0110] If, in the execution log, task c is in the running status as started and the second target timed task d is in the running status as stopped, then the configuration enable status of the second target timed task is consistent with the execution log of the second target timed task, and it is determined that the verification result of the first target timed task is that there is no distribution error.
[0111] If, in the execution log, both task c and the second target timed task d are listed as "started," it indicates an error occurred during task distribution, causing the second target timed task d, which should have been stopped, to be started. In this case, it can be confirmed that the check result for the first target timed task shows a distribution error. Other scenarios include task c being stopped while the second target timed task d is started, which will not be listed here.
[0112] In some embodiments of this application, the method further includes the following steps of verifying the task association configuration information before generating the task association record: determining the task logic of each scheduled task to be associated as indicated by the task association configuration information; determining the verification field of each scheduled task to be associated according to the task logic; determining that the verification is passed if the verification fields of each scheduled task to be associated are consistent, and then executing the step of generating the task association record according to the task association configuration information; determining that the verification is failed if the verification fields of at least two scheduled tasks to be associated are inconsistent, and then not executing the step of generating the task association record according to the task association configuration information.
[0113] When setting up associations for tasks in multiple data centers, the method in this embodiment can be used to correct whether the associations of multiple tasks are correct, so as to ensure that the second target timed task and the first target timed task perform the same task content before and after the data center switch.
[0114] Specifically, before generating the task association record, a verification step is performed. Taking two scheduled tasks to be associated as an example, the verification process is explained in detail below. Based on the task association configuration information, the task logic of multiple scheduled tasks to be associated is determined. For example, it can be determined based on the task type. If task a in data center A is a liquidation task, then the task logic of task a can be determined based on the task type. Further, the verification fields of task a are determined based on the task logic of task a. Simultaneously, the verification fields of task b in data center B, which is to be associated with task a, can be determined using the same method. If the verification fields of task a and task b are consistent, it indicates that their task logic is consistent, and the association between the first and second target scheduled tasks is correct, meaning they can be associated. If the verification fields of task a and task b are inconsistent, it indicates that their business logic is inconsistent, and the association between the first and second target scheduled tasks is incorrect, meaning they cannot be associated. The verification fields can also be reused in other scenarios to determine the task logic attributes of scheduled tasks.
[0115] It should be noted that the number of scheduled tasks to be associated is not limited to two. If there are three or more, during the verification process, if the verification fields of all scheduled tasks to be associated are consistent, the verification is considered successful, and the step of generating task association records based on task association configuration information will continue. If the verification fields of two or more scheduled tasks to be associated are inconsistent, the verification is considered unsuccessful, and the process ends, i.e., the step of generating task association records based on task association configuration information will not be executed. Furthermore, a pop-up window can be used to remind the user to make modifications.
[0116] In some embodiments of this application, updated task association configuration information can be received according to a preset period to update or overwrite existing task association configuration information, thereby maintaining the real-time validity of task association records. This setting enables automated checking of task association configurations; when the configuration information of the second target scheduled task changes, it can be automatically updated synchronously, eliminating the need for users to frequently update and maintain the configuration information of scheduled tasks and reducing verification costs.
[0117] In some embodiments of this application, the configurable operation permissions for the above-mentioned task-related configuration information can be limited, restricting the operation to only personnel within the scope of their authority.
[0118] Figure 2 This diagram illustrates a flowchart of a method for verifying a timed task according to another embodiment of this application. Figure 2 As can be seen from this embodiment, firstly, a DB table is formed or updated. Specifically, task association configuration information is received, which includes task a in data center A and task b in data center B. The association relationship between task a in data center A and task b in data center B is determined to be correct. If correct, a task association record for task a in data center A and task b in data center B is generated and stored in the DB table. If incorrect, the association fails and the task association configuration information is received again.
[0119] In response to the verification request for the first target scheduled task, the DB table is read, the first target scheduled task and its associated second target scheduled task are identified in the DB table, and it is determined whether the second target scheduled task has been executed.
[0120] If the second target timed task is not executed, the current time is obtained, and the first trigger time is used as the starting trigger time. The first estimated trigger time, which is to be executed once, is determined according to the preset trigger rules. It is then determined whether the current time is earlier than the first estimated trigger time. If so, the verification result of the first target timed task is determined to be that there is no missed trigger; otherwise, the verification result of the first target timed task is determined to be that there is a missed trigger.
[0121] If the second target scheduled task has been executed, obtain the second trigger time of the first execution of the second target scheduled task in the associated computer room; and use the second trigger time as the starting trigger time, and determine a number of expected trigger times for the number of executions according to the preset trigger rules.
[0122] Determine whether the second trigger time is consistent with the earliest expected trigger time. If they are consistent, the verification result of the first target timed task is determined to be that there is no missed trigger. If they are inconsistent, further determine whether the second trigger time is later than the earliest expected trigger time and earlier than or equal to the latest expected trigger time. If so, the verification result of the first target timed task is determined to be that there is a missed trigger, and the number of missed triggers is further determined.
[0123] Figure 3 This diagram illustrates the structure of a timed task verification device according to an embodiment of the present application. The device 300 is disposed in a verification server and... Figure 3 As can be seen from this, the device 300 includes:
[0124] The generation unit 310 is used to generate task association records based on task association configuration information. The task association records represent the association between multiple scheduled tasks, which are of the same type and are deployed in different data centers.
[0125] For the same type of scheduled task, although the parameters of the scheduled task are different in different data centers, the business logic is consistent. Scheduled tasks include, but are not limited to, peer tasks, backup tasks, etc. Therefore, the same type of task in different data centers can be associated. When the source data center is unavailable, the task can be switched to another data center, so that the associated task in the other data center can continue to execute the interrupted task in the source data center. Here, the other data center is called the associated data center.
[0126] One difference between peer tasks and backup tasks is that peer tasks have the same business logic, but the task content may not be the same, while backup tasks have the same business logic and the same task content. Another difference between peer tasks and backup tasks is that their execution states are different.
[0127] If the source data center is data center A, and one of the scheduled tasks currently being executed is task a, and the associated data center is data center B, and data center B has a pre-configured task b, and tasks a and b are backup tasks for each other, with the business logic and task content of tasks a and b being consistent, if data center A fails and becomes unusable, task a is suspended. At this time, data center A is switched to data center B, allowing task b to start executing. In other words, tasks a and b do not execute simultaneously; only one of them, the task deployed in the source data center, is executed.
[0128] Peer-to-peer tasks refer to tasks within the same tier in different data centers that use the same protocol, have the same business logic, and the same functionality. Peer-to-peer tasks can be the same program or different programs. For example, if the source data center is data center A, and one of the scheduled tasks currently being executed is task a, and the associated data center is data center B, with task b pre-configured in data center B, and tasks a and b are peer-to-peer tasks, assuming that both tasks a and b are settlement tasks—task a settling orders submitted in Beijing and task b settling orders submitted in Shenzhen—then during data center switching can be performed with tasks a and b performing the same task content. During normal operation in each data center, task a in data center A and task b in data center B are executed independently.
[0129] In existing technologies, task information for each task is stored in different data centers. During data center switching, manual intervention is required to log into the scheduling and management interface of each data center, locate the associated task in each data center according to the task information of the target scheduled task, find the specific data center where the associated task is located, and then perform the data center switch. This manual switching method is time-consuming, labor-intensive, and has a high risk of errors.
[0130] In this application, task association records can be pre-formed based on task association configuration information. These records represent the association between multiple scheduled tasks of the same type, deployed in different data centers. Specifically, the task association records contain information about the scheduled tasks in each data center, as well as the associations between these scheduled tasks. The task association configuration information can be submitted by the user.
[0131] It should be noted that multiple related, or potentially related, scheduled tasks must be of the same type. Here, "type" refers to the tasks having identical business logic and functionality. Whether a task is a peer task or a backup task can be further configured as a task attribute.
[0132] When generating a task association record based on task association configuration information, the system can specifically receive or read task association configuration information. This information includes multiple pre-set scheduled tasks in specified data centers; that is, the user only needs to specify which scheduled task they wish to associate with. In some embodiments of this application, the associated task, i.e., the second target scheduled task, can be one. In other embodiments, there can be multiple second target scheduled tasks, one as the primary associated task and the others as backup associated tasks. This application does not impose any restrictions.
[0133] To facilitate staff operations, this application provides a unified front-end interface. This interface includes configuration interfaces for scheduled tasks in each data center, an execution result viewing interface, and a unified exit point for data modification and maintenance. This improves staff efficiency and reduces the risk of human error. The front-end interface allows access to pre-set scheduled tasks in multiple specified data centers. In this embodiment, the task association configuration information includes pre-set task a in data center A and pre-set task b in data center B.
[0134] This application can also perform verification within a unified integrated operation and maintenance interface for each data center, supporting verification via coding, thus providing more scalability for subsequent business processing. This application does not limit the above implementation method; it can be selected as needed.
[0135] This application is executed through a verification server, which can be set up in any one of multiple data centers and communicate with each of the other data centers separately.
[0136] After obtaining the task association configuration information, you can log in to the data center where the task to be associated is located to obtain the task information. Then, based on the obtained task information, a task association record is generated. Continuing with the above, taking task a in data center A and task b in data center B as an example, after determining task a and task b, you can log in to data center A to obtain the task information of task a, and log in to data center B to obtain the task information of task b, such as task name, task type, timing expression, and task ID, etc. In some embodiments of this application, the task information of each task also includes a unique identification ID. This identification ID can be a string of numbers generated based on time, so that the target timing task can be determined more quickly when reading the task association record later. It should be noted that the task information of task a and task b both contain an association identification field. This association identification field is unique and consistent for task a and task b, and can be used to identify and determine the association relationship between task a and task b.
[0137] Based on the task information of task a and task b, a task association record for task a and task b is formed. Specifically, after obtaining the task association configuration information, that is, after determining that the tasks to be associated are task a and task b, and after obtaining the task information of task a and task b, the association identification field of task a and task b can be obtained from the task information. Assuming that the association identification field of task a is aabb and the association identification field of task b is also aabb, the association identification fields of task a and task b are consistent, then task a and task b can be determined to be associated tasks, and a task association record for task a and task b can be formed. On the other hand, assuming that the association identification field of task a is aabb and the association identification field of task b is also bbaa, the association identification fields of task a and task b are inconsistent, then task a and task b can be determined to be unassociatable tasks, and an association error message can be returned, indicating that a task association record cannot be formed.
[0138] The task association records contain task information for each task in each data center, as well as the relationships between scheduled tasks in different data centers. These task association records can be compiled into a table, such as a data permissions table (Database table, DB table), which can be stored and continuously updated based on the task association records.
[0139] The reading unit 320 is used to read the task association record corresponding to the first target timed task in response to the verification request for the first target timed task.
[0140] When checking a primary target timed task, the task association record corresponding to the primary target timed task is found in the file formed above. The specific search method can be to search for the task information of the primary target timed task, such as the unique identification ID.
[0141] In some embodiments of this application, the first target timed task can be identified based on the task name and other information in the task information. In other embodiments of this application, the task can be identified based on its identity ID. Using the identity ID can help find the first target timed task more quickly and accurately.
[0142] The retrieval unit 330 is used to determine the second target timed task associated with the first target timed task based on the read task association record.
[0143] After determining the first target scheduled task, the second target scheduled task associated with it is determined based on the task association record of the first target scheduled task. Specifically, it can be searched in the relevant fields of the record of the first target scheduled task. For example, the second target scheduled task can be found in the backup task or peer task fields of the record of the first target scheduled task. Alternatively, it can be determined based on the association identification field. For example, if task a in data center A is the first target scheduled task and it has the association identification field aabb, a search is performed in the overall file formed by the task association record. In addition to task a in data center A, tasks with the association identification field aabb are found. Taking task b in data center B as an example, task b in data center B is the second target scheduled task.
[0144] The acquisition unit 340 is used to acquire the execution records of the first target timed task and the second target timed task.
[0145] After determining the first and second target scheduled tasks, the execution records of the first and second target scheduled tasks are obtained. These execution records include the execution start time, execution time for each task, execution content, execution result, etc. In some embodiments of this application, to prevent the inability to obtain execution records after a data center crash, the execution status of each scheduled task in each data center can be stored in a verification server. This way, regardless of which data center crashes, the execution status of each scheduled task can be obtained from the verification server.
[0146] Verification unit 350 is used to determine the verification result of the first target timed task based on the execution record.
[0147] The verification result of the first target scheduled task is determined based on the execution records of the first and second target scheduled tasks. For example, the verification result may include which data center the backup task or peer task of the first target scheduled task is located in; or the verification result may also include whether the first target scheduled task has been omitted. Specifically, the omission of the first target scheduled task can be determined based on the last execution time of the first target scheduled task, the first execution time of the second target scheduled task, and the timing expression of the first target scheduled task.
[0148] from Figure 3As can be seen, the device of this application pre-sets the association information of multiple data center timed tasks and generates task association records. Then, in response to the verification request for the first target timed task, it determines the second target timed task corresponding to the first target timed task based on the task association records, and determines the verification result of the first target timed task based on the execution records of the first and second target timed tasks. This application records the association of timed tasks in each data center to form task association records. When verifying the first target timed task, the second target timed task corresponding to the first target timed task can be quickly determined by querying the task association records. Thus, the verification result of the first target timed task can be determined by the execution status of the first and second target timed tasks. This application can quickly lock the second target timed task corresponding to the first target timed task without complex manual analysis and comparison, or maintaining a large amount of second target timed task information for each data center. This provides a reliable and accurate basis for data center switching. It is simple to operate, highly efficient in verification, and greatly reduces labor, economic and time costs. It also significantly improves the accuracy of the inspection results, especially meeting the verification needs of scenarios with heavy business volume, such as large-scale promotions.
[0149] In some embodiments of this application, in the above-described apparatus, the verification request is generated after a data center switching event, whereby the data center switching event is a switch from the source data center where the first target timed task is located to at least one associated data center where a second target timed task is located; the acquisition unit 340 is used to acquire the first trigger time of the last execution of the first target timed task in the source data center, and to acquire the execution status of the second target timed task in the associated data center; the verification unit 350 is used to determine the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task.
[0150] In some embodiments of this application, in the above-described apparatus, the preset triggering rule for the timed task is: the timed task is triggered at the expected triggering time, wherein the expected triggering time is determined based on the start triggering time, the preset triggering period, and the number of executions.
[0151] In some embodiments of this application, in the above-described apparatus, the acquisition unit 340 is used to determine whether the associated computer room has executed the second target timed task; if not, it acquires the current time; the verification unit 350 is used to take the first trigger time as the starting trigger time, and determine the first estimated trigger time with one execution time according to the preset trigger rules; if the current time is earlier than the first estimated trigger time, it is determined that the verification result of the first target timed task is that there is no missed trigger; if the current time is later than the first estimated trigger time, it is determined that the verification result of the first target timed task is that there is a missed trigger.
[0152] In some embodiments of this application, in the above-described apparatus, the acquisition unit 340 is used to acquire the second trigger time of the first execution of the second target timed task by the associated computer room when it is determined that the associated computer room has executed the second target timed task; the verification unit 350 is used to take the first trigger time as the starting trigger time and determine a number of expected trigger times for a number of executions according to a preset trigger rule; when it is determined that the second trigger time is consistent with the earliest expected trigger time, the verification result of the first target timed task is determined to be that there is no missed trigger; when it is determined that the second trigger time is later than the earliest expected trigger time and earlier than or equal to the latest expected trigger time, the verification result of the first target timed task is determined to be that there is a missed trigger.
[0153] In some embodiments of this application, in the above-described apparatus, the verification unit 350 is further configured to determine the number of missed triggers of the first target timed task based on several expected trigger times, a second trigger time, and the preset trigger rules of the timed task when the verification result of the first target timed task is determined to be a missed trigger.
[0154] In some embodiments of this application, in the above-described apparatus, the type of the first target timed task is a backup task; the verification unit 350 is further configured to determine the configuration enable status of the first target timed task and the second target timed task based on the task association configuration information; and determine the verification result of the first target timed task based on the matching of the configuration enable status with the execution record.
[0155] In some embodiments of this application, in the above-described apparatus, the verification unit 350 is further configured to determine that the verification result of the first target timed task is that there is a distribution error if the configuration enable status of the first target timed task is inconsistent with the execution record of the first target timed task and / or the configuration enable status of the second target timed task is inconsistent with the execution record of the second target timed task; and to determine that the verification result of the first target timed task is that there is no distribution error if the configuration enable status of the first target timed task is consistent with the execution record of the first target timed task and the configuration enable status of the second target timed task is consistent with the execution record of the second target timed task.
[0156] In some embodiments of this application, in the above-described apparatus, the verification unit 350 is further configured to perform the following steps to verify the task association configuration information before generating the task association record: determining the task logic of each scheduled task to be associated as indicated by the task association configuration information; determining the verification field of each scheduled task to be associated based on the task logic; determining that the verification is passed if the verification fields of each scheduled task to be associated are consistent, and then executing the step of generating the task association record based on the task association configuration information; determining that the verification is failed if the verification fields of at least two scheduled tasks to be associated are inconsistent, and then not executing the step of generating the task association record based on the task association configuration information.
[0157] It is understood that the above-mentioned timed task verification device can implement each step of the timed task verification method executed by the verification server provided in the foregoing embodiments. The relevant explanations of the timed task verification method are applicable to the timed task verification device, and will not be repeated here.
[0158] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0159] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0160] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0161] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a software package security verification mechanism at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0162] A task association record is generated based on the task association configuration information. The task association record represents the association between multiple scheduled tasks, which are of the same type and are deployed in different data centers.
[0163] In response to the verification request for the first target timed task, read the task association record corresponding to the first target timed task;
[0164] Determine the second target timed task associated with the first target timed task based on the read task association record;
[0165] Obtain the execution records of the first target timed task and the second target timed task;
[0166] The verification result of the first target timed task is determined based on the execution record.
[0167] The above is as stated in this application. Figure 3The method for executing the timing task verification device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0168] The electronic device can also perform Figure 3 The method for executing the verification device for timed tasks, and the implementation of the verification device for timed tasks in... Figure 3 The functions of the embodiments shown are not described in detail here.
[0169] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 3 The method executed by the timed task verification device in the illustrated embodiment is specifically used to perform:
[0170] A task association record is generated based on the task association configuration information. The task association record represents the association between multiple scheduled tasks, which are of the same type and are deployed in different data centers.
[0171] In response to the verification request for the first target timed task, read the task association record corresponding to the first target timed task;
[0172] Determine the second target timed task associated with the first target timed task based on the read task association record;
[0173] Obtain the execution records of the first target timed task and the second target timed task;
[0174] The verification result of the first target timed task is determined based on the execution record.
[0175] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0176] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0177] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0178] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0179] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0180] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0181] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0182] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0183] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0184] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for verifying scheduled tasks, wherein, This method is executed by the verification server and includes: A task association record is generated based on the task association configuration information. The task association record represents the association between multiple scheduled tasks, which are of the same type and are deployed in different data centers. In response to the verification request for the first target timed task, read the task association record corresponding to the first target timed task; Determine the second target timed task associated with the first target timed task based on the read task association record; Obtain the execution records of the first target timed task and the second target timed task; The verification result of the first target timed task is determined based on the execution record; The verification request is generated after a data center switching event occurs. The data center switching event is a switch from the source data center where the first target timed task is located to at least one associated data center where the second target timed task is located. The acquisition of the execution records of the first target timed task and the second target timed task includes: Obtain the first trigger time of the last execution of the first target timed task in the source data center, and obtain the execution status of the second target timed task in the associated data center; The verification result for determining the first target timed task based on the execution record includes: Based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task, the verification result of the first target timed task is determined.
2. The method according to claim 1, wherein, The preset triggering rules for the scheduled task are as follows: The scheduled task is triggered at the expected trigger time, wherein the expected trigger time is determined based on the start trigger time, the preset trigger period, and the number of executions.
3. The method according to claim 2, wherein, The step of obtaining the execution status of the second target scheduled task in the associated computer room includes: Determine whether the associated computer room has executed the second target scheduled task; if not, obtain the current time. The step of determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task includes: The first trigger time is used as the starting trigger time, and the first estimated trigger time for the number of executions is determined according to the preset trigger rules; If the current time is earlier than the first expected trigger time, then the verification result of the first target timed task is determined to be that there is no missed trigger; If the current time is later than the first expected trigger time, then the verification result of the first target timed task is determined to be a missed trigger.
4. The method according to claim 2, wherein, The step of obtaining the execution status of the second target scheduled task in the associated computer room includes: If it is determined that the associated data center has executed the second target timed task, obtain the second trigger time for the first execution of the second target timed task by the associated data center; The step of determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task includes: Using the first trigger time as the starting trigger time, a number of expected trigger times are determined according to the preset trigger rules, with each time the execution is performed a certain number of times. If the second trigger time is determined to be consistent with the earliest expected trigger time, the verification result of the first target timed task is determined to be that there is no missed trigger; If it is determined that the second trigger time is later than the earliest expected trigger time, but earlier than or equal to the latest expected trigger time, the verification result of the first target timed task is determined to be a missed trigger.
5. The method according to claim 4, wherein, The step of determining the verification result of the first target timed task based on the first trigger time, the execution status of the second target timed task, and the preset triggering rules of the timed task further includes: If the verification result of the first target timed task is determined to be an missed trigger, the number of missed triggers of the first target timed task is determined according to the several expected trigger times, the second trigger time, and the preset trigger rules of the timed task.
6. The method according to claim 1, wherein, The first target scheduled task is a backup task; The method further includes: Based on the task association configuration information, determine the configuration activation status of the first target timed task and the second target timed task; Based on the matching of the configuration activation status with the execution record, the verification result of the first target scheduled task is determined.
7. The method according to claim 6, wherein, The step of determining the verification result of the first target scheduled task based on the matching of the configuration activation status and the execution record includes: If the configuration enable status of the first target scheduled task is inconsistent with the execution record of the first target scheduled task and / or the configuration enable status of the second target scheduled task is inconsistent with the execution record of the second target scheduled task, then the verification result of the first target scheduled task is determined to be a distribution error. If the configuration enable status of the first target scheduled task matches the execution record of the first target scheduled task, and the configuration enable status of the second target scheduled task matches the execution record of the second target scheduled task, then the verification result of the first target scheduled task is determined to be that there is no distribution error.
8. The method according to any one of claims 1 to 7, wherein, The method further includes the following step of verifying the task association configuration information before generating the task association record: Determine the task logic of each scheduled task to be associated as indicated by the task association configuration information; Based on the task logic, determine the verification fields for each scheduled task to be associated. If the verification fields of all scheduled tasks to be associated are consistent, the verification is deemed successful, and the step of generating task association records based on task association configuration information is executed. If the verification fields of at least two scheduled tasks to be associated are inconsistent, the verification is determined to be unsuccessful, and the step of generating task association records based on task association configuration information will not be executed.
9. A device for verifying scheduled tasks, applied to a verification server, wherein, The apparatus is used to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data disaster recovery method and system, terminal equipment and computer storage medium
CN113590386A