Alarm method and device, storage medium and computer program product
By adjusting the alarm time and converting the current time, the problem of inaccurate alarms in cross-time zones is solved, and the accuracy of job alarms is improved.
Patent Information
- Application Number
- CN202411517185.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-07
AI Technical Summary
In the case where there are cross-time zones between the business system and the job instance, the prior art fails to accurately consider the impact of the order time, resulting in the alarm time being inaccurate enough, and false alarms occur.
By determining whether to adjust the original planned alarm time based on the planned time and the positional relationship between the original planned alarm time and the order time switching interval of the instance to be alerted, the current service system is adjusted based on the time difference between the business system and the target site and the start and end time of the daylight saving time, the current service system is adjusted based on the time difference between the business system and the target site and the start and end time of the daylight saving time. Time is converted into the actual local time of the target location, and determine whether the actual planned alarm time is greater than the actual local time to decide whether to implement the alarm.
Improves the accuracy of job alarms in cross-time zone situations, and overcomes the monitoring alarm error caused by time point comparison after simple time difference conversion.
Smart Images

Figure CN119271512A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an alarm method, device, storage medium and computer program product. Background Art
[0002] In the business system, users can set the scheduling method and alarm method of the job. When the job is not scheduled at the set time, an alarm will be issued according to the set alarm method.
[0003] However, the scheduling and alarm configuration methods of the job itself are relatively complex and involve the monitoring of time information.
[0004] In the prior art, when the business system and the job instance exist across time zones, the time conversion is usually performed based on the time difference between the two, without considering the impact of the command time, resulting in inaccurate calculated alarm time and thus false alarms.
[0005] In view of this, how to accurately issue alarms when business systems and job instances exist across time zones has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present invention provides an alarm method, device, storage medium and computer program product, which are used to solve the technical problem in the prior art that false alarms are prone to occur when a business system and an operation instance exist across time zones.
[0007] In the first aspect, in order to solve the above technical problems, a technical solution of an alarm method provided by an embodiment of the present invention is as follows:
[0008] Based on the positional relationship between the planned time of the instance to be alarmed and the originally planned alarm time and the command time switching interval, determine whether to adjust the originally planned alarm time; wherein the originally planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command time switching interval is the time period involved in the command time switching;
[0009] If it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time;
[0010] Based on the time difference between the business system and the target location, and the start and end time of the daylight saving time of the target location, the current time of the business system is converted into the actual local time of the current daylight saving time of the target location; wherein the business system is used to schedule and manage the business corresponding to the instance to be alarmed, the business is deployed at the target location, and the daylight saving time distribution of the target location includes the daylight saving time switching interval;
[0011] It is determined whether the actual planned alarm time is greater than the actual local time, and if so, an alarm is issued for the alarm instance; if so, no alarm is issued for the alarm instance.
[0012] A possible implementation manner is to determine whether to adjust the originally planned alarm time based on the planned time of the instance to be alarmed and the positional relationship between the originally planned alarm time and the command switching interval, including:
[0013] Determine whether at least one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, and determine whether the time period between the planned time and the originally planned alarm time spans the time switching interval; wherein the time switching interval includes the winter-summer interval and the summer-winter interval;
[0014] If both are negative, it is determined that there is no need to adjust the originally planned alarm time;
[0015] If one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, then the originally planned alarm time is adjusted;
[0016] If the planned time and the original planned alarm time are both within the time switching interval, determine whether the planned time and the original planned alarm time are both within the summer-winter interval. If so, do not adjust the original planned alarm time. If the planned time and the original planned alarm time are both within the winter-summer interval, adjust the original planned alarm time.
[0017] In a possible implementation manner, if one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, adjusting the originally planned alarm time includes:
[0018] If the planned time is within the winter-summer interval, the planned time is adjusted to the start time of the daylight saving time, and the original planned alarm time is recalculated according to the start time of the daylight saving time and the alarm duration threshold to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the daylight saving time;
[0019] If the planned time is within the summer-winter interval and the originally planned alarm time is after the summer-winter time point, or the time period spans the summer-winter interval, the originally planned alarm time is adjusted according to the adjustment time length corresponding to the originally planned alarm time and the summer-winter interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to the winter time; wherein the summer-winter time point is the time point when the summer time switches to the winter time;
[0020] If the originally planned alarm time is within the winter-summer interval, or the time period spans the winter-summer interval, the originally planned alarm time is adjusted according to the adjustment duration corresponding to the originally planned alarm time and the winter-summer interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to daylight saving time.
[0021] A possible implementation method, if the planned time and the originally planned alarm time are both within the winter-summer interval, adjusting the originally planned alarm time includes:
[0022] Adjusting the planned time to the start time of the daylight saving time;
[0023] The sum of the start time of the daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time, and the time to which the adjusted original planned alarm time belongs is the daylight saving time.
[0024] A possible implementation method, based on the time difference between the business system and the destination, and the start and end time of the daylight saving time of the destination, converting the current time of the business system into the actual local time of the current daylight saving time of the destination, includes:
[0025] Based on the time difference, convert the current time into the first local time of the target location, and simulate the first local time as the first local time of the current time at the location of the business system;
[0026] converting the first local time into a second local time which is a second time different from the first time; wherein one of the first time and the second time is summer time and the other is winter time;
[0027] According to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, the actual local time is determined to be the first local time or the second local time, and the actual time of the actual local time.
[0028] In a possible implementation manner, the first time is winter time, and according to the relationship between the first local time and the second local time and the start and end time of the summer time of the target location, determining that the actual local time is the first local time or the second local time, and the time that the actual local time actually falls in, includes:
[0029] Determine whether the first local time is less than the start time of the daylight saving time of the target location, and if so, determine the first local time as the actual local time, and the time in which the actual local time is the winter time;
[0030] If the first local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the second local time is less than the end time of the daylight saving time of the destination, and if so, determine the second local time as the actual local time, and the actual time of the actual local time is the daylight saving time;
[0031] If the second local time is greater than or equal to the end time of the summer time saving time of the target location, the second local time is determined as the actual local time, and the actual time saving time of the actual local time is winter time.
[0032] In a possible implementation manner, the first time is daylight saving time, and according to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, determining that the actual local time is the first local time or the second local time, and the time in which the actual local time is located, includes:
[0033] Determine whether the second local time is less than the start time of the summer time of the target location, and if so, determine the second local time as the actual local time, and the summer time in which the actual local time is located is winter time;
[0034] If the second local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the first local time is less than the end time of the daylight saving time of the destination, and if so, determine the first local time as the actual local time, and the time in which the actual local time is the daylight saving time;
[0035] If the first local time is greater than or equal to the end time of the summer time saving time of the target location, the first local time is determined as the actual local time, and the time in which the actual local time is located is winter time.
[0036] In a possible implementation manner, before converting the current time to the first local time of the destination, the method further includes:
[0037] The actual current time of the business system is subtracted from the preset minutes to obtain the current time; wherein the preset minutes are set by the business system to compensate for the time consumed in information transmission when managing alarm instances across time zones.
[0038] In a possible implementation manner, determining whether the actual planned alarm time is greater than the actual local time includes:
[0039] Determine whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether the actual planned alarm time and the actual local time are both configured with seasonal information;
[0040] If it is determined not to terminate the judgment, then judging whether the actual planned alarm time and the actual local time are in the same year;
[0041] If the actual planned alarm time and the actual local time are in different years, the size relationship between the actual planned alarm time and the actual local time is determined according to the size relationship between the year in which the actual planned alarm time is located and the year in which the actual local time is located;
[0042] If the actual planned alarm time and the actual local time are in the same year, determining whether the actual planned alarm time and the actual local time are the same;
[0043] If the actual planned alarm time is the same as the actual local time, then determining whether the actual planned alarm time after removing the year is greater than the actual local time after removing the year;
[0044] If the actual planned alarm time is different from the respective time zones of the actual local time, the relationship between the actual planned alarm time and the actual local time is determined based on the respective time zones of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of daylight saving time at the target location.
[0045] In a possible implementation manner, determining whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether both the actual planned alarm time and the actual local time are configured with seasonal information, includes:
[0046] If the actual planned alarm time is different from the time zone where the actual local time is located, then the determination is terminated;
[0047] If the actual planned alarm time and the actual local time are in the same time zone, but at least one of the actual planned alarm time and the actual local time is not configured with the time information, the determination is terminated.
[0048] A possible implementation manner is to determine the size relationship between the actual planned alarm time and the actual local time according to the respective summer time of the actual planned alarm time and the actual local time, and the size relationship between the actual planned alarm time or the actual local time and the start and end time of the daylight saving time of the target location, including:
[0049] If the time when the actual local time is summer time and the time when the actual planned alarm is winter time, determine whether the actual planned alarm time is greater than the start time of summer time at the target location, and if so, determine that the actual planned alarm time is less than or equal to the actual local time; if not, determine that the actual planned alarm time is greater than the actual local time;
[0050] If the actual local time is winter time and the actual planned alarm time is summer time, determine whether the actual local time is greater than the end time of summer time at the target location. If so, determine that the actual planned alarm time is less than the actual local time; if not, determine that the actual planned alarm time is greater than or equal to the actual local time.
[0051] In a possible implementation manner, before determining whether to adjust the originally planned alarm time based on the planned time of the instance to be alarmed and the positional relationship between the originally planned alarm time and the command time switching interval, the method further includes:
[0052] Periodically scan the latest job instance table in the business system, and obtain the job instance with alarm configuration and whose job status has not reached a preset status from the latest job instance table as the instance to be alarmed;
[0053] Obtain and parse the object static configuration information of the instance to be alarmed to obtain the planned time and the alarm duration threshold; wherein the object static configuration information is used to configure the scheduling plan and alarm plan of the job corresponding to the instance to be alarmed.
[0054] In a possible implementation manner, the job includes multiple scheduling plans, and the multiple scheduling plans have different scheduling times; the scheduling time of the scheduling plan corresponding to the instance to be alarmed is used as the planned time;
[0055] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are the same, the same threshold is used in the static configuration information of the object to indicate the time lengths corresponding to the multiple scheduling plans; the threshold of the alarm plan corresponding to the instance to be alarmed is used as the alarm duration threshold, and the threshold is less than or equal to 7 days;
[0056] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are different, different thresholds are used in the object static configuration information to indicate the time lengths corresponding to different scheduling plans.
[0057] In a possible implementation manner, after acquiring and parsing the static configuration information of the object of the instance to be alarmed and obtaining the planned time and the alarm duration threshold, the method further includes:
[0058] Determine whether the total number of the plurality of scheduling plans is greater than the total number of thresholds included in the object static configuration information, and the total number of thresholds included in the object static configuration information is greater than 1;
[0059] If yes, it is determined that there is a configuration error in the static configuration information of the object, and it is indicated that an alarm cannot be issued for the instance to be alarmed.
[0060] In a second aspect, an embodiment of the present invention provides an alarm device, including:
[0061] A determination unit, configured to determine whether to adjust the originally planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the originally planned alarm time and the command switching interval; wherein the originally planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command switching interval is the time period involved in the command switching; if it is determined to adjust the originally planned alarm time, the adjusted originally planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the originally planned alarm time, the originally planned alarm time is used as the actual planned alarm time;
[0062] a conversion unit, configured to convert the current time of the business system into the actual local time of the current summer time of the target location based on the time difference between the business system and the target location, and the start and end time of the summer time of the target location; wherein the business system is used to schedule and manage the business corresponding to the instance to be alarmed, the business is deployed at the target location, and the summer time distribution of the target location includes the summer time switching interval;
[0063] The processing unit is used to determine whether the actual planned alarm time is greater than the actual local time, and if so, to implement an alarm for the alarm instance; if so, not to implement an alarm for the alarm instance.
[0064] In a possible implementation manner, the determining unit is further configured to:
[0065] Determine whether at least one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, and determine whether the time period between the planned time and the originally planned alarm time spans the time switching interval; wherein the time switching interval includes the winter-summer interval and the summer-winter interval;
[0066] If both are negative, it is determined that there is no need to adjust the originally planned alarm time;
[0067] If one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, then the originally planned alarm time is adjusted;
[0068] If the planned time and the original planned alarm time are both within the time switching interval, determine whether the planned time and the original planned alarm time are both within the summer-winter interval. If so, do not adjust the original planned alarm time. If the planned time and the original planned alarm time are both within the winter-summer interval, adjust the original planned alarm time.
[0069] In a possible implementation manner, if one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, the determining unit is further configured to:
[0070] If the planned time is within the winter-summer interval, the planned time is adjusted to the start time of the daylight saving time, and the original planned alarm time is recalculated according to the start time of the daylight saving time and the alarm duration threshold to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the daylight saving time;
[0071] If the planned time is within the summer-winter interval and the originally planned alarm time is after the summer-winter time point, or the time period spans the summer-winter interval, the originally planned alarm time is adjusted according to the adjustment time length corresponding to the originally planned alarm time and the summer-winter interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to the winter time; wherein the summer-winter time point is the time point when the summer time switches to the winter time;
[0072] If the originally planned alarm time is within the winter-summer interval, or the time period spans the winter-summer interval, the originally planned alarm time is adjusted according to the adjustment duration corresponding to the originally planned alarm time and the winter-summer interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to daylight saving time.
[0073] In a possible implementation manner, if the planned time and the originally planned alarm time are both within the winter-to-summer interval, the determining unit is further configured to:
[0074] Adjusting the planned time to the start time of the daylight saving time;
[0075] The sum of the start time of the daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time, and the time to which the adjusted original planned alarm time belongs is the daylight saving time.
[0076] In a possible implementation manner, the conversion unit is specifically used for:
[0077] Based on the time difference, convert the current time into the first local time of the target location, and simulate the first local time as the first local time of the current time at the location of the business system;
[0078] converting the first local time into a second local time which is a second time different from the first time; wherein one of the first time and the second time is summer time and the other is winter time;
[0079] According to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, the actual local time is determined to be the first local time or the second local time, and the actual time of the actual local time.
[0080] In a possible implementation manner, the first time is winter time, and the conversion unit is further used for:
[0081] Determine whether the first local time is less than the start time of the daylight saving time of the target location, and if so, determine the first local time as the actual local time, and the actual time of the actual local time is winter time;
[0082] If the first local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the second local time is less than the end time of the daylight saving time of the destination, and if so, determine the second local time as the actual local time, and the actual time of the actual local time is the daylight saving time;
[0083] If the second local time is greater than or equal to the end time of the summer time saving time of the target location, the second local time is determined as the actual local time, and the actual time saving time of the actual local time is winter time.
[0084] In a possible implementation manner, the first time is daylight saving time, and the conversion unit is further used for:
[0085] Determine whether the second local time is less than the start time of the summer time of the target location, and if so, determine the second local time as the actual local time, and the summer time in which the actual local time is located is winter time;
[0086] If the second local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the first local time is less than the end time of the daylight saving time of the destination, and if so, determine the first local time as the actual local time, and the time in which the actual local time is the daylight saving time;
[0087] If the first local time is greater than or equal to the end time of the summer time saving time of the target location, the first local time is determined as the actual local time, and the time in which the actual local time is located is winter time.
[0088] In a possible implementation manner, the conversion unit is further used for:
[0089] Before converting the current time to the first local time of the target location, the actual current time of the business system is subtracted from the preset minutes to obtain the current time; wherein the preset minutes are set by the business system to compensate for the time consumed in information transmission when managing alarm instances across time zones.
[0090] In a possible implementation manner, the processing unit is further configured to:
[0091] Determine whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether the actual planned alarm time and the actual local time are both configured with seasonal information;
[0092] If it is determined not to terminate the judgment, then judging whether the actual planned alarm time and the actual local time are in the same year;
[0093] If the actual planned alarm time and the actual local time are in different years, the size relationship between the actual planned alarm time and the actual local time is determined according to the size relationship between the year in which the actual planned alarm time is located and the year in which the actual local time is located;
[0094] If the actual planned alarm time and the actual local time are in the same year, determining whether the actual planned alarm time and the actual local time are the same;
[0095] If the actual planned alarm time is the same as the actual local time, then determining whether the actual planned alarm time after removing the year is greater than the actual local time after removing the year;
[0096] If the actual planned alarm time is different from the respective time zones of the actual local time, the relationship between the actual planned alarm time and the actual local time is determined based on the respective time zones of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of daylight saving time at the target location.
[0097] In a possible implementation manner, the processing unit is further configured to:
[0098] If the actual planned alarm time is different from the time zone where the actual local time is located, then the determination is terminated;
[0099] If the actual planned alarm time and the actual local time are in the same time zone, but at least one of the actual planned alarm time and the actual local time is not configured with the time information, the determination is terminated.
[0100] In a possible implementation manner, the processing unit is further configured to:
[0101] If the time when the actual local time is summer time and the time when the actual planned alarm is winter time, determine whether the actual planned alarm time is greater than the start time of summer time at the target location, and if so, determine that the actual planned alarm time is less than or equal to the actual local time; if not, determine that the actual planned alarm time is greater than the actual local time;
[0102] If the actual local time is winter time and the actual planned alarm time is summer time, determine whether the actual local time is greater than the end time of summer time at the target location. If so, determine that the actual planned alarm time is less than the actual local time; if not, determine that the actual planned alarm time is greater than or equal to the actual local time.
[0103] In a possible implementation manner, the device further includes an early preparation unit, and the early preparation unit is used to:
[0104] Based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the time switching interval, before determining whether to adjust the original planned alarm time, regularly scan the latest job instance table in the business system, and obtain the job instance with alarm configuration and whose job status has not reached the preset status from the latest job instance table as the instance to be alarmed;
[0105] Obtain and parse the object static configuration information of the instance to be alarmed to obtain the planned time and the alarm duration threshold; wherein the object static configuration information is used to configure the scheduling plan and alarm plan of the job corresponding to the instance to be alarmed.
[0106] In a possible implementation manner, the job includes multiple scheduling plans, and the multiple scheduling plans have different scheduling times; the scheduling time of the scheduling plan corresponding to the instance to be alarmed is used as the planned time;
[0107] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are the same, the same threshold is used in the static configuration information of the object to indicate the time lengths corresponding to the multiple scheduling plans; the threshold of the alarm plan corresponding to the instance to be alarmed is used as the alarm duration threshold, and the threshold is less than or equal to 7 days;
[0108] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are different, different thresholds are used in the object static configuration information to indicate the time lengths corresponding to different scheduling plans.
[0109] In a possible implementation manner, the preparatory unit is further used for:
[0110] Obtain and parse the object static configuration information of the instance to be alarmed, and after obtaining the planned time and the alarm duration threshold, determine whether the total number of the multiple scheduling plans is greater than the total number of thresholds included in the object static configuration information, and the total number of thresholds included in the object static configuration information is greater than 1;
[0111] If yes, it is determined that there is a configuration error in the static configuration information of the object, and it is indicated that an alarm cannot be issued for the instance to be alarmed.
[0112] In a third aspect, an embodiment of the present invention further provides an alarm device, including:
[0113] at least one processor, and
[0114] a memory coupled to the at least one processor;
[0115] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in the first aspect above by executing the instructions stored in the memory.
[0116] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, including:
[0117] Memory,
[0118] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method described in the first aspect above.
[0119] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a program code. When a computer runs the computer program, the program code executes the alarm method as described in the first aspect.
[0120] Through the technical solutions in one or more of the above embodiments of the embodiments of the present invention, the embodiments of the present invention have at least the following technical effects:
[0121] In the embodiment provided by the present invention, whether to adjust the original planned alarm time is determined based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command switching interval; wherein the original planned alarm time is the sum of the planned time and the alarm duration threshold of the instance to be alarmed, and the command switching interval is the time period involved in the command switching; if it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time; based on the time difference between the business system and the target location, and the start and end time of the daylight saving time of the target location, the current time of the business system is converted into the actual local time of the current command time of the target location; it is determined whether the actual planned alarm time is greater than the actual local time, if not, an alarm is issued to the alarm instance, and if yes, no alarm is issued to the alarm instance. The above scheme fully considers the impact of time switching on the actual alarm time when the business system and the job instance exist across time zones, thereby improving the accuracy of the job alarm with the picking time, and overcoming the monitoring alarm error caused by simply comparing the time points after simply converting the time points according to the time difference as in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0122] Figure 1 A flowchart of an alarm method is provided for an embodiment of the present invention;
[0123] Figure 2 A schematic diagram of the time distribution in the northern hemisphere provided by an embodiment of the present invention;
[0124] Figure 3A schematic diagram of the time distribution in the southern hemisphere provided by an embodiment of the present invention;
[0125] Figure 4 A schematic diagram of an embodiment of the present invention in which both the planned time and the originally planned alarm time are outside the time switching interval;
[0126] Figure 5 and Figure 6 A schematic diagram of the positional relationship between a time period corresponding to a planned time and an original planned alarm time and a time switching interval provided by an embodiment of the present invention;
[0127] Figure 7 A schematic diagram of the structure of an alarm device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0128] The present invention provides an alarm method, device, storage medium and computer program product to solve the technical problem of false alarms in the prior art when the business system and the operation instance are across time zones. The acquisition, storage, use and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0129] In order to better understand the above technical scheme, the technical scheme of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0130] In order to enable those skilled in the art to fully understand this solution, the following is a brief introduction to the commands related to this solution:
[0131] Winter time usually refers to the standard time used in the local area, that is, the state where no time adjustment is made. Summer time, also known as daylight saving time, is the practice of setting the time forward one hour to take advantage of the extra sunlight in the summer. In areas that use daylight saving time, clocks are set forward one hour in the summer and set back to standard time in the winter.
[0132] Taking the Central European Time (CET) time information as an example, the system records the summer time of the CET time zone this year as [2:00 on March 31, 2024, 2:00 on October 27, 2024]. In fact, at 2:00 on March 31, 2024 (i.e. the winter-to-summer time point), the local time will instantly switch to 3:00 on March 31, 2024; at 2:00 on October 27, 2024 (i.e. the summer-to-winter time point), the local time will instantly switch to 1:00 on October 27, 2024. It can be seen that the time point has a great impact on the season switching. Specifically, winter-to-summer will skip one hour, that is, the time points within the one hour on the day of switching do not exist; summer-to-winter will go back one hour, that is, the time points of the one hour back will be repeated. In the northern hemisphere, daylight saving time is generally from April to September; in the southern hemisphere, daylight saving time is generally from October to March.
[0133] In the financial system, when the business system schedules, monitors, and manages jobs, it configures the scheduling mode and alarm mode of the job through the static configuration information of the object corresponding to the job. Based on the planned time and alarm mode of the scheduled job, it determines that the job will be timed out when the planned time is not called. Scheduling methods include cyclic calling, fixed-point calling, and calling based on other jobs. When configuring the alarm mode, the timeout alarm can be based on the planned start time + threshold, or based on the planned end time + threshold; the planned time includes the planned start time and the planned end time.
[0134] Each time a job is scheduled, it is instantiated and a corresponding job instance is generated. The alarm time of the job instance is determined based on the planned time and threshold corresponding to the job instance. When the current time of the business system reaches the alarm time, an alarm is issued for the job instance.
[0135] The inventor discovered that when the time zone where the current time of the business system is located (i.e., the time zone where the equipment installed with the business system is located) is different from the time zone where the operation is implemented (i.e., the time zone where the equipment installed with the operation is located), static time conversion is only performed based on their time difference and the information in the static configuration information of the object. The impact of the command time on the above time conversion cannot be taken into account, resulting in errors in the alarm and then false alarms.
[0136] In order to solve the above problems, the present invention provides an alarm method, device, storage medium and computer program product, which are specifically implemented as follows:
[0137] Please refer to Figure 1 , an embodiment of the present invention provides a flowchart of an alarm method, and the processing process of the method is as follows.
[0138] Step 101: Determine whether to adjust the original planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command time switching interval; wherein the original planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command time switching interval is the time period involved in the command time switching;
[0139] Step 102: if it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time;
[0140] It should be understood that, since the passage of time always moves forward and never moves backward, in the present invention, the planned time must be before the original planned alarm time, that is, the planned time < the original planned alarm time.
[0141] In some embodiments, before determining whether to adjust the original planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command time switching interval, the method further includes:
[0142] Regularly scan the latest job instance table in the business system, and obtain job instances with alarm configuration and whose job status has not reached the preset status from the latest job instance table as instances to be alarmed;
[0143] Obtain and parse the object static configuration information of the instance to be alarmed, and obtain the planned time and alarm duration threshold; wherein the object static configuration information is used to configure the scheduling plan and alarm plan of the job corresponding to the instance to be alarmed.
[0144] The latest job instance table stores the job instances corresponding to the job or job flow. The job instance will change its job status based on whether the configured conditions are met, whether the conditions of the job flow are met, etc., such as changing from the never ready state to the ready state. The job instance will also change from the ready state to the running state based on whether the resources are available, and from the intermediate state to the result state based on the completion status of the job instance.
[0145] Therefore, the latest job instance table can be scanned regularly to select job instances with alarm configuration (i.e., the alarm method is configured) and whose job status reaches the preset status as instances to be alarmed; wherein the preset status includes that the job instance has not reached the ready state or has not reached the final state, and the state not reaching the ready state includes not ready, waiting for resources, and waiting for rerun, and the state not reaching the final state includes not ready, waiting for resources, waiting for rerun, ready, and running.
[0146] Each job has corresponding object static configuration information, which includes the business date and offset value of the job, at least one scheduling plan and an alarm plan for the scheduling plan. The scheduling plan includes the planned time of the scheduled business, and the alarm plan includes a threshold. The actual business date of the business can be determined based on the business date and the offset value, and the alarm time for implementing an alarm after the job instance corresponding to the job is not scheduled at the planned time can be determined based on the planned time and the threshold.
[0147] For example, if the business date is 20240710 and the offset value (in days) is -1, the actual business date is calculated by subtracting the offset value from the business date, 20240710-1=20240709, so the actual scheduling date is July 9, 2024. If the business is only called once on July 9, 2024, that is, there is one scheduling plan, assuming that the business is called at 3:00 on July 9, 2024, and the threshold is 2 hours, then the planned time (i.e., scheduling time) is 3:00 on July 9, 2024, and the corresponding original alarm time is 5:00 on July 9, 2024.
[0148] In some embodiments, a job has multiple batches under the same business date, that is, there are multiple scheduling plans under the same business date. The job will be instantiated into multiple job instances based on the batch number. The batch number of the job instance can be expressed as [x, N], where N represents the total number of batches included in the job, and x represents that the job instance is the xth batch among N batches. Each scheduling plan is configured with a corresponding planned time (i.e., scheduling time) and a corresponding threshold. If the thresholds corresponding to multiple scheduling plans are the same, one threshold can be used to represent it in the object static configuration information of the job; if the thresholds corresponding to multiple scheduling plans (i.e., the length of time between the scheduling time and the alarm time) are different, different thresholds can be used to represent it in the object static configuration information of the job. Usually, in the banking system, the threshold is less than or equal to 7 days, so the alarm duration threshold is ≤7 days and is a positive number.
[0149] The scheduled time and threshold of each job instance corresponding to the job can be parsed based on the static configuration information of the job object.
[0150] In some embodiments, after obtaining and parsing the static configuration information of the object of the alarm instance to be issued, and obtaining the planned time and the alarm duration threshold, the error scenario can also be intercepted in the following ways:
[0151] Determine whether the total number of the plurality of scheduling plans is greater than the total number of thresholds included in the static configuration information of the object, and whether the total number of thresholds included in the static configuration information of the object is greater than 1;
[0152] If yes, it is determined that there is a configuration error in the static configuration information of the object, and it is indicated that an alarm cannot be issued for the instance to be alarmed.
[0153] Since a job may have multiple job instances in the object static configuration information of the job, and the multiple job instances may each be configured with a corresponding threshold, or may share a threshold. Therefore, if a job has multiple job instances, but the thresholds contained in the object static configuration information are multiple and less than the total number of the multiple job instances, it means that some job instances are not configured with corresponding thresholds. Therefore, it can be determined that the threshold configuration in the object static configuration information is unreasonable, there is a configuration error, and the alarm cannot be issued. At this time, an indication that the alarm instance cannot be issued can be returned, such as returning a null value (NULL). In the subsequent alarm processing, this business will not be processed, thereby avoiding the subsequent transcoding process of the relevant time required for the alarm of the job instance corresponding to the job, thereby avoiding wasting resources on job instances that cannot actually be alarmed.
[0154] In some embodiments, based on the positional relationship between the planned time of the instance to be alarmed and the originally planned alarm time and the command switching interval, determining whether to adjust the originally planned alarm time can be achieved in the following manner:
[0155] Determine whether at least one of the planned time and the original planned alarm time is within the time switching interval, and the original planned alarm time is not within the summer-winter interval, and determine whether the time period between the planned time and the original planned alarm time spans the time switching interval; wherein the time switching interval includes the winter-summer interval and the summer-winter interval;
[0156] If both are negative, it is determined that there is no need to adjust the originally planned alarm time;
[0157] If one of the planned time and the original planned alarm time is within the time switching interval, and the original planned alarm time is not within the summer-winter interval, or the time period between the planned time and the original planned alarm time spans the time switching interval, the original planned alarm time is adjusted;
[0158] If the planned time and the original planned alarm time are both within the time switching interval, determine whether the planned time and the original planned alarm time are both within the summer-winter interval. If so, do not adjust the original planned alarm time. If the planned time and the original planned alarm time are both within the winter-summer interval, adjust the original planned alarm time.
[0159] See also Figure 2 A schematic diagram of time distribution in the northern hemisphere provided in an embodiment of the present invention.
[0160] The time distribution of the northern hemisphere is: winter time (last year) - summer time - winter time (this year). When the end time of last year's winter time is reached, the local time will be set forward by 1 hour and directly set to the start time of this year's summer time to realize the switch from winter time to summer time. Since the switch from last year's winter time to this year's summer time is made, it jumps directly from the end time of last year's winter time to the start time of this year's summer time. There is a difference of 1 hour between the end time of last year's winter time and the start time of this year's summer time. This 1 hour time point does not actually exist. This 1 hour is recorded in the present invention. It is the winter-to-summer interval; when the end time of this year's summer time is reached, the local time will be regressed 1 hour and directly set to the start time of this year's winter time to realize the switch from this year's summer time to this year's winter time. Since when this year's summer time is switched to this year's winter time, it is directly regressed 1 hour from the end time of this year's summer time to the start time of this year's winter time. Since this regressed 1 hour is repeated in time with the last 1 hour of data of this year's summer time, in the present invention, the 1 hour involved in the switch from this year's summer time to this year's winter time is recorded as the summer-to-winter interval. The above summer-to-winter interval and winter-to-summer interval can both be called time switching intervals.
[0161] See also Figure 3 A schematic diagram of the time distribution of the southern hemisphere provided in an embodiment of the present invention. Since the seasons in the southern hemisphere are opposite to those in the northern hemisphere, the time distribution is opposite, but both the southern hemisphere and the northern hemisphere include summer time and winter time, and both need to switch between winter time and summer time. Therefore, based on a division method similar to the time switching interval in the northern hemisphere, the time switching interval in the southern hemisphere also includes a summer-winter interval and a winter-summer interval.
[0162] Since the accuracy of the original planned alarm time may be affected only when the planned time and the original planned alarm time involve the command switching interval, it can be determined whether to adjust the original planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command switching interval.
[0163] Take the time distribution in the Northern Hemisphere as an example (the processing method in the Southern Hemisphere is similar to that in the Northern Hemisphere, so I won’t go into details). Figure 4 It is a schematic diagram showing that a planned time and an originally planned alarm time provided by an embodiment of the present invention are both outside the time switching interval.
[0164] Figure 4Among them, the corresponding planned time and the original planned alarm time of ① are both in last year, the corresponding planned time and the original planned alarm time are respectively in last year and this year, the corresponding planned time and the original planned alarm time are both in last year's winter time but do not involve the winter-to-summer interval, the corresponding planned time and the original planned alarm time are both in this year's summer time but do not involve the winter-to-summer interval and the summer-to-winter interval, the corresponding planned time and the original planned alarm time are both in this year's winter time but do not involve the summer-to-winter interval, the corresponding planned time and the original planned alarm time are both in this year's winter time but do not involve the summer-to-winter interval, the corresponding planned time and the original planned alarm time are respectively in this year and next year, and the corresponding planned time and the original planned alarm time are both in next year. Therefore Figure 4 ①~⑦ in the table are all outside the time switching interval and are in the same time (that is, their corresponding time periods do not cross the time switching interval). Time switching will not affect Figure 4 ①~⑦ in the figure correspond to the original planned alarm time respectively, so there is no need to adjust the original planned alarm time, nor the command time to which the original planned alarm time belongs. The original planned alarm time can be directly used as the actual planned alarm time, and the command time to which the original planned alarm time belongs can be used as the command time to which the actual alarm time belongs.
[0165] See also Figure 5 and Figure 6 A schematic diagram of the positional relationship between the time period corresponding to the planned time and the original planned alarm time and the time switching interval provided in an embodiment of the present invention.
[0166] Since at least one of the planned time and the original planned alarm time is within the time switching interval, the original planned alarm time may be affected by the time switching. Specifically, the following methods can be used to determine which original planned alarm time is affected by the time switching and needs to be adjusted:
[0167] Since the time point of the winter-summer switching interval does not actually exist, any of the planned time and the original planned alarm time (such as Figure 5 ②, Figure 6 ④ in the figure) or both fall into the winter-summer interval (as shown in Figure 5 ), or the time period corresponding to the planned time and the original planned alarm time (such as Figure 6 If the winter-summer interval is crossed, the original planned alarm time will be affected and the original planned alarm time needs to be adjusted.
[0168] Since the time point of the summer-winter interval actually exists, if the planned alarm time and the original planned alarm time both fall into the summer-winter interval (such as Figure 5 ③ in the figure), or the planned time falls on summer time and the original planned alarm time falls on the summer-winter interval (such as Figure 6⑥, that is, the original planned alarm time falls into the winter-to-summer interval), it will not affect the original planned alarm time, and there is no need to adjust the original planned alarm time at this time; if the planned time falls into the summer-to-winter interval and the original planned alarm time is after the summer-to-winter interval (such as Figure 6 ⑧), or the time period between the planned time and the original planned alarm time (such as Figure 6 ⑦) in the figure spans the summer-winter time interval. Since the switch from summer time to winter time will be retraced by 1 hour, the originally planned alarm time will be affected and needs to be adjusted.
[0169] Therefore, if one of the planned time and the original planned alarm time is within the order switching interval, and the original planned alarm time is not within the summer-winter interval; or the time period between the planned time and the original planned alarm time spans the order switching interval, then the original planned alarm time needs to be adjusted; if both the planned time and the original planned alarm time are within the winter-summer interval, then the original planned alarm time also needs to be adjusted, and if both the planned time and the original planned alarm time are within the summer-winter interval, then the original planned alarm time does not need to be adjusted.
[0170] In the embodiment provided by the present invention, by judging whether at least one of the planned time and the original planned alarm time is located in the time switching interval, and the original planned alarm time is not in the summer-winter interval; and judging whether the time period between the planned time and the original planned alarm time crosses the time switching interval, if both are no, it is determined that there is no need to adjust the original planned alarm time; if one of the planned time and the original planned alarm time is located in the time switching interval, and the original planned alarm time is not in the summer-winter interval, or the time period crosses the time switching interval, the original planned alarm time is adjusted; if both the planned time and the original planned alarm time are located in the time switching interval, it is judged whether both the planned time and the original planned alarm time are located in the summer-winter interval, if yes, the original planned alarm time is not adjusted, and if both the planned time and the original planned alarm time are located in the winter-summer interval, the original planned alarm time is adjusted. It is possible to quickly determine whether the original planned alarm time needs to be adjusted, and then adjust the original planned alarm time that needs to be adjusted, thereby improving the efficiency of determining the actual planned alarm time.
[0171] In some embodiments, if one of the planned time and the original planned alarm time is within the time switching interval, and the original planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, the original planned alarm time is adjusted, which can be achieved by:
[0172] If the planned time is within the winter-summer interval, the planned time is adjusted to the start time of daylight saving time, and the original planned alarm time is recalculated according to the start time of daylight saving time and the alarm duration threshold to obtain the adjusted original planned alarm time. The adjusted original planned alarm time belongs to daylight saving time.
[0173] like Figure 5 The planned time shown in ② is within the winter-to-summer interval, and the original planned alarm time is within the daylight saving time. Since the time points within the winter-to-summer interval do not exist, the planned time needs to be adjusted to the start time of the daylight saving time. In this way, the sum of the start time of the daylight saving time and the alarm duration threshold is the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the daylight saving time.
[0174] If the planned time is within the summer-to-winter interval and the original planned alarm time is after the summer-to-winter time point, or the time period between the planned time and the original planned alarm time spans the summer-to-winter interval, the original planned alarm time is adjusted according to the adjustment time corresponding to the original planned alarm time and the summer-to-winter interval to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the winter time; the summer-to-winter time point is the time point when the summer time switches to the winter time; if Figure 6 As shown in ⑧, the planned time is in the summer-winter interval, and the original planned alarm time is in winter time, or Figure 6 The time period between the planned time shown in ⑦ and the original planned alarm time spans the summer-winter interval. Since the time points in the summer-winter interval actually exist and there are repeated 1 hours, the adjustment time corresponding to the summer-winter interval is -1 hour. The original planned alarm time -1 hour can be used to obtain the adjusted original planned alarm time. The adjusted original planned alarm time is winter time.
[0175] If the original planned alarm time is within the winter-summer interval, or the time period between the planned time and the original planned alarm time spans the winter-summer interval, the original planned alarm time is adjusted according to the adjustment time corresponding to the original planned alarm time and the winter-summer interval to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to daylight saving time.
[0176] like Figure 6 As shown in ④, the original planned alarm time is within the winter-summer interval, and the planned time is in winter time, or as Figure 6 As shown in ⑤, the time period between the planned time and the original planned alarm time spans the winter-summer interval. Since the switch from winter time to summer time is to directly increase the end time of winter time by 1 hour to obtain the start time of summer time, the time points in the winter-summer interval do not exist. Therefore, the original planned alarm time needs to be increased by 1 hour to obtain the adjusted original planned alarm time. The adjusted original planned alarm time belongs to the summer time.
[0177] In the embodiment provided by the present invention, when one of the planned time and the original planned alarm time is located in the command time switching interval and the original planned alarm time is not in the summer-winter interval, or the time period between the planned time and the original planned alarm time spans the command time switching interval, by analyzing the impact of the command time switching interval on the planned time, the original planned alarm time, and the time period between the planned time and the original planned alarm time, it is possible to quickly determine how to adjust the original planned alarm time and the command time to which it belongs, thereby improving the efficiency of determining the adjusted original planned alarm time.
[0178] In some embodiments, if the planned time and the original planned alarm time are both within the winter-summer interval, the original planned alarm time is adjusted, which can be achieved by:
[0179] Adjust the scheduled time to the start time of daylight saving time;
[0180] The sum of the start time of the daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time, and the time to which the adjusted original planned alarm time belongs is the daylight saving time.
[0181] Since the time points in the winter-summer interval do not exist, the planned time and the original planned alarm time are both within the winter-summer interval, which means that the corresponding job instance will not actually be called up, and the alarm corresponding to the job instance will not actually take effect. Therefore, the planned time needs to be adjusted to the start time of daylight saving time, and then the sum of the start time of daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time. The adjusted original planned alarm time is daylight saving time.
[0182] For the convenience of programming, the above method of determining the adjusted original planned alarm time can also have other combinations or expressions under the guidance of the above scheme. For example, the planned time can be divided according to the relationship between the planned time and other major time nodes, and each division can be further subdivided, as follows:
[0183] 1. The year of [Plan Time] is last year or before
[0184] The alarm time of the current instance is calculated according to the time at the beginning of this year. For example, if the time distribution of this year is winter-summer-winter, the time of last year is assumed to be winter time (because the alarm duration threshold is ≤7 days). Since the time period between the planned time and the original planned alarm time cannot cross the time switching interval, there is no need to adjust the meta-plan alarm time.
[0185] However, in the subsequent specific alarm, you can use the following methods to quickly determine whether an alarm is issued:
[0186] (1) Scenario 1 [Planned time + Alarm duration threshold] (i.e., the original planned alarm time) <= actual local time. For example, if the planned time is December 1, the alarm duration threshold is 7 days, and the actual local time is January 1, an alarm should be issued:
[0187] - Direct warning
[0188] -The planned alarm time is assigned the time at the beginning of this year.
[0189] (2) Scenario 2 [Planned time + Alarm duration threshold] > Actual local time. For example, if the planned time is December 31, the alarm duration threshold is 7 days, and the actual local time is January 1, no alarm should be issued.
[0190] 2. [Planned time] During winter time, and not within 1 hour of the summer-winter switchover (i.e. not within the summer-winter switchover interval).
[0191] If the time distribution is winter-summer-winter, the condition is met when [Planned Time] is less than the start time of summer time, or [Planned Time] is greater than or equal to the end time of summer time;
[0192] If the time distribution is summer-winter-summer distribution, then [Planned Time] is greater than or equal to the end time of last year's daylight saving time, or [Planned Time] is less than the start time of this year's daylight saving time;
[0193] In summary, no matter what the time distribution is, when the planned time is in winter time and not in the summer-winter interval, the following conditions are met: [Planned time] is less than the start time of summer time or greater than or equal to the end time of summer time;
[0194] (1) Scenario 3 [Planned time + Alarm duration threshold] is in winter time and does not involve the 1 hour of summer-winter switching (i.e., not in the summer-winter switching interval), so there is no need to adjust the original planned alarm time. Similarly, it can be concluded that the original planned alarm time meets the following conditions: [Planned time + Alarm duration threshold] is less than the start time of summer time, or [Planned time + Alarm duration threshold] is greater than or equal to the end time of summer time;
[0195] -The original planned alarm time was set to winter time;
[0196] -Original planned alarm time = [planned time + alarm duration threshold];
[0197] (2) In scenario 4, the time period between the planned time and the original planned alarm time crosses from winter time to summer time (i.e., across the winter-to-summer switching interval), then [planned time + alarm duration threshold] involves the winter-to-summer switching time point, and at this time [planned time + threshold] is greater than or equal to the start time of summer time;
[0198] -The original planned alarm time is set to daylight saving time;
[0199] - Original planned alarm time = [planned time + alarm duration threshold] + 1h, so that the one hour skipped in winter and summer can be compensated;
[0200] 3. Scenario 5 [Planned Time] In the one hour of winter-to-summer time switching (i.e. winter-to-summer time interval), the original planned alarm time needs to be adjusted, such as [2:00, 3:00) when switching at 2 o'clock;
[0201] -The adjusted original planned alarm time is set to daylight saving time;
[0202] -Use the start time of daylight saving time as the adjusted planned time. This process is to ensure that the jobs scheduled within the skipped hour can be normally called up on the switching date. At this time, the adjusted planned alarm time = [start time of winter-summer switching + alarm duration threshold]. In addition, since the alarm duration threshold is ≤ 7 days, the planned time and the adjusted original planned start time will not span multiple seasons;
[0203] It should be noted that this plan includes two plans: the original planned alarm time is in the winter-summer interval and the original planned alarm time is in the daylight saving time.
[0204] 4. [Planned time] is during daylight saving time and outside the one hour affected by the winter-to-summer switchover (winter-to-summer interval), and outside the one hour affected by the summer-to-winter switchover (summer-to-winter interval), that is, the planned time is greater than or equal to the start time of daylight saving time plus one hour, and less than the end time of daylight saving time minus one hour;
[0205] (1) Scenario 6 [Planned time + Alarm duration threshold] is in summer time and outside the summer-winter switching interval, that is, it is greater than or equal to the summer time start time plus one hour and less than the summer time end time minus one hour. In this case, the time period between the planned time and the original planned alarm time is outside the switching interval, and there is no need to adjust the original planned alarm time.
[0206] -The original planned alarm time is set to daylight saving time;
[0207] -Original planned alarm time = [planned time + alarm duration threshold];
[0208] (2) The time period between the planned time and the original planned alarm time in scenario 7 spans the summer-winter interval, that is, [planned time + alarm duration threshold] is affected by the repeated one-hour summer-winter interval, and [planned time + alarm duration threshold] is greater than or equal to the end time of daylight saving time, so the original planned alarm time needs to be adjusted;
[0209] - Adjust the planned alarm time to winter time;
[0210] - Adjusted planned alarm time = [planned time + alarm duration threshold] - 1H, so that an hour that repeats in summer and winter is found;
[0211] 5. [Planned time] is during summer time, but within the one-hour range affected by the summer-to-winter switch (i.e., summer-to-winter interval), that is, the planned time is greater than or equal to the end time of summer time minus one hour, and less than the end time of summer time;
[0212] (1) In scenario 8, if [Planned time + Alarm duration threshold] is not after the summer-to-winter interval, that is, the planned time + Alarm duration threshold is less than the end time of summer time; at this time, the planned time and the original planned alarm time are both within the summer-to-winter interval, and there is no need to adjust the original planned alarm time.
[0213] -The original planned alarm time is set to daylight saving time;
[0214] -Original planned alarm time = [planned time + threshold];
[0215] (2) In scenario 9, if [Planned time + Alarm duration threshold] is after the summer-to-winter period, that is, the planned time + Alarm duration threshold is greater than or equal to the end time of daylight saving time; at this time, the original planned alarm time is affected by the 1-hour repeat of summer-to-winter, and the original planned alarm time needs to be adjusted:
[0216] -The original planned alarm time after adjustment is set to winter time;
[0217] - The adjusted original planned alarm time = [planned time + alarm duration threshold] - 1h. This saves energy and makes up for the one hour of summer-winter switching. Since the alarm duration threshold is ≤ 7 days, there is no situation where two time switching intervals are crossed.
[0218] Step 103: based on the time difference between the business system and the destination, and the start and end time of the daylight saving time at the destination, convert the current time of the business system into the actual local time of the destination;
[0219] In some embodiments, based on the time difference between the business system and the destination, and the start and end time of the daylight saving time at the destination, the current time of the business system is converted to the actual local time of the current destination, which can be achieved by:
[0220] Based on the time difference, the current time is converted to the first local time of the target location, and the time at the first local time is simulated as the first local time at the location of the business system; specifically, the formula can be sampled: first local time = current time - (8 - time difference);
[0221] converting the first local time into a second local time which is different from the first local time (i.e., simulating the second local time as the summer time of the destination); wherein one of the first local time and the second local time is the summer time and the other is the winter time;
[0222] According to the relationship between the first local time, the second local time and the start and end time of the daylight saving time of the target location, the actual local time is determined to be the first local time or the second local time, and the actual time of the actual local time.
[0223] For example, the location of the business system is A, and the target location is B. The time difference between A and B is 2 hours. The current time in the business system is 12:00 on May 1, 2024, and the first time is daylight saving time. According to the above formula for calculating the first local time, it can be determined that the first local time is 6:00 on May 1, 2024. Since the first local time is converted according to the local time in the business system, the time of the first local time is simulated as the time corresponding to the current time of the business system, so the time to which the first local time belongs is daylight saving time.
[0224] Since the location where the equipment of the business system is installed and the target location may be in different hemispheres, that is, their corresponding time distributions may be different, and the first local time may be in the summer-winter interval or the winter-summer interval, it is also necessary to consider converting the first local time into a second local time corresponding to a second time (winter time) different from the first time (summer time), and then determine whether the actual local time should be the first local time or the second local time, and the time to which the actual local time actually belongs, based on the relationship between the first local time, the second local time and the start and end times of the daylight saving time of the target location.
[0225] In the embodiment provided by the present invention, the current time is converted into a first local time at the target location based on the time difference, and the time at which the first local time is located is simulated as the first time at the location of the business system; the first local time is converted into a second local time which is different from the first time; wherein one of the first time and the second time is summer time and the other is winter time; according to the relationship between the first local time and the second local time and the start and end time of summer time at the target location, it is determined that the actual local time is the first local time or the second local time, and the time at which the actual local time is located, and the influence of the time switching interval and the time distribution on the actual local time can be taken into consideration, so as to accurately determine the actual local time.
[0226] In some embodiments, before converting the current time to the first local time of the destination, the method further includes:
[0227] Subtract the preset minutes from the actual current time of the business system to obtain the current time; wherein the preset minutes are set by the business system to compensate for the time consumed in information transmission when managing alarm instances across time zones.
[0228] The preset minutes can be 5 minutes.
[0229] In the embodiment provided by the present invention, by subtracting 5 minutes from the actual current time of the business system and then converting it into the actual local time of the target location through the above method, the business system can compensate for the time consumed in information transmission when managing alarm instances across time zones, thereby avoiding untimely alarms caused by information transmission costs.
[0230] In some embodiments, converting the first local time into a second local time which is a second time different from the first time can be achieved by:
[0231] If the first local time is winter time, the sum of the first local time and 1 hour is used as the second local time;
[0232] If the first local time is daylight saving time, the difference of 1 hour between the first local time and the first local time is used as the second local time.
[0233] Regardless of whether the time distribution is winter-summer-winter or summer-winter-summer, if the first time is winter time, the second time is summer time. To switch from winter time to summer time, it is inevitable to involve the winter-to-summer interval, and the adjustment time corresponding to the winter-to-summer interval is 1 hour. Therefore, it can be determined that: the second local time = the first local time + 1 hour.
[0234] Similarly, no matter whether the time distribution is winter-summer-winter or summer-winter-summer, if the first time is summer time, the second time is winter time. To switch from summer time to winter time, it must involve the summer-winter interval, and the adjustment time corresponding to the summer-winter interval is -1 hour. Therefore, it can be determined that: the second local time = the first local time - 1 hour.
[0235] In the embodiment provided by the present invention, if the first time is winter time, the sum of the first local time and 1 hour is used as the second local time; if the first time is summer time, the difference between the first local time and 1 hour is used as the second local time. The second local time can be quickly determined based on the first time and the first local time, thereby improving processing efficiency.
[0236] In some embodiments, the first time is winter time, and according to the relationship between the first local time and the second local time and the start and end time of the summer time at the destination, determining whether the actual local time is the first local time or the second local time, and the time at which the actual local time is actually located, can be achieved in the following manner:
[0237] Determine whether the first local time is less than the start time of the summer time of the target location. If so, determine the first local time as the actual local time, and the summer time where the actual local time is actually the winter time;
[0238] If the first local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the second local time is less than the end time of the daylight saving time of the destination. If so, determine the second local time as the actual local time, and the time when the actual local time is actually the daylight saving time;
[0239] If the second local time is greater than or equal to the end time of the summer time saving time at the destination, the second local time is determined as the actual local time, and the time saving time where the actual local time is located is actually winter time.
[0240] In some other embodiments, the first time is the daylight saving time. According to the relationship between the first local time and the second local time and the start and end time of the daylight saving time at the destination, determining whether the actual local time is the first local time or the second local time and the time at which the actual local time actually falls can be achieved in the following manner:
[0241] Determine whether the second local time is less than the start time of the summer time of the target location. If so, determine the second local time as the actual local time, and the summer time where the actual local time is actually the winter time;
[0242] If the second local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the first local time is less than the end time of the daylight saving time of the destination. If so, determine the first local time as the actual local time, and the time when the actual local time is actually the daylight saving time;
[0243] If the first local time is greater than or equal to the end time of the summer time saving time at the destination, the first local time is determined as the actual local time, and the time saving time where the actual local time is located is actually winter time.
[0244] In the above way, the actual local time can be quickly determined.
[0245] It should be noted that the positions of the above steps 101-102 and step 103 can be interchanged, that is, the actual local time can be determined first and then the actual planned alarm time; steps 101-102 and step 103 can also be executed in parallel, that is, the actual local time and the actual planned alarm time can be determined at the same time, and the specific determination order is not limited.
[0246] After the actual planned alarm time and the actual local time are determined, step 104 may be performed.
[0247] Step 104: determine whether the planned alarm time is greater than the actual local time, if not, issue an alarm to the alarm instance, if yes, do not issue an alarm to the alarm instance.
[0248] In some embodiments, determining whether the actual planned alarm time is greater than the actual local time may be achieved in the following manner:
[0249] Whether to terminate the judgment is determined based on whether the time zone where the actual planned alarm time is located is the same as the actual local time, and whether the actual planned alarm time and the actual local time are both configured with timing information; if one of them is yes, it is determined that the judgment needs to be terminated, and if both are no, it is determined that the judgment does not need to be terminated.
[0250] Whether to terminate the judgment is determined by determining whether the actual planned alarm time is in the same time zone as the actual local time, and whether both the actual planned alarm time and the actual local time are configured with seasonal information; terminating the judgment when any one of them is yes, and continuing the judgment when both of them are no, which can effectively eliminate the judgment process in which an alarm cannot be issued due to an incorrect configuration, thereby preventing resource waste.
[0251] If it is determined not to terminate the judgment, then it is determined whether the actual planned alarm time and the actual local time are in the same year;
[0252] If the actual planned alarm time and the actual local time are in different years, the relationship between the actual planned alarm time and the actual local time is determined based on the relationship between the year in which the actual planned alarm time is located and the year in which the actual local time is located. This can simplify the comparison data and quickly determine the relationship between the actual planned alarm time and the actual local time.
[0253] If the actual planned alarm time and the actual local time are in the same year, then determine whether the actual planned alarm time and the actual local time are the same;
[0254] If the actual planned alarm time and the actual local time are the same, then determine whether the actual planned alarm time after removing the year is greater than the actual local time after removing the year; if yes, determine to execute the alarm, if no, determine not to alarm;
[0255] If the actual planned alarm time and the actual local time are different, the relationship between the actual planned alarm time and the actual local time is determined based on the respective time of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of daylight saving time at the target location.
[0256] In some embodiments, the relationship between the actual planned alarm time and the actual local time is determined according to the respective time zones of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of the daylight saving time at the target location, which can be achieved by:
[0257] If the actual local time is summer time and the actual planned alarm time is winter time, determine whether the actual planned alarm time is greater than the start time of summer time at the target location. If so, determine that the actual planned alarm time is less than or equal to the actual local time; if not, determine that the actual planned alarm time is greater than the actual local time;
[0258] If the actual local time is winter time and the actual planned alarm time is summer time, determine whether the actual local time is greater than the end time of summer time at the target location. If so, determine that the actual planned alarm time is less than the actual local time; if not, determine that the actual planned alarm time is greater than or equal to the actual local time.
[0259] In the embodiment provided by the present invention, whether to adjust the original planned alarm time is determined based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command switching interval; wherein the original planned alarm time is the sum of the planned time and the alarm duration threshold of the instance to be alarmed, and the command switching interval is the time period involved in the command switching; if it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time; based on the time difference between the business system and the target location, and the start and end time of the daylight saving time of the target location, the current time of the business system is converted into the actual local time of the current command time of the target location; it is determined whether the actual planned alarm time is greater than the actual local time, if not, an alarm is issued to the alarm instance, and if yes, no alarm is issued to the alarm instance. The above scheme fully considers the impact of time switching on the actual alarm time when the business system and the job instance exist across time zones, thereby improving the accuracy of the job alarm with the picking time, and overcoming the monitoring alarm error caused by simply comparing the time points after simply converting the time points according to the time difference as in the prior art.
[0260] Based on the same inventive concept, an embodiment of the present invention provides an alarm device. The specific implementation of the alarm method of the device can refer to the description of the method embodiment part, and the repeated parts will not be repeated. Please refer to Figure 7 , the device comprises:
[0261] The determination unit 701 is used to determine whether to adjust the original planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the command switching interval; wherein the original planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command switching interval is the time period involved in the command switching; if it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time;
[0262] The conversion unit 702 is used to convert the current time of the business system into the actual local time of the current summer time of the target location based on the time difference between the business system and the target location, and the start and end time of the summer time of the target location; wherein the business system is used to schedule and manage the business corresponding to the alarm instance, the business is deployed at the target location, and the summer time distribution of the target location includes the summer time switching interval;
[0263] The processing unit 703 is used to determine whether the actual planned alarm time is greater than the actual local time, and if so, issue an alarm for the alarm instance; if so, do not issue an alarm for the alarm instance.
[0264] In a possible implementation manner, the determining unit 701 is further configured to:
[0265] Determine whether at least one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, and determine whether the time period between the planned time and the originally planned alarm time spans the time switching interval; wherein the time switching interval includes the winter-summer interval and the summer-winter interval;
[0266] If both are negative, it is determined that there is no need to adjust the originally planned alarm time;
[0267] If one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, then the originally planned alarm time is adjusted;
[0268] If the planned time and the original planned alarm time are both within the time switching interval, determine whether the planned time and the original planned alarm time are both within the summer-winter interval. If so, do not adjust the original planned alarm time. If the planned time and the original planned alarm time are both within the winter-summer interval, adjust the original planned alarm time.
[0269] In a possible implementation manner, if one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, the determining unit 701 is further configured to:
[0270] If the planned time is within the winter-summer interval, the planned time is adjusted to the start time of the daylight saving time, and the original planned alarm time is recalculated according to the start time of the daylight saving time and the alarm duration threshold to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the daylight saving time;
[0271] If the planned time is within the summer-winter interval and the original planned alarm time is after the summer-winter time point, or the time period spans the summer-winter interval, the original planned alarm time is adjusted according to the adjustment time length corresponding to the original planned alarm time and the summer-winter interval to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the winter time; wherein the summer-winter time point is the time point when the summer time switches to the winter time;
[0272] If the originally planned alarm time is within the winter-summer interval, or the time period spans the winter-summer interval, the originally planned alarm time is adjusted according to the adjustment duration corresponding to the originally planned alarm time and the winter-summer interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to daylight saving time.
[0273] In a possible implementation manner, if the planned time and the originally planned alarm time are both within the winter-to-summer interval, the determining unit 701 is further configured to:
[0274] Adjusting the planned time to the start time of the daylight saving time;
[0275] The sum of the start time of the daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time, and the time to which the adjusted original planned alarm time belongs is the daylight saving time.
[0276] In a possible implementation manner, the conversion unit 702 is specifically configured to:
[0277] Based on the time difference, convert the current time into the first local time of the target location, and simulate the first local time as the first local time of the current time at the location of the business system;
[0278] converting the first local time into a second local time which is a second time different from the first time; wherein one of the first time and the second time is summer time and the other is winter time;
[0279] According to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, the actual local time is determined to be the first local time or the second local time, and the actual time of the actual local time.
[0280] In a possible implementation manner, the first time is winter time, and the conversion unit 702 is further configured to:
[0281] Determine whether the first local time is less than the start time of the daylight saving time of the target location, and if so, determine the first local time as the actual local time, and the actual time of the actual local time is winter time;
[0282] If the first local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the second local time is less than the end time of the daylight saving time of the destination, and if so, determine the second local time as the actual local time, and the actual time of the actual local time is the daylight saving time;
[0283] If the second local time is greater than or equal to the end time of the summer time saving time of the target location, the second local time is determined as the actual local time, and the actual time saving time of the actual local time is winter time.
[0284] In a possible implementation manner, the first time is daylight saving time, and the conversion unit 702 is further configured to:
[0285] Determine whether the second local time is less than the start time of the summer time of the target location, and if so, determine the second local time as the actual local time, and the summer time in which the actual local time is located is winter time;
[0286] If the second local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the first local time is less than the end time of the daylight saving time of the destination, and if so, determine the first local time as the actual local time, and the time in which the actual local time is the daylight saving time;
[0287] If the first local time is greater than or equal to the end time of the summer time saving time of the target location, the first local time is determined as the actual local time, and the time in which the actual local time is located is winter time.
[0288] In a possible implementation manner, the conversion unit 702 is further configured to:
[0289] Before converting the current time to the first local time of the target location, the actual current time of the business system is subtracted from the preset minutes to obtain the current time; wherein the preset minutes are set by the business system to compensate for the time consumed in information transmission when managing alarm instances across time zones.
[0290] In a possible implementation manner, the processing unit 703 is further configured to:
[0291] Determine whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether the actual planned alarm time and the actual local time are both configured with seasonal information;
[0292] If it is determined not to terminate the judgment, then judging whether the actual planned alarm time and the actual local time are in the same year;
[0293] If the actual planned alarm time and the actual local time are in different years, the size relationship between the actual planned alarm time and the actual local time is determined according to the size relationship between the year in which the actual planned alarm time is located and the year in which the actual local time is located;
[0294] If the actual planned alarm time and the actual local time are in the same year, determining whether the actual planned alarm time and the actual local time are the same;
[0295] If the actual planned alarm time is the same as the actual local time, then determining whether the actual planned alarm time after removing the year is greater than the actual local time after removing the year;
[0296] If the actual planned alarm time is different from the respective time zones of the actual local time, the relationship between the actual planned alarm time and the actual local time is determined based on the respective time zones of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of daylight saving time at the target location.
[0297] In a possible implementation manner, the processing unit 703 is further configured to:
[0298] If the actual planned alarm time is different from the time zone where the actual local time is located, then the determination is terminated;
[0299] If the actual planned alarm time and the actual local time are in the same time zone, but at least one of the actual planned alarm time and the actual local time is not configured with the time information, the determination is terminated.
[0300] In a possible implementation manner, the processing unit 703 is further configured to:
[0301] If the time when the actual local time is summer time and the time when the actual planned alarm is winter time, determine whether the actual planned alarm time is greater than the start time of summer time at the target location, and if so, determine that the actual planned alarm time is less than or equal to the actual local time; if not, determine that the actual planned alarm time is greater than the actual local time;
[0302] If the actual local time is winter time and the actual planned alarm time is summer time, determine whether the actual local time is greater than the end time of summer time at the target location. If so, determine that the actual planned alarm time is less than the actual local time; if not, determine that the actual planned alarm time is greater than or equal to the actual local time.
[0303] In a possible implementation manner, the device further includes a preparatory unit 704, and the preparatory unit 704 is used to:
[0304] Based on the positional relationship between the planned time of the instance to be alarmed and the original planned alarm time and the time switching interval, before determining whether to adjust the original planned alarm time, regularly scan the latest job instance table in the business system, and obtain the job instance with alarm configuration and whose job status has not reached the preset status from the latest job instance table as the instance to be alarmed;
[0305] Obtain and parse the object static configuration information of the instance to be alarmed to obtain the planned time and the alarm duration threshold; wherein the object static configuration information is used to configure the scheduling plan and alarm plan of the job corresponding to the instance to be alarmed.
[0306] In a possible implementation manner, the job includes multiple scheduling plans, and the multiple scheduling plans have different scheduling times; the scheduling time of the scheduling plan corresponding to the instance to be alarmed is used as the planned time;
[0307] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are the same, the same threshold is used in the static configuration information of the object to indicate the time lengths corresponding to the multiple scheduling plans; the threshold of the alarm plan corresponding to the instance to be alarmed is used as the alarm duration threshold, and the threshold is less than or equal to 7 days;
[0308] If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are different, different thresholds are used in the object static configuration information to indicate the time lengths corresponding to different scheduling plans.
[0309] In a possible implementation manner, the preparatory unit 704 is further configured to:
[0310] Obtain and parse the object static configuration information of the instance to be alarmed, and after obtaining the planned time and the alarm duration threshold, determine whether the total number of the multiple scheduling plans is greater than the total number of thresholds included in the object static configuration information, and the total number of thresholds included in the object static configuration information is greater than 1;
[0311] If yes, it is determined that there is a configuration error in the static configuration information of the object, and it is indicated that an alarm cannot be issued for the instance to be alarmed.
[0312] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0313] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0314] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0315] Based on the same inventive concept, an embodiment of the present invention provides an alarm device, comprising: at least one processor, and
[0316] a memory coupled to the at least one processor;
[0317] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the alarm method as described above by executing the instructions stored in the memory.
[0318] Based on the same inventive concept, an embodiment of the present invention further provides a readable storage medium, including:
[0319] Memory,
[0320] The memory is used to store instructions, and when the instructions are executed by the processor, the device including the readable storage medium completes the alarm method as described above.
[0321] The readable storage medium may be any available medium or data storage device that the processor can access, including volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. As an example and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory, solid state disk (SSD), magnetic storage (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disc (MO), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.). Volatile memory may include random access memory (RAM), which may act as an external cache memory. By way of example and not limitation, RAM is available in a variety of forms, such as dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), and synchronous link DRAM (SLDRAM). The memory devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0322] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including program code. When a computer runs the computer program, the program code executes the alarm method as described above.
[0323] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, systems, or program products. Therefore, the embodiments of the present invention may be in the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may be in the form of machine program products implemented on one or more readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer / processor available program codes.
[0324] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0325] These program instructions may also be stored in a readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0326] These program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer / processor-implemented process, thereby providing instructions executed on the computer / processor or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0327] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A warning method, characterized in that: include: Based on the positional relationship between the planned time of the instance to be alarmed and the originally planned alarm time and the command time switching interval, determine whether to adjust the originally planned alarm time; wherein the originally planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command time switching interval is the time period involved in the command time switching; If it is determined to adjust the original planned alarm time, the adjusted original planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the original planned alarm time, the original planned alarm time is used as the actual planned alarm time; Based on the time difference between the business system and the target location, and the start and end time of the daylight saving time of the target location, the current time of the business system is converted into the actual local time of the current daylight saving time of the target location; wherein the business system is used to schedule and manage the business corresponding to the instance to be alarmed, the business is deployed at the target location, and the daylight saving time distribution of the target location includes the daylight saving time switching interval; It is determined whether the actual planned alarm time is greater than the actual local time, and if so, an alarm is issued for the alarm instance; if so, no alarm is issued for the alarm instance.
2. The method according to claim 1, characterized in that Determining whether to adjust the original planned alarm time based on the planned time of the instance to be alarmed and the positional relationship between the original planned alarm time and the command time switching interval includes: Determine whether at least one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, and determine whether the time period between the planned time and the originally planned alarm time spans the time switching interval; wherein the time switching interval includes the winter-summer interval and the summer-winter interval; If both are negative, it is determined that there is no need to adjust the originally planned alarm time; If one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, then the originally planned alarm time is adjusted; If the planned time and the original planned alarm time are both within the time switching interval, determine whether the planned time and the original planned alarm time are both within the summer-winter interval. If so, do not adjust the original planned alarm time. If the planned time and the original planned alarm time are both within the winter-summer interval, adjust the original planned alarm time.
3. The method according to claim 2, characterized in that If one of the planned time and the originally planned alarm time is within the time switching interval, and the originally planned alarm time is not within the summer-winter interval, or the time period spans the time switching interval, adjusting the originally planned alarm time includes: If the planned time is within the winter-summer interval, the planned time is adjusted to the start time of the daylight saving time, and the original planned alarm time is recalculated according to the start time of the daylight saving time and the alarm duration threshold to obtain the adjusted original planned alarm time, and the adjusted original planned alarm time belongs to the daylight saving time; If the planned time is within the summer-winter interval and the originally planned alarm time is after the summer-winter time point, or the time period spans the summer-winter interval, the originally planned alarm time is adjusted according to the adjustment time length corresponding to the original planned alarm time and the summer-winter interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to the winter time; wherein the summer-winter time point is the time point when the summer time switches to the winter time; If the originally planned alarm time is within the winter-summer interval, or the time period spans the winter-summer interval, the originally planned alarm time is adjusted according to the adjustment duration corresponding to the originally planned alarm time and the winter-summer interval to obtain the adjusted originally planned alarm time, and the adjusted originally planned alarm time belongs to the daylight saving time.
4. The method according to claim 2, characterized in that If the planned time and the originally planned alarm time are both within the winter-summer interval, adjusting the originally planned alarm time includes: Adjusting the planned time to the start time of the daylight saving time; The sum of the start time of the daylight saving time and the alarm duration threshold is used as the adjusted original planned alarm time, and the time to which the adjusted original planned alarm time belongs is the daylight saving time.
5. The method according to claim 1, characterized in that Based on the time difference between the business system and the destination, and the start and end time of the daylight saving time of the destination, the current time of the business system is converted into the actual local time of the current daylight saving time of the destination, including: Based on the time difference, convert the current time into the first local time of the target location, and simulate the first local time as the first local time of the current time at the location of the business system; Converting the first local time into a second local time which is a second time different from the first time; wherein one of the first time and the second time is the summer time and the other is the winter time; According to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, the actual local time is determined to be the first local time or the second local time, and the actual time of the actual local time.
6. The method according to claim 5, characterized in that The first time is the winter time, and according to the relationship between the first local time and the second local time and the start and end time of the summer time of the target location, determining that the actual local time is the first local time or the second local time, and the time in which the actual local time actually falls, includes: Determine whether the first local time is less than the start time of the summer time of the target location, and if so, determine the first local time as the actual local time, and the actual time of the actual local time is the winter time; If the first local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the second local time is less than the end time of the daylight saving time of the destination, and if so, determine the second local time as the actual local time, and the actual time of the actual local time is the daylight saving time; If the second local time is greater than or equal to the end time of the summer time saving time of the target location, the second local time is determined as the actual local time, and the actual time of the actual local time is the winter time.
7. The method according to claim 5, characterized in that The first time is the daylight saving time, and according to the relationship between the first local time and the second local time and the start and end time of the daylight saving time of the target location, determining that the actual local time is the first local time or the second local time, and the time at which the actual local time actually falls, includes: Determine whether the second local time is less than the start time of the summer time of the target location, and if so, determine the second local time as the actual local time, and the actual time of the actual local time is the winter time; If the second local time is greater than or equal to the start time of the daylight saving time of the destination, determine whether the first local time is less than the end time of the daylight saving time of the destination, and if so, determine the first local time as the actual local time, and the time in which the actual local time is the daylight saving time; If the first local time is greater than or equal to the end time of the summer time saving time of the target location, the first local time is determined as the actual local time, and the time in which the actual local time is located is winter time.
8. The method according to any one of claims 5 to 7, characterized in that: Before converting the current time to the first local time of the target location, the method further includes: The actual current time of the business system is subtracted from the preset minutes to obtain the current time; wherein the preset minutes are set by the business system to compensate for the time consumed in information transmission when managing alarm instances across time zones.
9. The method according to claim 1, characterized in that Determining whether the actual planned alarm time is greater than the actual local time includes: Determine whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether the actual planned alarm time and the actual local time are both configured with seasonal information; If it is determined not to terminate the judgment, then judging whether the actual planned alarm time and the actual local time are in the same year; If the actual planned alarm time and the actual local time are in different years, the size relationship between the actual planned alarm time and the actual local time is determined according to the size relationship between the year in which the actual planned alarm time is located and the year in which the actual local time is located; If the actual planned alarm time and the actual local time are in the same year, determining whether the actual planned alarm time and the actual local time are the same; If the actual planned alarm time is the same as the actual local time, then determining whether the actual planned alarm time after removing the year is greater than the actual local time after removing the year; If the actual planned alarm time is different from the respective time zones of the actual local time, the relationship between the actual planned alarm time and the actual local time is determined based on the respective time zones of the actual planned alarm time and the actual local time, and the relationship between the actual planned alarm time or the actual local time and the start and end time of daylight saving time at the target location.
10. The method according to claim 9, characterized in that Determining whether to terminate the judgment according to whether the time zone where the actual planned alarm time and the actual local time are located is the same, and whether the actual planned alarm time and the actual local time are both configured with seasonal information, includes: If the actual planned alarm time is different from the time zone where the actual local time is located, then the determination is terminated; If the actual planned alarm time and the actual local time are in the same time zone, but at least one of the actual planned alarm time and the actual local time is not configured with the time information, the determination is terminated.
11. The method according to claim 9, characterized in that Determining the size relationship between the actual planned alarm time and the actual local time according to the respective time zones of the actual planned alarm time and the actual local time, and the size relationship between the actual planned alarm time or the actual local time and the start and end time of the daylight saving time of the target location, includes: If the time when the actual local time is summer time and the time when the actual planned alarm is winter time, determine whether the actual planned alarm time is greater than the start time of summer time at the target location, and if so, determine that the actual planned alarm time is less than or equal to the actual local time; if not, determine that the actual planned alarm time is greater than the actual local time; If the actual local time is winter time and the actual planned alarm time is summer time, determine whether the actual local time is greater than the end time of summer time at the target location. If so, determine that the actual planned alarm time is less than the actual local time; if not, determine that the actual planned alarm time is greater than or equal to the actual local time.
12. The method according to any one of claims 1 to 7 and 9 to 11, characterized in that Before determining whether to adjust the originally planned alarm time based on the planned time of the instance to be alarmed and the positional relationship between the originally planned alarm time and the command time switching interval, the method further includes: Periodically scan the latest job instance table in the business system, and obtain the job instance with alarm configuration and whose job status has not reached a preset status from the latest job instance table as the instance to be alarmed; Obtain and parse the object static configuration information of the instance to be alarmed to obtain the planned time and the alarm duration threshold; wherein the object static configuration information is used to configure the scheduling plan and alarm plan of the job corresponding to the instance to be alarmed.
13. The method according to claim 12, characterized in that The job includes a plurality of scheduling plans, and the plurality of scheduling plans have different scheduling times; The scheduling time of the scheduling plan corresponding to the instance to be alarmed is used as the planned time; If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are the same, then the same threshold is used in the object static configuration information to indicate the time lengths corresponding to the multiple scheduling plans; The threshold of the alarm plan corresponding to the instance to be alarmed is used as the alarm duration threshold, and the threshold is less than or equal to 7 days; If the time lengths between the scheduling times corresponding to the multiple scheduling plans and the alarm times of the corresponding alarm plans are different, different thresholds are used in the object static configuration information to indicate the time lengths corresponding to different scheduling plans.
14. The method according to claim 13, characterized in that After acquiring and parsing the static configuration information of the object of the instance to be alarmed and obtaining the planned time and the alarm duration threshold, the method further includes: Determine whether the total number of the plurality of scheduling plans is greater than the total number of thresholds included in the object static configuration information, and the total number of thresholds included in the object static configuration information is greater than 1; If yes, it is determined that there is a configuration error in the static configuration information of the object, and it is indicated that an alarm cannot be issued for the instance to be alarmed.
15. An alarm device, characterized in that: include: A determination unit, configured to determine whether to adjust the originally planned alarm time based on the positional relationship between the planned time of the instance to be alarmed and the originally planned alarm time and the command switching interval; wherein the originally planned alarm time is the sum of the planned time and the alarm duration threshold configured for the instance to be alarmed, and the command switching interval is the time period involved in the command switching; if it is determined to adjust the originally planned alarm time, the adjusted originally planned alarm time is used as the actual planned alarm time; if it is determined not to adjust the originally planned alarm time, the originally planned alarm time is used as the actual planned alarm time; a conversion unit, configured to convert the current time of the business system into the actual local time of the current summer time of the target location based on the time difference between the business system and the target location, and the start and end time of the summer time of the target location; wherein the business system is used to schedule and manage the business corresponding to the instance to be alarmed, the business is deployed at the target location, and the summer time distribution of the target location includes the summer time switching interval; The processing unit is used to determine whether the actual planned alarm time is greater than the actual local time, and if so, to implement an alarm for the alarm instance; if so, not to implement an alarm for the alarm instance.
16. An alarm device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the at least one processor executes the method according to any one of claims 1 to 14 by executing the instructions stored in the memory.
17. A readable storage medium, characterized in that: Including memory, The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium implements the method according to any one of claims 1 to 14.
18. A computer program product, characterized in that It includes program code, and when a computer runs the computer program, the program code executes the business processing method as described in any one of claims 1 to 14.