Message push processing method and device, computer equipment and readable storage medium
By decoupling the service interface and the message processing interface in the message push processing method, a continuous and non-overlapping message query interval is built, the problem of incomplete message push in traditional technology is solved, and efficient and complete message push is achieved.
Patent Information
- Application Number
- CN202411156793.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In traditional technology, message pushing methods rely on coupled calls between the service interface and the message processing interface, resulting in the inability to push the complete message content, because the service data in this query starts from the end time of the last push, which may lead to data loss.
By decoupling the service interface and the message processing interface, a message push processing method is adopted to determine the push message type of the message push task, and build a continuous and non-overlapping message query interval based on the current time and historical task execution records, thereby querying and pushing the complete message content.
It realizes that the complete message content can be pushed efficiently without the need for coupled calls between the service interface and the message processing interface, ensuring the integrity and deduplication efficiency of the message content.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of big data processing, and in particular to a message push processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In the scenario where a message needs to be pushed for business completion, traditional technologies rely on the coupled call of the business interface and the message processing interface. Usually, the business interface needs to call the message processing interface to obtain business data, and then the message processing interface obtains the message content to be pushed by processing the business data. Then, the message processing interface stores the message content in the cache so that the message consumer can retrieve the message from the cache and push it. In the process of the message processing interface obtaining business data, the execution end time of the last pushed message is usually directly used as the start time of this query of business data to determine the specific time period to be queried, so as to query and obtain business data. However, the method of starting the query only from the last execution end time will cause the business data queried this time to be missing, resulting in incomplete content of the pushed message.
[0003] Therefore, the message push method in the traditional technology not only relies on the coupled call of the business interface and the message processing interface, but also cannot push the complete message content. Summary of the invention
[0004] Based on this, it is necessary to provide a message push processing method, device, computer equipment, computer-readable storage medium and computer program product that can achieve decoupling of the business interface and the message processing interface and efficiently push complete message content to address the above technical problems.
[0005] In the first aspect, the present application provides a message push processing method, including: if there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks, and use the current time as the query end time; for each message push task, if the historical task execution record of the push message type of the message push task is queried, determine the last execution end time and the message processing duration during the last execution from the historical task execution record; based on the last execution end time and the message processing duration, determine the query start time, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; according to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task to push the message content.
[0006] In one of the embodiments, according to the message query interval, the message content belonging to the message push task is queried, including: obtaining the target business data table associated with the push message type of the message push task; each data stored in the target business data table is marked with the data generation time; according to the message query interval, the target business data table is queried to obtain the business data whose data generation time is within the message query interval; according to the business data, the message content belonging to the message push task is obtained.
[0007] In one of the embodiments, the business data includes sub-business data under multiple data types; based on the business data, the message content belonging to the message push task is obtained, including: obtaining the data processing rules that match each data type; for each sub-business data in the business data, according to the data processing rules that match the data type to which the sub-business data belongs, data processing is performed on the sub-business data to obtain the data processing result of the business data; based on the data processing result of the business data, the message content belonging to the message push task is obtained.
[0008] In one of the embodiments, based on the data processing results of the business data, the message content belonging to the message push task is obtained, including: querying the historical task execution records to obtain the pushed historical messages associated with the push message type of the message push task; comparing the historical messages with the data processing results to determine the duplicate data in the data processing results; deleting the duplicate data in the data processing results to obtain the data to be pushed; obtaining the message splicing template that matches the push message type of the message push task, assembling the data to be pushed according to the message splicing template, and obtaining the message content belonging to the message push task.
[0009] In one of the embodiments, executing a message push task to push message content includes: obtaining a message push channel that matches the push message type of the message push task, and an object identifier carried in the message content; and pushing the message content to a message recipient associated with the object identifier through the message push channel.
[0010] In one of the embodiments, the message push processing method also includes: if no historical task execution record of the push message type of the message push task is found, the current time is used as the query end time, and a message query interval is constructed based on the query end time; according to the message query interval, the message content belonging to the message push task is queried and the message push task is executed to push the message content.
[0011] On the second aspect, the present application also provides a message push processing device, including: a push message type determination module, which is used to determine the push message type of at least one message push task if there is at least one message push task to be executed at the current time, and use the current time as the query end time; a message processing duration determination module, which is used to determine the last execution end time and the message processing duration during the last execution from the historical task execution records for each message push task if the historical task execution record of the push message type of the message push task is queried; a non-first query interval construction module, which is used to determine the query start time based on the last execution end time and the message processing duration, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; a non-first message content push module, which is used to query and obtain the message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content.
[0012] In one of the embodiments, the non-first message content push module includes: a data table acquisition unit, used to acquire the target business data table associated with the push message type of the message push task; each data stored in the target business data table is marked with the data generation time; a business data acquisition unit, used to query the target business data table according to the message query interval, and obtain the business data whose data generation time is within the message query interval; a message content acquisition unit, used to obtain the message content belonging to the message push task based on the business data.
[0013] In one of the embodiments, the business data includes sub-business data under multiple data types; the message content acquisition unit is specifically used to: obtain the data processing rules that match each data type; for each sub-business data in the business data, according to the data processing rules that match the data type to which the sub-business data belongs, perform data processing on the sub-business data to obtain the data processing result of the business data; based on the data processing result of the business data, obtain the message content belonging to the message push task.
[0014] In one of the embodiments, the message content obtaining unit is also used to: query the historical task execution records to obtain the pushed historical messages associated with the push message type of the message push task; compare the historical messages with the data processing results to determine the duplicate data in the data processing results; delete the duplicate data in the data processing results to obtain the data to be pushed; obtain the message splicing template that matches the push message type of the message push task, assemble the data to be pushed according to the message splicing template, and obtain the message content belonging to the message push task.
[0015] In one of the embodiments, the non-first message content push module includes: a channel identification acquisition unit, used to obtain a message push channel that matches the push message type of the message push task, and an object identifier carried in the message content; a non-first message content push unit, used to push the message content to the message recipient associated with the object identifier through the message push channel.
[0016] In one of the embodiments, the message push processing device also includes: a first query interval construction module, which is used to use the current time as the query end time if the historical task execution record of the push message type of the message push task is not found, and to construct a message query interval based on the query end time; a first message content push module, which is used to query and obtain the message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content.
[0017] In the third aspect, the present application also provides a computer device, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: if there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks, and use the current time as the query end time; for each message push task, if the historical task execution record of the push message type of the message push task is queried, determine the last execution end time and the message processing duration during the last execution from the historical task execution record; based on the last execution end time and the message processing duration, determine the query start time, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; according to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task to push the message content.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the following steps when executed by a processor: if there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks, and use the current time as the query end time; for each message push task, if a historical task execution record of the push message type of the message push task is queried, determine the last execution end time and the message processing duration during the last execution from the historical task execution record; determine the query start time based on the last execution end time and the message processing duration, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; according to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task to push the message content.
[0019] In the fifth aspect, the present application also provides a computer program product, including a computer program, which implements the following steps when executed by a processor: if there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks, and use the current time as the query end time; for each message push task, if the historical task execution record of the push message type of the message push task is queried, determine the last execution end time and the message processing duration during the last execution from the historical task execution record; based on the last execution end time and the message processing duration, determine the query start time, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; according to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task to push the message content.
[0020] The above-mentioned message push processing method, device, computer equipment, computer-readable storage medium and computer program product, if there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push task, and use the current time as the query end time. For each message push task, if the historical task execution record of the push message type of the message push task is queried, the last execution end time and the message processing duration during the last execution are determined from the historical task execution record. Further, considering the time difference caused by the message processing time, the query start time is determined based on the last execution end time and the message processing duration, instead of directly using the last execution end time as the query start time of this query as in the traditional technology. Based on this, the message query interval of the message push task can be constructed according to the query start time and the query end time, so that the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record. Among them, the interval continuity can ensure that the query obtains the complete message content, and the interval non-overlap is conducive to reducing the repetitiveness of the message content obtained by the query, improving the efficiency of subsequent message content deduplication, and thus facilitating efficient message push. Furthermore, the complete message content belonging to the message push task can be obtained according to the message query interval query. This process does not rely on the business interface to call the message processing interface to obtain data, but automatically determines the message query interval and obtains business data by setting a scheduled task. Finally, the message push task is executed to push the message content. In the whole process, compared with the message push method in traditional technology, there is no need for the coupled call of the business interface and the message processing interface, and the complete message content can be pushed efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 An application environment diagram of a message push processing method in an embodiment;
[0023] Figure 2 It is an application environment diagram of a message push processing method in another embodiment;
[0024] Figure 3 A schematic diagram of a flow chart of a message push processing method in one embodiment;
[0025] Figure 4A schematic diagram of a process of querying and obtaining message content belonging to a message push task according to a message query interval in an embodiment;
[0026] Figure 5 A schematic diagram of a flow chart of a message processor processing business data in one embodiment;
[0027] Figure 6 It is a schematic diagram of a process of performing data deduplication on a received data processing result by a message sender in one embodiment;
[0028] Figure 7 A schematic diagram of a process of executing a message push task to push message content in one embodiment;
[0029] Figure 8 This is a schematic diagram of a process of pushing message content for the first time in one embodiment;
[0030] Fig. 9 A flowchart of a message push processing method including first push and non-first push in one embodiment;
[0031] Fig.10 It is a structural block diagram of a message push processing device in an embodiment;
[0032] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. It should be noted that in the embodiments of the present application, certain software, groups, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with relevant provisions of national laws and regulations.
[0035] The message push processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the server 100 can communicate with the terminal 200 through the network. The server 100 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The server 100 can be pre-customized with multiple scheduled message push tasks. The data storage system can store the data that the server 100 needs to process. The data storage system can be integrated on the server 100, or it can be placed on the cloud or other network servers. The terminal 200 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, etc. Specifically, if the server 100 detects that there is at least one message push task to be executed at the current time, the server 100 can first determine the push message type of each of the at least one message push tasks, and use the current time as the query end time. For each message push task, if the server 100 queries the historical task execution record of the push message type of the message push task, the server 100 can determine the last execution end time and the message processing duration during the last execution from the historical task execution record, thereby determining the query start time based on the last execution end time and the message processing duration, and constructing the message query interval of the message push task according to the query start time and the query end time, so that the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record. Further, the server 100 can query and obtain the message content belonging to the message push task according to the message query interval, thereby executing the message push task to push the message content to the terminal 200.
[0036] It should be noted that, in the server 100, in addition to being able to pre-configure multiple scheduled message push tasks, such as Figure 2 As shown, a message processor 102 and a message transmitter 104 may also be configured. The message processor 102 and the message transmitter 104 are modules in the server 100 for specifically executing relevant steps. The message processor 102 and the message transmitter 104 may be built based on a set of message processing mechanisms, and may send and process data. In this embodiment, after the server 100 generates a message query interval, the server 100 may pass the message query interval into the message processor 102, so that the message processor 102 may query and obtain business data related to the message push task according to the message query interval, perform data processing on the business data, and then forward the processing result to the message transmitter 104. The message transmitter 104 may perform secondary processing on the received processing result, for example, assembling the message content through a custom message splicing template, and then push the message content to the user terminal 200.
[0037] In an exemplary embodiment, Figure 3As shown, a message push processing method is provided, which is applied to Figure 1 The server 100 in FIG. 1 is taken as an example to illustrate the method, which includes the following steps 302 to 308. Among them:
[0038] Step 302: If there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks, and use the current time as the query end time.
[0039] Each message push task has its own corresponding task parameters, including but not limited to: the push message type, task preset execution time, push channel, etc. The push message types of message push tasks include but are not limited to: identity authentication type, information type, marketing type, notification type (involving interactive information notification, asset change notification, etc.). The message push tasks to be executed specifically refer to: message push tasks whose preset execution time is earlier than or equal to the current time.
[0040] Optionally, multiple scheduled message push tasks may be pre-set in the server. During the operation of the server, the server may traverse the task parameters of all scheduled message push tasks in real time to determine whether there is at least one message push task to be executed at the current time. If there is at least one message push task to be executed, the server may first determine the push message type of each of the at least one message push task to be executed, and use the current time as the query end time of the at least one message push task to be executed.
[0041] Exemplarily, the message pusher can configure the message push task in the server in advance according to the message push demand, and configure the push message type and CRON expression for the message push task to realize the configuration of the scheduled message push task. Among them, the CRON expression is a time representation method used to configure time-based job scheduling, which allows the server to specify when to execute a specific script or command. The CRON expression can be composed of five, six or seven fields, which represent different parts of time, such as seconds, minutes, hours, a day of the month, a month, a day of the week, and a year.
[0042] Exemplarily, how to determine whether there is at least one message push task to be executed at the current time includes but is not limited to the following judgment situations: (1) If there is a message push task A represented by a CRON expression with a preset execution time of 8:50, but the server is in a downtime or shutdown state from 8:49 to 8:51, or fails to detect the message push task A due to other reasons, if the current time is 9:00, and the server detects that the task preset execution time of the message push task A is earlier than the current time, then the server can treat the message push task A as the message push task to be executed; (2) If there is a message push task A represented by a CRON expression with a preset execution time of 9:00, when it reaches 9:00, the server can detect that the task preset execution time of the message push task A is equal to the current time, thereby treating the message push task A as the message push task to be executed.
[0043] Step 304, for each message push task, if the historical task execution record of the push message type of the message push task is queried, the last execution end time and the message processing duration during the last execution are determined from the historical task execution record.
[0044] Optionally, after each message push task is executed, the server can record and store the message processing time and execution end time of the message push task. Among them, the message processing time is: the total time consumed for querying data and processing data (the process of generating message query intervals and pushing messages is short and can be ignored). Each message push task has a push message type. If it is the first time to execute a message push task under a certain push message type, the server cannot query the historical task execution record of the push message type. If it is not the first time to execute a message push task under a certain push message type, the server can query the historical task execution record of the push message type. Based on this, for each message push task, if the server queries the historical task execution record of the push message type of the message push task, the server can determine the end time of the last execution and the message processing time during the last execution from the historical task execution record.
[0045] Step 306, based on the last execution end time and the message processing duration, determine the query start time, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record.
[0046] Optionally, the server may construct a query start time for the corresponding message push task based on the last execution end time and the message processing duration, thereby constructing a message query interval for the message push task according to the query start time and the query end time.
[0047] Exemplarily, the server may set the query start time = the last execution end time - the message processing time, advance the start time of this query, extend this message query interval, and avoid omissions in data obtained based on the message query interval query.
[0048] For example, if the current time is 9:03 and the server detects that the task is set to execute at 9:00, for example, if the push message type of the message push task A is X, the server can first query whether there is a historical task execution record of the push message type X. If no record is found, the server can determine that it is the first time to execute the message push task under the push message type X, so as to use the current time 9:03 as the query end time, construct the message query interval (~, 9:03) of the message push task, and pass the message query interval as a temporary parameter to the message processor, so that the message processor can obtain the business data related to the message push task according to the message query interval query, perform data processing on the business data, and then forward the processing result to the message sender. The message sender can perform secondary processing on the received processing result to obtain the message content, and then push the message content to the message recipient. Taking into account the time it takes for the message processor to query data and process business data, as well as the time it takes for the message sender to perform secondary processing of data, if the message sender completes the push of the message content of message push task A at 9:06, the server can record the end time of this execution as 9:06 and the message processing time as 3 minutes, where the message processing time can also represent: the time difference between the incoming message query interval and the completion of the message push.
[0049] Further, taking the current time as 10:00, and the server detecting the task preset execution time of message push task B as 10:00, the server can set the query end time to 10:00. If the push message type of message push task B is also X, the server can query the historical task execution record of push message type X, that is, the last execution end time is 9:06 and the message processing time during the last execution is 3 minutes. Based on this, the server can set the query start time of this time = the last execution end time - message processing time, that is, 9:03, and construct the message query interval of this time [9:03, 10:00), so that the message query interval of this time [9:03, 10:00) is continuous and non-overlapping with the last historical query interval (~, 9:03). Instead of directly using the last execution end time 9:06 as the query start time of this time as the traditional technology, resulting in discontinuity of the two message query intervals, which leads to omissions in the business data obtained by subsequent queries, making the pushed message content incomplete.
[0050] Step 308: According to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task, and push the message content.
[0051] Optionally, for each message push task to be executed, after triggering the execution of the message push task, the server can automatically generate a message query interval for the message push task, and by importing the message query interval into the message processor configured in the server, the message processor is automatically called up to query the business data table storing the business data according to the message query interval, so as to obtain the business data that is in the message query interval and is related to the message push task, without relying on the business interface to call the message processing interface as in the traditional technology. The business interface in this embodiment only needs to focus on the processing of the business itself during development, and does not need to be directly associated with the message processing interface or the message processor, which can improve the flexibility and maintainability of the system to which the server belongs, making the development and maintenance of the business interface simpler and more efficient. Further, the message processor in the server can perform data processing on the business data obtained by the query, and then forward the processing result to the message sender configured in the server. The message sender in the server can perform secondary processing on the received processing result to obtain the message content, and then push the message content to the message recipient to complete the message push task.
[0052] In the above message push processing method, if there is at least one message push task to be executed at the current time, the push message type of each of the at least one message push task is determined, and the current time is used as the query end time. For each message push task, if the historical task execution record of the push message type of the message push task is queried, the last execution end time and the message processing duration during the last execution are determined from the historical task execution record. Further, considering the time difference caused by the message processing time, the query start time is determined based on the last execution end time and the message processing duration, instead of directly using the last execution end time as the query start time of this query as in the traditional technology. Based on this, the message query interval of the message push task can be constructed according to the query start time and the query end time, so that the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record. Among them, the interval continuity can ensure that the query obtains the complete message content, and the interval non-overlap is conducive to reducing the repetitiveness of the message content obtained by the query, improving the efficiency of subsequent message content deduplication, and thus facilitating efficient message push. Furthermore, the complete message content belonging to the message push task can be obtained according to the message query interval query. This process does not rely on the business interface to call the message processing interface to obtain data, but automatically determines the message query interval and obtains business data by setting a scheduled task. Finally, the message push task is executed to push the message content. In the whole process, compared with the message push method in traditional technology, there is no need for the coupled call of the business interface and the message processing interface, and the complete message content can be pushed efficiently.
[0053] In an exemplary embodiment, Figure 4 As shown, a flowchart of querying and obtaining the message content belonging to a message push task according to a message query interval is provided, which mainly includes the following steps:
[0054] Step 402: Obtain a target business data table associated with the push message type of the message push task; each piece of data stored in the target business data table is marked with the data generation time.
[0055] Among them, a data storage system connected to the server stores multiple business data tables, and each business data table stores business data under its own associated business scenario.
[0056] Optionally, after the server passes the message query interval to the message processor, the message processor may first obtain a target business data table associated with the push message type of the message push task from the data storage system.
[0057] Exemplarily, each push message type may be associated with an identification number, and each business data table in the data storage system may also be associated with an identification number. The message processor in the server may obtain the target business data table from the data storage system by comparing the identification number of the push message type with the identification number of the business data table in the data storage system. The identification number of the target business data table is the same as the identification number associated with the corresponding push message type.
[0058] Step 404, query the target business data table according to the message query interval to obtain the business data whose data generation time is within the message query interval.
[0059] Optionally, since each piece of data stored in the target business data table is marked with the data generation time, based on this, the message processor can query the target business data table according to the message query interval to obtain the business data whose data generation time is within the message query interval. In this embodiment, the business data obtained by the query is related to the targeted message push task and is within the message query interval, and since the message query area of this time is continuous and non-overlapping with the historical query interval of the last push task, the business data obtained by the query has neither omissions nor a large amount of duplication with the historical business data obtained in the historical period, which is conducive to reducing the workload of subsequent data deduplication, thereby facilitating the efficient push of complete message content. Among them, data deduplication can include: comparing and deduplicating with historical business data, and comparing and deduplicating within the business data obtained by this query.
[0060] Step 406: Get the message content belonging to the message push task according to the business data.
[0061] Optionally, the message processor in the server can process the business data obtained from the query, and then forward the processing results to the message sender configured in the server. The message sender can deduplicate and assemble the received processing results to obtain the message content belonging to the message push task.
[0062] In this embodiment, business data without omissions and without a large amount of duplication with historical business data obtained in historical periods can be queried from the business data table according to the message query interval, which is conducive to obtaining complete message content with less duplication, and facilitates the subsequent efficient push of complete message content.
[0063] In one embodiment, the business data includes sub-business data under multiple data types. Figure 4 Based on this, a flow chart of the message processor processing business data is provided, such as Figure 5 As shown, including:
[0064] Step 502: Obtain the data processing rules that match each data type.
[0065] Optionally, if the business data obtained by the query needs to be processed, the message processor may first obtain the data processing rules pre-configured for each data type.
[0066] Exemplarily, for the data type of the resource storage account number, the data processing rule is: truncate the last four digits; for the data type of the mobile phone number, the data processing rule is: truncate the last four digits; for the data type of the date, the data processing rule is: convert the date data into the standard year-month-day format; for the data type of the user name, the data processing rule is: if the user name is 2 characters, only truncate the last name; if the user name has more than 2 characters, only truncate the first and last characters.
[0067] Step 504 , for each sub-business data in the business data, data processing is performed on the sub-business data according to a data processing rule that matches the data type to which the sub-business data belongs, to obtain a data processing result of the business data.
[0068] Optionally, for each sub-business data in the business data, the message processor can process the sub-business data according to the data processing rules that match the data type to which the sub-business data belongs, so as to avoid the inability to obtain accurate data processing results due to mismatch of data processing rules. Based on this, for the business data obtained by the query, the message processor can obtain the data processing results of all sub-business data, and aggregate the data processing results of all sub-business data to obtain the data processing results of the business data. Among them, the message processor can process multiple sub-business data in the business data in parallel and multi-threaded to improve data processing efficiency, thereby improving message push efficiency. The data processing results can meet both privacy protection requirements and business usage requirements.
[0069] Step 506: Obtain the message content belonging to the message push task according to the data processing result of the business data.
[0070] Optionally, the message processor may forward the data processing results of the business data to the message sender, so that the message sender deduplicates and assembles the received data processing results to obtain the message content belonging to the message push task.
[0071] In this embodiment, for each message push task, the business data queried for the message push task can be processed based on the matching data processing rules, so as to obtain accurate data processing results, which facilitates subsequent processing to obtain accurate message content.
[0072] In one possible implementation, Figure 5 On the basis of Figure 6 As shown, a schematic diagram of a process of a message sender performing data deduplication on a received data processing result is provided, including:
[0073] Step 602: query the historical task execution record to obtain the pushed historical messages associated with the push message type of the message push task.
[0074] Optionally, after the message sender completes pushing the message content of a message push task, the server can record and store the message processing duration, execution end time, and message content (historical messages that have been pushed) of the message push task, and associate the recorded historical messages with the push message type to which the message push task belongs, forming a historical task execution record associated with the push message type to which the message push task belongs. Based on this, after the message processor forwards the data processing result of the business data to the message sender, the message sender can query the historical task execution record associated with the push message type of the message push task to obtain the pushed historical messages associated with the push message type of the message push task.
[0075] Step 604: Compare the historical messages with the data processing results to determine duplicate data in the data processing results.
[0076] Optionally, for each message push task, even if the message query interval of this time is ensured to be continuous and non-overlapping with the historical query interval of the last push task to reduce the content duplication between the business data obtained this time and the historical business data obtained last time, but considering that some duplicate business data may be generated and / or stored in the target business data table within the message query interval of this time, when executing the push task this time, the message sender also needs to compare the historical message with the data processing result to determine the duplicate data in the data processing result. In addition, in addition to comparing with the historical message, the message sender can also compare within the business data obtained from the current query to determine the duplicate data.
[0077] Step 606: Delete duplicate data in the data processing result to obtain data to be pushed.
[0078] Optionally, the message sender may delete duplicate data in the data processing result to obtain the data to be pushed, thereby ensuring the quality of the pushed message content and avoiding repeated pushing of the message content.
[0079] Step 608, obtaining a message splicing template that matches the push message type of the message push task, assembling the data to be pushed according to the message splicing template, and obtaining the message content belonging to the message push task.
[0080] Optionally, a data storage system connected to the server stores message splicing templates that match each of the push message types. For each message push task, after obtaining the data to be pushed corresponding to the message push task, the message sender can first determine the message splicing template that matches the push message type of the message push task, and then assemble the data to be pushed according to the message splicing template to obtain the message content belonging to the message push task.
[0081] For example, taking the message in the push resource extraction notification scenario as an example, the data to be pushed can be a json string, which can contain a name field and a date field. If the message splicing template that matches the push message type of the message push task is "Dear #xingming#, you made an extraction application on #date#", the message sender can intercept the corresponding fields in the json string from the data to be pushed, and then assemble the intercepted fields with the message splicing template to obtain the message content belonging to the message push task. Among them, JSON (JavaScript Object Notation) is a lightweight data exchange format that can use a text format that is completely independent of the language to store and represent data.
[0082] In this embodiment, the quality of the subsequently pushed messages can be improved and repeated push of messages can be avoided by deleting duplicate data in the data involved in the current push.
[0083] In one embodiment, in Figure 6 On the basis of Figure 7 As shown, a flow chart of executing a message push task to push message content is provided, including:
[0084] Step 702: Acquire a message push channel that matches the push message type of the message push task, and an object identifier carried in the message content.
[0085] Among them, the message push channels include but are not limited to: SMS notification, WeChat notification, Alipay notification, personal / unit online office pop-up notification, counter system pop-up notification, etc. The object identifier is used to determine the message recipient, which can be a user ID, user mobile phone number, etc.
[0086] Optionally, for each message push task, after obtaining the message content belonging to the message push task, the message sender may further determine and obtain a message push channel that matches the push message type of the message push task, and parse the object identifier from the message content.
[0087] Step 704: Push the message content to the message recipient associated with the object identifier through the message push channel.
[0088] Optionally, the message sender may push the message content to the message recipient associated with the object identifier through the determined message push channel.
[0089] For example, if the determined message push channel is SMS notification, the object identifier parsed by the message sender can be the mobile phone number of the message recipient, so that the message content is pushed to the mobile phone number. For example, if the determined message push channel is WeChat notification / Alipay notification, etc., the object identifier parsed by the message sender can be the WeChat account / Alipay account of the message recipient, so that the message content is pushed. For example, if the determined message push channel is system pop-up notification, the object identifier parsed by the message sender can be the system account of the message recipient, so that the message content is pushed.
[0090] In this embodiment, the message content belonging to the message push task can be pushed to the message recipient according to the message push channel that matches the push message type of the message push task, ensuring that the message push channel matches the message content pushed from the message push channel, thereby ensuring the smooth progress of the message push process.
[0091] In some embodiments, Figure 8 As shown, a schematic diagram of the process of pushing message content for the first time is provided, which mainly includes the following steps:
[0092] Step 802: If there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push tasks.
[0093] Optionally, if the server detects that there is at least one message push task to be executed at the current time, the push message type of each of the at least one message push tasks may be determined first.
[0094] Step 804: if no historical task execution record of the push message type of the message push task is found, the current time is used as the query end time, and a message query interval is constructed based on the query end time.
[0095] Optionally, if the server does not query the historical task execution record of the push message type of the message push task, the server can use the current time as the query end time and build a message query interval (~, current time) based on the query end time to comprehensively collect business data that has not been pushed before the current time.
[0096] Step 806: According to the message query interval, query and obtain the message content belonging to the message push task, execute the message push task to push the message content.
[0097] Optionally, the server can import the message query interval into the message processor, and the message processor can first obtain the target business data table associated with the push message type of the message push task, thereby querying the target business data table according to the message query interval to obtain the business data whose data generation time is within the message query interval. Further, for each sub-business data in the business data, the message processor can process the sub-business data according to the data processing rules matching the data type to which the sub-business data belongs, and obtain the data processing result of the business data. Further, the message processor can forward the data processing result of the business data to the message sender. Since there is no historical task execution record, the message processor can perform an internal comparison of the business data to perform data deduplication to obtain the data to be pushed. Then, the message sender can obtain the message splicing template that matches the push message type of the message push task, thereby assembling the data to be pushed according to the message splicing template to obtain the message content belonging to the message push task. Finally, the message sender can obtain the message push channel that matches the push message type of the message push task, and the object identifier carried in the message content, and push the message content to the message receiver associated with the object identifier through the determined message push channel.
[0098] In this embodiment, when the message content is pushed for the first time, the current time can be used as the query end time in the message query interval to comprehensively collect business data that has not been pushed before the current time, ensuring that the complete message content can be pushed when the message content is pushed for the first time.
[0099] In a most detailed embodiment, Fig. 9 As shown, a flow chart of a message push processing method including first push and non-first push is provided, wherein:
[0100] (1) The server can first obtain the pre-configured scheduled message push task and determine whether there is a message push task to be executed at the current time, that is, determine whether there is a message push task with a preset execution time earlier than or equal to the current time. If not, continue to detect; if so, determine that there is a message push task to be executed at the current time.
[0101] (2) For each message push task to be executed, determine the push message type of the message push task, and query the data storage system for the historical task execution records of the push message type of the message push task. If the historical task execution records of the push message type of the message push task are queried, determine the end time of the last execution and the message processing duration during the last execution from the historical task execution records, and determine the query start time based on the end time of the last execution and the message processing duration during the last execution, and use the current time as the query end time to construct the message query interval of the message push task, so that the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution records. If the historical task execution records of the push message type of the message push task are not queried, the current time can be used as the query end time to construct the message query interval of the message push task to push the relevant business data that has not been pushed before the current time.
[0102] (3) The server can pass the generated message query interval to the message processor. The message processor can obtain the target business data table associated with the push message type of the message push task, and query the target business data table according to the message query interval to obtain the business data whose data generation time is within the message query interval. Furthermore, for each sub-business data in the business data, the message processor can process the sub-business data according to the data processing rules that match the data type to which the sub-business data belongs, and obtain the data processing result of the business data. The message processor can forward the data processing result to the message sender. The message sender can deduplicate the data processing result to obtain the data to be pushed, and then obtain the message splicing template that matches the push message type of the message push task, assemble the data to be pushed according to the message splicing template, and obtain the message content belonging to the message push task.
[0103] (4) The message sender can obtain the message push channel that matches the push message type of the message push task, as well as the object identifier carried in the message content, and then push the message content to the message recipient associated with the object identifier through the message push channel.
[0104] In this embodiment, the decoupling of business processing and message push can be achieved, and the time interval extension mechanism can ensure that in the process of not obtaining business data for the first time, complete business data including message processing time can be obtained, solving the problem of message content loss due to processing time delay. In the process of obtaining business data for the first time, messages that have not been pushed before can be pushed comprehensively. In addition, in the process of pushing messages, data deduplication can be used to avoid repeated message pushes.
[0105] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0106] Based on the same inventive concept, the embodiment of the present application also provides a message push processing device for implementing the message push processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more message push processing device embodiments provided below can refer to the limitations of the message push processing method above, and will not be repeated here.
[0107] In an exemplary embodiment, Fig.10 As shown, a message push processing device is provided, including: a push message type determination module 1002, a message processing time determination module 1004, a non-first query interval construction module 1006 and a non-first message content push module 1008, wherein:
[0108] A push message type determination module, used to determine the push message type of each of the at least one message push tasks if there is at least one message push task to be executed at the current time, and use the current time as the query end time;
[0109] The message processing duration determination module is used to determine the last execution end time and the message processing duration during the last execution from the historical task execution records for each message push task if the historical task execution records of the push message type of the message push task are queried;
[0110] A non-first query interval construction module is used to determine the query start time based on the last execution end time and the message processing duration, and to construct a message query interval for the message push task based on the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record;
[0111] The non-first message content push module is used to query and obtain the message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content.
[0112] The above-mentioned message push processing device, if there is at least one message push task to be executed at the current time, determines the push message type of each of the at least one message push task, and uses the current time as the query end time. For each message push task, if the historical task execution record of the push message type of the message push task is queried, the last execution end time and the message processing duration during the last execution are determined from the historical task execution record. Further, considering the time difference caused by the message processing time, the query start time is determined based on the last execution end time and the message processing duration, instead of directly using the last execution end time as the query start time of this query as in the traditional technology. Based on this, the message query interval of the message push task can be constructed according to the query start time and the query end time, so that the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record. Among them, the interval continuity can ensure that the query obtains the complete message content, and the non-overlapping interval is conducive to reducing the repetitiveness of the message content obtained by the query, improving the efficiency of subsequent message content deduplication, and thus facilitating efficient message push. Furthermore, the complete message content belonging to the message push task can be obtained according to the message query interval query. This process does not rely on the business interface to call the message processing interface to obtain data, but automatically determines the message query interval and obtains business data by setting a scheduled task. Finally, the message push task is executed to push the message content. In the whole process, compared with the message push method in traditional technology, there is no need for the coupled call of the business interface and the message processing interface, and the complete message content can be pushed efficiently.
[0113] In one of the embodiments, the non-first message content push module includes: a data table acquisition unit, used to acquire the target business data table associated with the push message type of the message push task; each data stored in the target business data table is marked with the data generation time; a business data acquisition unit, used to query the target business data table according to the message query interval, and obtain the business data whose data generation time is within the message query interval; a message content acquisition unit, used to obtain the message content belonging to the message push task based on the business data.
[0114] In one of the embodiments, the business data includes sub-business data under multiple data types; the message content acquisition unit is specifically used to: obtain the data processing rules that match each data type; for each sub-business data in the business data, according to the data processing rules that match the data type to which the sub-business data belongs, perform data processing on the sub-business data to obtain the data processing result of the business data; based on the data processing result of the business data, obtain the message content belonging to the message push task.
[0115] In one of the embodiments, the message content obtaining unit is also used to: query the historical task execution records to obtain the pushed historical messages associated with the push message type of the message push task; compare the historical messages with the data processing results to determine the duplicate data in the data processing results; delete the duplicate data in the data processing results to obtain the data to be pushed; obtain the message splicing template that matches the push message type of the message push task, assemble the data to be pushed according to the message splicing template, and obtain the message content belonging to the message push task.
[0116] In one of the embodiments, the non-first message content push module includes: a channel identification acquisition unit, used to obtain a message push channel that matches the push message type of the message push task, and an object identifier carried in the message content; a non-first message content push unit, used to push the message content to the message recipient associated with the object identifier through the message push channel.
[0117] In one of the embodiments, the message push processing device also includes: a first query interval construction module, which is used to use the current time as the query end time if the historical task execution record of the push message type of the message push task is not found, and to construct a message query interval based on the query end time; a first message content push module, which is used to query and obtain the message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content.
[0118] Each module in the above message push processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0119] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store message push processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message push processing method is implemented.
[0120] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0121] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0122] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0123] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0124] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0126] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A message push processing method, characterized in that: The method comprises: If there is at least one message push task to be executed at the current time, determine the push message type of each of the at least one message push task, and use the current time as the query end time; For each of the message push tasks, if the historical task execution records of the push message type of the message push task are queried, the last execution end time and the message processing duration during the last execution are determined from the historical task execution records; Based on the last execution end time and the message processing duration, determine the query start time, and construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; According to the message query interval, the message content belonging to the message push task is queried and the message push task is executed to push the message content.
2. The method according to claim 1, characterized in that: The querying and obtaining the message content belonging to the message push task according to the message query interval includes: Obtaining a target business data table associated with the push message type of the message push task; each piece of data stored in the target business data table is marked with the data generation time; Query the target service data table according to the message query interval to obtain service data whose data generation time is within the message query interval; According to the business data, the message content belonging to the message push task is obtained.
3. The method according to claim 2, characterized in that The business data includes sub-business data under multiple data types; the message content belonging to the message push task is obtained according to the business data, including: Get the data processing rules that match each data type; For each sub-business data in the business data, according to a data processing rule matching a data type to which the sub-business data belongs, data processing is performed on the sub-business data to obtain a data processing result of the business data; According to the data processing result of the business data, the message content belonging to the message push task is obtained.
4. The method according to claim 3, characterized in that The obtaining of the message content belonging to the message push task according to the data processing result of the business data includes: Query the historical task execution record to obtain the pushed historical messages associated with the push message type of the message push task; Comparing the historical message with the data processing result to determine duplicate data in the data processing result; Deleting duplicate data from the data processing result to obtain data to be pushed; A message splicing template matching the push message type of the message push task is obtained, and the data to be pushed is assembled according to the message splicing template to obtain the message content belonging to the message push task.
5. The method according to claim 1, characterized in that The executing the message pushing task to push the message content includes: Acquire a message push channel that matches the push message type of the message push task, and an object identifier carried in the message content; The message content is pushed to the message recipient associated with the object identifier through the message push channel.
6. The method according to claim 1, characterized in that The method further comprises: If no historical task execution record of the push message type of the message push task is found, the current time is used as the query end time, and a message query interval is constructed based on the query end time; According to the message query interval, the message content belonging to the message push task is queried and the message push task is executed to push the message content.
7. A message push processing device, characterized in that: The device comprises: A push message type determination module, used to determine the push message type of each of the at least one message push task if there is at least one message push task to be executed at the current time, and use the current time as the query end time; A message processing duration determination module is used to determine, for each message push task, the last execution end time and the message processing duration during the last execution from the historical task execution records if the historical task execution records of the push message type of the message push task are queried; A non-first query interval construction module is used to determine the query start time based on the last execution end time and the message processing duration, and to construct a message query interval for the message push task according to the query start time and the query end time; the message query interval is continuous and non-overlapping with the historical query interval of the last push task in the historical task execution record; The non-first message content push module is used to query and obtain the message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content.
8. The device according to claim 7, characterized in that The non-first message content push module includes: A data table acquisition unit, used to acquire a target business data table associated with the push message type of the message push task; each piece of data stored in the target business data table is marked with the data generation time; A service data obtaining unit, configured to query the target service data table according to the message query interval, and obtain service data whose data generation time is within the message query interval; The message content obtaining unit is used to obtain the message content belonging to the message push task according to the business data.
9. The device according to claim 8, characterized in that The service data includes sub-service data under multiple data types; the message content obtaining unit is specifically used to: Get the data processing rules that match each data type; For each sub-business data in the business data, according to a data processing rule matching a data type to which the sub-business data belongs, data processing is performed on the sub-business data to obtain a data processing result of the business data; According to the data processing result of the business data, the message content belonging to the message push task is obtained.
10. The device according to claim 9, characterized in that The message content obtaining unit is also used for: Query the historical task execution record to obtain the pushed historical messages associated with the push message type of the message push task; Comparing the historical message with the data processing result to determine duplicate data in the data processing result; Deleting duplicate data from the data processing result to obtain data to be pushed; A message splicing template matching the push message type of the message push task is obtained, and the data to be pushed is assembled according to the message splicing template to obtain the message content belonging to the message push task.
11. The device according to claim 7, characterized in that The non-first message content push module includes: A channel identification acquisition unit, used to acquire a message push channel that matches the push message type of the message push task, and an object identification carried in the message content; The non-first message content pushing unit is used to push the message content to the message recipient associated with the object identifier through the message pushing channel.
12. The device according to claim 7, characterized in that The device also includes: A first query interval construction module, used for, if no historical task execution record of the push message type of the message push task is found, taking the current time as the query end time, and constructing a message query interval based on the query end time; The first message content push module is used to query and obtain the message content belonging to the message push task according to the message query interval, and execute the message push task to push the message content.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Message pushing method and device, storage medium and processor
CN110971643A
Task execution system and method, server and computer readable storage medium
CN114546629A
Task execution method and device
CN114880117A
Telecommunication service batch processing method and device
CN115456570A
Data processing method and device, electronic equipment and storage medium
CN117951155A
Cited By
Message pushing method and device and computer storage medium
CN121357239A
Message pushing method, device and computer storage medium
CN121357239B