Message pushing processing method and device, computer device and readable storage medium
By constructing continuous and non-overlapping message query intervals, business data is automatically acquired and processed, solving the problem of incomplete message push in traditional technologies and achieving efficient push of complete message content.
Patent Information
- Application Number
- CN202411156793.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In traditional technologies, the coupled calls between business interfaces and message processing interfaces result in incomplete message pushes, making it impossible to push complete message content.
By constructing a message query interval and using historical task execution records to determine the query start time, the query interval is ensured to be continuous and non-overlapping with the interval of the previous push task. Business data is automatically obtained and processed, and finally the message content is pushed.
It enables efficient push of complete message content without coupling between business interfaces and message processing interfaces, improving the accuracy of message content and deduplication efficiency.
Smart Images

Figure CN119603262B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data processing, and in particular, to a message pushing processing method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] In the scenario of business settlement needing to push messages, in the traditional technology, the coupling call of the business interface and the message processing interface is relied on, and the business interface usually 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, and then the message processing interface stores the message content in the cache, so that the message consumer takes out the message from the cache and pushes it. In the process of obtaining the business data by the message processing interface, the execution end time of the last push message is usually directly used as the start time of the query of the business data to determine the specific time period to be queried, so as to query the business data, but the query from the last execution end time will cause the missing of the business data queried this time, resulting in the incomplete message content pushed.
[0003] Therefore, the message pushing manner in the traditional technology not only relies on the coupling call of the business interface and the message processing interface, but also cannot push the complete message content. SUMMARY
[0004] Therefore, it is necessary to provide a message pushing processing method, device, computer equipment, computer readable storage medium and computer program product which can realize the decoupling of the business interface and the message processing interface and efficiently push the complete message content.
[0005] In a first aspect, the present application provides a message pushing processing method, comprising: if there is at least one message pushing task to be executed at a current time, determining the pushing message types of the at least one message pushing task respectively, and taking the current time as a query end time; for each message pushing task, if the historical task execution record of the pushing message type of the message pushing task is queried, determining the last execution end time and the message processing duration in the last execution process from the historical task execution record; determining the query start time based on the last execution end time and the message processing duration, constructing the message query interval of the message pushing 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 pushing task in the historical task execution record; according to the message query interval, the message content belonging to the message pushing task is queried, the message pushing task is executed, and the message content is pushed.
[0006] In one of the embodiments, the message content belonging to the message push task is obtained according to the message query interval, including: 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 a data generation time; querying the target business data table according to the message query interval to obtain business data with the data generation time within the message query interval; and obtaining the message content belonging to the message push task according to the business data.
[0007] In one of the embodiments, the business data includes sub-business data in multiple data types; and the message content belonging to the message push task is obtained according to the business data, including: obtaining a data processing rule matched by each data type; for each sub-business data in the business data, performing data processing on the sub-business data according to the data processing rule matched by the data type to which the sub-business data belongs, to obtain a data processing result of the business data; and obtaining the message content belonging to the message push task according to the data processing result of the business data.
[0008] In one of the embodiments, the message content belonging to the message push task is obtained according to the data processing result of the business data, including: querying a historical task execution record to obtain a historical message pushed in association with the push message type of the message push task; comparing the historical message with the data processing result to determine repeated data in the data processing result; deleting the repeated data in the data processing result to obtain to-be-pushed data; obtaining a message splicing template matched with the push message type of the message push task; and assembling the to-be-pushed data according to the message splicing template to obtain the message content belonging to the message push task.
[0009] In one of the embodiments, the message push task is executed to push the message content, including: obtaining a message push channel matched with 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 receiver associated with the object identifier through the message push channel.
[0010] In one of the embodiments, the message push processing method further includes: if no historical task execution record of the push message type of the message push task is queried, taking a current time as a query end time, and constructing a message query interval based on the query end time; obtaining the message content belonging to the message push task according to the message query interval; and executing the message push task to push the message content.
[0011] In a second aspect, the present application also provides a message pushing processing apparatus, comprising: a pushing message type determining module, configured to determine the pushing message type of each of at least one message pushing task to be executed if there is at least one message pushing task to be executed at the current time, and take the current time as the query end time; a message processing duration determining module, configured to, for each message pushing task, determine the last execution end time and the message processing duration in the last execution process from the historical task execution record of the pushing message type of the message pushing task if the historical task execution record is queried; a non-first query interval constructing module, configured to determine the query start time based on the last execution end time and the message processing duration, and construct the message query interval of the message pushing 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 pushing task in the historical task execution record; a non-first message content pushing module, configured to query the message content belonging to the message pushing task according to the message query interval, and execute the message pushing task to push the message content.
[0012] In one of the embodiments, the non-first message content pushing module comprises: a data table obtaining unit, configured to obtain the target business data table associated with the pushing message type of the message pushing task; each piece of data stored in the target business data table is marked with a data generation time; a business data obtaining unit, configured to query the target business data table according to the message query interval to obtain the business data with the data generation time in the message query interval; and a message content obtaining unit, configured to obtain the message content belonging to the message pushing task according to the business data.
[0013] In one of the embodiments, the business data comprises sub-business data under multiple data types; and the message content obtaining unit is specifically configured to: obtain the data processing rule matched by each data type; perform data processing on each sub-business data in the business data according to the data processing rule matched by the data type to which the sub-business data belongs, to obtain the data processing result of the business data; and obtain the message content belonging to the message pushing task according to the data processing result of the business data.
[0014] In one of the embodiments, the message content obtaining unit is further configured to: query the historical task execution record to obtain the historical message pushed in association with the pushing message type of the message pushing task; compare the historical message with the data processing result to determine the repeated data in the data processing result; delete the repeated data in the data processing result to obtain the data to be pushed; obtain the message splicing template matched by the pushing message type of the message pushing task; and assemble the data to be pushed according to the message splicing template to obtain the message content belonging to the message pushing task.
[0015] In one of the embodiments, the non-first message content pushing module comprises: a channel identification obtaining unit, configured to obtain a message pushing channel matched with the message pushing task and the object identification carried in the message content; and a non-first message content pushing unit, configured to push the message content to the message receiver associated with the object identification through the message pushing channel.
[0016] In one of the embodiments, the message pushing processing apparatus further comprises: a first query interval constructing module, configured to, if no historical task execution record of the message pushing task is queried, take the current time as a query end time, and construct a message query interval based on the query end time; and a first message content pushing module, configured to query the message content belonging to the message pushing task according to the message query interval, execute the message pushing task, and push the message content.
[0017] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: if there is at least one message pushing task to be executed at the current time, determining the pushing message type of each of the at least one message pushing task, and taking the current time as a query end time; for each message pushing task, if a historical task execution record of the pushing message type of the message pushing task is queried, determining the last execution end time and the message processing time length in the last execution process from the historical task execution record; determining a query start time based on the last execution end time and the message processing time length, constructing a message query interval of the message pushing 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 pushing task in the historical task execution record; querying the message content belonging to the message pushing task according to the message query interval, executing the message pushing task, and pushing the message content.
[0018] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the following steps: if there is at least one message push task to be executed at a current time, determining the push message type of each of the at least one message push task, and taking the current time as a 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, determining the last execution end time and the message processing duration in the last execution process from the historical task execution record; determining a query start time based on the last execution end time and the message processing duration, constructing a message query interval of 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; querying the message content belonging to the message push task according to the message query interval, executing the message push task, and pushing the message content.
[0019] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps: if there is at least one message push task to be executed at a current time, determining the push message type of each of the at least one message push task, and taking the current time as a 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, determining the last execution end time and the message processing duration in the last execution process from the historical task execution record; determining a query start time based on the last execution end time and the message processing duration, constructing a message query interval of 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; querying the message content belonging to the message push task according to the message query interval, executing the message push task, and pushing the message content.
[0020] The message pushing processing method, device, computer device, computer readable storage medium and computer program product can determine the message pushing task of each message pushing task if the historical task execution record of the message pushing task of the pushing message type is queried, determine the last execution end time and the message processing time length in the last execution process from the historical task execution record, further consider the time difference caused by the message processing time, determine the query start time based on the last execution end time and the message processing time length, and not directly use the last execution end time as the query start time of the current query as in the traditional technology. Based on this, the message query interval of the message pushing task can be constructed according to the query start time and the query end time, so that the message query interval is continuous and does not overlap with the historical query interval of the last pushing task in the historical task execution record. The interval continuity can ensure that complete message content is obtained by querying, the interval non-overlapping is beneficial to reducing the repetitiveness of the message content obtained by querying, improving the efficiency of subsequent message content deduplication, and thus being beneficial to efficiently pushing the message. Further, complete message content belonging to the message pushing task can be obtained according to the message query interval, and this process does not need to rely on the business interface to call the message processing interface to obtain data, but automatically determines the message query interval and obtains the business data by setting the timing task, finally, the message pushing task is executed to push the message content. In the whole process, compared with the message pushing mode in the traditional technology, the coupling call of the business interface and the message processing interface is not needed, and complete message content can be efficiently pushed. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0022] Figure 1 An application environment diagram of the message pushing processing method in an embodiment;
[0023] Figure 2 An application environment diagram of the message pushing processing method in another embodiment;
[0024] Figure 3 A flowchart of the message pushing processing method in an embodiment;
[0025] Figure 4A flowchart of a process of querying a message content belonging to a message pushing task according to a message query interval in an embodiment;
[0026] Figure 5 A flowchart of a process of data processing of a service data by a message processor in an embodiment;
[0027] Figure 6 A flowchart of a process of data deduplication of a data processing result received by a message sender in an embodiment;
[0028] Figure 7 A flowchart of a process of executing a message pushing task to push a message content in an embodiment;
[0029] Figure 8 A flowchart of a process of pushing a message content for the first time in an embodiment;
[0030] Figure 9 A flowchart of a process of a message pushing processing method including the first time pushing and the non-first time pushing in an embodiment;
[0031] Figure 10 A structural block diagram of a message pushing processing apparatus in an embodiment;
[0032] Figure 11 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0033] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. It should be noted that in the embodiments of the present application, some software, groups, models and other industry existing solutions may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the technical solution implementation of the present application, but 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations. The acquisition, storage, use, processing and other data in the technical solution of the present application comply with the relevant regulations of national laws and regulations.
[0035] The message pushing processing method provided in the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the server 100 can communicate with the terminal 200 through the network. The server 100 can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services, and the server 100 can be pre-configured with multiple timing message push tasks. The data storage system can store the data required by the server 100 to process, and the data storage system can be integrated on the server 100, or placed on the cloud or other network servers. The terminal 200 can be, but is not limited to, various personal computers, notebook computers, 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 task, and take 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 in the last execution process from the historical task execution record, so as to determine the query start time based on the last execution end time and the message processing duration, and construct 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 the message content belonging to the message push task according to the message query interval, so as to execute 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-define multiple timing message push tasks, such as Figure 2 The message processor 102 and the message sender 104 can also be configured. The message processor 102 and the message sender 104 are modules in the server 100 for specifically executing related steps, and the message processor 102 and the message sender 104 can be built based on a set of message processing mechanisms and can send and process data. In this embodiment, after the server 100 generates the message query interval, the server 100 can pass the message query interval into the message processor 102, so that the message processor 102 queries the business data related to the message push task according to the message query interval, processes the business data, and then forwards the processing result to the message sender 104. The message sender 104 can perform secondary processing on the received processing result, for example, assemble the message content through a self-defined message splicing template, and then push the message content to the user terminal 200.
[0037] In an exemplary embodiment, as Figure 3As shown, a message pushing processing method is provided, and the method is applied to Figure 1 The server 100 in the message pushing system 1000 is taken as an example for description, and the method comprises the following steps 302 to 308. In the steps 302 to 308, the server 100 determines the push message type of each message pushing task, and sets the current time as the query end time.
[0038] In the step 302, if there is at least one message pushing task to be executed at the current time, the server 100 determines the push message type of each message pushing task, and sets the current time as the query end time.
[0039] In the step 302, if there is at least one message pushing task to be executed at the current time, the server 100 determines the push message type of each message pushing task, and sets the current time as the query end time.
[0040] Optionally, a plurality of timing message pushing tasks can be pre-configured in the server, and the server can traverse the task parameters of all the timing message pushing tasks in real time to determine whether there is at least one message pushing task to be executed at the current time. If there is at least one message pushing task to be executed, the server can first determine the push message type of each message pushing task to be executed, and set the current time as the query end time of the at least one message pushing task to be executed.
[0041] Exemplarily, the message pushing party can pre-configure the message pushing tasks in the server according to the message pushing requirements, and configure the push message type and the CRON expression for the message pushing tasks to realize the configuration of the timing message pushing tasks. The CRON expression is a time representation method, which is used to configure the time-based job scheduling and can allow the server to specify when to execute a specific script or command. The CRON expression can be composed of five, six or seven fields, and these fields represent different parts of time, such as seconds, minutes, hours, a certain day in a month, a certain month, a certain day in a week, and a year.
[0042] Exemplarily, as to how to determine whether there is at least one message pushing task to be executed at the current time, the following determination cases are included but not limited to: (1) if the preset execution time of the message pushing task A represented by the CRON expression is 8:50, but the server is in a down or shutdown state from 8:49 to 8:51 or fails to detect the message pushing task A due to other reasons, if the current time is 9:00 and the server detects that the preset execution time of the message pushing task A is earlier than the current time at this time, the server can take the message pushing task A as the message pushing task to be executed; (2) if the preset execution time of the message pushing task A represented by the CRON expression is 9:00, when 9:00 is reached, the server can detect that the preset execution time of the message pushing task A is equal to the current time, so as to take the message pushing task A as the message pushing task to be executed.
[0043] In step 304, for each message pushing task, if the historical task execution record of the pushing message type of the message pushing task is queried, the last execution end time and the message processing duration in the last execution process are determined from the historical task execution record.
[0044] Optionally, after each message pushing task is executed, the server can record and store the message processing duration of executing the message pushing task and the execution end time. The message processing duration is the total time consumption of querying and processing data (the time consumption of generating the message query interval and the pushing message is short and can be ignored). Each message pushing task has a pushing message type, if it is the first execution of the message pushing task under a pushing message type, the server cannot query the historical task execution record of the pushing message type, if it is the non-first execution of the message pushing task under a pushing message type, the server can query the historical task execution record of the pushing message type. Based on this, for each message pushing task, if the server queries the historical task execution record of the pushing message type of the message pushing task, the server can determine the last execution end time and the message processing duration in the last execution process from the historical task execution record.
[0045] In step 306, the query start time is determined based on the last execution end time and the message processing duration, and the message query interval of the message pushing task is constructed 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 pushing task in the historical task execution record.
[0046] Optionally, the server can construct the query start time of the corresponding message pushing task based on the last execution end time and the message processing duration, so as to construct the message query interval of the message pushing task according to the query start time and the query end time.
[0047] Exemplarily, the server can make the query start time = last execution end time - message processing duration, advance the query start time of this time, extend the message query interval of this time, and avoid missing data obtained based on the message query interval query.
[0048] Exemplarily, taking the current time as 9:03 and the server detecting the message push task A with a preset execution time of 9:00 as an 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 not, the server can determine that it is the first execution of the message push task under the push message type X, so as to take 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 into the message processor, so that the message processor queries the business data related to the message push task according to the message query interval, processes the business data, and then forwards 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 receiver. Considering the time consumption of the message processor in querying data and processing business data, and the time consumption of the message sender in secondary processing of data, if the message sender completes the push of the message content of the message push task A at 9:06, the server can record the execution end time of this time as 9:06, and the message processing duration as 3 minutes, wherein the message processing duration can also represent the time difference between the message query interval and the completion of the message push.
[0049] Further, taking the current time as 10:00 and the server detecting the message push task B with a preset execution time of 10:00 as an example, the server can make the query end time of this time as 10:00, and if the push message type of the message push task B is also X, the server can query the historical task execution record of the push message type X, i.e., the last execution end time is 9:06 and the message processing duration during the last execution process is 3 minutes. Based on this, the server can make the query start time of this time = last execution end time - message processing duration, i.e., 9:03, and construct the message query interval [9:03, 10:00) of this time, so that the message query interval [9:03, 10:00) of this time is continuous and non-overlapping with the historical query interval (~, 9:03) of the last time. Instead of directly taking the last execution end time 9:06 as the query start time of this time as in the traditional technology, the message query interval of this time is not continuous, which leads to missing of business data obtained by subsequent query, and incomplete message content.
[0050] At step 308, according to the message query interval, the message content belonging to the message push task is queried, the message push task is executed, and the message content is pushed.
[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 automatically invoke the message processor configured in the server to query the business data table storing the business data according to the message query interval to obtain the business data in the message query interval and related to the message push task by importing the message query interval into the message processor, without relying on the business interface to call the message processing interface as in the traditional technology. In the present embodiment, the business interface only needs to focus on the processing of the business itself during development, without the 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, and make the development and maintenance of the business interface simpler and more efficient. Further, the message processor in the server can process the queried business data, 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 receiver to complete the message push task.
[0052] The aforementioned message push processing method, if at least one message push task is pending execution at the current time, determines the message type for 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 a historical task execution record for the message type of the message push task is found, the last execution end time and message processing duration during the last execution are determined from the historical task execution record. Furthermore, considering the time difference caused by message processing time, the query start time is determined based on the last execution end time and message processing duration, instead of directly using the last execution end time as the query start time for the current query as in traditional techniques. Based on this, a message query interval for the message push task can be constructed according to the query start time and query end time, ensuring 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. The continuity of the interval ensures that complete message content is retrieved, and the non-overlapping interval helps reduce the duplication of the retrieved message content, improving the efficiency of subsequent message content deduplication, thereby facilitating efficient message push. Furthermore, the complete message content belonging to the message push task can be retrieved based on the message query range. This process does not rely on business interfaces calling message processing interfaces to obtain data. Instead, a scheduled task is set to automatically determine the message query range and obtain business data. Finally, the message push task is executed to push the message content. Throughout this process, compared to traditional message push methods, there is no need for coupled calls between business interfaces and message processing interfaces, and the complete message content can be pushed efficiently.
[0053] In one exemplary embodiment, such as Figure 4 The diagram illustrates a process for retrieving message content belonging to a message push task based on a message query range, primarily including the following steps:
[0054] Step 402: Obtain the target business data table associated with the push message type of the push task; each piece of data stored in the target business data table is marked with the data generation time.
[0055] The data storage system connected to the server stores multiple business data tables, each containing business data related to its own business scenario.
[0056] Optionally, after the server passes the message query range to the message processor, the message processor can first obtain the 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 can be associated with an identification number respectively, and each business data table in the data storage system can also be associated with an identification number respectively, and the message processor in the server can obtain the target business data table from the data storage system by comparing the identification number of the push message type and the identification number of the business data table in the data storage system. Wherein, the identification number of the target business data table is the same as the identification number associated with the corresponding push message type.
[0058] In step 404, the target business data table is queried according to the message query interval, and the business data with the data generation time in the message query interval is obtained.
[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, and obtain the business data with the data generation time in the message query interval. In this embodiment, the business data obtained by querying is related to the message push task, and is in the message query interval, and since the message query interval of this time is continuous and non-overlapping with the historical query interval of the last push task, the business data obtained by querying neither exists omission nor exists a large amount of duplication with the historical business data obtained in the historical period, which is beneficial to reduce the workload of subsequent data deduplication, thereby being beneficial to efficiently push the complete message content. Wherein, the data deduplication can include: comparing and deduplicating with the historical business data, comparing and deduplicating within the business data obtained by querying this time.
[0060] In step 406, the message content belonging to the message push task is obtained according to the business data.
[0061] Optionally, the message processor in the server can perform data processing on the business data obtained by querying, and then forward the processing result to the message sender configured in the server. The message sender can deduplicate and assemble the received processing result, thereby obtaining the message content belonging to the message push task.
[0062] In this embodiment, the business data without omission and without a large amount of duplication with the historical business data obtained in the historical period can be obtained from the business data table according to the message query interval, which is beneficial to obtain the complete message content with less content duplication, and is beneficial to efficiently push the complete message content subsequently.
[0063] In one of the embodiments, the business data includes sub-business data under multiple data types, and on the basis of Figure 4 , a flowchart of the data processing process of the message processor on the business data is provided, as shown in Figure 5 , including:
[0064] At step 502, the data processing rule matched with each data type is obtained.
[0065] Optionally, if the business data obtained by the query is to be processed, the message processor can first obtain the data processing rule configured in advance for each data type.
[0066] For example, for the data type of the account of the resource storage account, the data processing rule is to intercept the last four digits; for the data type of the mobile phone number, the data processing rule is to intercept the last four digits; for the data type of the date, the data processing rule is to convert the date data into the standard year-month-day format; for the data type of the user name, the data processing rule is to intercept only the surname if the user name is two characters, and to intercept only the first character and the last character if the user name exceeds two characters.
[0067] At step 504, for each sub-business data in the business data, the data processing rule matched with the data type to which the sub-business data belongs is used to process the sub-business data, so as to obtain the 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 rule matched with the data type to which the sub-business data belongs, so as to avoid the situation that the accurate data processing result cannot be obtained due to the mismatch of the data processing rule. Based on this, for the business data obtained by the query, the message processor can obtain the data processing result of all the sub-business data, and collect the data processing results of all the sub-business data, so as to obtain the data processing result of the business data. The message processor can process multiple sub-business data in the business data in parallel and in multiple threads, so as to improve the data processing efficiency and thus improve the message pushing efficiency. The data processing result can meet the privacy protection requirement and the business use requirement.
[0069] At step 506, the message content belonging to the message pushing task is obtained according to the data processing result of the business data.
[0070] Optionally, the message processor can forward the data processing result of the business data to the message sender, so that the message sender obtains the message content belonging to the message pushing task after de-duplication and assembly of the received data processing result.
[0071] In this embodiment, for each message pushing task, the data processing rule matched with the data processing result of the business data obtained by the query can be used to process the business data, so that the accurate data processing result can be obtained, which is convenient for subsequent processing to obtain the accurate message content.
[0072] In one possible implementation, in the case that the data processing rule matched with each data type is obtained at step 502, Figure 5 on the basis of the above, likeFigure 6 As shown, a flowchart of the message sender performing data deduplication on the received data processing result is provided, including:
[0073] Step 602, query the historical task execution record to obtain the historical message pushed in association with the push message type of the message push task.
[0074] Optionally, after the message sender pushes the message content of each message push task, the server can record and store the message processing duration, execution end time, and message content (historical message pushed) of the message push task, and associate the recorded historical message to the push message type to which the message push task belongs, to form the 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 historical message pushed in association with the push message type of the message push task.
[0075] Step 604, compare the historical message with the data processing result to determine the duplicate data in the data processing result.
[0076] Optionally, for each message push task, even if it is ensured that the message query interval of this time is 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, considering that some duplicate business data may be generated within the message query interval of this time and / or stored in the target business data table, therefore, when performing 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 this time to determine the duplicate data.
[0077] Step 606, delete the duplicate data in the data processing result to obtain the to-be-pushed data.
[0078] Optionally, the message sender can delete the duplicate data in the data processing result to obtain the to-be-pushed data, to ensure the quality of the pushed message content and avoid duplicate pushing of the message content.
[0079] Step 608, obtain a message splicing template matching the push message type of the message push task, assemble the to-be-pushed data according to the message splicing template to obtain the message content belonging to the message push task.
[0080] Optionally, the data storage system connected with the server stores a plurality of message splicing templates respectively matched with a plurality of push message types, for each message push task, after obtaining the to-be-pushed data corresponding to the message push task, the message sender can first determine the message splicing template matched with the push message type of the message push task, so as to assemble the to-be-pushed data according to the message splicing template, and obtain the message content belonging to the message push task.
[0081] Exemplarily, taking the message in the push resource extraction notification scenario as an example, the to-be-pushed data can be a json string, the json string can include a name field and a date field, if the message splicing template matched with the push message type of the message push task is "Dear #xingming#, you have an extraction application on #date#", the message sender can intercept the corresponding field in the json string from the to-be-pushed data, and then assemble the intercepted field with the message splicing template, to obtain the message content belonging to the message push task. Wherein, JSON (JavaScript Object Notation) is a lightweight data exchange format, which can use a text format completely independent of language to store and represent data.
[0082] In the embodiment, the quality of the message of the subsequent push can be improved by deleting the repeated data in the data involved in the current push, and the repeated push of the message can be avoided.
[0083] In one of the embodiments, on the basis of Figure 6 , as shown in Figure 7 , a flowchart for performing a message push task to push a message content is provided, comprising:
[0084] Step 702, obtaining a message push channel matched with the push message type of the message push task, and an object identifier carried in the message content.
[0085] Wherein, the message push channel includes but is not limited to: SMS notification, WeChat notification, Alipay notification, personal / unit web hall pop-up notification, counter system pop-up notification, etc. The object identifier is used to determine the message receiver, which can be 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 can further determine and obtain the message push channel matched with the push message type of the message push task, and parse the object identifier from the message content.
[0087] Step 704, pushing the message content to the message receiver associated with the object identifier through the message push channel.
[0088] Optionally, the message sender can push the message content to the message receiver associated with the object identifier through the determined message push channel.
[0089] For example, in the case of the determined message push channel being a short message notification, the object identifier parsed by the message sender can be the mobile phone number of the message receiver, so as to push the message content to the mobile phone number. In the case of the determined message push channel being a WeChat notification / Alipay notification, the object identifier parsed by the message sender can be the WeChat number / Alipay account of the message receiver, so as to push the message content. In the case of the determined message push channel being a system pop-up notification, the object identifier parsed by the message sender can be the system account of the message receiver, so as to push the message content.
[0090] In this embodiment, the message content belonging to the message push task can be pushed to the message receiver according to the message push channel matched with the push message type of the message push task, ensuring the matching of the message push channel and the message content pushed from the message push channel, and further ensuring the smooth progress of the message push process.
[0091] In some embodiments, as shown in Figure 8 A flowchart for first pushing the message content is provided, mainly including 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 task.
[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 task can be determined first.
[0094] Step 804, if no historical task execution record of the push message type of the message push task is queried, take the current time as the query end time, and construct a message query interval 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 take the current time as the query end time, and construct a message query interval (~, current time) based on the query end time, so as to comprehensively collect the business data not pushed before the current time.
[0096] Step 806, according to the message query interval, query the message content belonging to the message push task, execute the message push task, and push the message content.
[0097] Optionally, the server can import the message query interval into the message processor, and the message processor can first acquire the target business data table associated with the push message type of the message push task, and then 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. Further, for each sub-business data in the business data, the message processor can perform data processing on the sub-business data according to the data processing rule matched by the data type to which the sub-business data belongs, to obtain the data processing result of the business data. Still 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 internal comparison on the data of the business data to perform data deduplication to obtain the to-be-pushed data. Then, the message sender can acquire the message splicing template matched with the push message type of the message push task, and assemble the to-be-pushed data according to the message splicing template to obtain the message content belonging to the message push task. Finally, the message sender can acquire the message push channel matched with 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 the embodiment, when the message content is pushed for the first time, the current time can be taken as the query end time in the message query interval to comprehensively collect the business data that has not been pushed before the current time, so as to ensure that complete message content can be pushed when the message content is pushed for the first time.
[0099] In one most detailed embodiment, as shown in FIG. 1, a flowchart of a message push processing method including first-time push and non-first-time push is provided, in which: Figure 9
[0100] (1) The server can first acquire the pre-defined timing message push task, and determine whether there is a to-be-executed message push task at the current time, that is, whether there is a message push task whose task preset execution time is earlier than or equal to the current time. If not, continue to detect, if yes, determine that there is a to-be-executed message push task at the current time.
[0101] (2) For each to-be-executed message pushing task, determine the pushing message type of the message pushing task, and query the historical task execution record of the pushing message type of the message pushing task from the data storage system. If the historical task execution record of the pushing message type of the message pushing task is queried, from the historical task execution record, determine the last execution end time and the message processing time length in the last execution process, and based on the last execution end time and the message processing time length in the last execution process, determine the query start time, and take the current time as the query end time, thereby constructing the message query interval of the message pushing task, so that the message query interval is continuous and non-overlapping with the historical query interval of the last pushing task in the historical task execution record. If the historical task execution record of the pushing message type of the message pushing task is not queried, the current time can be taken as the query end time, thereby constructing the message query interval of the message pushing task, so as to push the related business data not pushed before the current time.
[0102] (3) The server can transmit the generated message query interval to the message processor, and the message processor can obtain the target business data table associated with the pushing message type of the message pushing task, and query the target business data table according to the message query interval to obtain the business data with the data generation time in the message query interval. Further, for each sub-business data in the business data, the message processor can perform data processing on the sub-business data according to the data processing rule matched with the data type of the sub-business data to obtain the data processing result of the business data. The message processor can forward the data processing result to the message sender, and the message sender can perform data deduplication on the data processing result to obtain the to-be-pushed data, and then obtain the message splicing template matched with the pushing message type of the message pushing task, assemble the to-be-pushed data according to the message splicing template, and obtain the message content belonging to the message pushing task.
[0103] (4) The message sender can obtain the message pushing channel matched with the pushing message type of the message pushing task and the object identifier carried in the message content, and then push the message content to the message receiver associated with the object identifier through the message pushing channel.
[0104] In the embodiment, the decoupling of business processing and message pushing can be implemented, and through the time interval extension mechanism, it is ensured that complete business data including message processing time can be obtained in the process of non-first acquisition of business data, and the problem of message content loss caused by processing time delay is solved, and in the process of first acquisition of business data, messages not pushed before can be fully pushed. In addition, in the process of pushing messages, data deduplication can be used to avoid repeated pushing of messages.
[0105] It should be understood that although each step in the flowchart involved in each embodiment as described above is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless explicitly stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which 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 sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.
[0106] Based on the same inventive concept, the embodiments of the present application also provide a message pushing processing device for implementing the message pushing processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more message pushing processing device embodiments provided below can refer to the limitations of the message pushing processing method described above, which will not be repeated here.
[0107] In one exemplary embodiment, as shown in Figure 10 a message pushing processing device is provided, comprising: a push message type determination module 1002, a message processing duration determination module 1004, a non-first query interval construction module 1006, and a non-first message content pushing module 1008, wherein:
[0108] The push message type determination module is configured to, if there is at least one message pushing task to be executed at the current time, determine the push message type of each of the at least one message pushing task, and take the current time as the query end time.
[0109] The message processing duration determination module is configured to, for each message pushing task, if the historical task execution record of the push message type of the message pushing task is queried, determine the last execution end time and the message processing duration in the last execution process from the historical task execution record.
[0110] The non-first query interval construction module is configured to determine the query start time based on the last execution end time and the message processing duration, and construct the message query interval of the message pushing 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.
[0111] The non-first message content pushing module is configured to query the message content belonging to the message pushing task according to the message query interval, and execute the message pushing task to push the message content.
[0112] The message pushing processing apparatus determines the push message type of each of the at least one message pushing task if the current time exists at least one message pushing task to be executed, and takes the current time as the query end time. For each message pushing task, if the historical task execution record of the push message type of the message pushing task is queried, the last execution end time and the message processing time length in the last execution process 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 time length, instead of directly taking the last execution end time as the query start time of the current query as in the traditional technology. Based on this, the message query interval of the message pushing 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 pushing task in the historical task execution record. The interval continuity can ensure that the query obtains complete message content, and the interval non-overlapping is conducive to reducing the repetitiveness of the message content obtained by the query and improving the efficiency of subsequent deduplication of the message content, thereby being conducive to efficient pushing of the message. Further, complete message content belonging to the message pushing task can be obtained according to the message query interval, and this process does not need to rely on the business interface to call the message processing interface to obtain data, but automatically determines the message query interval and obtains the business data by setting the timing task, and finally, the message pushing task is executed to push the message content. In the whole process, compared with the message pushing mode in the traditional technology, the coupling call of the business interface and the message processing interface is not needed, and complete message content can be efficiently pushed.
[0113] In one of the embodiments, the non-first message content pushing module comprises: a data table obtaining unit configured to obtain a target business data table associated with the push message type of the message pushing task; each data stored in the target business data table is marked with a data generation time; a business data obtaining unit configured to query the target business data table according to the message query interval to obtain business data with the data generation time in the message query interval; and a message content obtaining unit configured to obtain the message content belonging to the message pushing task according to the business data.
[0114] In one of the embodiments, the business data comprises sub-business data under multiple data types; and the message content obtaining unit is specifically configured to: obtain a data processing rule matched for each data type; perform data processing on each sub-business data in the business data according to the data processing rule matched for the data type to which the sub-business data belongs, to obtain a data processing result of the business data; and obtain the message content belonging to the message pushing task according to the data processing result of the business data.
[0115] In one of the embodiments, the message content obtaining unit is further configured to: query the historical task execution record to obtain a historical message that is pushed and associated with the push message type of the message push task; compare the historical message with the data processing result to determine repeated data in the data processing result; delete the repeated data in the data processing result to obtain to-be-pushed data; obtain a message splicing template that matches the push message type of the message push task, and assemble the to-be-pushed data according to the message splicing template to obtain the message content that belongs to the message push task.
[0116] In one of the embodiments, the non-first message content push module comprises: a channel identifier obtaining unit configured 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; and a non-first message content push unit configured to push the message content to a message receiver associated with the object identifier through the message push channel.
[0117] In one of the embodiments, the message push processing apparatus further comprises: a first query interval construction module configured to, if no historical task execution record of the push message type of the message push task is queried, take a current time as a query end time, and construct a message query interval based on the query end time; and a first message content push module configured to query the message content that belongs to the message push task according to the message query interval, execute the message push task, and push the message content.
[0118] The modules in the message push processing apparatus described above can be all or partially implemented by software, hardware, and combinations thereof. The modules described above can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to the modules.
[0119] In one of the embodiments, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 1. Figure 11As shown in the figure. 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 the 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 capability. 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 operating system and the computer program in the non-volatile storage medium to run. 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 the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a message push processing method.
[0120] Those skilled in the art can understand that, Figure 11 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0121] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in each of the method embodiments described above.
[0122] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to implement the steps in each of the method embodiments described above.
[0123] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to implement the steps in each of the method embodiments described above.
[0124] 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. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to 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. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0125] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0126] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A message push processing method, characterized by, The method comprises: If there is at least one message pushing task to be executed at the current time, determining the pushing message type of each of the at least one message pushing task, and taking the current time as the query end time; For each of the message pushing tasks, if the historical task execution record of the pushing message type of the message pushing task is queried, determining the last execution end time and the message processing time length in the last execution process from the historical task execution record; Based on the last execution end time and the message processing time length, determining the query start time, and constructing the message query interval of the message pushing 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 pushing task in the historical task execution record; Obtaining the target business data table associated with the pushing message type of the message pushing task; each piece of data stored in the target business data table is marked with a data generation time; According to the message query interval, querying the target business data table to obtain business data with a data generation time in the message query interval; the business data includes sub-business data under multiple data types; Obtaining the data processing rule matched by each data type respectively; For each sub-business data in the business data, according to the data processing rule matched by the data type to which the sub-business data belongs, performing data processing on the sub-business data to obtain the data processing result of the business data, obtaining the message content belonging to the message pushing task according to the data processing result of the business data, executing the message pushing task to push the message content.
2. The method of claim 1, wherein, The method further comprises: If the historical task execution record of the pushing message type of the message pushing task is not queried, taking the current time as the query end time, and constructing the message query interval based on the query end time; According to the message query interval, querying to obtain the message content belonging to the message pushing task, executing the message pushing task to push the message content. The device comprises: 3. The method of claim 1, wherein, 4. The method of claim 1, wherein, 5. A message push processing apparatus characterized by comprising: The push message type determination module is configured to, 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 take the current time as the query end time. The message processing duration determination module is configured to, for each of the message push tasks, if a historical task execution record of the push message type of the message push task is queried, determine, from the historical task execution record, the last execution end time and the message processing duration in the last execution process. The non-first query interval construction module is configured to determine a query start time based on the last execution end time and the message processing duration, and construct a message query interval of 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 a historical query interval of the last push task in the historical task execution record. The non-first message content push module includes: a data table acquisition unit configured 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 a data generation time; a business data obtaining unit configured to query the target business data table according to the message query interval to obtain business data with a data generation time in the message query interval; and a message content obtaining unit configured to obtain message content belonging to the message push task according to the business data. The business data includes sub-business data under multiple data types; the message content obtaining unit is specifically configured to: acquire a data processing rule matched for each data type; for each sub-business data in the business data, perform data processing on the sub-business data according to the data processing rule matched for the data type to which the sub-business data belongs, to obtain a data processing result of the business data; and obtain message content belonging to the message push task according to the data processing result of the business data.
6. The apparatus of claim 5, wherein, The message content obtaining unit is further configured to: query the historical task execution record to obtain a historical message that has been pushed and that is associated with the push message type of the message push task; compare the historical message with the data processing result to determine repeated data in the data processing result; delete the repeated data in the data processing result to obtain to-be-pushed data; acquire a message splicing template matched with the push message type of the message push task, and assemble the to-be-pushed data according to the message splicing template to obtain message content belonging to the message push task.
7. The apparatus of claim 5, wherein, The non-first message content push module includes: a channel identifier acquisition unit configured to acquire a message push channel matched with 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 configured to push the message content to a message receiver associated with the object identifier through the message push channel.
8. The apparatus of claim 5, wherein, The apparatus further includes: The first query interval construction module is configured to, if no historical task execution record of the push message type of the message push task is found, take the current time as a query end time, and construct a message query interval based on the query end time. The first message content push module is configured to query message content belonging to the message push task according to the message query interval, execute the message push task, and push the message content. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 4.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
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