A notification message sending device, comprising hardware performing instructions stored in a non-transitory computer readable medium which executes following steps:
- acquiring target resource information, a notification sending policy and a notification sending address;
- generating a corresponding notification message when a target resource changes;
- and
- sending the notification message to the notification sending address according to the notification sending policy;
- wherein the notification sending policy comprises one or more of the following:
- a notification sending mode, a number of notifications and a notification time length;
- wherein the notification sending mode is a normal mode, and said sending the notification message to the notification sending address according to the notification sending policy comprise:
- when the number of notifications and the notification time length are not empty, judging whether a number of notification messages sent in a current time window exceeds the number of notifications, and if no, sending the notification message;
- and if yes, sending the notification message in a next time window, wherein a length of the time window is the notification time length;
- or,
- wherein the notification sending mode is a latest notification sending mode,
- after generating the corresponding notification message, storing the notification message;
- said sending the notification message to the notification sending address according to the notification sending policy comprises:
- when the number of notifications and the notification time length are not empty, judging whether a number of saved notification messages is not smaller than the number of notifications, and judging whether saving time of the notification messages is not smaller than the notification time length, and if the number of the saved notification messages is not smaller than the number of notifications or the saving time of the notification messages is not smaller than the notification time length, sending a latest generated notification message in the saved notification messages;
- or when the number of notifications is not empty but the notification time length is empty, judging whether a number of saved notification messages is not smaller than the number of notifications, and if the number of the saved notification messages is not smaller than the number of notifications, sending a latest generated notification message in the saved notification messages;
- or when the notification time length is not empty but the number of notifications is empty, judging whether saving time of notification messages is not smaller than the notification time length, and if the saving time of the notification messages is not smaller than the notification time length, sending a latest generated notification message in the saved notification messages;
- or,
- wherein the notification sending mode is a batch-processing sending mode,
- after generating the corresponding notification message, storing the notification message;
- and
- said sending the notification message to the notification sending address according to the notification sending policy comprises:
- when the number of notifications and the notification time length are not empty, judging whether a number of saved notification messages is not smaller than the number of notifications, and whether saving time of the notification messages is not smaller than the notification time length, and if the number of the saved notification messages is not smaller than the number of notifications or the saving time of the notification messages is not smaller than the notification time length, sending the saved notification messages;
- or when the number of notifications is not empty but the notification time length is empty, judging whether a number of saved notification messages is not smaller than the number of notifications, and if the number of the saved notification messages is not smaller than the number of notifications, sending the saved notification messages;
- or
- when the notification time length is not empty but the number of notifications is empty, judging whether saving time of notification messages is not smaller than the notification time length, and if the saving time of the notification messages is not smaller than the notification time length, sending the saved notification messages.