Message delay pushing method, program product, storage medium and electronic equipment

By encrypted and decrypting the message by using security verification token and encrypted token in a delayed push system, the problem of unauthorized third -party interception or tampering of messages was solved, and the safety and delayed push efficiency of message transmission were solved.

CN119363818AInactive Publication Date: 2025-01-24QINGDAO HAIER TECH +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411404062.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the delayed push of messages, unauthorized third parties may intercept, tamper or forge messages, resulting in leakage of sensitive information or system attacks, affecting the normal operation of the message push service.

Method used

By receiving the security verification token sent by the terminal, and when the token matches the preset token, the encryption token is determined, and the message body and delay time are encrypted to ensure the security of the message during transmission. The message server uses the security verification token and encryption token to decrypt the received encrypted message, obtain the message body to be sent and its delay time, and perform delayed push based on the delay time.

Benefits of technology

Effectively prevent unauthorized third -party interception, tampering or falsification of messages, ensure the security and integrity of the transmission of the message, and improve the reliability and response speed of message push services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363818A_ABST
    Figure CN119363818A_ABST
Patent Text Reader

Abstract

The invention provides a message delay pushing method, a program product, a storage medium and electronic equipment. The method comprises the following steps: a terminal sends a security verification token to a message server, the message server receives the security verification token, determines an encryption token according to the security verification token when the security verification token is matched with a security preset token, and sends a verification pass response to the terminal based on the encryption token; the terminal generates an encrypted message based on the encryption token in the verification passing response and the to-be-sent message, and sends the encrypted message to the message server; and the message server receives the encrypted message, decrypts the encrypted message to obtain a to-be-sent message body and the corresponding delay time, and performs delayed pushing on the to-be-sent message body based on the delay time. According to the method, a flexible message delay pushing service is provided, message pushing with different time precision requirements can be supported, the use requirements of different service scenes are met, and the pushing efficiency of the delay message is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message processing, and in particular to a message delayed push method, program product, storage medium and electronic device. Background Art

[0002] In modern communication systems, message push technology is widely used in various scenarios, such as instant messaging, email notifications, system alarms, etc. Traditional message push technology usually requires that messages be sent to the receiving terminal immediately after they are generated. In contrast, delayed message push allows messages to be sent at a specified time point or under specific conditions.

[0003] However, during the process of delayed message push, unauthorized third parties may intercept, tamper with or forge messages, resulting in sensitive information leakage or system attacks, causing the received message to be inconsistent with the sent message, and affecting the normal operation of the message push service. Summary of the invention

[0004] The present application provides a message delayed push method, program product, storage medium and electronic device to solve the technical problem that an unauthorized third party may intercept, tamper with or forge messages, resulting in sensitive information leakage or system attack, causing the received message to be inconsistent with the sent message, and affecting the normal operation of the message push service.

[0005] In a first aspect, the present application provides a message delayed push method, applied to a message server, comprising:

[0006] Receiving the security verification token sent by the terminal;

[0007] If the security verification token matches the security preset token, determining the encrypted token according to the security verification token, and sending a verification pass response to the terminal, wherein the verification pass response includes the encrypted token;

[0008] Receiving an encrypted message sent by the terminal, wherein the encrypted message is obtained by encrypting a message body to be sent and a delay time using the encryption token;

[0009] Decrypting the encrypted message using the security verification token and the encryption token to obtain the message body to be sent and the corresponding delay time;

[0010] The message body to be sent is pushed with delay based on the delay time.

[0011] Optionally, the delaying pushing of the message body to be sent based on the delay time includes:

[0012] Determine the execution time of the message body to be sent according to the delay time, and put the identifier of the message body to be sent and the corresponding execution time into a delay queue;

[0013] The delay queue is polled by using a polling service, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent.

[0014] Optionally, determining the execution time of the message body to be sent according to the delay time, and placing the identifier of the message body to be sent and the corresponding execution time into a delay queue includes:

[0015] The execution time of the message body to be sent and the precision of the execution time are determined according to the delay time, and the identifier of the message body to be sent and the corresponding execution time are placed in a delay queue corresponding to the precision.

[0016] Optionally, the polling the delay queue by using a polling service to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent, includes:

[0017] Using a polling service to poll each to-be-sent message body in the delay queue, if the execution time corresponding to the identifier of the to-be-sent message body is reached, then putting the identifier of the to-be-sent message body into the execution queue;

[0018] When the execution queue is not empty, the to-be-sent message body corresponding to the identifier of the to-be-sent message body in the execution queue is pushed.

[0019] Optionally, the message delayed push method further includes:

[0020] Monitoring the execution queue, and determining the identifier of the message body to be sent that has not been successfully pushed in the execution queue;

[0021] Based on the identifier of the unsuccessfully pushed message body to be sent, the unsuccessfully pushed message body to be sent is acquired, and a push failure notification is sent to the terminal, wherein the push failure notification includes the unsuccessfully pushed message body to be sent.

[0022] Optionally, before receiving the security verification token sent by the terminal, the message delayed push method further includes:

[0023] receiving a configuration information loading instruction sent by the terminal, wherein the configuration information loading instruction is used to instruct to load target configuration information;

[0024] Read configuration information from the configuration server, where the configuration information includes one or more of tenant information, delay configuration information, and message configuration information;

[0025] Determine whether the read configuration information includes the target configuration information, and if so, load the target configuration information and return a success response to the terminal.

[0026] In a second aspect, the present application provides a message delay push method, applied to a terminal, comprising:

[0027] Send a security verification token to the message server;

[0028] Receiving a verification success response sent by the message server, wherein the verification success response includes an encrypted token, and the encrypted token is determined according to the security verification token when the security verification token matches a security preset token of the message server;

[0029] The encryption token is used to encrypt the message body to be sent and the delay time to obtain an encrypted message, and the encrypted message is sent to the message server. The delay time is used to instruct the message server to delay the push of the message body to be sent.

[0030] Optionally, the method further includes:

[0031] A push failure notification sent by the message server is received, wherein the push failure notification includes a message body to be sent that was not successfully pushed.

[0032] In a third aspect, the present application provides a message delay push device, which is applied to a message server, comprising:

[0033] The acquisition module is used to receive the security verification token sent by the terminal.

[0034] If the security verification token matches the security preset token, a determination module is used to determine the encryption token according to the security verification token.

[0035] The processing module is used to send a verification success response to the terminal, wherein the verification success response includes the encrypted token.

[0036] The acquisition module is further used to receive an encrypted message sent by the terminal, where the encrypted message is obtained by encrypting the message body to be sent and the delay time using the encryption token.

[0037] The processing module is further used to use the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time.

[0038] The processing module is further used to delay pushing the message body to be sent based on the delay time.

[0039] Optionally, the determination module is further used to determine the execution time of the message body to be sent according to the delay time.

[0040] The processing module is further used to put the identifier of the message body to be sent and the corresponding execution time into a delay queue.

[0041] The processing module is further used to poll the delay queue using a polling service, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent.

[0042] Optionally, the determination module is further used to determine the execution time of the message body to be sent and the accuracy of the execution time according to the delay time.

[0043] The processing module is further used to put the identifier of the message body to be sent and the corresponding execution time into a delay queue corresponding to the precision.

[0044] Optionally, the processing module is further used to poll each message body to be sent in the delay queue using a polling service, and if the execution time corresponding to the identifier of the message body to be sent is reached, the identifier of the message body to be sent is placed in the execution queue.

[0045] The processing module is further configured to push the to-be-sent message body corresponding to the identifier of the to-be-sent message body in the execution queue when the execution queue is not empty.

[0046] Optionally, the processing module is also used to monitor the execution queue.

[0047] The determining module is further used to determine the identifier of the message body to be sent that has not been successfully pushed in the execution queue.

[0048] The acquisition module is further configured to acquire the unsuccessfully pushed message body to be sent based on the identifier of the unsuccessfully pushed message body to be sent.

[0049] The processing module is further configured to send a push failure notification to the terminal, wherein the push failure notification includes the message body to be sent that was not successfully pushed.

[0050] Optionally, the acquisition module is further used to receive a configuration information loading instruction sent by the terminal, where the configuration information loading instruction is used to instruct loading target configuration information.

[0051] The processing module is further used to read configuration information from the configuration server, where the configuration information includes one or more of tenant information, delay configuration information, and message configuration information.

[0052] The determination module is further used to determine whether the read configuration information includes the target configuration information.

[0053] If the read configuration information includes the target configuration information, the processing module is further configured to load the target configuration information and return a success response to the terminal.

[0054] In a fourth aspect, the present application provides a message delay push device, applied to a terminal, comprising:

[0055] The processing module is used to send a security verification token to the message server.

[0056] The acquisition module is used to receive a verification response sent by the message service end, wherein the verification response includes an encrypted token, and the encrypted token is determined based on the security verification token when the security verification token matches the security preset token of the message service end.

[0057] The processing module is also used to use the encryption token to encrypt the message body to be sent and the delay time to obtain an encrypted message, and send the encrypted message to the message server. The delay time is used to instruct the message server to delay the push of the message body to be sent.

[0058] In a fifth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0059] The memory stores computer-executable instructions;

[0060] The processor executes the computer-executable instructions stored in the memory to implement the message delayed push method as described in the above-mentioned first aspect and various possible implementations of the first aspect or the second aspect and various possible implementations of the second aspect.

[0061] In a sixth aspect, the present application provides a computer-readable storage medium having computer execution instructions stored thereon, which, when executed by a processor, are used to implement the message delayed push method as described in the first aspect and various possible implementations of the first aspect or the second aspect and various possible implementations of the second aspect.

[0062] In a seventh aspect, the present application provides a program product, including a computer program, which, when executed by a processor, implements the message delayed push method as described above.

[0063] The message delayed push method, program product, storage medium and electronic device provided by the present application are as follows: a terminal sends a security verification token to a message server; the message server receives the security verification token sent by the terminal, determines the encryption token according to the security verification token when the security verification token matches the security preset token, and sends a verification success response to the terminal; the terminal receives the verification success response sent by the message server, and uses the encryption token in the verification success response to encrypt the message body to be sent and the delay time to obtain an encrypted message, and sends the encrypted message to the message server; the message server receives the encrypted message sent by the terminal, and uses the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time, determines the execution time of the message body to be sent according to the delay time, and puts the identifier of the message body to be sent and the corresponding execution time into a delay queue of the corresponding time precision, and then uses a polling service to poll the delay queues of different time precisions, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent. This method provides a flexible delayed message push service that can support message push with different time accuracy requirements to adapt to messages with different time sensitivities, meet the usage requirements of different business scenarios, optimize the use of system resources, improve the response speed of the message push service, and the push efficiency of delayed messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0066] Figure 1 A schematic diagram of a scenario for the message delay push method provided in this application;

[0067] Figure 2 Schematic diagram of the process of delayed message push method provided by this application Figure 1 ;

[0068] Figure 3 Schematic diagram of the process of delayed message push method provided by this application Figure 2 ;

[0069] Figure 4 Structural schematic diagram of the message delay push device provided by this application Figure 1 ;

[0070] Figure 5 Structural schematic diagram of the message delay push device provided by this application Figure 2 ;

[0071] Figure 6 A schematic diagram of the structure of the message delayed push device provided for this application. DETAILED DESCRIPTION

[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0073] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0074] In modern communication systems, message push technology is widely used in various scenarios, such as instant messaging, email notifications, system alarms, etc.

[0075] Traditional message push technology usually requires that messages be sent to the receiving terminal immediately after they are generated. In some application scenarios, instant message push may not be the best choice. For example, in a distributed system, different services or components may need to receive messages at a specific time point to maintain synchronization or execute scheduled tasks; therefore, it is necessary to delay the push of messages, that is, to allow messages to be sent only at a specified time point or under specific conditions.

[0076] However, most of the delayed message push in the prior art adopts a single time wheel with a fixed time accuracy. For message push requiring different delay time accuracy, the single time wheel cannot provide more flexibility for the message push service and cannot adapt to message push with different accuracy requirements.

[0077] The method for delayed message push provided in this application is intended to solve the above technical problems in the prior art.

[0078] First, the implementation scenarios involved in this application are described.

[0079] Figure 1 Schematic diagram of the scenario of the message delay push method provided by this application. Figure 1 As shown, the smart terminal device group 101 is communicatively connected with the server 102, and multiple devices in the smart terminal device group 101 are in the same smart network, and can all send push information, and send the push information to the server 102; the server 102 stores a message delay push module, through which the delayed push of push messages with different time accuracy requirements can be achieved; wherein, the smart terminal device group 101, for example, can be multiple smart devices in the same smart network environment, and the multiple smart devices include: smart mobile terminals, smart central control devices; the server 102, for example, can be a central server configured with a message delay push module.

[0080] The present application provides a method for delayed message push, which verifies the security of the message push process through a security token, and uses the security token to encrypt the push message; then sets up multi-level, different time precision delay queues, and distributes the push message to the corresponding delay queue according to the time precision of the encrypted push message, and uses a polling service to poll the delay queues with different time precisions, so that the push messages in the delay queues with different time precisions can be pushed. This method provides a flexible message delayed push service, which can support the push of messages with different time precision requirements to adapt to messages with different time sensitivities, meet the usage requirements of different business scenarios, optimize the use of system resources, improve the response speed of the message push service, and the push efficiency of delayed messages.

[0081] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0082] Figure 2 Schematic diagram of the process of the message delay push method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the message delay push method provided in this embodiment includes:

[0083] S201: The terminal determines the security verification token.

[0084] S202: The terminal sends the security verification token to the message server.

[0085] Among them, the security verification token is used to confirm the communication security between the terminal and the message server.

[0086] It is understandable that the terminal and the message server are connected in communication, and the terminal can transmit data with the message server; the terminal receives the user's message push demand and the corresponding message to be pushed, and sends the message push demand and the message to be pushed at that time to the message server; the message server can receive messages from different terminals, and the message needs to be pushed delayed or directly. This application does not impose any special restrictions on the number of terminals.

[0087] In order to ensure the security of data transmission between the terminal and the message server, before the terminal sends a message to be pushed to the message server, the terminal generates a security verification token for the time being and sends the security verification token to the message server to verify whether the data transmission environment is secure.

[0088] The security verification token may also include: a timestamp, a digital signature, and a serial number, which are used to enhance the communication security between the terminal and the message server or to provide more information about the communicating parties. This application does not impose any special restrictions on the content of the security verification token.

[0089] For example, the security verification token can be a fixed-length token generated from a random string and a corresponding user ID. Specifically, a pseudo-random number generator is used to generate a random string of sufficient length, which is combined with the user ID corresponding to the terminal to generate a corresponding security verification token. The smart terminal then sends the security verification token to a central server configured with a message delay push module.

[0090] S203: If the security verification token matches the security preset token, the message server determines the encryption token according to the security verification token.

[0091] S204: The message server sends a verification pass response to the terminal.

[0092] Among them, the security preset token is used to indicate multiple token information pre-stored in the message server; the verification response includes an encrypted token, and the encrypted token is determined based on the security verification token when the security preset token in the security verification token matches the security preset token of the message server.

[0093] It can be understood that a list of security preset tokens is pre-configured in the message server, which includes the security preset tokens corresponding to all terminals that can communicate, and different terminals have unique corresponding security preset tokens; multiple pre-configured security preset tokens can be stored in a database, or saved in the memory or file system of the message server in other ways.

[0094] The message server receives a security verification token sent from a terminal, and extracts a digital signature or serial number corresponding to the terminal in the security verification token; calls a list of pre-configured security preset tokens in the message server, screens the list of security preset tokens according to the digital signature or serial number, and determines a security preset token that is consistent with the currently received security verification token, that is, determines a security preset token that matches the security verification token from the list of security preset tokens, and there is only a unique corresponding matching relationship, which indicates that the data transmission between the terminal that sends the security verification token and the message server is secure. At this time, the message server determines an encryption token based on the security verification token, generates a verification pass response using the encryption token, and then sends the verification pass response to the terminal.

[0095] It can be understood that the security verification token also includes: timestamp, digital signature, serial number, etc., among which the digital signature or serial number is unique and can point to the corresponding terminal. Therefore, the digital signature or serial number also has a unique corresponding relationship with the security preset token. When performing security verification, the digital signatures or serial numbers of different terminals can be used to determine whether there is a unique corresponding security preset token in the security preset token list; in addition, the calculation of the encrypted token can, for example, be: calculation based on the security verification token, key, expiration time, and salt value, and the confidential token is saved in the cache.

[0096] For example, if the security verification token is: "aB3cD9eF1", and the security preset token list includes: "Security preset token 1: aB3cD9eF1", "Security preset token 2: gH2iJ5kL6", "Security preset token 3: mN8oP0qRs" and "Security preset token 4: TuVwXzY1A"; the security verification token matches the security preset token 1, which indicates that the data transmission between the terminal that sends the security verification token and the message server is safe. At this time, the message delayed push module generates an encryption token based on the security verification token "aB3cD9eF1", that is, the security preset token 1, and the encryption token can be: "c3F9aDe1B", and generates a verification pass response based on the encryption token, and sends the verification pass response to the corresponding smart terminal. This application does not impose any special restrictions on the specific content of the security preset token and the encryption token.

[0097] Preferably, when performing security verification, if the security verification token does not match the security preset token, it indicates that the data transmission between the terminal that sent the security verification token and the message server is unsafe. At this time, the message server generates a corresponding verification failure response based on the result of the security verification failure, and sends the verification failure response to the terminal.

[0098] Preferably, before the message server receives the security verification token sent by the terminal, the method further includes:

[0099] The message server receives the configuration information loading instruction sent by the terminal, reads the configuration information from the configuration server, determines whether the read configuration information includes the target configuration information, and if so, loads the target configuration information and returns a success response to the terminal.

[0100] The configuration information loading instruction is used to instruct loading of target configuration information, and the configuration information includes one or more of tenant information, delay configuration information, and message configuration information.

[0101] It is understandable that the loading of configuration information is to determine the user's usage rights, and the usage rights limit the message push service provided by the message server to the user; the configuration server can be set in the same server as the message server, or in a different server. This application does not impose any special restrictions on the specific settings of the configuration server.

[0102] For example, a central server equipped with a message delay push module receives a configuration information loading instruction sent by a smart terminal, reads configuration information from a configuration server, and the configuration includes: cache configuration, group configuration, task policy configuration, user information configuration, user usage rights, message delay push range, and a security preset token corresponding to the terminal; determines whether the read configuration information includes target configuration information, and the target configuration information includes: user usage rights, message delay push range, and a security preset token corresponding to the terminal; if the target configuration information is included, the central server loads the target configuration information and returns a successful response to the smart terminal.

[0103] S205: The terminal uses an encryption token to encrypt the message body and the delay time to obtain an encrypted message.

[0104] S206: The terminal sends the encrypted information to the message server.

[0105] The encrypted message is obtained by encrypting the message body to be sent and the delay time using an encryption token, and the delay time is used to instruct the message server to delay the push of the message body to be sent.

[0106] It is understandable that when a user requires a message server to provide a message push service, the terminal can determine the corresponding message body to be sent and the specific push time of the message to be pushed according to the message to be pushed input by the user, and determine the specific push time as the delay time.

[0107] The terminal uses the encryption token sent by the message server to encrypt the message body and delay time to obtain an encrypted message, and sends the encrypted information to the message server.

[0108] For example, if the message to be pushed obtained by the terminal at this time includes: "message body A to be sent" and "delay time A", an asymmetric encryption algorithm is used to encrypt the "message body A to be sent" and "delay time A" using the encryption token "c3F9aDe1B" to obtain an encrypted message, and the encrypted message is sent to the central server; wherein the encryption token serves as the public key for encrypting the message to be pushed, and the security verification token can be used as the private key for the corresponding decryption process.

[0109] S207: The message server uses the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time.

[0110] S208: The message server delays the push of the message body to be sent based on the delay time.

[0111] The message server uses the security verification token and encryption token to decrypt the encrypted message, obtains the message body to be sent and the corresponding delay time, determines the time accuracy corresponding to the delay time, and delays the push of the message body to be sent according to the time accuracy of the delay time.

[0112] For example, the encrypted message is decrypted using the security verification token "aB3cD9eF1" and the encryption token "c3F9aDe1B" to obtain the "message body A to be sent" and "delay time A" that need to be pushed this time; based on the time accuracy of the "delay time A", the message body A to be sent is pushed with a delayed push; if the time accuracy of the "delay time A" is at the millisecond level, the message body A to be sent is pushed with a delayed push according to the corresponding millisecond level time accuracy; if the time accuracy of the "delay time A" is at the second level, the message body A to be sent is pushed with a delayed push according to the corresponding second level time accuracy.

[0113] The message delayed push method provided in this embodiment is that the terminal sends a security verification token to the message server, and the message server receives the security verification token sent by the terminal. When the security verification token matches the security preset token, the encryption token is determined according to the security verification token, and a verification pass response is sent to the terminal; the terminal receives the verification pass response sent by the message server, and uses the encryption token in the verification pass response to encrypt the message body to be sent and the delay time to obtain an encrypted message, and sends the encrypted message to the message server; the message server receives the encrypted message sent by the terminal, and uses the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time, and delays the push of the message body to be sent based on the delay time. This method provides a flexible message delayed push service, meets the usage requirements of different business scenarios, optimizes the use of system resources, improves the response speed of the message push service, and improves the push efficiency of delayed messages.

[0114] Figure 3 Schematic diagram of the process of the message delay push method provided in the embodiment of the present application Figure 2 .like Figure 3 As shown, in this embodiment Figure 2 Based on the embodiment, the message delay push method is described in detail. The message delay push method shown in this embodiment includes:

[0115] S301: The terminal determines the security verification token.

[0116] S302: The terminal sends the security verification token to the message server.

[0117] S303: If the security verification token matches the security preset token, the message server determines the encryption token based on the security verification token.

[0118] S304: The message server sends a verification pass response to the terminal.

[0119] S305: The terminal uses an encryption token to encrypt the message body and the delay time to obtain an encrypted message.

[0120] S306: The terminal sends the encrypted information to the message server.

[0121] S307: The message server uses the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time.

[0122] Steps S301-S307 are similar to the above-mentioned steps S201-S207 and will not be described in detail here.

[0123] S308: The message server determines the execution time of the message body to be sent according to the delay time, and puts the identifier of the message body to be sent and the corresponding execution time into a delay queue.

[0124] The identifier of the message body to be sent is used to distinguish different terminals that are connected to the message server for communication.

[0125] The message server can calculate the execution time of the message body to be sent, that is, the time node when the message body to be sent is pushed, based on the delay time determined at that time and the sending time of the message body to be sent, and put the identifier of the message body to be sent and the corresponding execution time into the delay queue.

[0126] Specifically, the execution time of the message body to be sent and the precision of the execution time are determined according to the delay time, and the identifier of the message body to be sent and the corresponding execution time are put into a delay queue corresponding to the precision.

[0127] It can be understood that the message server is equipped with multiple delay queues, and different delay queues have different time precisions. Therefore, the message server can provide users with more flexible and refined message push services, so that the message delay push module can select the appropriate time precision queue for processing according to the push requirements of different messages, thereby improving the accuracy and efficiency of message push and enhancing the overall performance and user experience of the message push system; the time precision can be, for example: hours, minutes, seconds, milliseconds.

[0128] For example, when delay queues with different time precisions are set in the secondary central server, including: hourly delay queue A, hourly delay queue B, minute-level delay queue A, minute-level delay queue B, minute-level delay queue C, second-level delay queue A, second-level delay queue B, second-level delay queue B, second-level delay queue D; if the time precision of the delay time A obtained this time is seconds, the message body A to be sent is placed in the second-level delay queue A, which can also be the second-level delay queue B.

[0129] S309: The message server uses a polling service to poll the delay queue to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent.

[0130] It can be understood that delay queues with different time precision are set with different polling frequencies, and the number of delay queues with different time precision is also different; delay queues with low time precision are set with lower polling frequencies, while delay queues with high time precision require higher polling frequencies to avoid the occurrence of unsent message bodies that are not correctly delayed and pushed; since the choice of polling frequency directly affects the accuracy of message push and the resource utilization of the system, different polling frequencies are set according to different time precisions, so that the message server can more efficiently handle message push requirements with different time precisions while maintaining high message push accuracy and system performance.

[0131] The message server determines the polling frequency of the polling service according to the time accuracy of the delay time, and polls the delay queue according to the polling frequency, so as to determine the push object of the message obtained this time based on the execution time of the message body to be sent and the identifier of the message body to be sent, and pushes the message body to be sent to the push object corresponding to the identifier.

[0132] Preferably, a polling service is used to poll the delay queue to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent, including:

[0133] A polling service is used to poll each message body to be sent in the delay queue. If the execution time corresponding to the identifier of the message body to be sent is reached, the identifier of the message body to be sent is placed in the execution queue. If the execution queue is not empty, the message body to be sent corresponding to the identifier of the message body to be sent in the execution queue is pushed.

[0134] The execution queue is used to store the message bodies to be sent whose delay time is less than the preset value.

[0135] It can be understood that in order to ensure that the message body to be sent can be pushed on time, an execution queue is set in the message service end. When the polling service polls the delay queues with different time precisions, the time difference between the delay time of different message bodies to be sent in different delay queues and the time node of the current polling service is calculated, and it is determined whether the time difference meets the preset value under the corresponding time precision. If it meets the preset value, it indicates that the corresponding message body to be sent is close to the time node to be pushed. At this time, the corresponding message body to be sent can be stored in the execution queue; the delay queues under different time precisions have different preset values. For example, the preset value under the hourly time precision can be 1 minute, the preset value under the minute-level time precision can be 5 seconds, the preset value under the second-level time precision can be 1 second, and the preset value under the millisecond-level time precision can be 30 milliseconds.

[0136] A polling service is used to poll each message body to be sent in the delay queue, and the time difference between the message body to be sent and the current polling time is calculated, and whether the corresponding time difference meets the preset value is determined respectively; if the corresponding time difference meets the preset value, it indicates that the message body to be sent has arrived at the corresponding execution time. At this time, the identifier of the message body to be sent is placed in the execution queue; when the execution queue is not empty, the message body to be sent is pushed to the device corresponding to the identifier of the message body to be sent in the execution queue.

[0137] For example, if the identifier of the message body A to be sent is identifier A, the message body A to be sent is placed in the second-level delay queue A, and the corresponding time accuracy is in seconds. At this time, the corresponding preset value is 1 second; the polling service is used to poll the delay queue A to determine whether the time difference between the message body to be sent in the queue and the time node of the current polling meets the preset value of 1 second; if the time difference between the message body A to be sent and the time node of the current polling is 1 second, the identifier A of the message body A to be sent is placed in the execution queue, and according to the identifier A of the message body A to be sent in the execution queue, the message body A to be sent is executed and pushed to the device corresponding to the identifier A.

[0138] Preferably, the method further comprises:

[0139] The message server monitors the execution queue and determines the identifier of the unsuccessfully pushed message body in the execution queue; based on the identifier of the unsuccessfully pushed message body, the message server obtains the unsuccessfully pushed message body and sends a push failure notification to the terminal.

[0140] The push failure notification includes the message body to be sent that was not successfully pushed.

[0141] The message server monitors the execution queue to determine whether there is a message body to be sent that has not been successfully pushed in the execution queue; if there is a message body to be sent that has not been successfully pushed, the message server determines the identifier of the message body to be sent that has not been successfully pushed, obtains the message body to be sent that has not been successfully pushed based on the identifier of the message body to be sent that has not been successfully pushed, generates a push failure notification based on the message body to be sent that has not been successfully pushed, and sends the push failure notification to the terminal.

[0142] For example, the central server monitors the execution queue. If there are messages that have not been pushed successfully in the execution queue, the identifier of the message body A to be sent, that is, identifier A, is determined. According to identifier A, it can be determined that the message body to be sent that has not been pushed successfully is: message body A to be sent, and then a push failure notification is generated based on the message body A to be sent, and the push failure notification is sent to the smart terminal that sent the push request.

[0143] Preferably, the message delay push method further includes:

[0144] The terminal receives the push failure notification sent by the message server.

[0145] The push failure notification includes the message body to be sent that was not successfully pushed.

[0146] After the message server sends the push failure notification, the terminal receives the push failure notification sent by the message server, and the terminal can record the push failure situation, or retry to interact with the message server and re-push the push failure message.

[0147] The message delayed push method provided by the present implementation comprises the following steps: the terminal sends a security verification token to the message server, the message server receives the security verification token sent by the terminal, determines the encryption token according to the security verification token when the security verification token matches the security preset token, and sends a verification success response to the terminal; the terminal receives the verification success response sent by the message server, and uses the encryption token in the verification success response to encrypt the message body to be sent and the delay time to obtain an encrypted message, and sends the encrypted message to the message server; the message server receives the encrypted message sent by the terminal, and uses the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time, determines the execution time of the message body to be sent according to the delay time, and puts the identifier of the message body to be sent and the corresponding execution time into a delay queue of the corresponding time precision, and then uses the polling service to poll the delay queues of different time precisions, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent. This method provides a flexible delayed message push service that can support message push with different time accuracy requirements to adapt to messages with different time sensitivities, meet the usage requirements of different business scenarios, optimize the use of system resources, improve the response speed of the message push service, and the push efficiency of delayed messages.

[0148] Figure 4 Structural schematic diagram of the message delay push device provided by this application Figure 1 .like Figure 4 As shown, the present application provides a message delay push device, and the message delay push device 400 includes:

[0149] The acquisition module 401 is used to receive a security verification token sent by a terminal.

[0150] If the security verification token matches the security preset token, the determination module 402 is used to determine the encryption token according to the security verification token.

[0151] The processing module 403 is used to send a verification success response to the terminal, where the verification success response includes the encrypted token.

[0152] The acquisition module 401 is further used to receive an encrypted message sent by the terminal, where the encrypted message is obtained by encrypting the message body to be sent and the delay time using the encryption token.

[0153] The processing module 403 is further configured to use the security verification token and the encryption token to decrypt the encrypted message to obtain the message body to be sent and the corresponding delay time.

[0154] The processing module 403 is further configured to delay pushing the message body to be sent based on the delay time.

[0155] Optionally, the determination module 402 is further configured to determine the execution time of the message body to be sent according to the delay time.

[0156] The processing module 403 is further configured to put the identifier of the message body to be sent and the corresponding execution time into a delay queue.

[0157] The processing module 403 is further configured to poll the delay queue using a polling service, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent.

[0158] Optionally, the determination module 402 is further configured to determine the execution time of the message body to be sent and the accuracy of the execution time according to the delay time.

[0159] The processing module 403 is further configured to place the identifier of the message body to be sent and the corresponding execution time into a delay queue corresponding to the precision.

[0160] Optionally, the processing module 403 is further configured to use a polling service to poll each message body to be sent in the delay queue, and if the execution time corresponding to the identifier of the message body to be sent is reached, the identifier of the message body to be sent is placed in the execution queue.

[0161] The processing module 403 is further configured to push the to-be-sent message body corresponding to the identifier of the to-be-sent message body in the execution queue when the execution queue is not empty.

[0162] Optionally, the processing module 403 is further configured to monitor the execution queue.

[0163] The determining module 402 is further configured to determine the identifier of the message body to be sent that has not been successfully pushed in the execution queue.

[0164] The acquisition module 401 is further configured to acquire the unsuccessfully pushed message body to be sent based on the identifier of the unsuccessfully pushed message body to be sent.

[0165] The processing module 403 is further configured to send a push failure notification to the terminal, wherein the push failure notification includes the unsuccessfully pushed message body to be sent.

[0166] Optionally, the acquisition module 401 is further configured to receive a configuration information loading instruction sent by the terminal, where the configuration information loading instruction is used to instruct to load target configuration information.

[0167] The processing module 403 is further configured to read configuration information from the configuration server, where the configuration information includes one or more of tenant information, delay configuration information, and message configuration information.

[0168] The determination module 402 is further configured to determine whether the read configuration information includes the target configuration information.

[0169] If the read configuration information includes the target configuration information, the processing module 403 is further configured to load the target configuration information and return a success response to the terminal.

[0170] Figure 5 Structural schematic diagram of the message delay push device provided by this application Figure 2 .like Figure 5 As shown, the present application provides a message delay push device, and the message delay push device 500 includes:

[0171] The processing module 501 is used to send a security verification token to the message server.

[0172] The acquisition module 502 is used to receive a verification success response sent by the message server, wherein the verification success response includes an encrypted token, and the encrypted token is determined based on the security verification token when the security verification token matches a security preset token of the message server.

[0173] The processing module 501 is also used to use the encryption token to encrypt the message body to be sent and the delay time to obtain an encrypted message, and send the encrypted message to the message server. The delay time is used to instruct the message server to delay the push of the message body to be sent.

[0174] Figure 6 This is a schematic diagram of the structure of the message delay push device provided by this application. Figure 6 As shown, the present application provides a message delay push device, and the message delay push device 600 includes: a receiver 601, a transmitter 602, a processor 603 and a memory 604.

[0175] Receiver 601, used for receiving instructions and data;

[0176] A transmitter 602, used for sending instructions and data;

[0177] Memory 604, used to store computer-executable instructions;

[0178] The processor 603 is used to execute the computer-executable instructions stored in the memory 604 to implement the various steps executed by the message delay push method in the above embodiment. For details, please refer to the relevant description in the above message delay push method embodiment.

[0179] Optionally, the memory 604 may be independent or integrated with the processor 603 .

[0180] When the memory 604 is independently provided, the electronic device further includes a bus for connecting the memory 604 and the processor 603 .

[0181] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the aforementioned embodiments and will not be described in detail here.

[0182] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in any of the above embodiments is implemented.

[0183] An embodiment of the present application further provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed by a processor.

[0184] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0185] The above-mentioned message delay push method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. In the above-mentioned application scenario, multiple terminal devices are included, and the terminal devices are connected through a network. The above-mentioned network may include but is not limited to at least one of the following: wired network, wireless network. The above-mentioned wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above-mentioned wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity, wireless fidelity), Bluetooth. Terminal devices may not be limited to PCs, mobile phones, tablet computers, smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projection equipment, smart TVs, smart clothes drying racks, smart curtains, smart audio and video, smart sockets, smart speakers, smart speakers, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart sweeping robots, smart window cleaning robots, smart mopping robots, smart air purification equipment, smart steamers, smart microwave ovens, smart kitchen treasures, smart purifiers, smart water dispensers, smart door locks, etc.

[0186] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.

[0187] It should be understood that the above-mentioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.

[0188] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0189] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0190] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0191] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0193] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for delayed message push, characterized in that: The method comprises: Receiving the security verification token sent by the terminal; If the security verification token matches the security preset token, determining the encrypted token according to the security verification token, and sending a verification pass response to the terminal, wherein the verification pass response includes the encrypted token; Receiving an encrypted message sent by the terminal, wherein the encrypted message is obtained by encrypting a message body to be sent and a delay time using the encryption token; Decrypting the encrypted message using the security verification token and the encryption token to obtain the message body to be sent and the corresponding delay time; The message body to be sent is pushed with delay based on the delay time.

2. The message delayed push method according to claim 1, characterized in that: The delaying pushing the message body to be sent based on the delay time includes: Determine the execution time of the message body to be sent according to the delay time, and put the identifier of the message body to be sent and the corresponding execution time into a delay queue; The delay queue is polled by using a polling service, so as to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent.

3. The message delayed push method according to claim 2, characterized in that: The step of determining the execution time of the message body to be sent according to the delay time, and placing the identifier of the message body to be sent and the corresponding execution time into a delay queue includes: The execution time of the message body to be sent and the precision of the execution time are determined according to the delay time, and the identifier of the message body to be sent and the corresponding execution time are placed in a delay queue corresponding to the precision.

4. The message delayed push method according to claim 3, characterized in that: The polling service is used to poll the delay queue to push the message body to be sent according to the execution time of the message body to be sent and based on the identifier of the message body to be sent, including: Using a polling service to poll each to-be-sent message body in the delay queue, if the execution time corresponding to the identifier of the to-be-sent message body is reached, then putting the identifier of the to-be-sent message body into the execution queue; When the execution queue is not empty, the to-be-sent message body corresponding to the identifier of the to-be-sent message body in the execution queue is pushed.

5. The message delayed push method according to claim 4, characterized in that: Also includes: Monitoring the execution queue, and determining the identifier of the message body to be sent that has not been successfully pushed in the execution queue; Based on the identifier of the unsuccessfully pushed message body to be sent, the unsuccessfully pushed message body to be sent is acquired, and a push failure notification is sent to the terminal, wherein the push failure notification includes the unsuccessfully pushed message body to be sent.

6. The message delayed push method according to any one of claims 1 to 5, characterized in that: Before receiving the security verification token sent by the terminal, the method further includes: receiving a configuration information loading instruction sent by the terminal, wherein the configuration information loading instruction is used to instruct to load target configuration information; Read configuration information from the configuration server, where the configuration information includes one or more of tenant information, delay configuration information, and message configuration information; Determine whether the read configuration information includes the target configuration information, and if so, load the target configuration information and return a success response to the terminal.

7. A method for delayed message push, characterized in that: The method comprises: Send a security verification token to the message server; Receiving a verification success response sent by the message server, wherein the verification success response includes an encrypted token, and the encrypted token is determined according to the security verification token when the security verification token matches a security preset token of the message server; The encryption token is used to encrypt the message body to be sent and the delay time to obtain an encrypted message, and the encrypted message is sent to the message server. The delay time is used to instruct the message server to delay the push of the message body to be sent.

8. A program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the message delayed push method described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the message delayed push method according to any one of claims 1 to 7 is executed when the program is run.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the message delayed push method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Delay message pushing method and apparatus, computer device and storage medium

    CN108388479A

  • Message processing method and device, platform and storage medium

    CN112148506A

  • Delay message pushing method and device and message middleware

    CN112702259A

  • Page request processing method and device

    CN112751878A

  • Data transmission method and device, electronic equipment and storage medium

    CN116865993A