Timing service message generation method, device, electronic device and storage medium

The method separates scheduled tasks from message push tasks, enabling customizable message processing logic and efficient integration of new logic, thus improving flexibility and speed in generating timing service messages.

CN112256451BActive Publication Date: 2024-12-31BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011118640.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-19
Publication Date
2024-12-31
Estimated Expiration
2040-10-19

AI Technical Summary

Technical Problem

Existing methods for generating timing service messages lack flexibility, as they execute scheduled tasks at fixed intervals and couple the scheduled task part with the message push part, limiting processing speed and the ability to customize message processing logic.

Method used

A method and device that separate the scheduled task part from the message push part, allowing customization of message processing logic by reading a configuration file with scheduled task configurations, determining a target message processing node, and generating messages based on actual needs, with optional grayscale upgrading of message processing nodes to support new logic.

Benefits of technology

Enhances flexibility and processing speed of timing service message generation by allowing customization of message processing logic and smooth integration of new logic without disrupting ongoing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256451B_ABST
    Figure CN112256451B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, electronic device and storage medium for generating a scheduled service message, the method comprising: reading a configuration file including a scheduled task configuration in response to a scheduled task trigger instruction, the scheduled task configuration including a message processing logic identifier and associated service parameters; when there is a target scheduled task configuration matching the current time node in the scheduled task configuration, generating an intermediate queue message according to the target scheduled task configuration and storing it in a message queue; obtaining the intermediate queue message from the message queue by a target message processing node among multiple message processing nodes, each message processing node including multiple preset message processing logics; determining a target message processing logic matching the message processing logic identifier from multiple message processing logics; calling the target message processing logic, and generating a scheduled service message to be pushed by the target message processing logic according to the associated service parameters. The present disclosure improves the flexibility of the scheduled push task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for generating a timing service message. Background Art

[0002] With the widespread use of mobile terminals, more and more applications are available for mobile terminals. Some applications will push business messages to multiple mobile terminal users at certain times. For example, live broadcast applications will push messages about big anchors starting broadcasts to users, so that users can enter the big anchors' live broadcast rooms in time to watch their live broadcast content.

[0003] In the related art, the server pushes business messages to multiple mobile terminal users through a scheduled push task. The scheduled push task includes a scheduled task part and a message push part that are coupled together. The scheduled task part triggers the execution of the scheduled task at a certain time interval, that is, the scheduled task execution is triggered once at each time node. When the scheduled task is executed, the message push part generates and pushes business messages according to a fixed message processing logic. However, in actual applications, sometimes it is not desirable to execute scheduled tasks at each time node. Obviously, the related art cannot meet this demand and has poor flexibility. In addition, since the scheduled task part and the message push part are coupled together in the related art, not only the processing speed of the message push part is limited, but also the specific message processing logic adopted when the scheduled task is executed cannot be determined according to actual needs, which further reduces the flexibility of the scheduled push task. Summary of the invention

[0004] The present disclosure provides a method, device, electronic device and storage medium for generating a timed service message, so as to at least solve the problem of poor flexibility of timed push tasks in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a method for generating a timing service message is provided, including:

[0006] In response to a scheduled task trigger instruction, a configuration file is read; the configuration file includes at least one scheduled task configuration, and the scheduled task configuration includes a message processing logic identifier and associated business parameters;

[0007] When there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration, generating an intermediate queue message according to the target scheduled task configuration, and storing the intermediate queue message in a message queue;

[0008] Determine a target message processing node among a plurality of message processing nodes, and obtain the intermediate queue message from the message queue by the target message processing node, each of the message processing nodes including a plurality of preset message processing logics;

[0009] Determine a target message processing logic from the multiple message processing logics, the target message processing logic matching the message processing logic identifier in the intermediate queue message;

[0010] The target message processing logic is called, and the target message processing logic generates a scheduled service message to be pushed according to the associated service parameters.

[0011] In an exemplary embodiment, the method further comprises:

[0012] In response to a configuration operation for a scheduled task, obtaining configuration parameters; the configuration parameters include execution time, message processing logic identifier, and associated business parameters;

[0013] The scheduled task configuration in the configuration file is generated by using the execution time as key data and the message processing logic identifier and associated business parameters corresponding to the execution time as value data.

[0014] In an exemplary embodiment, when there is a target scheduled task configuration matching the current time in the at least one scheduled task configuration, before generating the intermediate queue message according to the target scheduled task configuration, the method further includes:

[0015] Obtain at least one key data in the configuration file;

[0016] Determine whether there is target key data matching the current time node in the at least one key data;

[0017] When the result of the judgment is yes, obtaining the target value data corresponding to the target key data;

[0018] The scheduled task configuration corresponding to the target value data is used as a target scheduled task configuration, and it is determined that there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration.

[0019] In an exemplary embodiment, the method further comprises:

[0020] Get the new message processing logic;

[0021] Selecting a first number of message processing nodes from the plurality of message processing nodes as message processing nodes to be upgraded, and selecting message processing nodes other than the message processing nodes to be upgraded from the plurality of message processing nodes as remaining message processing nodes;

[0022] Upgrading the first number of message processing nodes to be upgraded according to the newly added message processing logic;

[0023] When the upgrade status of the first number of message processing nodes to be upgraded is upgrade completed, the remaining message processing nodes are taken as the multiple message processing nodes, and the step of selecting the first number of message processing nodes from the multiple message processing nodes as the message processing nodes to be upgraded is performed until there are no remaining message processing nodes.

[0024] In an exemplary implementation, determining a target message processing node among a plurality of message processing nodes includes:

[0025] Determine the upgrade message processing node that has completed the upgrade;

[0026] taking the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes;

[0027] The target message processing node is selected from the candidate message processing nodes.

[0028] In an exemplary embodiment, before taking the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes, the method further includes:

[0029] Determine whether the message processing logic identifier in the intermediate queue message is a newly added message processing logic identifier;

[0030] When the result of the judgment is no, the step of taking the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes is performed.

[0031] When the result of the determination is yes, the upgrade message processing node is used as the candidate message processing node.

[0032] In an exemplary embodiment, the method further comprises:

[0033] Monitoring the number of intermediate queue messages contained in the message queue;

[0034] When the number of messages exceeds a first preset threshold, determining a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes;

[0035] Determine the number of nodes to be added of the message processing nodes to be added according to the first number difference;

[0036] The number of nodes of the plurality of message processing nodes is increased according to the number of nodes to be added.

[0037] In an exemplary embodiment, the method further comprises:

[0038] When the number of messages is less than a second preset threshold, determining a second quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes;

[0039] Determine the number of message processing nodes to be reduced according to the second number difference;

[0040] The number of nodes of the plurality of message processing nodes is reduced according to the number of nodes to be reduced.

[0041] In an exemplary embodiment, the plurality of message processing logics correspond to at least one service message template;

[0042] The calling of the target message processing logic, wherein the target message processing logic generates a timed service message to be pushed according to the associated service parameter, comprises:

[0043] Calling the target message processing logic, and sending a request for obtaining target service information to a service server according to the associated service parameters, so that the service server determines the target service information according to the associated service parameters;

[0044] Receiving the target service information returned by the service server;

[0045] Determine a target service message template in the at least one service message template according to the target service information;

[0046] Generate the scheduled service message to be pushed according to the target service message template.

[0047] In an exemplary embodiment, the associated service parameters include a service identifier and a target user identifier;

[0048] The calling of the target message processing logic and sending a request for obtaining target service information to the service server according to the associated service parameters comprises:

[0049] Calling the target message processing logic to generate a request for obtaining a target business relationship, where the target business relationship is a relationship between a business object corresponding to the business identifier and a target user corresponding to the target user identifier;

[0050] Sending a request to obtain the target business relationship to the business server;

[0051] Determining a target service message template in the at least one service message template according to the target service information includes:

[0052] Determining a target relationship type corresponding to the target business relationship;

[0053] A target service message template matching the target user in the first service message templates is determined according to the target relationship type, and the at least one service message template includes first service message templates corresponding to different relationship types.

[0054] According to a second aspect of an embodiment of the present disclosure, a timing service message generating device is provided, including:

[0055] A configuration reading unit is configured to execute in response to a scheduled task trigger instruction and read a configuration file; the configuration file includes at least one scheduled task configuration, and the scheduled task configuration includes a message processing logic identifier and associated business parameters;

[0056] A queue message storage unit is configured to generate an intermediate queue message according to the target scheduled task configuration when there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration, and store the intermediate queue message in the message queue;

[0057] A processing node determination unit is configured to determine a target message processing node among a plurality of message processing nodes, wherein the target message processing node obtains the intermediate queue message from the message queue, and each of the message processing nodes includes a plurality of preset message processing logics;

[0058] a message processing logic determination unit, configured to determine a target message processing logic from the multiple message processing logics, the target message processing logic matching the message processing logic identifier in the intermediate queue message;

[0059] The scheduled service message generating unit is configured to execute and call the target message processing logic, and the target message processing logic generates the scheduled service message to be pushed according to the associated service parameters.

[0060] In an exemplary embodiment, the device further comprises:

[0061] A configuration parameter acquisition unit, configured to execute a configuration operation in response to a scheduled task and acquire configuration parameters; the configuration parameters include an execution time, a message processing logic identifier, and associated business parameters;

[0062] The task configuration generating unit is configured to generate the scheduled task configuration in the configuration file by taking the execution time as key data and the message processing logic identifier and associated business parameters corresponding to the execution time as value data.

[0063] In an exemplary embodiment, the device further comprises:

[0064] A key data acquisition unit, configured to acquire at least one key data in the configuration file;

[0065] A first judgment unit is configured to judge whether there is target key data matching the current time node in the at least one key data;

[0066] a value data acquisition unit, configured to acquire target value data corresponding to the target key data when the result of the judgment by the first judgment unit is yes;

[0067] The target configuration determining unit is configured to execute the scheduled task configuration corresponding to the target value data as the target scheduled task configuration, and determine whether there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration.

[0068] In an exemplary embodiment, the device further comprises:

[0069] A first acquisition unit is configured to execute a logic for acquiring a new message processing;

[0070] A first selection unit is configured to select a first number of message processing nodes from the multiple message processing nodes as message processing nodes to be upgraded, and the message processing nodes other than the message processing nodes to be upgraded in the multiple message processing nodes are used as remaining message processing nodes;

[0071] The node upgrade unit is configured to upgrade the first number of message processing nodes to be upgraded according to the newly added message processing logic; when the upgrade status of the first number of message processing nodes to be upgraded is upgrade completed, the remaining message processing nodes are taken as the multiple message processing nodes, and the step of selecting the first number of message processing nodes from the multiple message processing nodes as the message processing nodes to be upgraded is executed until there are no remaining message processing nodes.

[0072] In an exemplary embodiment, the processing node determination unit includes:

[0073] A first determining unit is configured to execute and determine an upgrade message processing node that has completed the upgrade;

[0074] A second determining unit is configured to execute the upgrade message processing node and the remaining message processing nodes as candidate message processing nodes;

[0075] The second selection unit is configured to select the target message processing node from the candidate message processing nodes.

[0076] In an exemplary embodiment, the processing node determination unit further includes:

[0077] The second judgment unit is configured to execute the judgment whether the message processing logic identifier in the intermediate queue message is a newly added message processing logic identifier; when the judgment result is no, execute the step of taking the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes.

[0078] The third determining unit is configured to, when the result of the determination by the second determining unit is yes, use the upgrade message processing node as the candidate message processing node.

[0079] In an exemplary embodiment, the device further comprises:

[0080] A monitoring unit, configured to monitor the number of intermediate queue messages contained in the message queue;

[0081] A fourth determining unit is configured to determine a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages exceeds a first preset threshold;

[0082] A fifth determining unit is configured to determine the number of nodes to be added of the message processing nodes to be added according to the first number difference;

[0083] The node expansion unit is configured to increase the number of nodes of the plurality of message processing nodes according to the number of nodes to be added.

[0084] In an exemplary embodiment, the device further comprises:

[0085] A sixth determining unit is configured to determine a second quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages is less than a second preset threshold;

[0086] A seventh determining unit is configured to determine the number of message processing nodes to be reduced according to the second number difference;

[0087] The node reduction unit is configured to reduce the number of nodes of the plurality of message processing nodes according to the number of nodes to be reduced.

[0088] In an exemplary embodiment, the plurality of message processing logics correspond to at least one service message template;

[0089] The timing service message generating unit comprises:

[0090] A second acquisition unit is configured to execute the call of the target message processing logic and send a request for acquiring target business information to the business server according to the associated business parameters, so that the business server determines the target business information according to the associated business parameters;

[0091] A receiving unit, configured to receive the target service information returned by the service server;

[0092] An eighth determining unit is configured to determine a target service message template in the at least one service message template according to the target service information;

[0093] The generating subunit is configured to generate the scheduled service message to be pushed according to the target service message template.

[0094] In an exemplary embodiment, the associated service parameters include a service identifier and a target user identifier;

[0095] The second acquiring unit includes:

[0096] A request generating unit, configured to execute and call the target message processing logic to generate a request for obtaining a target business relationship, wherein the target business relationship is a relationship between a business object corresponding to the business identifier and a target user corresponding to the target user identifier;

[0097] A sending unit, configured to execute a request to obtain a target business relationship to a business server;

[0098] The eighth determining unit includes:

[0099] A ninth determining unit, configured to determine a target relationship type corresponding to the target business relationship;

[0100] The tenth determining unit is configured to determine a target service message template that matches the target user in the first service message templates according to the target relationship type, wherein the at least one service message template includes first service message templates corresponding to different relationship types.

[0101] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0102] processor;

[0103] a memory for storing instructions executable by the processor;

[0104] The processor is configured to execute the instructions to implement the method for generating a timing service message as described in any one of the above embodiments.

[0105] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method for generating a timing service message described in any of the above embodiments.

[0106] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the timing service message generation method provided in any one of the above embodiments;

[0107] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0108] By responding to a scheduled task trigger instruction, a configuration file including at least one scheduled task configuration is read, and the scheduled task configuration includes a message processing logic identifier and associated business parameters. When there is a target scheduled task configuration that matches the current time node, an intermediate queue message is generated according to the target scheduled configuration task, the intermediate queue message is stored in the target message queue, and a target message processing node among multiple message processing nodes is determined, and the target message processing node obtains the intermediate queue message from the target message queue. Since each message processing node includes multiple preset message processing logics, the target message processing logic that matches the message processing logic identifier in the obtained intermediate queue message can be determined from multiple message processing logics, and the target message processing logic is called. The target message processing logic generates a scheduled business message to be pushed according to the associated business parameters, and then the scheduled task part and the message push part are separated. In the scheduled task part, whether the scheduled task of each time node is executed can be determined according to the actual scheduled task configuration in the configuration file, and the specific message processing logic adopted each time the scheduled task is executed can be determined according to actual needs, thereby realizing customization of the message processing logic, and improving the flexibility of the scheduled push task while improving the processing speed of the message push part.

[0109] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0110] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0111] Figure 1 is an application environment diagram of a method for generating a timing service message according to an exemplary embodiment;

[0112] Figure 2 is a flow chart of a method for generating a timing service message according to an exemplary embodiment;

[0113] Figure 3 is a flowchart of gray-scale upgrading multiple message processing nodes according to an exemplary embodiment;

[0114] Figure 4a is a flow chart of another method for generating a timing service message according to an exemplary embodiment;

[0115] Figure 4b is a flow chart of another method for generating a timing service message according to an exemplary embodiment;

[0116] Figure 5 It is a flowchart of calling target message processing logic according to an exemplary embodiment, where the target message processing logic generates a timed service message to be pushed according to associated service parameters;

[0117] Figure 6 is a flowchart of scaling multiple message processing nodes according to an exemplary embodiment;

[0118] Figure 7 is a block diagram of a timing service message generating device according to an exemplary embodiment;

[0119] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0120] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0121] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0122] See also Figure 1, which is an application environment diagram of a timing service message generation method according to an exemplary embodiment, the application environment may include a server 110 and multiple terminals 120, and the server 110 and the multiple terminals 120 may be connected via a wired network or a wireless network.

[0123] The multiple terminals 120 may be smart phones, tablet computers, laptop computers, desktop computers, etc., but are not limited thereto. The terminal 120 may be installed with client software such as an application (Application, referred to as App) that provides corresponding business functions. The business functions may include, but are not limited to, live broadcast functions and instant messaging functions, that is, the application may include, but are not limited to, live broadcast App and instant messaging App. The user of the terminal 120 may log in to the application using pre-registered user information, which may include an account number and a password.

[0124] The server 110 may be a server that provides background services for the application in the terminal 120, or may be another server that is connected and communicated with the background server of the application, and may be a single server or a server cluster composed of multiple servers. The server 110 stores a configuration file, which includes at least one pre-configured scheduled task configuration, and the scheduled task configuration may include a message processing logic identifier and associated business parameters. The server 110 provides a scheduled push task service, through which scheduled business messages can be pushed to multiple terminals 120.

[0125] Specifically, Figure 1 As shown, the server 110 may include a scheduled task module, a message queue and a message consumption module, wherein the scheduled task module may generate a scheduled task trigger instruction at a certain time interval to trigger the scheduled task, and read the above-mentioned configuration file when the scheduled task is triggered, and search whether there is a target scheduled task configuration matching the current time node in at least one scheduled task configuration of the configuration file, and when a target scheduled task configuration matching the current time node is found, an intermediate queue message is generated according to the target scheduled task configuration, and the intermediate queue message is stored in the message queue; the message consumption module includes multiple message processing nodes, such as Figure 1In consumer1, consumer2 to consumerN, each message processing node includes multiple preset message processing logics. When the message consumption module consumes the intermediate queue message in the message queue, it can first determine the target message processing node among the multiple message processing nodes. The target message processing node obtains the intermediate queue message from the message queue, and determines the target message processing logic that matches the message processing logic identifier in the obtained intermediate queue message from the multiple message processing logics, and then calls the target message processing logic. The target message processing logic generates a scheduled business message to be pushed according to the associated business parameters. Of course, after the scheduled business message to be pushed is generated, it can be pushed to the corresponding terminal 120 user.

[0126] The embodiments of the present disclosure separate the scheduled business part and the message push part. In the scheduled task part, whether the scheduled task of each time node is executed is determined according to the actual scheduled task configuration in the configuration file, and the specific message processing logic adopted each time the scheduled task is executed can be determined according to actual needs, thereby realizing the customization of the message processing logic, improving the flexibility of the scheduled push task while improving the processing speed of the scheduled business message.

[0127] Figure 2 is a flow chart of a method for generating a timing service message according to an exemplary embodiment. Figure 2 As shown, the timing service message generation method is applied to Figure 1 The server 110 shown is illustrated and includes the following steps.

[0128] In step S210, in response to the scheduled task triggering instruction, the configuration file is read.

[0129] Among them, the configuration file is an external configuration file that can be modified at any time, including at least one scheduled task configuration, each scheduled task configuration includes a message processing logic identifier and associated business parameters, and of course also includes the execution time corresponding to the scheduled task configuration. Among them, the associated business parameter refers to the business parameter associated with the message processing logic corresponding to the message processing logic identifier, that is, the associated business parameter can be used as an input parameter of the message processing logic. For example, the associated business parameter can represent the target user to which the scheduled business message is pushed. The target user can be one or more. In a specific implementation, the category or feature tag to which the target user belongs can be used as the associated business parameter.

[0130] The message processing logic identifier is used to uniquely identify a message processing logic, and the message processing logic refers to the specific generation process or specific implementation method of the scheduled service message.

[0131] Specifically, the server is configured with a scheduled task that is executed at a preset time interval. A scheduled task trigger instruction is generated at each time node. The time node is the system time when the scheduled task trigger instruction is generated. The time difference between two adjacent time nodes is the preset time interval. The server can read the above configuration file in response to the trigger instruction. Among them, the time granularity of the preset time interval can be seconds, minutes or hours, and its specific time granularity can be determined according to the time granularity of the execution time in the configuration file, which can generally be equal to or less than the time granularity of the execution time. For example, if the time granularity of the execution time in the configuration file is hourly, the time granularity of the preset time interval can be set to hourly, that is, a scheduled task trigger instruction is generated once every hour; if the time granularity of the execution time in the configuration file is minute-level, the time granularity of the preset time interval can be set to minute-level, that is, a scheduled task trigger instruction is generated once every minute; if the time granularity of the execution time in the configuration file includes both hourly and minute-level, the minimum time granularity of the execution time in the configuration file can be used as the time granularity of the preset time interval, that is, the time granularity of the preset time interval can be set to minute-level here.

[0132] It should be understood that in actual applications, one or more scheduled task configurations can be added to the configuration file as needed, or one or more scheduled task configurations can be deleted from the configuration file.

[0133] In the embodiments of the present disclosure, the message processing logic included in the message processing node can be logically upgraded. The message processing logic after the logic upgrade may require more business parameters as input than before the upgrade. In order to achieve rapid logic upgrade of the message processing logic and further improve the flexibility of the scheduled push task, the configuration file can store each scheduled task configuration in the form of a key-value pair, where the key (key data) can be the execution time, and the value (value data) can be the message processing logic identifier and associated business parameters corresponding to the execution time. In a specific implementation, the storage form of each scheduled task configuration in the configuration file can be a map<string,string> , where map is a data structure in Java, representing a key-value interface.<string,string> Indicates that both key and value are of string type. With this storage format, when a message processing logic needs more business parameters as input after upgrading, the value of the message processing logic identifier corresponding to the message processing logic in the configuration file can be directly expanded.

[0134] In view of this, in an exemplary embodiment, the method may further include a configuration step of configuring the scheduled task in the configuration file, which step may include the following:

[0135] (1) In response to a configuration operation for a scheduled task, configuration parameters are obtained, where the configuration parameters may include an execution time, a message processing logic identifier, and associated business parameters.

[0136] Specifically, the server may provide a configuration interface for the scheduled task, wherein the configuration interface includes an input interface for configuration parameters, and the input configuration parameters may be obtained through the input interface.

[0137] (2) Using the above execution time as key data, and the message processing logic identifier and associated business parameters corresponding to the execution time as value data, generate the scheduled task configuration in the configuration file.

[0138] Specifically, after obtaining the configuration parameters, the server can convert the execution time in the configuration parameters into key data key, and convert the message processing logic identifier and associated business parameters corresponding to the execution time into value data value, thereby storing the scheduled task configuration in the configuration file in the form of a key-value pair. For example, if the execution time is 12:00 on August 4, 2020, the message processing logic identifier is 1, and the associated business parameter is all users, then the corresponding scheduled task configuration in the configuration file can be: {"2020080412":{"templateId":1,"user":"all"}}, where "2020080412" is the key data key, and {"templateId":1,"user":"all"} is the value data value.

[0139] In step S220, it is determined whether there is a target scheduled task configuration matching the current time node in at least one scheduled task configuration of the configuration file.

[0140] Among them, the execution time corresponding to the target scheduled task configuration is consistent with the system time corresponding to the current time node.

[0141] In the embodiments of the present disclosure, a scheduled task trigger instruction does not necessarily cause the execution of the task. It is also necessary to determine whether the task really needs to be executed at present based on the actual scheduled task configuration in the configuration file, that is, it is necessary to determine whether there is a target scheduled task configuration that matches the current time node in at least one scheduled task configuration in the configuration file. If the result of the judgment is that there is a target scheduled task configuration that matches the current time node, step S230 can be executed; if the result of the judgment is that there is no target scheduled task configuration that matches the current time node, it indicates that the scheduled task is not desired to be executed at the current time node, the task is not executed, and the scheduled task execution at the current time node is ended.

[0142] In an exemplary embodiment, for a configuration file storing each scheduled task configuration in the form of a key-value pair, step S220 may include the following steps when executed:

[0143] (1) Obtain at least one key data in the configuration file.

[0144] (2) Determine whether there is target key data matching the current time node in the at least one key data. If so, execute steps (3) to (4); if not, terminate the scheduled task of the current time node.

[0145] (3) Obtain the target value data corresponding to the target key data.

[0146] (4) The scheduled task configuration corresponding to the target value data is used as the target scheduled task configuration, and it is determined that there is a target scheduled task configuration matching the current time node in at least one scheduled task configuration.

[0147] For example, if the system time corresponding to the current time node is 13:00 on August 4, 2020, and the configuration file includes only one scheduled task configuration of {"2020080412":{"templateId":1,"user":"all"}}, then all key data keys in the configuration file are obtained to get "2020080412", and the key data key is converted to the system time of August 4, 2020 at 12:00. The system time corresponding to the current time node is compared with the system time after the key data key is converted. If the two are inconsistent, it means that there is no target key data matching the current time node in the configuration file, and the scheduled task of the current time node is terminated. If the system time corresponding to the current time node is 12:00 on August 4, 2020, the target key data "2020080412" matching the current time node can be found in the configuration file. The target value data corresponding to the target key data "2020080412" is {"templateId":1, "user": "all"}. The scheduled task configuration corresponding to the target value data {"templateId":1, "user": "all"} can be used as the target scheduled task configuration, so that the message processing logic identifier can be obtained as 1, and the associated business parameters are all users.

[0148] In step S230, an intermediate queue message is generated according to the target scheduled task configuration, and the intermediate queue message is stored in the message queue.

[0149] The message queue can be implemented based on a distributed publish-subscribe message system such as Kafka. The intermediate queue message includes the message processing logic identifier and associated business parameters corresponding to the target scheduled task configuration.

[0150] In step 240, a target message processing node among the plurality of message processing nodes is determined, and the target message processing node obtains the intermediate queue message from the message queue.

[0151] In the embodiment of the present disclosure, a message processing node can be implemented as a process, multiple message processing nodes jointly process the intermediate queue messages in the above message queue, and each message processing node includes multiple preset message processing logics. Among them, the target message processing node can be a message processing node randomly selected from the multiple message processing nodes.

[0152] In actual applications, if you want the above-mentioned multiple message processing nodes to support the newly added message processing logic, you need to upgrade the multiple message processing nodes. In the embodiment of the present disclosure, you can upgrade the message processing logic included in each message processing node. However, the message processing node in the process of node upgrade cannot process the intermediate queue messages, which will have an adverse impact on the execution of the scheduled task.

[0153] In order to avoid the impact of the above-mentioned node upgrade operation on the execution of scheduled tasks, in an exemplary implementation, a grayscale upgrade of multiple message processing nodes can be adopted, that is, multiple message processing nodes are upgraded in groups, and only one group of message processing nodes is upgraded each time, and the message processing nodes of the next group are upgraded after the message processing nodes of the group are upgraded. The number of message processing nodes to be upgraded contained in each group can be determined based on the number of actual intermediate queue messages and the number of multiple message processing nodes. For example, each group can include only one message processing node. Then, when grayscale upgrading the message processing nodes, one message processing node is upgraded first and then the next message processing node is upgraded. This ensures that the execution of scheduled tasks is not affected and the newly added message processing logic is smoothly launched. In a specific implementation, a grayscale upgrade of multiple message processing nodes may include Figure 3 The following steps:

[0154] In step S310, newly added message processing logic is obtained.

[0155] In step S320, a first number of message processing nodes are selected from a plurality of message processing nodes as message processing nodes to be upgraded, and message processing nodes other than the message processing nodes to be upgraded from the plurality of message processing nodes are selected as remaining message processing nodes.

[0156] The first number can be set according to actual needs, for example, it can be 1.

[0157] In step S330, a first number of message processing nodes to be upgraded are upgraded according to the above-mentioned newly added message processing logic.

[0158] That is, the newly added message processing logic is respectively encapsulated into the first number of message processing nodes to be upgraded, so that the first number of upgraded message processing nodes can support the message processing logic.

[0159] In step S340, when the upgrade status of the above-mentioned first number of message processing nodes to be upgraded is upgrade completed, the above-mentioned remaining message processing nodes are used as multiple message processing nodes in step S320, and the step of selecting the first number of message processing nodes from the multiple message processing nodes as the message processing nodes to be upgraded for upgrading is executed until there are no remaining message processing nodes.

[0160] by Figure 1 For example, the message consumption module includes three message processing nodes (consumer1, consumer2, consumer3). When upgrading the three message processing nodes, consumer1 can be upgraded first. At this time, (consumer2, consumer3) are the remaining message processing nodes. After the upgrade of consumer1 is completed, consumer2 can be selected from the remaining message processing nodes (consumer2, consumer3) for upgrading. At this time, (consumer3) is the remaining message processing node. After the upgrade of consumer2 is completed, consumer3 can be selected from the remaining message processing nodes (consumer3) for upgrading. At this time, there are no remaining message processing nodes. Therefore, when the upgrade of consumer3 is completed, the upgrade of all message processing nodes is completed.

[0161] In order to ensure that the execution of scheduled tasks is not affected by the upgrade of each message processing node and at the same time enable the system to have high concurrent processing capabilities, in an exemplary embodiment, Figure 4a As shown in , the above step S230 may include the following steps when determining the target message processing node among the multiple message processing nodes:

[0162] In step S410, an upgrade message processing node that has completed the upgrade is determined.

[0163] The upgraded message processing node that has completed the upgrade includes the new message processing logic.

[0164] In step S420, the upgraded message processing node and the remaining message processing nodes are taken as candidate message processing nodes.

[0165] It can be understood that the remaining message processing nodes are not in an upgraded state and thus can process the intermediate queue messages.

[0166] In step S430, a target message processing node is selected from the candidate message processing nodes.

[0167] It can be seen from the above-mentioned upgrade process of the embodiment of the present disclosure that in the process of upgrading multiple message processing nodes, the message processing nodes that have completed the upgrade include the newly added message processing logic, while the message processing nodes that have not yet been upgraded do not include the newly added message processing logic. If the message processing logic identifier in the scheduled task configuration corresponding to the current time node is exactly the newly added message processing logic identifier, then in order to ensure the timely and correct execution of the scheduled task, the target message processing node can only be selected from the upgraded message processing nodes that have been upgraded. Therefore, in an exemplary implementation, if Figure 4b As shown, before step S420, the following may also be included:

[0168] In step S440, it is determined whether the message processing logic identifier in the current intermediate queue message is a newly added message processing logic identifier. If so, step S450 is executed; if not, the aforementioned step S420 is executed.

[0169] The current intermediate queue message is the intermediate queue message currently to be processed.

[0170] In step S450, the upgraded message processing node is used as a candidate message processing node.

[0171] In a specific implementation, the server can configure a scheduling node for the message consumption module, and the scheduling node is used to perform the step S240 of determining the target message processing node among multiple message processing nodes. The scheduling node can maintain a message processing logic identifier record table, so that when executing step S440, it can be checked whether the current message processing logic identifier exists in the record table. If not, it indicates that the current message processing logic identifier is a newly added message processing logic identifier. If it exists, it indicates that the current message processing logic identifier is not a newly added message processing logic identifier. After determining that the current message processing logic identifier is a newly added message processing logic identifier, the scheduling node can automatically add the newly added message processing logic identifier to the message processing logic identifier record table, thereby completing the timely update of the record table so that the system supports high concurrency.

[0172] In step S250, a target message processing logic is determined from a plurality of message processing logics, and the target message processing logic matches the message processing logic identifier in the intermediate queue message.

[0173] Specifically, the target message processing logic that matches the message processing logic identifier in the obtained intermediate queue message can be determined from multiple message processing logics included in the target message processing node.

[0174] In step 260, the above-mentioned target message processing logic is called, and the target message processing logic generates a scheduled service message to be pushed according to the associated service parameters.

[0175] Since the target message processing logic matches the message processing logic identifier in the scheduled task configuration, and the message processing logic identifier is configured according to actual needs, the embodiment of the present disclosure allows the specific generation method of the scheduled business message in the scheduled push task to be customized according to actual needs, which greatly improves the flexibility of the scheduled push task. In addition, the grayscale upgrade of the message processing node ensures that the execution of the scheduled task is not affected by the upgrade operation, and the new message processing logic is smoothly launched.

[0176] In order to improve the efficiency of generating scheduled service messages, in an exemplary embodiment, multiple message processing logics may correspond to at least one service message template. A service message template refers to a data structure with certain format and content restrictions, and some contents can be customized as needed. Then, when executing step S260, it may include Figure 5 The following steps:

[0177] In step S510, the target message processing logic is called to send a request for obtaining target business information to the business server according to the associated business parameters, so that the business server determines the target business information according to the associated business parameters.

[0178] The service server is a server that matches the service corresponding to the associated service parameter. For example, if the associated service parameter includes live broadcast information, the service server may be a live broadcast server.

[0179] In step S520, target service information returned by the service server is received.

[0180] In step S530, a target service message template in at least one service message template is determined according to the target service information.

[0181] In step S540, a scheduled service message to be pushed is generated according to the target service message template.

[0182] The following example uses the relationship-based target message processing logic, where the associated business parameters include the business identifier and the target user identifier. Figure 5 The method shown in is introduced in

[0183] The execution of the above step S510 may include the following steps:

[0184] (1) Calling the target message processing logic to generate a request to obtain a target business relationship, wherein the target business relationship is a relationship between a business object corresponding to the business identifier and a target user corresponding to the target user identifier.

[0185] For example, the business identifier may be a live broadcast identifier, and the target business relationship is the relationship between the anchor corresponding to the live broadcast identifier and the target user. The relationship may include, but is not limited to, a friend relationship, a follow-up relationship, etc., and the target business relationship in this step may be a friend relationship or a follow-up relationship.

[0186] (2) Send a request to the business server to obtain the target business relationship.

[0187] Continuing with the example in (1) above, the business server can be a live broadcast server, that is, in the process of the target message processing node generating a scheduled business message through the target message processing logic, the relevant interface can be called to send a request to the live broadcast server to obtain the target business relationship, and the acquisition request carries a live broadcast identifier and a target user identifier.

[0188] Correspondingly, after receiving the acquisition request, the live broadcast server can determine the target business relationship between the anchor corresponding to the live broadcast identifier and the target user corresponding to the target user identifier, and then can receive the target business relationship returned by the live broadcast server.

[0189] Accordingly, the execution of the above step S530 may include the following steps:

[0190] (1) Determine the target relationship type corresponding to the target business relationship.

[0191] For example, the target relationship type may be a friend relationship or a follow relationship.

[0192] (2) Determine a target service message template that matches the target user in the first service message templates according to the target relationship type, wherein at least one service message template includes first service message templates corresponding to different relationship types.

[0193] For example, the first service message template corresponding to a friend relationship may be "your friend xxx has started live streaming", and the first service message template corresponding to a follow relationship may be "hi xxx, xxx, who your friend xxx also follows, has started live streaming". After the first service message template is determined, a timed service message corresponding to the target user may be generated according to the first service message template.

[0194] In actual applications, when there are many scheduled push tasks, a large number of intermediate queue messages will be generated. In order to improve the flexibility of the server for scheduled push tasks and enhance the processing capability under high concurrency, in an exemplary implementation, Figure 6 As shown, the method may also include:

[0195] In step S610, the number of intermediate queue messages contained in the message queue is monitored.

[0196] In step S620, when the number of messages exceeds a first preset threshold, a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes is determined.

[0197] The first preset threshold is greater than or equal to the number of the plurality of message processing nodes, and the specific value of the first preset threshold can be set according to actual needs.

[0198] For example, the number of messages in the current intermediate queue is 10, the first preset threshold is 5, and the number of nodes of multiple message processing nodes in the message consumption module is also 5. Since the number of messages is greater than the first preset threshold, the first quantity difference between the number of messages and the number of nodes is determined to be 5 (10-5=5).

[0199] In step S630, the number of message processing nodes to be added is determined according to the first number difference.

[0200] In step S640, the number of the plurality of message processing nodes is increased according to the number of nodes to be added.

[0201] Specifically, the number of nodes to be added can be greater than or equal to the first number difference, and the number of message processing nodes to be added is added to the message consumption module, thereby expanding the capacity of multiple message processing nodes in the message consumption module and enhancing the processing capability under high concurrency. Taking the above example, for example, if the number of nodes to be added is equal to the first number difference of 5, then 5 message processing nodes can be added to the message consumption module. It can be understood that each added message processing node includes multiple message processing logics.

[0202] In order to further improve the flexibility of the server for scheduled push tasks to save resource overhead, in another exemplary embodiment, Figure 6 As shown, after step S610, the method may further include:

[0203] In step S650, when the number of messages is less than the second preset threshold, a second number difference between the number of messages and the number of nodes of the plurality of message processing nodes is determined.

[0204] The second preset threshold is less than or equal to the number of the plurality of message processing nodes, and the specific value of the second preset threshold can be set according to actual needs.

[0205] For example, the number of messages in the current intermediate queue is 3, the second preset threshold is 5, and the number of nodes of multiple message processing nodes in the message consumption module is 5. Since the number of messages is less than the second preset threshold, the second number difference between the number of messages and the number of nodes is determined to be 2 (5-3=5).

[0206] In step S660, the number of message processing nodes to be reduced is determined according to the second number difference.

[0207] In step S670, the number of nodes of the plurality of message processing nodes is reduced according to the number of nodes to be reduced.

[0208] Specifically, the number of nodes to be reduced can be less than or equal to the first number difference, and the message consumption module is reduced by the number of message processing nodes to be reduced, thereby reducing the capacity of multiple message processing nodes in the message consumption module, saving unnecessary resource overhead while ensuring processing capacity, and improving the flexibility of the server for scheduled push tasks. Taking the above example, if the number of nodes to be reduced is equal to the second number difference of 2, then 2 message processing nodes can be reduced for the message consumption module.

[0209] The embodiments of the present disclosure flexibly scale up and down multiple message processing nodes in the message consumption module based on the number of messages in the intermediate queue messages, which not only ensures high concurrent processing capabilities for scheduled push tasks, but also saves system resource overhead.

[0210] Figure 7 FIG. 1 is a block diagram of a device for generating a timing service message according to an exemplary embodiment. Figure 7 The device includes a configuration reading unit 710, a queue message storage unit 720, a processing node determination unit 730, a message processing logic determination unit 740 and a timing service message generation unit 750.

[0211] The configuration reading unit 710 is configured to execute in response to a scheduled task trigger instruction and read a configuration file; the configuration file includes at least one scheduled task configuration, and the scheduled task configuration includes a message processing logic identifier and associated business parameters;

[0212] The queue message storage unit 720 is configured to generate an intermediate queue message according to the target scheduled task configuration when there is a target scheduled task configuration matching the current time node in at least one scheduled task configuration, and store the intermediate queue message in the message queue;

[0213] The processing node determination unit 730 is configured to determine a target message processing node among a plurality of message processing nodes, and the target message processing node obtains the intermediate queue message from the message queue, and each message processing node includes a plurality of preset message processing logics;

[0214] The message processing logic determination unit 740 is configured to determine a target message processing logic from a plurality of message processing logics, the target message processing logic matching the message processing logic identifier in the intermediate queue message;

[0215] The scheduled service message generating unit 750 is configured to execute the calling target message processing logic, and the target message processing logic generates the scheduled service message to be pushed according to the associated service parameters.

[0216] In an exemplary embodiment, the device may further include:

[0217] A configuration parameter acquisition unit is configured to execute a configuration operation in response to a scheduled task and acquire configuration parameters; the configuration parameters include an execution time, a message processing logic identifier, and associated business parameters;

[0218] The task configuration generating unit is configured to generate a scheduled task configuration in a configuration file with the execution time as key data and the message processing logic identifier and associated business parameters corresponding to the execution time as value data.

[0219] In an exemplary embodiment, the device may further include:

[0220] A key data acquisition unit, configured to acquire at least one key data in the configuration file;

[0221] A first judgment unit is configured to judge whether there is target key data matching the current time node in the at least one key data;

[0222] a value data acquisition unit, configured to acquire target value data corresponding to the target key data when the result of the judgment by the first judgment unit is yes;

[0223] The target configuration determining unit is configured to execute the scheduled task configuration corresponding to the above target value data as the target scheduled task configuration, and determine that there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration.

[0224] In an exemplary embodiment, the device may further include:

[0225] A first acquisition unit is configured to execute a logic for acquiring a new message processing;

[0226] A first selection unit is configured to select a first number of message processing nodes from a plurality of message processing nodes as message processing nodes to be upgraded, and message processing nodes other than the message processing nodes to be upgraded from the plurality of message processing nodes as remaining message processing nodes;

[0227] The node upgrade unit is configured to upgrade the first number of message processing nodes to be upgraded according to the newly added message processing logic; when the upgrade status of the first number of message processing nodes to be upgraded is upgrade completed, the remaining message processing nodes are used as multiple message processing nodes in the first selection unit, and the step of selecting the first number of message processing nodes from multiple message processing nodes as message processing nodes to be upgraded is executed until there are no remaining message processing nodes.

[0228] In an exemplary implementation, the processing node determination unit 730 may include:

[0229] A first determining unit is configured to execute and determine an upgrade message processing node that has completed the upgrade;

[0230] A second determining unit is configured to execute the above-mentioned upgraded message processing node and the remaining message processing nodes as candidate message processing nodes;

[0231] The second selection unit is configured to select a target message processing node from the candidate message processing nodes.

[0232] In an exemplary implementation, the processing node determination unit 730 may further include:

[0233] The second judgment unit is configured to execute the judgment whether the message processing logic identifier in the intermediate queue message is a newly added message processing logic identifier; when the result of the judgment is no, execute the step of taking the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes.

[0234] The third determining unit is configured to, when the result of the determination by the second determining unit is yes, select the upgraded message processing node as a candidate message processing node.

[0235] In an exemplary embodiment, the device may further include:

[0236] A monitoring unit is configured to monitor the number of intermediate queue messages contained in the message queue;

[0237] A fourth determining unit is configured to determine a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages exceeds a first preset threshold;

[0238] A fifth determining unit is configured to determine the number of nodes to be added of the message processing nodes to be added according to the first number difference;

[0239] The node expansion unit is configured to increase the number of the multiple message processing nodes according to the number of nodes to be added.

[0240] In an exemplary embodiment, the device may further include:

[0241] A sixth determining unit is configured to determine a second quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages is less than a second preset threshold;

[0242] A seventh determining unit is configured to determine the number of message processing nodes to be reduced according to the second number difference;

[0243] The node reduction unit is configured to reduce the number of the multiple message processing nodes according to the number of nodes to be reduced.

[0244] In an exemplary embodiment, the plurality of message processing logics correspond to at least one business message template;

[0245] Accordingly, the timing service message generating unit 750 may include:

[0246] A second acquisition unit is configured to execute the call target message processing logic and send a request for acquiring target business information to the business server according to the associated business parameters, so that the business server determines the target business information according to the associated business parameters;

[0247] A receiving unit, configured to receive target service information returned by the service server;

[0248] An eighth determining unit is configured to determine a target service message template in at least one service message template according to the target service information;

[0249] The generating subunit is configured to generate a scheduled service message to be pushed according to the target service message template.

[0250] In an exemplary implementation, the above-mentioned associated service parameters may include a service identifier and a target user identifier;

[0251] Accordingly, the second obtaining unit may include:

[0252] A request generating unit is configured to execute the calling target message processing logic and generate a request for obtaining a target business relationship, where the target business relationship is a relationship between the business object corresponding to the above business identifier and the target user corresponding to the above target user identifier;

[0253] A sending unit, configured to execute a request to obtain a target business relationship to a business server;

[0254] Accordingly, the eighth determining unit may include:

[0255] A ninth determining unit is configured to determine a target relationship type corresponding to the target business relationship;

[0256] The tenth determining unit is configured to determine a target service message template that matches the target user in the first service message template according to the target relationship type, wherein the at least one service message template includes first service message templates corresponding to different relationship types.

[0257] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0258] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the steps of any of the timing service message generation methods in the above embodiments when executing the instructions stored in the memory.

[0259] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Figure 8It is a block diagram of an electronic device for generating a timing service message according to an exemplary embodiment. The electronic device 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 810 (the processor 810 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 830 for storing data, and one or more storage media 820 (such as one or more mass storage devices) for storing application programs 823 or data 822. Among them, the memory 830 and the storage medium 820 can be short-term storage or permanent storage. The program stored in the storage medium 820 may include one or more modules, and each module may include a series of instruction operations in the electronic device. Furthermore, the central processor 810 can be configured to communicate with the storage medium 820 to execute a series of instruction operations in the storage medium 820 on the electronic device 800. The electronic device 800 may also include one or more power supplies 860, one or more wired or wireless network interfaces 850, one or more input and output interfaces 840, and / or one or more operating systems 821, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0260] The input / output interface 840 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 800. In one example, the input / output interface 840 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In an exemplary embodiment, the input / output interface 840 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0261] It can be understood by those skilled in the art that Figure 8 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 8 More or fewer components as shown, or with Figure 8 Different configurations are shown.

[0262] In an exemplary embodiment, a storage medium is further provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the steps of any of the timing service message generation methods in the above embodiments.

[0263] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the timing service message generation method provided in any of the above embodiments.

[0264] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0265] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0266] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for generating a timed service message, characterized in that: include: In response to a scheduled task trigger instruction, a configuration file is read; the configuration file includes at least one scheduled task configuration, and the scheduled task configuration includes a message processing logic identifier and associated business parameters; When there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration, generating an intermediate queue message according to the target scheduled task configuration, and storing the intermediate queue message in a message queue; Acquire new message processing logic; select a first number of message processing nodes from a plurality of message processing nodes as message processing nodes to be upgraded, and the message processing nodes other than the message processing nodes to be upgraded from the plurality of message processing nodes as remaining message processing nodes; Upgrading the first number of message processing nodes to be upgraded according to the newly added message processing logic; Determine an upgraded message processing node that has completed the upgrade; determine whether the message processing logic identifier in the intermediate queue message is a newly added message processing logic identifier; when the result of the determination is no, use the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes; When the result of the judgment is yes, taking the upgraded message processing node as the candidate message processing node; Selecting a target message processing node from the candidate message processing nodes, and having the target message processing node obtain the intermediate queue message from the message queue, each of the message processing nodes including a plurality of preset message processing logics; Determine a target message processing logic from the multiple message processing logics, the target message processing logic matching the message processing logic identifier in the intermediate queue message; The target message processing logic is called, and the target message processing logic generates a scheduled service message to be pushed according to the associated service parameters.

2. The method for generating a timing service message according to claim 1, characterized in that: The method further comprises: In response to a configuration operation for a scheduled task, obtaining configuration parameters; the configuration parameters include execution time, message processing logic identifier, and associated business parameters; The scheduled task configuration in the configuration file is generated by using the execution time as key data and the message processing logic identifier and associated business parameters corresponding to the execution time as value data.

3. The method for generating a timing service message according to claim 2, characterized in that: When there is a target scheduled task configuration matching the current time in the at least one scheduled task configuration, before generating the intermediate queue message according to the target scheduled task configuration, the method further includes: Obtain at least one key data in the configuration file; Determine whether there is target key data matching the current time node in the at least one key data; When the result of the judgment is yes, obtaining the target value data corresponding to the target key data; The scheduled task configuration corresponding to the target value data is used as a target scheduled task configuration, and it is determined that there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration.

4. The method for generating a timing service message according to claim 1, characterized in that: The method further comprises: When the upgrade status of the first number of message processing nodes to be upgraded is upgrade completed, the remaining message processing nodes are taken as the multiple message processing nodes, and the step of selecting the first number of message processing nodes from the multiple message processing nodes as the message processing nodes to be upgraded is performed until there are no remaining message processing nodes.

5. The method for generating a timing service message according to claim 1, characterized in that: The method further comprises: Monitoring the number of intermediate queue messages contained in the message queue; When the number of messages exceeds a first preset threshold, determining a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes; Determine the number of nodes to be added of the message processing nodes to be added according to the first number difference; The number of nodes of the plurality of message processing nodes is increased according to the number of nodes to be added.

6. The method for generating a timing service message according to claim 5, characterized in that: The method further comprises: When the number of messages is less than a second preset threshold, determining a second quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes; Determine the number of message processing nodes to be reduced according to the second number difference; The number of nodes of the plurality of message processing nodes is reduced according to the number of nodes to be reduced.

7. The method for generating a timing service message according to claim 1, characterized in that: The multiple message processing logics correspond to at least one business message template; The calling of the target message processing logic, wherein the target message processing logic generates a timed service message to be pushed according to the associated service parameter, comprises: Calling the target message processing logic, and sending a request for obtaining target service information to a service server according to the associated service parameters, so that the service server determines the target service information according to the associated service parameters; Receiving the target service information returned by the service server; Determine a target service message template in the at least one service message template according to the target service information; Generate the scheduled service message to be pushed according to the target service message template.

8. The method for generating a timing service message according to claim 7, characterized in that: The associated service parameters include a service identifier and a target user identifier; The calling of the target message processing logic and sending a request for obtaining target service information to the service server according to the associated service parameters comprises: Calling the target message processing logic to generate a request for obtaining a target business relationship, where the target business relationship is a relationship between a business object corresponding to the business identifier and a target user corresponding to the target user identifier; Sending a request to obtain the target business relationship to the business server; Determining a target service message template in the at least one service message template according to the target service information includes: Determining a target relationship type corresponding to the target business relationship; A target service message template matching the target user in the first service message templates is determined according to the target relationship type, and the at least one service message template includes first service message templates corresponding to different relationship types.

9. A timing service message generating device, characterized in that: include: A configuration reading unit is configured to execute in response to a scheduled task trigger instruction and read a configuration file; the configuration file includes at least one scheduled task configuration, and the scheduled task configuration includes a message processing logic identifier and associated business parameters; A queue message storage unit is configured to generate an intermediate queue message according to the target scheduled task configuration when there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration, and store the intermediate queue message in the message queue; A processing node determination unit is configured to execute acquisition of newly added message processing logic; select a first number of message processing nodes from a plurality of message processing nodes as message processing nodes to be upgraded, and the message processing nodes other than the message processing nodes to be upgraded from the plurality of message processing nodes as remaining message processing nodes; Upgrading the first number of message processing nodes to be upgraded according to the newly added message processing logic; Determine an upgraded message processing node that has completed the upgrade; determine whether the message processing logic identifier in the intermediate queue message is a newly added message processing logic identifier; when the result of the determination is no, use the upgraded message processing node and the remaining message processing nodes as candidate message processing nodes; When the result of the judgment is yes, taking the upgraded message processing node as the candidate message processing node; Selecting a target message processing node from the candidate message processing nodes, and having the target message processing node obtain the intermediate queue message from the message queue, each of the message processing nodes including a plurality of preset message processing logics; a message processing logic determination unit, configured to determine a target message processing logic from the multiple message processing logics, the target message processing logic matching the message processing logic identifier in the intermediate queue message; The scheduled service message generating unit is configured to execute and call the target message processing logic, and the target message processing logic generates the scheduled service message to be pushed according to the associated service parameters.

10. The timing service message generating device according to claim 9, characterized in that: The device also includes: A configuration parameter acquisition unit, configured to execute a configuration operation in response to a scheduled task and acquire configuration parameters; the configuration parameters include an execution time, a message processing logic identifier, and associated business parameters; The task configuration generating unit is configured to generate the scheduled task configuration in the configuration file by taking the execution time as key data and the message processing logic identifier and associated business parameters corresponding to the execution time as value data.

11. The timing service message generating device according to claim 10, characterized in that: The device also includes: A key data acquisition unit, configured to acquire at least one key data in the configuration file; A first judgment unit is configured to judge whether there is target key data matching the current time node in the at least one key data; a value data acquisition unit, configured to acquire target value data corresponding to the target key data when the result of the judgment by the first judgment unit is yes; The target configuration determining unit is configured to execute the scheduled task configuration corresponding to the target value data as the target scheduled task configuration, and determine whether there is a target scheduled task configuration matching the current time node in the at least one scheduled task configuration.

12. The timing service message generating device according to claim 9, characterized in that: The device also includes: The node upgrading unit is configured to execute the step of selecting a first number of message processing nodes from the multiple message processing nodes as the message processing nodes to be upgraded for upgrading when the upgrade status of the first number of message processing nodes to be upgraded is upgrade completed, taking the remaining message processing nodes as the multiple message processing nodes, until there are no remaining message processing nodes.

13. The timing service message generating device according to claim 9, characterized in that: The device also includes: A monitoring unit, configured to monitor the number of intermediate queue messages contained in the message queue; A fourth determining unit is configured to determine a first quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages exceeds a first preset threshold; A fifth determining unit is configured to determine the number of nodes to be added of the message processing nodes to be added according to the first number difference; The node expansion unit is configured to increase the number of nodes of the plurality of message processing nodes according to the number of nodes to be added.

14. The timing service message generating device according to claim 13, characterized in that: The device also includes: A sixth determining unit is configured to determine a second quantity difference between the number of messages and the number of nodes of the plurality of message processing nodes when the number of messages is less than a second preset threshold; A seventh determining unit is configured to determine the number of message processing nodes to be reduced according to the second number difference; The node reduction unit is configured to reduce the number of nodes of the plurality of message processing nodes according to the number of nodes to be reduced.

15. The timing service message generating device according to claim 9, characterized in that: The multiple message processing logics correspond to at least one business message template; The timing service message generating unit comprises: A second acquisition unit is configured to execute the call of the target message processing logic and send a request for acquiring target business information to the business server according to the associated business parameters, so that the business server determines the target business information according to the associated business parameters; A receiving unit, configured to receive the target service information returned by the service server; An eighth determining unit is configured to determine a target service message template in the at least one service message template according to the target service information; The generating subunit is configured to generate the scheduled service message to be pushed according to the target service message template.

16. The timing service message generating device according to claim 15, characterized in that: The associated service parameters include a service identifier and a target user identifier; The second acquiring unit includes: A request generating unit, configured to execute and call the target message processing logic to generate a request for obtaining a target business relationship, wherein the target business relationship is a relationship between a business object corresponding to the business identifier and a target user corresponding to the target user identifier; A sending unit, configured to execute a request to obtain a target business relationship to a business server; The eighth determining unit includes: A ninth determining unit, configured to determine a target relationship type corresponding to the target business relationship; The tenth determining unit is configured to determine a target service message template that matches the target user in the first service message templates according to the target relationship type, wherein the at least one service message template includes first service message templates corresponding to different relationship types.

17. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the timing service message generating method according to any one of claims 1 to 8.

18. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the timing service message generating method according to any one of claims 1 to 8.

19. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the timing service message generating method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Timing task processing method, system and equipment

    CN110245008A

  • Virtual machine component upgrading method and device and computer readable storage medium

    CN110874232A

  • Message processing method and device, storage medium and electronic device

    CN111338814A

  • Message processing method and device, electronic equipment and readable storage medium

    CN111585867A

  • Data processing system and method

    WO2019219005A1