CN108449256B - Message pushing processing method and device, computer equipment and storage medium - Google Patents

Message pushing processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN108449256B
CN108449256B CN201810138045.3A CN201810138045A CN108449256B CN 108449256 B CN108449256 B CN 108449256B CN 201810138045 A CN201810138045 A CN 201810138045A CN 108449256 B CN108449256 B CN 108449256B
Authority
CN
China
Prior art keywords
pushing
message
party
identifier
pushed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810138045.3A
Other languages
Chinese (zh)
Other versions
CN108449256A (en
Inventor
刘浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201810138045.3A priority Critical patent/CN108449256B/en
Publication of CN108449256A publication Critical patent/CN108449256A/en
Application granted granted Critical
Publication of CN108449256B publication Critical patent/CN108449256B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/23Reliability checks, e.g. acknowledgments or fault reporting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/234Monitoring or handling of messages for tracking messages

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention is suitable for the technical field of communication, and provides a processing method for message pushing, which comprises the following steps: when message pushing is initiated, a message body of a message to be pushed, a device identification of a pushing party and a device identification of a receiving party are obtained; generating a unique identifier corresponding to the message to be pushed; and transmitting the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party into a pushing interface provided by a message pushing system by using the interface parameters, so that the message pushing system queries a group corresponding to the equipment identifier of the pushing party according to the unique identifier and executes pushing operation according to a query result. The invention coordinates the processing logic between the missed sending and the retransmission of the message through the unique identifier, so that the pushing party only needs to pay attention to the initiating logic of the message pushing and generate the unique identifier, and whether the pushing is finally completed by the message pushing system according to the cached query result, thereby not only ensuring the situation of no missed sending, but also controlling the retransmission problem.

Description

Message pushing processing method and device, computer equipment and storage medium
Technical Field
The present invention belongs to the field of communication technologies, and in particular, to a method and an apparatus for processing a message push, a computer device, and a storage medium.
Background
In the message pushing system, no matter notification pushing or short message pushing is performed, or chat messages and in-station messages in the social application program are pushed, the problems of message missing and message resending are encountered. For example, when a failure retransmission mechanism is adopted to solve the problem of missed transmission, because the message received by the receiving party is asynchronous, the phenomenon that the receiving party has received the message and the pushing party considers that the message transmission fails and requires retransmission easily occurs, so that the receiving party receives the same message for multiple times, and the experience of the user is reduced. Therefore, in the prior art, a large contradiction exists between the missed transmission monitoring and the retransmission starting, the coordination logic of the retransmission and the missed transmission is not good enough, and the phenomena of waste of network resources, loss of pushed messages or repeated receiving are easily caused.
Disclosure of Invention
The embodiment of the invention provides a message pushing processing method, a message pushing processing device, computer equipment and a storage medium, and aims to solve the problem that in the prior art, the coordination logic of retransmission and missed transmission is poor.
In a first aspect, an embodiment of the present invention provides a method for processing a message push, where the method includes:
when message pushing is initiated, a message body of a message to be pushed, a device identification of a pushing party and a device identification of a receiving party are obtained;
generating a unique identifier corresponding to the message to be pushed;
and transmitting the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party into a pushing interface provided by a message pushing system by using the interface parameters, so that the message pushing system queries a group corresponding to the equipment identifier of the pushing party according to the unique identifier and executes pushing operation according to a query result.
Further, the generating the unique identifier corresponding to the message to be pushed includes:
generating a 36-bit random number string by adopting a random number algorithm, and removing 4-bit separators in the 36-bit random number string to obtain a 32-bit random number string;
generating a 14-bit time stamp according to the current time information;
and adding the timestamp to the end of the 32-bit random number string to obtain a 46-bit random number string which is used as the unique identifier of the message to be pushed.
Further, the processing method further comprises:
inquiring a processing result of the message to be pushed by the message pushing system from the pushing interface according to a preset time interval;
and if the processing result is not inquired in the preset time interval or the inquired processing result is not the preset result code, transmitting the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party into the pushing interface so as to initiate the pushing of the message to be pushed again.
In a second aspect, an embodiment of the present invention provides a method for processing a message push, where the method includes:
acquiring interface parameters transmitted by a push party through a push interface, wherein the interface parameters comprise a unique identifier of a message to be pushed, a message body, an equipment identifier of the push party and an equipment identifier of a receiving party;
inquiring a group corresponding to the equipment identifier of the pushing party in a preset cache according to the unique identifier;
if the same unique identifier exists in the group corresponding to the equipment identifier of the pushing party, ending the pushing processing flow;
and if the same unique identifier does not exist in the group corresponding to the equipment identifier of the pushing party, executing pushing operation according to the message body of the message to be pushed, the equipment identifier of the pushing party and the equipment identifier of the receiving party.
Further, after executing a push operation according to the message body of the message to be pushed, the device identifier of the push party, and the device identifier of the receiving party, the processing method includes:
and if the pushing operation is successfully executed, adding the unique identifier to a group corresponding to the equipment identifier of the pushing party.
Further, before acquiring the interface parameters which are transmitted by the push party through the push interface, the processing method further includes:
acquiring a configuration request sent by a pushing party, wherein the configuration request comprises a device identifier of the pushing party;
and creating a group corresponding to the equipment identifier of the pushing party in a preset cache, wherein the group is used for storing the equipment identifier of the pushing party and the unique identifier of the pushed message corresponding to the equipment identifier of the pushing party.
In a third aspect, an embodiment of the present invention provides a processing apparatus for pushing a message, where the processing apparatus includes:
the device comprises an acquisition module, a sending module and a receiving module, wherein the acquisition module is used for acquiring a message body of a message to be pushed, a device identifier of a pushing party and a device identifier of a receiving party when message pushing is initiated;
the generating module is used for generating a unique identifier corresponding to the message to be pushed;
and the pushing request module is used for transmitting the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party into a pushing interface provided by the message pushing system as interface parameters, so that the message pushing system queries the group corresponding to the equipment identifier of the pushing party according to the unique identifier and executes pushing operation according to the query result.
In a fourth aspect, an embodiment of the present invention provides a processing apparatus for pushing a message, where the processing apparatus includes:
the system comprises a parameter acquisition module, a message body acquisition module and a message sending module, wherein the parameter acquisition module is used for acquiring interface parameters transmitted by a pushing party through a pushing interface, and the interface parameters comprise a unique identifier of a message to be pushed, a message body, a device identifier of the pushing party and a device identifier of a receiving party;
the identifier query module is used for querying a group corresponding to the equipment identifier of the pushing party in a preset cache according to the unique identifier;
the pushing processing module is used for ending the pushing processing flow if the same unique identifier exists in the group corresponding to the equipment identifier of the pushing party; otherwise, executing the pushing operation according to the message body of the message to be pushed, the equipment identification of the pushing party and the equipment identification of the receiving party.
In a fifth aspect, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the message pushing processing method described above when executing the computer program.
In a sixth aspect, the embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when being executed by a processor, the computer program implements the steps of the message push processing method described above.
Compared with the prior art, the embodiment of the invention has the advantages that by additionally arranging the unique identifier of the message to be pushed, when message pushing is initiated, the unique identifier of the message to be pushed is generated by the pushing party, and the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party are used as interface parameters and are transmitted to the pushing interface provided by the pushing system, so that the pushing system can inquire the group corresponding to the equipment identifier of the pushing party according to the unique identifier and execute pushing operation according to the inquiring result; therefore, the processing logic between the missed sending and the retransmission of the message is coordinated through the unique identifier, so that the pushing party only needs to pay attention to the initiating logic of the message pushing and generate the unique identifier, the processing mode of the pushing party when the pushing party initiates the message pushing is simplified, and whether the pushing is finally completed by the message pushing system according to the cached query result, the condition that the message is not missed is ensured, the retransmission problem is controlled, the problem that the message is lost or repeatedly received is effectively solved, and the waste of network resources is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of a first implementation of a message pushing processing method provided by an embodiment of the present invention;
fig. 2 is a flowchart of a second implementation of a message pushing processing method provided by the embodiment of the present invention;
fig. 3 is a flowchart of a third implementation of a message pushing processing method provided in the embodiment of the present invention;
fig. 4 is a flowchart of a fourth implementation of a message pushing processing method according to an embodiment of the present invention;
fig. 5 is a flowchart of a fifth implementation of a message pushing processing method according to an embodiment of the present invention;
fig. 6 is a first component structure diagram of a message pushing processing device according to an embodiment of the present invention;
fig. 7 is a second component structure diagram of a message pushing processing device according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a computer device provided by an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The message pushing processing method provided by the embodiment of the invention is applied to calling equipment and a message pushing system. The calling device is a background server of an application program on the mobile terminal, can serve as a message pushing party to initiate a message pushing request by calling a pushing interface provided by the message pushing system, and can also serve as a receiving party to receive a pushed message from the message pushing system. Optionally, the message pushing includes, but is not limited to, notification pushing, short message pushing, chat message pushing in a social application program, and in-station message pushing.
The following describes in detail the processing flow of the message pushing processing method on the calling device side.
Fig. 1 shows a first implementation flow of a message pushing processing method provided by an embodiment of the present invention. The message push processing method provided by the embodiment of the invention is applied to calling equipment. Referring to fig. 1, the processing method for message pushing includes:
in step S101, when initiating message pushing, a message body of a message to be pushed, a device identifier of a pushing party, and a device identifier of a receiving party are acquired.
In the embodiment of the invention, the message pushing system provides a pushing interface for the calling equipment to call. Illustratively, the push interface may be: ip port/admin/msgFacade. When a pushing interface is called to initiate message pushing, the calling party equipment acquires a message body of a message to be pushed, an equipment identifier of a pushing party and an equipment identifier of a receiving party. The message body is the message content.
Here, the device identifier is an identity code of a backend server of a different application on the message push system, and is used for the message push system to distinguish different calling devices. Before each calling device uses the push interface, it needs to configure on the message push system and set its corresponding device identifier.
In step S102, a unique identifier corresponding to the message to be pushed is generated.
In the embodiment of the invention, the unique identifier of the message to be pushed is the identity code of different messages to be pushed, the unique identifier is used for distinguishing different messages to be pushed by a message pushing system and calling equipment serving as a pushing party/a receiving party, and the calling equipment serving as the pushing party generates the message when the message is pushed for the first time so as to establish an identification code which does not conflict with other messages to be pushed. Each message to be pushed corresponds to a unique identifier.
It should be noted that the different messages to be pushed are distinguished according to different service scenarios, and the pushing of the same content in the same service scenario belongs to one message to be pushed. Exemplarily, the invoking device a as the push sends a message "do you? Before the first push, generating a corresponding unique identifier 1; if in the pushing process, when the message pushing system fails in pushing and repeatedly pushes, the message "how good you? The "still corresponds to the unique identifier 1, and no new unique identifier is generated any more when the push is repeated, and the two times of push belong to the same category of the message to be pushed. If the calling devices as the pushing parties are different or the same calling device as the pushing party initiates pushing at different time, the messages belong to different messages to be pushed and different unique identifiers are used. For example, the calling device a as the sender sends a message "do you are? "a message" do you are there "is sent again at four points? ", the two messages belong to two different messages to be pushed, and different unique identifiers are used.
In step S103, the unique identifier, the message body, the device identifier of the sender, and the device identifier of the receiver are used as interface parameters and are transmitted to a push interface provided by the message push system, so that the message push system queries a group corresponding to the device identifier of the sender according to the unique identifier and executes a push operation according to a query result.
After generating the unique identifier of the message to be pushed, calling equipment calls a pushing interface in an HTTP mode, packages the unique identifier, the message body, the equipment identifier of a pushing party and the equipment identifier of a receiving party into a pushing request, and transmits the pushing request into the pushing interface to initiate the pushing request, so that the pushing system executes pushing operation according to the interface parameters. And after receiving the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party, the message pushing system inquires a group corresponding to the equipment identifier of the pushing party according to the unique identifier and determines whether to execute a pushing operation according to an inquiry result.
The embodiment of the invention adds the unique identifier of the message to be pushed, when the message pushing is initiated, the pushing party generates the unique identifier of the message to be pushed, and the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party are used as interface parameters and are transmitted into a pushing interface provided by a pushing system so as to initiate a pushing request to the message pushing system, so that the pushing party only needs to pay attention to the initiating logic of the message pushing and generate the unique identifier, the processing mode of the pushing party is simplified, and whether the message is pushed or not is finally determined by the message pushing system according to the query result of the unique identifier, thereby ensuring the condition of no transmission leakage and controlling the problem of retransmission.
Further, on the basis of the first implementation flow of the message pushing processing method provided in fig. 1, a second implementation flow of the message pushing processing method provided in the embodiment of the present invention is provided.
Fig. 2 is a schematic flow chart of a second implementation of the message push processing method according to the embodiment of the present invention. The embodiment of the invention uses Java to generate the universal Unique identifier UUID, and then generates the Unique identifier based on the universal Unique identifier UUID (Universal Unique identifier). The step S102 of generating the unique identifier corresponding to the message to be pushed includes:
in step S1021, a 36-bit random number string is generated by a random number algorithm, and a 4-bit separator in the 36-bit random number string is removed to obtain a 32-bit random number string.
Here, the 36-bit random number string is a standard format UUID, i.e., xxxxxxxxxx-xxxx-xxxx-xxxxxxxx-xxxxxxxxxxxxxx (8-4-4-12). Where each "x" is a hexadecimal number in the range of 0-9 or a-f. Each "-" is a separator, which can be implemented by way of:
UUID uuid=UUID.randomUUID();
String str=uuid.toString();
or the second execution mode:
UUID uuid=UUID.randomUUID();
System.out.println(uuid.toString().replace("-",""));
and removing the 4-bit separator "-" in the 36-bit random number string to obtain the 32-bit random number string, namely the universal unique identifier UUID.
Illustratively, if the 36-bit random number string generated by the random number algorithm is 2f393d0f-0479-4d8f-9189-0d1efe160fe5, the 32-bit random number string obtained after the 4-bit separator in the 36-bit random number string is removed is 2f393d0f04794d8f91890d1efe160fe 5.
In step S1022, a 14-bit time stamp is generated from the current time information.
In an embodiment of the present invention, the 14-bit timestamp is in the format of yyymmddhhmss, where yyyy represents year, MM represents month, dd represents day, hh represents hour, MM represents minute, and ss represents second, such as 20181221120923.
In step S1023, the timestamp is added to the end of the 32-bit random number string to obtain a 46-bit random number string as the unique identifier of the message to be pushed.
After obtaining the 32-bit random number string and the 14-bit timestamp, adding the timestamp to the end of the 32-bit random number string to combine the 32-bit random number string and the 14-bit timestamp to obtain the unique identifier of the message to be pushed. As mentioned above, if the 32-bit random number string is: 2f393d0f04794d8f91890d1efe160fe5, with a 14-bit timestamp: 20181221120923, the unique identifier obtained by combination is: 2f393d0f04794d8f91890d1efe160fe 520180121120923.
The embodiment of the invention uses the UUID, ensures that the generated unique identification can not be repeated, is unique to all equipment in the same air at the same time, and ensures the uniqueness of the identification information of each message to be pushed.
Further, on the basis of the implementation flow of the message pushing processing method provided in fig. 1 or fig. 2, a third implementation flow of the message pushing processing method provided in the embodiment of the present invention is provided.
Fig. 3 is a schematic flow chart of a third implementation of the message pushing processing method according to the embodiment of the present invention. Before each calling device uses the push interface, in addition to setting the device identifier corresponding to the calling device identifier on the message push system, a repeated calling policy may be further set, and a time interval for repeatedly calling the push interface for the same message to be pushed is agreed by itself, and if no return or a return error is received within the agreed time interval from the initiation of pushing, the repeated calling may be performed until the pushing is successful. After the unique identifier, the message body, the device identifier of the push party, and the device identifier of the receiving party are transmitted into a push interface provided by a push system as interface parameters, the processing method may further include:
in step S104, a processing result of the message to be pushed by the message pushing system is queried from the pushing interface according to a preset time interval.
For example, assuming that the time interval for the calling device to call the push interface repeatedly is 1 minute, the calling device may query the push interface every one minute from the initiation of the push request to obtain a processing result of the message to be pushed by the message pushing system.
In step S105, if no processing result is queried within the preset time interval or the queried processing result is not the preset result code, the unique identifier, the message body, the device identifier of the sender, and the device identifier of the receiver are transmitted to the push interface, so as to initiate pushing of the message to be pushed again.
Here, the embodiment of the present invention presets a result code, such as 0000, of successful message pushing. And if the message is successfully pushed to the receiver, the message pushing system returns the preset result code to the pusher through the pushing interface, otherwise, the preset result code or other character strings are not returned. When the processing result is not inquired within the preset time interval, the calling device as the pushing party indicates that the message pushing is overtime, or when the inquired processing result is not the preset result code, the pushing execution is wrong, at this time, the calling device can initiate a pushing request for the message to be pushed, namely, the unique identifier, the message body, the device identifier of the receiving party and the device identifier of the pushing party are transmitted into the pushing interface again until the pushing is successful, so that the problem of message missing sending is solved. The calling equipment does not need to concern about the retransmission problem, and only needs to be called again when the interface does not return or fails to return within the appointed time, so that the logic of the calling equipment for processing the missed transmission problem is further simplified.
Optionally, before each calling device uses the push interface, a threshold of times of repeatedly calling the push interface may be further set, and if the number of times of occurrence of no return or return error within an appointed time interval is within the threshold of times, repeated calling may be performed until the push is successful; and if the number of times is larger than the threshold value, the pushing interface is not called any more.
The above is a processing flow of the message pushing processing method on the calling device side, and a detailed description will be given below of a processing flow of the message pushing processing method on the message pushing system side.
Fig. 4 shows a fourth implementation flow of the message pushing processing method provided by the embodiment of the present invention. The message pushing processing method provided by the embodiment of the invention is applied to a message pushing system. Referring to fig. 4, the processing method for message pushing includes:
in step S401, interface parameters transmitted by the push party through the push interface are obtained, where the interface parameters include a unique identifier of the message to be pushed, a message body, an equipment identifier of the push party, and an equipment identifier of the receiving party.
As mentioned above, the push interface may be: ip port/admin/msgFacade. The calling device serving as the pushing party calls the pushing interface, and transmits the unique identifier, the message body, the device identifier of the pushing party and the device identifier of the receiving party to the pushing interface to initiate message pushing to the message pushing system; the message pushing system acquires the unique identifier of the message to be pushed, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party through the pushing interface.
In step S402, a group corresponding to the device identifier of the push party is queried in a preset cache according to the unique identifier.
In the embodiment of the present invention, each calling device corresponds to a group on the message push system, and is configured to store a device identifier of a push party and a unique identifier of a pushed message corresponding to the device identifier. As described above, before each calling device is used as a push party to call the push interface, it needs to configure on the message push system and set a device identifier corresponding to the device identifier. Therefore, before receiving the interface parameters which are input by the push party through the push interface, the message push system needs to configure the calling device, and the processing method further comprises the following steps:
receiving a configuration request sent by a pushing party, wherein the configuration request comprises a device identifier of the pushing party;
and creating a group corresponding to the equipment identifier of the pushing party in a preset cache.
Here, the groups are divided according to the device identifiers of the calling devices, and each calling device corresponds to one group. Through grouping, the management efficiency of the message pushing system on the cache data is improved, and the message pushing system is convenient to inquire the cache data, wherein the cache data comprises but is not limited to a device identifier of the calling device and a unique identifier of the message. Optionally, the preset cache may adopt a Redis cache, which not only saves storage space, but also improves performance of the push interface compared with other databases.
When a push request sent by a push party is acquired, the message push system calls software Development kit (sdk) provided by the Redis cache to Java, and queries the cache data by taking the device identifier of the push party and the unique identifier of the message to be pushed as keys. Firstly, a group corresponding to the equipment identifier of the pushing party is obtained, and then the unique identifier of the message to be pushed is matched with the existing unique identifier in the group so as to inquire whether the same unique identifier of the message to be pushed exists in the group.
In step S403, if the same unique identifier exists in the group corresponding to the device identifier of the push party, the push processing flow is ended.
In step S404, if the same unique identifier does not exist in the group corresponding to the device identifier of the push party, a push operation is performed according to the message body of the message to be pushed, the device identifier of the push party, and the device identifier of the receiving party.
In the embodiment of the present invention, the unique identifier written in the packet corresponding to the device identifier of the push party indicates that the message referred to by the unique identifier has been pushed and has been pushed successfully. Through the query operation in step S402, it may be determined whether the message to be pushed is pushed for the first time or whether the last pushing is successful. If the same unique identifier exists in the group, the message corresponding to the unique identifier is successfully pushed in the last pushing process, and the pushing processing flow is ended. If the same unique identifier does not exist in the group, the message corresponding to the unique identifier is represented as first push or last push failure, the device identifier of the receiving party is obtained, and a message push module in the system is triggered to execute a push process so as to send the message body of the message to be pushed to the receiving party.
The embodiment of the invention adds the corresponding group for each calling device on the message pushing system and is used for storing the unique identifier of the pushed message. Before the push operation is executed, the message push system determines whether to execute the push or end the flow according to the query result of the unique identifier, thereby ensuring the condition of no transmission leakage, controlling the retransmission problem, effectively solving the problem of message loss or repeated reception and reducing the waste of network resources.
Optionally, as a preferred example of the present invention, in the packet corresponding to each device identifier, in addition to the storage device identifier and the unique identifier of the pushed message corresponding to the storage device identifier, a status bar may be added to record status information of the message, so as to distinguish whether to push the message for the first time or to push the message for a second time. Wherein the status information comprises a default value and a pushed value. Here, the default value is an initial value of the status information at the time of packet creation, and the status information is updated to be pushed if and only if the message is successfully pushed.
When step S402 inquires whether the same unique identifier exists in the group corresponding to the device identifier of the push party: if the same unique identifier exists, which indicates that the message to be pushed has been successfully pushed in the last pushing process, step S403 is executed; if the same unique identifier does not exist and the status bar is a default value, which indicates that the current message to be pushed is pushed for the first time, executing the pushing operation, and moving to the step S404; if the same unique identifier exists and the status bar is the default value, it indicates that the current message to be pushed is pushed for the nth time, where n is a positive integer not equal to 1, repeated pushing is performed, and the flow goes to step S404.
Further, on the basis of the fourth implementation flow of the message pushing processing method provided in fig. 4, a fifth implementation flow of the message pushing processing method provided in the embodiment of the present invention is provided.
Fig. 5 is a schematic flowchart of a fifth implementation of a message pushing processing method according to an embodiment of the present invention. After step S404 executes a push operation according to the message body of the message to be pushed, the device identifier of the push party, and the device identifier of the receiving party, the processing method includes:
in step S405, if the push operation is successfully executed, the unique identifier is added to the packet corresponding to the device identifier of the push party.
When the push operation is successfully executed, for example, push success status information fed back by a message push module inside the system is received, writing the unique identifier into a group corresponding to the device identifier of the push party, so as to update a group record corresponding to the device identifier of the push party; and meanwhile, generating a preset result code, and returning the preset result code to a pushing party through the pushing interface. The embodiment of the invention can smoothly end the pushing flow when the pushing party initiates the pushing request to the pushed message again by storing the unique identifier of the pushed message, thereby effectively avoiding the problem of repeated receiving of the pushed message and solving the problem of poor coordination logic of retransmission and missed transmission.
It should be understood that, in the above embodiments, the order of execution of the steps is not meant to imply any order, and the order of execution of the steps should be determined by their function and inherent logic, and should not limit the implementation process of the embodiments of the present invention.
Example 2
Fig. 6 shows a first component structure diagram of a message push processing apparatus according to an embodiment of the present invention, and for convenience of description, only a part related to the embodiment of the present invention is shown.
In this embodiment of the present invention, the message pushing processing apparatus is used to implement the message pushing processing method in the embodiments shown in fig. 1, fig. 2, or fig. 3, and may be a software unit, a hardware unit, or a unit combining software and hardware that is built in a computer device. The computer equipment is a background server of an application program on the mobile terminal. Optionally, the message pushing includes, but is not limited to, notification pushing, short message pushing, chat message pushing in a social application program, and in-station message pushing.
Referring to fig. 6, the processing apparatus for message push includes:
the acquiring module 61 is configured to acquire a message body of a message to be pushed, an equipment identifier of a pushing party, and an equipment identifier of a receiving party when initiating message pushing;
a generating module 62, configured to generate a unique identifier corresponding to the message to be pushed;
a push request module 63, configured to send the unique identifier, the message body, the device identifier of the sender, and the device identifier of the receiver as interface parameters to a push interface provided by the message pushing system, so that the message pushing system queries, according to the unique identifier, a group corresponding to the device identifier of the sender, and executes a push operation according to a query result.
Optionally, the generating module 62 further includes:
the first generating unit 621 is configured to generate a 36-bit random number string by using a random number algorithm, and remove a 4-bit separator in the 36-bit random number string to obtain a 32-bit random number string;
a second generating unit 622 for generating a 14-bit time stamp according to the current time information;
an adding unit 623, configured to add the timestamp to the end of the 32-bit random number string to obtain a 46-bit random number string, which is used as a unique identifier of the message to be pushed.
Optionally, the processing apparatus further comprises:
a result query module 64, configured to query, according to a preset time interval, a processing result of the message to be pushed by the message pushing system from the pushing interface;
the push request module 63 is further configured to, if a processing result is not queried within the preset time interval or the queried processing result is not a preset result code, transmit the unique identifier, the message body, the device identifier of the push party, and the device identifier of the receiving party to the push interface, so as to initiate pushing of the message to be pushed again.
It should be noted that each module/unit in the embodiment of the present invention may be configured to implement all technical solutions in the method embodiments described in fig. 1, fig. 2, or fig. 3, and a specific working process thereof may refer to a corresponding process in the foregoing method embodiment, which is not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Fig. 7 shows a second component structure diagram of a message push processing apparatus according to an embodiment of the present invention, and for convenience of description, only a part related to the embodiment of the present invention is shown.
In this embodiment of the present invention, the message pushing processing apparatus is used to implement the message pushing processing method described in the above embodiment of fig. 4 or fig. 5, and may be a software unit, a hardware unit, or a unit combining software and hardware that is built in a computer device. The computer equipment is a background server corresponding to the message pushing system.
Referring to fig. 7, the processing apparatus for message push includes:
the parameter obtaining module 71 is configured to obtain an interface parameter transmitted by a push party through a push interface, where the interface parameter includes a unique identifier of a message to be pushed, a message body, an equipment identifier of the push party, and an equipment identifier of a receiving party;
the identifier query module 72 is configured to query, in a preset cache, a group corresponding to the device identifier of the push party according to the unique identifier;
a push processing module 73, configured to end a push processing flow if the same unique identifier exists in the group corresponding to the device identifier of the push party; otherwise, executing the pushing operation according to the message body of the message to be pushed, the equipment identification of the pushing party and the equipment identification of the receiving party.
Optionally, the processing apparatus further comprises:
an adding module 74, configured to add the unique identifier to a packet corresponding to the device identifier of the push party if the push operation is successfully executed.
Optionally, the processing apparatus further comprises:
a configuration module 75, configured to obtain a configuration request sent by a push party before obtaining an interface parameter transmitted by the push party through a push interface, where the configuration request includes an equipment identifier of the push party; and creating a group corresponding to the equipment identifier of the pushing party in a preset cache, wherein the group is used for storing the equipment identifier of the pushing party and the unique identifier of the pushed message corresponding to the equipment identifier of the pushing party.
It should be noted that each module/unit in the embodiment of the present invention may be configured to implement all technical solutions in the method embodiments described in fig. 4 or fig. 5, and a specific working process thereof may refer to a corresponding process in the foregoing method embodiment, which is not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Example 3
This embodiment provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for processing message pushing in embodiment 1 is implemented, and details are not described here for avoiding repetition. Alternatively, the computer program, when executed by the processor, implements the functions of each module/unit in the processing apparatus for message pushing in embodiment 2, and is not described herein again to avoid redundancy.
It is to be understood that the computer-readable storage medium may include: any entity or device capable of carrying said computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, etc.
Example 4
Fig. 8 is a schematic diagram of a computer device according to an embodiment of the present invention. As shown in fig. 8, the computer device 8 of this embodiment includes: a processor 80, a memory 81 and a computer program 82 stored in said memory 81 and executable on said processor 80. When the processor 80 executes the computer program 82, the steps of the processing method for pushing a message in the foregoing embodiment 1 are implemented, for example, steps S101 to S103 shown in fig. 1, steps S1021 to S1023 shown in fig. 2, steps S104 to S105 shown in fig. 3, and steps S401 to S404 shown in fig. 4, and step S405 shown in fig. 5, or, when the processor 80 executes the computer program 82, the functions of the modules/units in the processing device for pushing a message in the foregoing embodiment 2 are implemented, for example, the functions of the modules 61 to 64 shown in fig. 6, and the functions of the modules 71 to 75 shown in fig. 7
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A processing method for pushing a message is characterized by comprising the following steps:
when message pushing is initiated, a message body of a message to be pushed, a device identification of a pushing party and a device identification of a receiving party are obtained;
generating a unique identifier corresponding to the message to be pushed;
the unique identification, the message body, the equipment identification of the pushing party and the equipment identification of the receiving party are used as interface parameters to be transmitted into a pushing interface provided by a message pushing system, so that the message pushing system queries the group corresponding to the equipment identification of the pushing party according to the unique identification and executes pushing operation according to the query result, the group comprises a device identification, a unique identification and a status bar, the status bar comprises a default value and a pushed value, wherein the status bar is a default value when the group is created, is updated to be pushed after the message is successfully pushed, and the message pushing system inquires a group corresponding to the equipment identifier of the pushing party, finishes pushing operation if the unique identifier exists, executes pushing operation if the unique identifier does not exist and the status bar is a default value, and executes repeated pushing if the same unique identifier exists and the status bar is a default value.
2. The message pushing processing method according to claim 1, wherein the generating of the unique identifier corresponding to the message to be pushed includes:
generating a 36-bit random number string by adopting a random number algorithm, and removing 4-bit separators in the 36-bit random number string to obtain a 32-bit random number string;
generating a 14-bit time stamp according to the current time information;
and adding the timestamp to the end of the 32-bit random number string to obtain a 46-bit random number string which is used as the unique identifier of the message to be pushed.
3. The processing method for message pushing according to claim 1 or 2, wherein the processing method further comprises:
inquiring a processing result of the message to be pushed by the message pushing system from the pushing interface according to a preset time interval;
and if the processing result is not inquired in the preset time interval or the inquired processing result is not the preset result code, transmitting the unique identifier, the message body, the equipment identifier of the pushing party and the equipment identifier of the receiving party into the pushing interface so as to initiate the pushing of the message to be pushed again.
4. A processing method for pushing a message is characterized by comprising the following steps:
acquiring interface parameters transmitted by a push party through a push interface, wherein the interface parameters comprise a unique identifier of a message to be pushed, a message body, an equipment identifier of the push party and an equipment identifier of a receiving party;
inquiring a group corresponding to the equipment identifier of the pushing party in a preset cache according to the unique identifier;
if the same unique identifier exists in the group corresponding to the equipment identifier of the pushing party, ending the pushing processing flow;
if the same unique identifier does not exist in the group corresponding to the equipment identifier of the pushing party, executing pushing operation according to the message body of the message to be pushed, the equipment identifier of the pushing party and the equipment identifier of the receiving party;
the group comprises a device identifier, a unique identifier and a status bar, wherein the status bar comprises a default value and a pushed value, the status bar is the default value when the group is created, the status bar is updated to the pushed value after the message is successfully pushed, after the group corresponding to the device identifier of the pushing party is inquired, the pushing operation is finished if the unique identifier exists, the pushing operation is executed if the unique identifier does not exist and the status bar is the default value, and the repeated pushing is executed if the same unique identifier exists and the status bar is the default value.
5. The message push processing method according to claim 4, wherein after performing the push operation according to the message body of the message to be pushed, the device identifier of the push party, and the device identifier of the receiving party, the processing method comprises:
and if the pushing operation is successfully executed, adding the unique identifier to a group corresponding to the equipment identifier of the pushing party.
6. The message push processing method according to claim 4, wherein before acquiring the interface parameters that are sent in by the push party through the push interface, the processing method further comprises:
acquiring a configuration request sent by a pushing party, wherein the configuration request comprises a device identifier of the pushing party;
and creating a group corresponding to the equipment identifier of the pushing party in a preset cache, wherein the group is used for storing the equipment identifier of the pushing party and the unique identifier of the pushed message corresponding to the equipment identifier of the pushing party.
7. A processing apparatus for message pushing, the processing apparatus comprising:
the device comprises an acquisition module, a sending module and a receiving module, wherein the acquisition module is used for acquiring a message body of a message to be pushed, a device identifier of a pushing party and a device identifier of a receiving party when message pushing is initiated;
the generating module is used for generating a unique identifier corresponding to the message to be pushed;
the push request module is used for transmitting the unique identifier, the message body, the equipment identifier of the push party and the equipment identifier of the receiving party into a push interface provided by the message push system as interface parameters so that the message push system can inquire a group corresponding to the equipment identifier of the push party according to the unique identifier and execute push operation according to an inquiry result;
the group comprises a device identifier, a unique identifier and a status bar, wherein the status bar comprises a default value and a pushed value, the status bar is the default value when the group is created, the status bar is updated to the pushed value after the message is successfully pushed, the message pushing system inquires the group corresponding to the device identifier of the pushing party, if the unique identifier exists, the pushing operation is finished, if the unique identifier does not exist and the status bar is the default value, the pushing operation is executed, and if the same unique identifier exists and the status bar is the default value, the repeated pushing is executed.
8. A processing apparatus for message pushing, the processing apparatus comprising:
the system comprises a parameter acquisition module, a message body acquisition module and a message sending module, wherein the parameter acquisition module is used for acquiring interface parameters transmitted by a pushing party through a pushing interface, and the interface parameters comprise a unique identifier of a message to be pushed, a message body, a device identifier of the pushing party and a device identifier of a receiving party;
the identifier query module is used for querying a group corresponding to the equipment identifier of the pushing party in a preset cache according to the unique identifier;
the pushing processing module is used for ending the pushing processing flow if the same unique identifier exists in the group corresponding to the equipment identifier of the pushing party; otherwise, executing the pushing operation according to the message body of the message to be pushed, the equipment identification of the pushing party and the equipment identification of the receiving party;
the group comprises a device identifier, an unique identifier and a status bar, wherein the status bar comprises a default value and a pushed value, the status bar is the default value when the group is created, and is updated to the pushed value after the message is successfully pushed, the pushing processing module is also used for finishing the pushing operation if the unique identifier exists after the group corresponding to the device identifier of the pushing party is inquired, executing the pushing operation if the unique identifier does not exist and the status bar is the default value, and executing repeated pushing if the same unique identifier exists and the status bar is the default value.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the message push processing method according to any one of claims 1 to 3 or any one of claims 4 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the steps of the method for processing a message push according to any one of claims 1 to 3 or 4 to 6.
CN201810138045.3A 2018-02-10 2018-02-10 Message pushing processing method and device, computer equipment and storage medium Active CN108449256B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810138045.3A CN108449256B (en) 2018-02-10 2018-02-10 Message pushing processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810138045.3A CN108449256B (en) 2018-02-10 2018-02-10 Message pushing processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108449256A CN108449256A (en) 2018-08-24
CN108449256B true CN108449256B (en) 2021-05-04

Family

ID=63192212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810138045.3A Active CN108449256B (en) 2018-02-10 2018-02-10 Message pushing processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108449256B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109491765B (en) * 2018-10-09 2021-07-30 创新先进技术有限公司 Method and device for processing cross-domain service request
CN109802995B (en) * 2018-12-13 2023-04-11 深圳壹账通智能科技有限公司 Message pushing method, device, equipment and storage medium
CN110247963A (en) * 2019-05-31 2019-09-17 北京智慧云行科技有限责任公司 A kind of data push method and system
CN111984713A (en) * 2020-06-29 2020-11-24 五八到家有限公司 Data processing method, device, equipment and storage medium
WO2022036526A1 (en) * 2020-08-17 2022-02-24 Oppo广东移动通信有限公司 Method, apparatus, and device for processing notification message, and storage medium
CN112187903B (en) * 2020-09-22 2022-08-26 华云工业互联网有限公司 Message pushing method and device and message service system
CN112579093B (en) * 2020-12-11 2022-08-12 杭州安恒信息技术股份有限公司 Information pushing method and device and related equipment
CN112637151B (en) * 2020-12-11 2023-05-05 深圳市英威腾电气股份有限公司 Data message transmission method, terminal device, server and storage medium
CN114374705A (en) * 2022-01-06 2022-04-19 青岛海信智慧生活科技股份有限公司 Service cluster and message pushing method
CN114553815A (en) * 2022-01-29 2022-05-27 北京金堤科技有限公司 Method and device for processing message
CN114584416B (en) * 2022-02-11 2023-12-19 青岛海尔科技有限公司 Electrical equipment control method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702486A (en) * 2013-12-09 2015-06-10 腾讯科技(深圳)有限公司 Information publication method and device
CN105491539A (en) * 2014-09-18 2016-04-13 博雅网络游戏开发(深圳)有限公司 Message push management method and device
CN106330947A (en) * 2016-09-06 2017-01-11 西安瀚炬网络科技有限公司 Method and system for recognizing disguised WiFi and system working method
CN106657299A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Method and system for online reminding of concerned anchor
CN106713124A (en) * 2017-01-24 2017-05-24 深圳市启仑智能科技有限公司 Message push method and system based on MQTT and MYSQL

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702486A (en) * 2013-12-09 2015-06-10 腾讯科技(深圳)有限公司 Information publication method and device
CN105491539A (en) * 2014-09-18 2016-04-13 博雅网络游戏开发(深圳)有限公司 Message push management method and device
CN106330947A (en) * 2016-09-06 2017-01-11 西安瀚炬网络科技有限公司 Method and system for recognizing disguised WiFi and system working method
CN106657299A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Method and system for online reminding of concerned anchor
CN106713124A (en) * 2017-01-24 2017-05-24 深圳市启仑智能科技有限公司 Message push method and system based on MQTT and MYSQL

Also Published As

Publication number Publication date
CN108449256A (en) 2018-08-24

Similar Documents

Publication Publication Date Title
CN108449256B (en) Message pushing processing method and device, computer equipment and storage medium
CN110351111B (en) Subscription processing method, network node and user database
EP2993838A1 (en) Method for setting identity of gateway device and management gateway device
CN107204873B (en) Method for switching target domain name resolution server and related equipment
JP7479450B2 (en) NAT traversal method, device and system
CN108429739B (en) Method, system and terminal equipment for identifying honeypots
US10057392B2 (en) Packet processing method, device and system
EP3226516B1 (en) Unified data networking across heterogeneous networks
WO2018000389A1 (en) Method and device for managing network slice
CN113391979A (en) Processing method, equipment and system for monitoring data display and storage medium
CN105165035A (en) Transmission of multimedia message doubled with transmission of text message
US10268532B2 (en) Application message processing system, method, and application device
US8489838B2 (en) Method and terminal device for erasing data of terminal
CN112566123A (en) Method and device for determining abnormal network node
CN114126085B (en) Industrial field bus communication method and device, electronic equipment and storage medium
CN115344405A (en) Data processing method, network interface card, electronic equipment and storage medium
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)
CN110166185B (en) Audio data processing method and device, storage medium and processor
CN103138953A (en) Method and system of massively texting multimedia information
CN111372204A (en) Discovery method and device
CN110943897A (en) PPPoE data message transmission method, device, equipment and storage medium
AU2020416492B2 (en) Multicast Service Implementation Method and Apparatus, and Communications Device
CN111918365B (en) Network distribution method, device and system of Internet of things and storage medium
CN115150031B (en) Distributed system message response method and device based on distributed message
CN111107174B (en) Address resolution method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant