A timed task management method, device and storage medium

By receiving and processing timing task creation requests, building and executing target timing tasks, the complexity of timing task creation in large companies is solved, and management efficiency and system maintainability are improved.

CN112799796BActive Publication Date: 2025-01-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201911115021.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-14
Publication Date
2025-01-17
Estimated Expiration
2040-02-18

AI Technical Summary

Technical Problem

In large companies, the creation process of timing tasks is complicated, resulting in low management efficiency, and it takes a long time to understand business logic code and write timing logic code.

Method used

By receiving the timing task creation request sent by the service server, obtaining the timing strategy of the message to be pushed, and building a target timing task based on the service identity and message, executing the task at a specified time to send the message.

Benefits of technology

It simplifies the creation process of timing tasks, improves management efficiency, reduces system complexity and maintenance costs, so that the system does not need to pay attention to timing logic design, but only business logic design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112799796B_ABST
    Figure CN112799796B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a scheduled task management method, device and storage medium, the method may include: receiving a scheduled task creation request sent by a business server, the scheduled task creation request carrying a first business identifier and a message to be pushed; obtaining a timing policy for the message to be pushed according to the scheduled task creation request; constructing a target scheduled task corresponding to the message to be pushed according to the first business identifier, the message to be pushed and the timing policy; after the message notification time indicated by the timing policy arrives, executing the target scheduled task to send the message to be pushed to a designated message receiving object associated with the first business identifier. The present invention can improve the management efficiency of scheduled tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a timed task management method, device and storage medium. Background Art

[0002] Scheduled tasks are often automatically monitored and executed by computer systems. For some companies, such as some larger companies, there are often more businesses, so there are more projects that need to be managed simultaneously, and each project often contains multiple scheduled tasks. In the development process of the system corresponding to each project, if a scheduled task needs to be created, it often takes a long time to understand the relevant business logic code, and write the scheduled logic code of the scheduled task in combination with the business logic code, so as to build a scheduled task for message push. The scheduled task creation process is relatively complicated, which reduces the efficiency of scheduled task creation, and thus reduces the efficiency of managing scheduled tasks. Summary of the invention

[0003] The embodiments of the present invention provide a scheduled task management method, device and storage medium, which can improve the management efficiency of scheduled tasks.

[0004] On the one hand, an embodiment of the present invention provides a scheduled task management method, including:

[0005] Receive a scheduled task creation request sent by a business server, wherein the scheduled task creation request carries a first business identifier and a message to be pushed;

[0006] Acquire the timing strategy of the message to be pushed according to the scheduled task creation request;

[0007] Constructing a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy;

[0008] After the message notification time indicated by the timing policy arrives, the target timing task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier.

[0009] In another aspect, an embodiment of the present invention provides a scheduled task management device, comprising:

[0010] A communication unit, configured to receive a scheduled task creation request sent by a service server, wherein the scheduled task creation request carries a first service identifier and a message to be pushed;

[0011] An acquisition unit, configured to acquire a timing strategy for the message to be pushed according to the scheduled task creation request;

[0012] A construction unit, configured to construct a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy;

[0013] The task execution unit is used to execute the target timing task after the message notification time indicated by the timing strategy arrives, so as to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit.

[0014] On the other hand, an embodiment of the present invention provides a management server, including: a processor, an input device, an output device and a memory; the memory is used to store program instructions; the processor calls the program instructions to implement the above-mentioned scheduled task management method.

[0015] On the other hand, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores program instructions, and when the program instructions are executed, they are used to implement the above-mentioned scheduled task management method.

[0016] To sum up, the management server can receive a scheduled task creation request sent by a business server, and construct a target scheduled task corresponding to the message to be pushed according to the first business identifier and the message to be pushed carried in the scheduled task creation request, so that after the message notification time indicated by the timing policy arrives, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first business identifier. Compared with the prior art, it takes a long time to understand the relevant business logic code and write the timing logic code of the scheduled task in combination with the business logic code, thereby constructing a scheduled task for message notification. The embodiment of the present invention can improve the efficiency of creating scheduled tasks, and thus improve the management efficiency of scheduled tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a schematic diagram of the architecture of a scheduled task management system provided by an embodiment of the present invention;

[0019] Figure 2 It is a flowchart of a scheduled task management method provided by an embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of a scheduled task creation process provided by an embodiment of the present invention;

[0021] Figure 4 It is a flowchart of another scheduled task management method provided by an embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of a message notification process provided by an embodiment of the present invention;

[0023] Figure 6 is a schematic diagram of a scheduled task deletion process provided by an embodiment of the present invention;

[0024] Figure 7 It is a structural diagram of a scheduled task management device provided by an embodiment of the present invention;

[0025] Figure 8 It is a structural diagram of a management server provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0027] The embodiment of the present invention proposes a scheduled task management solution, which can be applied to scenarios that require timed triggering, such as notifying users of appointments and pre-sales in shopping mall projects, urging payment of orders, reminding merchants of receipt of goods, configuring scheduled activities on and off shelves, and sending scheduled messages to procurement polling systems. The use of this scheduled task creation solution can make the creation process of scheduled tasks more convenient and efficient, and improve the management efficiency of scheduled tasks. In particular, for some systems that require the design of timing logic and business logic, the use of this solution means that this part of the system no longer needs to pay attention to the design of the timing logic, but only needs to pay attention to its own business logic design, thereby greatly reducing the complexity of this part of the system and improving the maintainability of this part of the system.

[0028] Among them, the above-mentioned scheduled task management solution can be applied to Figure 1 In the scheduled task management system shown. Figure 1 The scheduled task management system shown may include a business server 10, a management server 20, a business server 30, and a business server 40. The management server 20 may implement functions such as scheduled task creation, message notification, and scheduled task deletion. The management server 20 may establish communication with the business server 10, the business server 30, and the business server 40, respectively. The business server 30 may establish communication with the terminal device 50, and the business server 40 may establish communication with the terminal device 60.

[0029] exist Figure 1In the scheduled task management system shown, the business server 10 can send a scheduled task creation request to the management server 20, and the scheduled task creation request carries the first business identifier and the message to be pushed. The management server 20 can receive the scheduled task creation request sent by the business server 10. The management server 20 can obtain the timing policy of the message to be pushed according to the scheduled task creation request, and construct the scheduled task corresponding to the message to be pushed according to the first business identifier, the message to be pushed and the timing policy, so that after the message notification time indicated by the timing policy arrives, the target task is executed to send the message to be pushed to the corresponding service, that is, to the designated message receiving object associated with the first business identifier, such as the business server 30 and / or the business server 40. In one embodiment, the management server 20 can send the message to be pushed to the designated message receiving object associated with the first business identifier through a fixed protocol.

[0030] In one embodiment, before the management server 20 receives the scheduled task creation request sent by the service server 10, the service server 10 may apply for a service identifier from the management server 20. The management server 20 may allocate a first service identifier to the service server 10.

[0031] In one embodiment, the service server 10 may send a service identification creation request to the management server 20, and the service identification creation request carries the service information corresponding to the service server 10, and the service information may include some demand information. The management server 20 may receive the service identification creation request sent by the service server 10, and generate a first service identification for the service server 10 according to the service identification creation request.

[0032] In an application scenario, after the management server 20 assigns the first business identifier to the business server 10. The business party, such as a customer of the scheduled task management platform, can obtain the scheduled task creation interface corresponding to the first business identifier from the management server 20 through the business server 10. The business party can configure the message to be pushed and the timing policy in the scheduled task creation interface. After configuring the first message to be pushed and the timing policy, the business party can click the confirmation submission button included in the scheduled task creation page to send a scheduled task creation request to the management server 20 through the business server 10. The scheduled task creation request carries the first business identifier, the timing policy and the message to be pushed.

[0033] Accordingly, the management server 20 may obtain the timing policy of the message to be pushed according to the scheduled task creation request in the following manner: the management server 20 uses the timing policy carried in the scheduled task creation request as the timing policy of the message to be pushed.

[0034] In one embodiment, in addition to allocating the first service identifier to the service server 10, the management server 20 may also allocate multiple sub-service identifiers corresponding to the first service identifier to the service server 10. In one embodiment, the management server 20 may also configure a timing strategy for each of the multiple sub-service identifiers.

[0035] In one embodiment, the business server 10 may send a business identification creation request to the management server 20, and the business identification creation request carries the business information corresponding to the business server 10. The management server 20 may receive the business identification creation request sent by the business server 10, and generate a first business identification and multiple sub-business identifications corresponding to the first business identification for the business server 10 according to the business identification creation request. The management server 20 may obtain a timing policy configured for each of the multiple sub-business identifications, and establish a corresponding relationship between the sub-business identification and the timing policy according to the configured timing policy of each sub-business identification.

[0036] In an application scenario, after allocating the first business identifier and multiple sub-business identifiers corresponding to the first business identifier to the business server 10, the business party can obtain the scheduled task creation interface corresponding to the business identifier from the management server 20 through the business server 10. The business party can configure the message to be pushed corresponding to the target sub-business identifier of the first business identifier based on the scheduled task creation interface. After configuring the message to be pushed corresponding to the target sub-business identifier of the first business identifier, the business party can click the confirmation submission button included in the scheduled task creation page to send a scheduled task creation request to the management server 20 through the business server 10. The scheduled task creation request carries the first business identifier, the target sub-business identifier of the first business identifier, and the message to be pushed.

[0037] Correspondingly, the management server 20 obtains the timing policy of the message to be pushed according to the scheduled task creation request. The management server 20 can use the correspondence between the sub-service identifier and the timing policy to determine the timing policy corresponding to the target sub-service identifier, and use the timing policy corresponding to the target sub-service identifier as the timing policy of the message to be pushed.

[0038] See also Figure 2 , is a flow chart of a scheduled task management method provided by an embodiment of the present invention. The method can be applied to a management server. Specifically, the method can include the following steps:

[0039] S201. Receive a scheduled task creation request sent by a service server, where the scheduled task creation request carries a first service identifier and a message to be pushed.

[0040] In one embodiment, the scheduled task creation request may carry the first service identifier, the timing strategy, and the message to be pushed.

[0041] In one embodiment, the task creation request may only carry the first service identifier, the target sub-service identifier of the first service identifier, and the message to be pushed.

[0042] In one embodiment, the management server may verify the first service identifier; if the verification is successful, step S202 is executed. The management server may verify the first service identifier in at least one of the following ways: verifying whether the first service identifier exists, verifying whether the first service identifier is generated by the management server, verifying whether the first service identifier is within the validity period, and verifying whether the first service identifier has the scheduled task setting authority, such as the scheduled task creation authority and the scheduled task deletion authority.

[0043] In one embodiment, if the verification is passed, the management server may determine whether the message to be pushed is sent repeatedly. If it is determined that the message to be pushed is not sent repeatedly, step S202 is executed.

[0044] In one embodiment, the scheduled task creation request may also carry a message sequence number, which may be generated by a business server. The management server may determine whether the message to be pushed is sent repeatedly by: the management server generates a key using the first business identifier and the message sequence number; the management server queries the database for the key; if the key does not exist, it is determined that the message to be pushed is not sent repeatedly.

[0045] For example, assuming that the first service identifier is appid and the message sequence number is seqnum, the management server concatenates appid and seqnum into a key: appid_seqnum; the management server queries the database for whether the key exists; if the key does not exist, the management server determines that the message to be pushed is not sent repeatedly.

[0046] In one embodiment, if it is determined that the message to be pushed is not sent repeatedly, the management server can store the key in the database. If it is determined that the message to be pushed is sent repeatedly, the management server can perform deduplication processing on the message to be pushed. In one embodiment, deduplication processing means discarding the message to be pushed. Through deduplication processing, it is possible to avoid the situation where the same message to be pushed is sent repeatedly for multiple times within a period of time.

[0047] In one embodiment, the key has an expiration time, such as 10 minutes, and the value corresponding to the key may be the current timestamp. When the management server detects that the expiration time corresponding to the key has arrived according to the current timestamp, the key may be deleted from the database.

[0048] S202: Obtain a timing strategy for the message to be pushed according to the scheduled task creation request.

[0049] Among them, the timing strategy may include a timing type, which may include any of the following: a specified time point (such as 10:00), a specified duration (such as 30 minutes), a specified recurring time point (such as 10:00 every day), and a specified recurring time interval (such as every 30 minutes).

[0050] In the embodiment of the present invention, the management server may acquire the timing policy of the message to be pushed according to the timing policy in one of the following ways:

[0051] First, when the scheduled task creation request carries the first business identifier, the timing policy and the message to be pushed, the management server can use the timing policy carried by the scheduled task creation request as the timing policy of the message to be pushed. In the first way, during the scheduled task creation process, the business party can configure the timing policy in real time, thereby making the scheduled task creation process more flexible.

[0052] Second, when the scheduled task creation request carries the first service identifier, the target sub-service identifier of the first service identifier, and the message to be pushed, the management server can obtain the target sub-service identifier of the first service identifier carried by the scheduled task creation request, and use the correspondence between the sub-service identifier and the timing policy to determine the timing policy corresponding to the target sub-service identifier, thereby using the timing policy corresponding to the target sub-service identifier as the timing policy of the message to be pushed. Using the second method, during the scheduled task creation process, the business party does not need to pay attention to the configuration process of the timing policy, making the scheduled task creation process simpler and more efficient.

[0053] In one embodiment, the management server can determine whether the scheduled task creation request carries a timing policy. If the scheduled task creation request carries a timing policy, the management server uses the timing policy carried in the scheduled task creation request as the timing policy of the message to be pushed. If the scheduled task creation request does not carry a timing policy, the management server obtains the target sub-service identifier of the first service identifier carried by the scheduled task creation request, and uses the corresponding relationship between the sub-service identifier and the timing policy to determine the timing policy corresponding to the target sub-service identifier, thereby using the timing policy corresponding to the target sub-service identifier as the timing policy of the message to be pushed. In this process, the first method has a higher priority than the second method. That is, if the scheduled task creation request carries a timing policy, the first method is used to obtain the timing policy of the message to be pushed. If the scheduled task does not carry a timing policy, the second method is used to obtain the timing policy of the message to be pushed.

[0054] S203: Construct a target scheduled task for the message to be pushed according to the first service identifier, the message to be pushed, and the timing strategy.

[0055] S204: After the message notification time indicated by the timing policy arrives, execute the target timing task to send the message to be pushed to the designated message receiving object associated with the first service identifier.

[0056] In one embodiment, when sending the message to be pushed to the designated message receiving object associated with the first service identifier, the management server can obtain the address information of the designated message receiving object associated with the first service identifier, and send the message to be pushed to the designated message receiving object according to the address information of the designated message receiving object.

[0057] In one embodiment, the business server may send the address information of the designated message recipient to the management server, the management server may save the address information of the designated message recipient, and the management server may obtain the saved address information of the designated message recipient. In one embodiment, the aforementioned business information may include the address information of the designated recipient.

[0058] In one embodiment, the scheduled task creation request may carry the address information of the designated message receiving object, and the management server may obtain the address information of the designated message receiving object carried by the scheduled task creation request. In this way, the message receiving object may be flexibly set for message notification.

[0059] In one embodiment, the management server constructs the target timed task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing policy. The management server generates a message identifier for the message to be pushed, and can generate task information including the first service identifier, the message identifier and the message notification time indicated by the timing policy; the management server constructs the target timed task according to the task information and the message to be pushed. The message identifier refers to information used to uniquely identify the message to be pushed.

[0060] In one embodiment, after generating a message identifier for the message to be pushed, the management server may record an operation log of the message to be pushed in a database. The operation log may include the message identifier and the message to be pushed.

[0061] In one embodiment, the management server may store the message identifier and the message to be pushed in a first data structure. The first data structure may be a hash structure, such as key v1v2...vn. Wherein, key is the message identifier, and vn is the message to be pushed. After the message notification time indicated by the timing strategy arrives, the management server may find the message to be pushed according to the first data structure and the message identifier, thereby sending the message to be pushed to the designated message receiving object associated with the first service identifier.

[0062] In one embodiment, when the task creation request carries a first service identifier, a timing policy, and a message to be pushed, the management server can store task information including the first service identifier, the message identifier, and the message notification time indicated by the timing policy in a second data structure. The message notification time can be obtained according to the timing type included in the timing policy. For example, if the timing type included in the timing policy is a specified time point, such as 10:00, the message notification time can be 10:00. If the timing type included in the timing policy is a specified duration, such as 30 minutes, the message notification time can be 30 minutes later calculated from the time when the scheduled task creation request is received as the start time. In one embodiment, when the second data structure is an ordered set SortedSet structure, the key can be the service identifier, the member membe can be the message identifier, and the score can be the message notification time.

[0063] In one embodiment, when the task creation request carries a first service identifier, a target sub-service identifier of the first service identifier, and a message to be pushed, the management server may store task information including the first service identifier, the target sub-service identifier of the first service identifier, a message identifier, and the time when the task creation request was received in a second data structure. In one embodiment, when the second data structure is a SortedSet structure, the key may be a service identifier_sub-service identifier, such as appid_subappid; the member may be a message identifier; and the score may be the time when the task creation request was received. In one embodiment, the aforementioned second data structure may also be a Set structure. In one embodiment, the time when the task creation request was received may also be replaced by a message notification time, which may be determined based on the time when the task creation request was received and the timing type included in the timing policy.

[0064] visible, Figure 2 In the illustrated embodiment, the management server can automatically create a scheduled task upon receiving a scheduled task creation request, making the scheduled task creation process more convenient and efficient.

[0065] See also Figure 3 , Figure 3 A schematic diagram of the process of creating a scheduled task provided by an embodiment of the present invention. In steps S301-S307, after receiving the insertion request, the management server can construct the target scheduled task corresponding to the message to be pushed through processes such as appid verification. Specifically:

[0066] In step S301, the management server may receive an insert request, which may carry the appid and the message to be pushed. The insert request is the scheduled task creation request mentioned in the embodiment of the present invention.

[0067] In step S302, the management server may verify the appid;

[0068] In step S303, after passing the verification, the management server can verify whether the message to be pushed is sent repeatedly. If so, deduplication processing is performed. If not, a message identification ID is generated for the message to be pushed.

[0069] In step S304, after generating the message ID, the management server may write a DB log for the message to be pushed, that is, the management server may record the operation log of the message to be pushed in the database.

[0070] In step S305, after writing the database flow, the management server may store the message to be pushed in a Hash structure, that is, the management server may store the message to be pushed in a first data structure.

[0071] In steps S306-S307, after storing the message to be pushed in a Hash structure, the management server may store the data of the SoretedSet structure corresponding to the appid, so as to construct the scheduled task corresponding to the message to be pushed according to the data of the SoretedSet structure and the message to be pushed. That is, the management server may store the task information in the SoretedSet structure, so as to construct the target scheduled task corresponding to the message to be pushed according to the task information and the message to be pushed.

[0072] See also Figure 4 , is a flow chart of another scheduled task management method provided by an embodiment of the present invention. The method can be applied to a management server. Specifically, the method may include:

[0073] S401: Receive a scheduled task creation request sent by a service server, where the scheduled task creation request carries a first service identifier and a message to be pushed.

[0074] S402: Obtain a timing strategy for the message to be pushed according to the scheduled task creation request.

[0075] S403: construct a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy;

[0076] S403: After the message notification time indicated by the timing policy arrives, execute the target timing task to send the message to be pushed to the designated message receiving object associated with the first service identifier.

[0077] Steps S401 to S404 can be found in Figure 2 The steps S201-S204 in the embodiment are not described in detail in the embodiment of the present invention.

[0078] S405: Add the target scheduled task to the scheduled task list.

[0079] In an embodiment, the scheduled task list may be a scheduled task list corresponding to the first service identifier.

[0080] In one embodiment, when the scheduled task creation request carries the first service identifier, the target sub-service identifier of the first service identifier, and the message to be pushed, the scheduled task list can be a scheduled task list corresponding to the first service identifier or a scheduled task list corresponding to the target sub-service identifier.

[0081] S406: When a designated scanning cycle arrives, scan the scheduled task list to obtain task information of each scheduled task in the plurality of scheduled tasks included in the scheduled task list.

[0082] In an embodiment of the present invention, the management server can scan the scheduled task list when a specified scanning cycle arrives to obtain task information of each of the multiple scheduled tasks included in the task list, and then detect whether the message notification time indicated by the timing policy corresponding to each of the multiple scheduled tasks has arrived based on the task information.

[0083] In one embodiment, if the management server detects from the task information that the message notification time indicated by the timing policy corresponding to the target scheduled task is less than or equal to the current system time, it determines that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived.

[0084] S407: When it is detected according to the task information that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier.

[0085] In one embodiment, when it is detected that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived according to the task information, the management server can obtain the message identifier included in the task information of the target task, and find the message to be pushed according to the message identifier, thereby sending the message to be pushed to the designated message receiving object associated with the first service identifier.

[0086] In one embodiment, after the management server sends the message to be pushed to the designated message receiving object associated with the first service identifier, if the management server does not receive a notification of successful reception of the message to be pushed returned by the designated message receiving object, the management server determines whether the message to be pushed is expired based on the timing strategy and / or the number of times the message to be pushed is sent; if it is not expired, the step of executing the target timing task is performed again to send the message to be pushed to the designated message receiving object associated with the first service identifier. In one embodiment, if the management server receives a notification of successful reception of the message to be pushed returned by the designated message receiving object, the management server can delete the target timing task in the timing task list, and can also access the data of the first data structure where the target message to be pushed is located.

[0087] In one embodiment, the management server determines whether the message to be pushed is expired according to the timing policy in the following manner: the management server determines whether the current system time is within a preset time period starting from the message notification time indicated by the timing policy; if so, it is determined that it is not expired; otherwise, it is determined that it is expired. And / or, the management server determines whether the current number of sending times is within the number of sending times of the message to be pushed; if so, it is determined that it is not expired; otherwise, it is determined that it is expired.

[0088] In one embodiment, the management server may receive a scheduled task deletion request sent by a business server, and the scheduled task deletion request carries a specified business identifier, such as the first business identifier carried by the task creation request mentioned above. The management server may verify the specified business identifier; after the verification is passed, the management server may delete the scheduled task corresponding to the specified business identifier from the scheduled task list. In one embodiment, the scheduled task deletion request may also carry a specified sub-business identifier of the specified business identifier, and the management server may verify the specified business identifier; after the verification is passed, the scheduled task corresponding to the specified sub-business identifier is deleted from the scheduled task list.

[0089] visible, Figure 4 In the illustrated embodiment, the management server may periodically scan the scheduled task list to perform notification of messages to be pushed, thereby ensuring the reliability and real-time performance of the process of notification of messages to be pushed.

[0090] See also Figure 5 , is a schematic diagram of a notification process of a message to be pushed provided by an embodiment of the present invention. In S501-S5011, the management server can periodically scan the scheduled task list to detect whether the messages to be pushed corresponding to each scheduled task have expired, and send the expired messages to be pushed. In addition, the management server has also taken corresponding measures for the situation where the message sending fails to ensure the reliability of the message notification process. At the same time, the management server can also reduce memory usage by deleting the relevant data of the expired messages to be pushed after the message is successfully sent. Specifically:

[0091] In steps S501-S502, the management server can obtain all appids included in the scheduled task list when the specified scanning cycle arrives, and can obtain the timeout configuration and Sortedset value of each appid in all appids. Among them, the value of Sortedset can include the member and score corresponding to the appid. By executing steps S501-S502, the management server can obtain the task information of each scheduled task in the multiple scheduled tasks included in the scheduled task list.

[0092] In step S503, the management server can detect whether the member corresponding to each appid has expired. If there is a member corresponding to the target appid that has expired, step S504 is executed. In this step, the management server can detect whether the message notification time indicated by the timing policy corresponding to each of the multiple scheduled tasks has arrived according to the task information, thereby realizing the overdue judgment.

[0093] In step S504, when the member corresponding to the target appid expires, the management server can obtain the Hash structure value of the member corresponding to the target appid, that is, obtain the message to be pushed corresponding to the member corresponding to the target appid. The target appid can correspond to the first service identifier mentioned above. When the management server detects that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived according to the task information, the target scheduled task can be executed to send the message to be pushed to the designated message receiving object associated with the first service identifier.

[0094] In step S505, the management server may determine whether the message to be pushed is expired, and if so, step S506 may be executed. That is, after the management server sends the message to be pushed to the designated message receiving object associated with the first service identifier, if the management server does not receive a notification of successful reception of the message to be pushed returned by the designated message receiving object associated with the first service identifier, the management server may determine whether the message to be pushed is expired according to the timing strategy and / or the number of times the message to be pushed is sent.

[0095] In step S506-step S508, the management server may delete the member corresponding to the target appid in the scheduled task list, and may report the expiration information to the Hawkeye record log, that is, report it to the monitoring system for log recording.

[0096] In step S509-step S511, the management server can send the message to be pushed of the member corresponding to the target appid to the service corresponding to the target appid, that is, send it to the designated message receiving object associated with the first service identifier. After the management server receives the notification of successful reception of the message to be pushed returned by the designated message receiving object associated with the first service identifier, the management server can delete the data of the SortedSet structure where the member corresponding to the target appid is located and the data of the Hash structure where the message to be pushed corresponding to the member corresponding to the target appid is located. If the management server does not receive the notification of successful reception of the message to be pushed returned by the designated message receiving object associated with the target appid, the management server can also generate an alarm message for reporting.

[0097] See also Figure 6, is a schematic diagram of a scheduled task deletion process provided by an embodiment of the present invention. Specifically, the process may include the following steps:

[0098] In step S601, the management server receives a deletion request sent by the business server. The deletion request may be a scheduled task deletion request.

[0099] In step S602, the management server may verify the appid carried in the deletion request. The verification method can be found in Figure 2 Embodiment: The embodiments of the present invention are not described in detail here.

[0100] In step S603, the management server may delete the data of the SortedSet structure where the appid carried in the deletion request is located after verification. That is, the management server may delete the scheduled task corresponding to the appid.

[0101] In step S604, the management server may delete the data of the Hash structure corresponding to the appid. That is, the management server may delete the data of the Hash structure where the message to be pushed corresponding to the appid is located.

[0102] Based on the description of the above method embodiment, in one embodiment, the present invention also provides a method as follows: Figure 7 The structural diagram of the scheduled task management device is shown in FIG. The scheduled task management device can be applied to the management server mentioned above. Figure 7 As shown, the scheduled task management device in the embodiment of the present invention may include:

[0103] The communication unit 701 is used to receive a scheduled task creation request sent by a service server, wherein the scheduled task creation request carries a first service identifier and a message to be pushed;

[0104] An acquisition unit 702 is used to acquire a timing strategy of the message to be pushed according to the scheduled task creation request;

[0105] A construction unit 703 is configured to construct a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy;

[0106] The task execution unit 704 is used to execute the target timing task after the message notification time indicated by the timing policy arrives, so as to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit 701.

[0107] In an optional implementation, the acquisition unit 702 is specifically used to determine whether the scheduled task creation request carries a timing policy; if the scheduled task creation request carries a timing policy, the timing policy carried in the scheduled task creation request is used as the timing policy of the message to be pushed.

[0108] In an optional embodiment, the acquisition unit 702 is also used to obtain the target sub-service identifier of the first service identifier carried by the scheduled task creation request if the scheduled task creation request does not carry a timing policy; determine the timing policy corresponding to the target sub-service identifier using the correspondence between the sub-service identifier and the timing policy; and use the timing policy corresponding to the target sub-service identifier as the timing policy for the message to be pushed.

[0109] In an optional embodiment, the task execution unit 704 is specifically used to add the target scheduled task to the scheduled task list; when the specified scanning cycle arrives, the task information of each scheduled task in the multiple scheduled tasks included in the scheduled task list is obtained by scanning the scheduled task list; when it is detected according to the task information that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit 701.

[0110] In an optional implementation, the construction unit 703 is specifically used to generate a message identifier for the message to be pushed; generate task information including the first service identifier, the message identifier and the message notification time indicated by the timing policy; and construct a target timing task corresponding to the message to be pushed based on the task information and the message to be pushed.

[0111] In an optional implementation, the scheduled task management device further includes a configuration unit 705 .

[0112] In an optional embodiment, the configuration unit 705 is used to receive a business identification creation request sent by the business server through the communication unit 701, and the business identification creation request carries the business information corresponding to the business server; generate a first business identification and multiple sub-business identifications corresponding to the first business identification for the business server according to the business identification creation request; obtain a timing policy configured for each sub-business identification in the multiple sub-business identifications; and establish a correspondence between the sub-business identification and the timing policy according to the configured timing policy of each sub-business identification.

[0113] In an optional embodiment, the task execution unit 704 is also used to execute the target timing task after the message notification time indicated by the timing policy arrives, so as to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit 701. If the notification of successful reception of the message to be pushed returned by the designated message receiving object is not received, then whether the message to be pushed is expired is determined according to the timing policy and / or the number of times the message to be pushed is sent; if not expired, the target timing task is executed again to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit 701.

[0114] In an optional implementation, the task execution unit 704 is further used to delete the message identifier included in the task information of the target scheduled task if it has expired, and upload the expiration information of the message to be pushed to the monitoring system through the communication unit 701 for log recording.

[0115] It can be seen that in Figure 7 In the illustrated embodiment, the management server can receive a scheduled task creation request sent by a business server, and construct a target scheduled task corresponding to the message to be pushed based on the first business identifier and the message to be pushed carried in the scheduled task creation request, so that after the message notification time indicated by the timing policy arrives, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first business identifier, thereby improving the management efficiency of the scheduled tasks.

[0116] See also Figure 8 , is a schematic diagram of the structure of a management server provided by an embodiment of the present invention. Figure 5 The management server in the embodiment shown may include: one or more processors 801; one or more input devices 802, one or more output devices 803 and a memory 804. The processor 801, input device 802, output device 803 and memory 804 are connected via a bus or other means. The input device 802 is an optional device. The memory 804 is used to store a computer program, which includes program instructions. The processor 801 is used to execute the program instructions stored in the memory 804 to implement the various methods involved above.

[0117] The memory 804 may include a volatile memory, such as a random-access memory (RAM); the memory 804 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 804 may also include a combination of the above-mentioned types of memory.

[0118] In one embodiment, the processor 801 may be a central processing unit (CPU), or may be other general-purpose processors, i.e., a microprocessor or any conventional processor. The memory 804 may include a read-only memory and a random access memory. Therefore, the processor 801 and the memory 804 are not limited herein.

[0119] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is used to receive a scheduled task creation request sent by the business server through the input device 802, and the scheduled task creation request carries a first business identifier and a message to be pushed; obtains a timing policy for the message to be pushed according to the scheduled task creation request; constructs a target scheduled task corresponding to the message to be pushed according to the first business identifier, the message to be pushed and the timing policy; after the message notification time indicated by the timing policy arrives, executes the target scheduled task to send the message to be pushed to the designated message receiving object associated with the first business identifier through the output device 803.

[0120] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to determine whether the scheduled task creation request carries a timing policy; if the scheduled task creation request carries a timing policy, the timing policy carried in the scheduled task creation request is used as the timing policy of the message to be pushed.

[0121] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to obtain the target sub-service identifier of the first service identifier carried by the scheduled task creation request if the scheduled task creation request does not carry a timing policy; determine the timing policy corresponding to the target sub-service identifier using the correspondence between the sub-service identifier and the timing policy; and use the timing policy corresponding to the target sub-service identifier as the timing policy for the message to be pushed.

[0122] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to add the target scheduled task to the scheduled task list; when a specified scanning cycle arrives, the task information of each scheduled task in the multiple scheduled tasks included in the scheduled task list is obtained by scanning the scheduled task list; when it is detected according to the task information that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier through the output device 803.

[0123] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to generate a message identifier for the message to be pushed; generate task information including the first service identifier, the message identifier and the message notification time indicated by the timing policy; and construct a target timing task corresponding to the message to be pushed based on the task information and the message to be pushed.

[0124] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to receive a business identification creation request sent by the business server through the input device 802, and the business identification creation request carries the business information corresponding to the business server; generates a first business identification and multiple sub-business identifications corresponding to the first business identification for the business server according to the business identification creation request; obtains a timing policy configured for each sub-business identification in the multiple sub-business identifications; and establishes a correspondence between the sub-business identification and the timing policy according to the configured timing policy of each sub-business identification.

[0125] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to determine whether the message to be pushed is expired based on the timing strategy and / or the number of times the message to be pushed is sent if the notification of successful reception of the message to be pushed is not received from the designated message receiving object; if not expired, the target timing task is executed again to send the message to be pushed to the designated message receiving object associated with the first service identifier through the output device 803.

[0126] In one embodiment, the processor 801 calls the program instructions stored in the memory 804, and is also used to delete the message identifier included in the task information of the target scheduled task if it has expired, and upload the expiration information of the message to be pushed to the monitoring system for logging.

[0127] It should be noted that the specific working process of the management server and the unit described above can refer to the relevant description in the aforementioned embodiments, which will not be repeated here.

[0128] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer storage medium, which can be a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0129] The above disclosure is only part of the embodiments of the present invention, which certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A scheduled task management method, characterized in that: include: Receive a scheduled task creation request sent by a business server, wherein the scheduled task creation request carries a first business identifier and a message to be pushed; Acquire the timing strategy of the message to be pushed according to the scheduled task creation request; Constructing a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy; After the message notification time indicated by the timing policy arrives, executing the target timing task to send the message to be pushed to the designated message receiving object associated with the first service identifier; Wherein, the step of obtaining the timing strategy of the message to be pushed according to the scheduled task creation request includes: If the scheduled task creation request does not carry a timing policy, obtaining a target sub-service identifier of the first service identifier carried in the scheduled task creation request; Determine the timing strategy corresponding to the target sub-service identifier by using the corresponding relationship between the sub-service identifier and the timing strategy; Using the timing policy corresponding to the target sub-service identifier as the timing policy of the message to be pushed; Among them, the method for establishing the correspondence between the sub-service identifier and the timing policy includes: receiving a service identifier creation request sent by the service server, the service identifier creation request carrying the service information corresponding to the service server; generating a first service identifier and multiple sub-service identifiers corresponding to the first service identifier for the service server according to the service identifier creation request; obtaining the timing policy configured for each sub-service identifier among the multiple sub-service identifiers; and establishing the correspondence between the sub-service identifier and the timing policy according to the configured timing policy of each sub-service identifier.

2. The method according to claim 1, characterized in that The step of obtaining the timing strategy of the message to be pushed according to the scheduled task creation request further includes: If the scheduled task creation request carries a scheduled policy, the scheduled policy carried in the scheduled task creation request is used as the scheduled policy of the message to be pushed.

3. The method according to claim 1 or 2, characterized in that: After the message notification time indicated by the timing strategy arrives, executing the target timing task to send the message to be pushed to a designated message receiving object associated with the first service identifier includes: Add the target scheduled task to the scheduled task list; When a specified scanning cycle arrives, the task information of each scheduled task in the plurality of scheduled tasks included in the scheduled task list is obtained by scanning the scheduled task list; When it is detected according to the task information that the message notification time indicated by the timing policy corresponding to the target scheduled task has arrived, the target scheduled task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier.

4. The method according to claim 1 or 2, characterized in that: The step of constructing a target timed task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy includes: Generating a message identifier for the message to be pushed; Generate task information including the first service identifier, the message identifier and the message notification time indicated by the timing strategy; A target scheduled task corresponding to the message to be pushed is constructed according to the task information and the message to be pushed.

5. The method according to claim 1, characterized in that After the message notification time indicated by the timing strategy arrives, the target timing task is executed to send the message to be pushed to the designated message receiving object associated with the first service identifier, the method further includes: If no notification of successful reception of the message to be pushed returned by the designated message receiving object is received, determining whether the message to be pushed is expired according to the timing strategy and / or the number of times the message to be pushed is sent; If it has not expired, the step of executing the target scheduled task is performed again to send the message to be pushed to the designated message receiving object associated with the first service identifier.

6. The method according to claim 5, characterized in that The method further includes: if the message has expired, deleting the message identifier included in the task information of the target scheduled task, and uploading the expiration information of the message to be pushed to the monitoring system for log recording.

7. A scheduled task management device, characterized in that: include: A communication unit, configured to receive a scheduled task creation request sent by a service server, wherein the scheduled task creation request carries a first service identifier and a message to be pushed; An acquisition unit, configured to acquire a timing strategy for the message to be pushed according to the scheduled task creation request; A construction unit, configured to construct a target scheduled task corresponding to the message to be pushed according to the first service identifier, the message to be pushed and the timing strategy; A task execution unit, configured to execute the target timing task after the message notification time indicated by the timing strategy arrives, so as to send the message to be pushed to the designated message receiving object associated with the first service identifier through the communication unit; Wherein, the acquisition unit is specifically used for: If the scheduled task creation request does not carry a timing policy, obtaining a target sub-service identifier of the first service identifier carried in the scheduled task creation request; Determine the timing strategy corresponding to the target sub-service identifier by using the corresponding relationship between the sub-service identifier and the timing strategy; Using the timing policy corresponding to the target sub-service identifier as the timing policy of the message to be pushed; Among them, the method for establishing the correspondence between the sub-service identifier and the timing policy includes: receiving a service identifier creation request sent by the service server, the service identifier creation request carrying the service information corresponding to the service server; generating a first service identifier and multiple sub-service identifiers corresponding to the first service identifier for the service server according to the service identifier creation request; obtaining the timing policy configured for each sub-service identifier among the multiple sub-service identifiers; and establishing the correspondence between the sub-service identifier and the timing policy according to the configured timing policy of each sub-service identifier.

8. A computer storage medium, characterized in that: The computer storage medium stores program instructions, which, when executed, are used to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Timing task processing method and timing task processing device

    CN106775965A