Message processing method and device, electronic equipment and storage medium

文档序号:1965906 发布日期:2021-12-14 浏览:18次 中文

阅读说明:本技术 消息处理方法、装置、电子设备及存储介质 (Message processing method and device, electronic equipment and storage medium ) 是由 孙阳 时彬强 耿启富 詹海峰 查杨 于 2021-08-17 设计创作,主要内容包括:本公开关于一种消息处理方法、装置、电子设备及存储介质,其中,消息处理方法包括:从数据库的重试数据表中依次获取目标消息,其中,目标消息为由于网络原因导致未成功发送的消息,重试数据表用于存储全部处于发送中状态的消息;在满足预设网络要求的情况下,在消息表中查询目标消息的目标消息状态,基于目标消息状态重发目标消息,其中,消息表用于存储全部消息的消息状态。该方法至少可以解决相关技术中消息重发成功率低的问题。(The present disclosure relates to a message processing method, a message processing apparatus, an electronic device, and a storage medium, wherein the message processing method includes: sequentially acquiring target messages from a retry data table of a database, wherein the target messages are messages which are not successfully sent due to network reasons, and the retry data table is used for storing all messages in a sending state; and under the condition of meeting the preset network requirement, inquiring the target message state of the target message in a message table, and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all the messages. The method can at least solve the problem of low message retransmission success rate in the related art.)

1. A message processing method, comprising:

sequentially acquiring target messages from a retry data table of a database, wherein the target messages are messages which are not successfully sent due to network reasons, and the retry data table is used for storing all messages in a sending state;

and under the condition of meeting the preset network requirement, inquiring the target message state of the target message in a message table, and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all messages.

2. The method of claim 1, wherein said querying a message table for a target message status of the target message comprises: removing the target message from the retry data table if the target message is not found in the message table.

3. The method of claim 1, wherein said retransmitting the target message based on the target message status comprises:

acquiring a resource uploading state of the target message under the condition that a message sending state in the target message state is a sending state, wherein the target message state comprises the message sending state and the resource uploading state;

and retransmitting the target message based on the resource uploading state, wherein the resource uploading state is used for indicating the state of uploading the message resource of the target message to a server.

4. The method of claim 3, wherein the retransmitting the target message based on the resource upload status comprises:

removing the target message in the retry data table if the resource upload status indicates that the message resource of the target message is not uploaded to the server;

and under the condition that the resource uploading state indicates that the message resource of the target message is uploaded to the server, retransmitting the target message.

5. The method of claim 3, wherein the retransmitting the target message based on the target message status comprises:

acquiring an attribute state of the target message, wherein the target message state comprises the attribute state, and the attribute state comprises the number of times of retransmission and the storage duration of the target message in the retry data table;

under the condition that the retransmission times are smaller than a preset time threshold and the storage duration is smaller than a preset time threshold, retransmitting the target message;

and under the condition that the retransmission times are larger than or equal to the preset time threshold or the storage duration is larger than or equal to the preset time threshold, removing the target message in the retry data table.

6. The method of claim 5, wherein after obtaining the attribute status of the target message, the method further comprises:

searching the target message in the server;

confirming to retransmit the target message under the condition that the target message is not found in the server;

removing the target message in the retry data table if the target message is found in the server.

7. The method of claim 6, wherein said retransmitting the target message based on the target message status comprises:

acquiring sending type information of the target message, wherein the sending type information comprises: directly sending or forwarding;

and retransmitting the target message according to the sending type information.

8. A computer-readable storage medium, characterized in that it comprises a stored program which when executed performs the method of any of claims 1 to 7.

9. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the method of any of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.

Technical Field

The present disclosure relates to the field of instant messaging, and in particular, to a message processing method and apparatus, an electronic device, and a storage medium.

Background

Instant messaging refers to the real-time delivery of text, files, voice, video, and other messages by two or more people using a network. Instant messaging has high requirements for message real-time.

In the related art, when the network environment of the sending end is poor or there is no network, the processing manner of the instant messaging application program for the message is generally: 1, the message is in a waiting state within a period of time, if the network recovers within the period of time, the waiting message is automatically sent, and after the period of time, the message sending failure is displayed; 2, the message is always in a waiting state, and the message is automatically retransmitted after the network is recovered, even if the restarting application program still cannot change the message waiting state.

When the operation of the user on the related message object fails because the current network environment is weak network or even no network, the retry operation on the related message object is started when the network environment recovers the network or even the strong network, so that the related message object is cached, and the retry is automatically performed based on the cache after the network environment recovers. However, the instant messaging product may experience a restart condition before the network environment is restored, and the cached data is lost and is not retried. Thereby returning an operation failure notification to the user, guiding the user to manually retry. The above related art solution has the problems of low success probability of automatic retry and poor experience of manual retry of the user.

Disclosure of Invention

The present disclosure provides a message processing method, device, electronic device and storage medium, to at least solve the problem of low success rate of automatic message retransmission caused by message retransmission in the related art. The technical scheme of the disclosure is as follows:

according to a first aspect of the embodiments of the present disclosure, a message processing method is provided, which includes sequentially obtaining target messages from a retry data table of a database, where the target messages are messages that are unsuccessfully sent due to a network reason, and the retry data table is used to store all messages in a sending state; and under the condition of meeting the preset network requirement, inquiring the target message state of the target message in a message table, and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all messages.

Optionally, the querying the target message status of the target message in the message table includes: and removing the target message from the retry data table when the target message is not found in the message table.

Optionally, the retransmitting the target message based on the target message status includes: acquiring a resource uploading state of the target message under the condition that a message sending state in the target message state is a sending state, wherein the target message state comprises the message sending state and the resource uploading state; and retransmitting the target message based on the resource uploading state, wherein the resource uploading state is used for indicating the state of uploading the message resource of the target message to a server.

Optionally, the retransmitting the target message based on the resource upload status includes: removing the target message from the retry data table if the resource upload status indicates that the message resource of the target message is not uploaded to the server; and under the condition that the resource uploading state indicates that the message resource of the target message is uploaded to the server, retransmitting the target message.

Optionally, the retransmitting the target message based on the target message status includes: acquiring an attribute state of the target message, wherein the target message state comprises the attribute state, and the attribute state comprises the retransmission times and the storage duration of the target message in the retry data table; under the condition that the retransmission times are smaller than a preset time threshold and the storage duration is smaller than a preset time threshold, retransmitting the target message; and removing the target message in the retry data table when the retransmission times are greater than or equal to the preset time threshold or the storage time length is greater than or equal to the preset time threshold.

Optionally, after obtaining the attribute status of the target message, the method further includes: searching the target message in the server; confirming to retransmit the target message under the condition that the target message is not found in the server; and removing the target message in the retry data table under the condition that the target message is found in the server.

Optionally, the retransmitting the target message based on the target message status includes: acquiring the sending type information of the target message, wherein the sending type information comprises: directly sending or forwarding; and retransmitting the target message according to the transmission type information.

Optionally, the retransmitting the target message based on the target message status includes: acquiring a plurality of target messages indicating batch sending; and retransmitting the target messages in batches.

Optionally, after retransmitting the target message based on the target message status, the method further includes: removing the target message from the retry data table; and updating the message sending state of the target message in the message table to be a sent state.

According to a second aspect of the embodiments of the present disclosure, there is provided a message processing apparatus, including an obtaining unit, configured to sequentially obtain target messages from a retry data table of a database, where the target messages are messages that are not successfully transmitted due to a network, and the retry data table is used to store all messages in a transmission state; and the retransmission unit is used for inquiring the target message state of the target message in a message table under the condition of meeting the preset network requirement and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all messages.

According to a third aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-mentioned message processing method when running.

According to a fourth aspect of the embodiments of the present invention, there is also provided a computer program product, which includes a computer program/instruction, and the computer program/instruction realizes the message processing method when executed by a processor.

According to a fifth aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, the memory having a computer program stored therein, the processor being configured to execute the message processing method described above through the computer program.

In the embodiment of the application, the target message which is not successfully sent due to the network reason is recorded in the retry data table, in case of meeting the network requirements of message transmission, the target message state of the target message is inquired from the message table, the target message is retransmitted according to the status of the target message, the target message which is not successfully transmitted due to the network is recorded by using a retry data table, and the messages which are not successfully sent due to non-network reasons are removed, only if the messages which are successfully sent due to the network reasons meet the network requirements, the target message is retransmitted according to the target message state, the retransmission of the target message according to the message state of the target message is achieved, therefore, the success rate of the target message retransmission is improved, the technical effect of improving the success rate of the message automatic retransmission is realized, and the technical problem of low success rate of the message automatic retransmission is solved.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.

Fig. 1 is a flow chart illustrating a method of message processing according to an example embodiment.

Fig. 2 is a flow chart illustrating a method of message processing according to an example embodiment.

Fig. 3 is a flow chart illustrating a method of message processing according to an example embodiment.

Fig. 4 is a flow chart illustrating a method of message processing according to an example embodiment.

Fig. 5 is a block diagram illustrating a message processing apparatus according to an example embodiment.

FIG. 6 is a block diagram illustrating an electronic device in accordance with an example embodiment.

Detailed Description

In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

Fig. 1 is a flow chart illustrating a message processing method according to an exemplary embodiment, where the message processing method is used in an instant messaging environment, as shown in fig. 1, and includes the following steps.

In step S11, sequentially obtaining target messages from a retry data table of the database, where the target messages are messages that are not successfully sent due to network reasons, and the retry data table is used to store all messages in a sending state;

in step S12, in case that the preset network requirement is satisfied, the target message state of the target message is looked up in a message table for storing the message states of all messages, and the target message is retransmitted based on the target message state.

Alternatively, the sending flow of the message in the instant messaging environment is not limited to that shown in fig. 2. S21, creating a message to be sent. The message to be sent may be a message input in a message input interface of a target client running in the target terminal. The target client may be a client with an instant messaging function, and is not limited to a video client, an instant messaging client, a browser client, an education client, and the like. May include, but is not limited to, at least one of: mobile phones (such as Android phones, IOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The message input interface is an input interface supporting instant messaging functionality, for example, an interface containing a message input control. The messages may be, but are not limited to: text, pictures, expressions, audio, video and any combination thereof.

And S22, preprocessing the message. The messages to be sent are preprocessed, for example, audio and video transcoding, picture compression, etc. After the preprocessing is completed, S23 is executed, and the resource is uploaded. And uploading the preprocessed resources to a server. Here, the target terminal and the server interact with each other based on the resources of the message to be sent. When the resource upload is completed, S24 is executed to transmit. And sending the message to be sent to the receiving terminal through the server, and carrying out message interaction between the target terminal and the receiving terminal. After the message is sent, S25 is executed to confirm the sending result. The message transmission result is divided into transmission success and transmission failure.

Alternatively, the transmission failure cause is not limited to include a network cause and a non-network cause. The non-network reason is not limited to the authority policy reason, such as no authority for message interaction with the account logged in the receiving terminal, the transmitted message not meeting the transmission requirement, and the like.

Alternatively, the confirmation of the message transmission failure reason is not limited to an error code determination returned in the case of a message transmission failure. Taking the error code as an example of a digital code, when the number is less than 0 zero, the transmission failure caused by the network reason is determined, and when the number is between 100 and 200, the transmission failure caused by the message authority is determined.

Optionally, the message sending result is displayed in a message display interface. In case of a failure of the message transmission, a failure flag, e.g. an exclamation point, is displayed.

Alternatively, the retrieval of the target message may be, but is not limited to, by retrying the data table retrieval. The retry data table is used to record messages that were not successfully sent due to network reasons. The structure of the retry data table is not limited to that shown in table 1:

TABLE 1

Name of field Type of field Description of field
retryKey TEXT (character string) Message identification
retryCount INT (integer) Number of message transmissions
createTimestamp INT (integer) Time of message transmission

It should be noted that the message sending time in the above table may be the first time the message is sent.

Alternatively, the application of the retry data table may be, but is not limited to, as shown in FIG. 3. After creating the message to be transmitted at S21, S31 is performed to save the message to be transmitted to the retry data table. After the transmission result is confirmed at S25, if the transmission result indicates that the message transmission is successful or the transmission is failed due to a non-network reason, S32 is executed to remove the message to be transmitted recorded in the retry data table. If the transmission result indicates a transmission failure due to the message network reason, S33 is executed to retain the message to be transmitted in the retry data table.

Optionally, the message recorded in the retry data table is a target message. The retry data table is stored in the target terminal to avoid data loss in the retry data table due to the restart of the target client.

Alternatively, the preset network requirement is not limited to that the network strength of the terminal device where the client is located exceeds a preset network strength threshold. And determining to meet the preset network requirement under the condition that the real-time network intensity of the terminal equipment exceeds the preset network intensity threshold value. The monitoring of the network strength may be, but is not limited to, determined by a network speed measurement function of the target terminal or the target client. The predetermined network strength is independent of the message type and the message data amount, and can satisfy the network strength of successful message transmission.

In the embodiment of the application, the target message which is not successfully sent due to the network reason is recorded in the retry data table, in case of meeting the network requirements of message transmission, the target message state of the target message is inquired from the message table, the target message is retransmitted according to the status of the target message, the target message which is not successfully transmitted due to the network is recorded by using a retry data table, and the messages which are not successfully sent due to non-network reasons are removed, only if the messages which are successfully sent due to the network reasons meet the network requirements, the target message is retransmitted according to the target message state, the retransmission of the target message according to the message state of the target message is achieved, therefore, the success rate of the target message retransmission is improved, the technical effect of improving the success rate of the message automatic retransmission is realized, and the technical problem of low success rate of the message automatic retransmission is solved.

As an optional implementation, the querying the message table for the target message status of the target message includes: in the event that the target message is not found in the message table, the target message is removed from the retry data table.

Alternatively, the message status of the target message may be, but is not limited to being, obtained by querying a message table. The message table is a data table for recording the status of messages. The attribute message of the message is not limited to include: message data, message identification, message sending state, resource uploading state, attribute state and sending type information.

Optionally, the querying the message table to obtain the target message status of the target message may be, but is not limited to, obtaining a message identifier of the target message in the retry data table, and looking up the target message status of the target message in the message table according to the message identifier of the target message.

Alternatively, in the case that a message matching the message identifier of the target message is not found in the message table, it is determined that the target message does not exist in the message, and is not limited to that the target message has been deleted. In the case where the target message has been deleted, retransmission is not performed on the target message, and the message identification of the target message in the retry data table is deleted.

Whether the target message exists or not is inquired in the message table, the target message is confirmed, the deleted message in the message table is removed from the target message, the message recorded in the retry data table is ensured to be the message which is not successfully sent due to the network reason at present, and the retransmission failure caused by the retransmission of the target message and the waste of network resources caused by the inaccurate and untimely removal of the message recorded in the retry data table are avoided.

As an optional implementation, the target message is retransmitted based on the target message status, including:

acquiring a resource uploading state of a target message under the condition that a message sending state in a target message state is a sending state, wherein the target message state comprises a message sending state and a resource uploading state;

and retransmitting the target message based on the resource uploading state, wherein the resource uploading state is used for indicating the state of the message resource of the target message uploaded to the server.

Alternatively, the message sending status of the target message may be, but is not limited to being, obtained by querying a message table. And acquiring the message identifier of the target message in the retry data table, and searching the message sending state of the target message in the message table according to the message identifier of the target message.

Optionally, the messaging status may include, but is not limited to: in the transmission, the transmission is already performed. The transmitted representation target message is successfully transmitted.

Alternatively, the message transmission status of the target message is updated after each transmission operation (including a retransmission operation) is performed on the target message. And when the transmission number count of the current target message is not 1, namely the target message is in a retransmission process or a retransmission process again, acquiring the updated message transmission state of the target message. And under the condition that the updated message sending state of the target message is in sending, determining that the target message is in an unsuccessful sending state.

Alternatively, the resource upload status of the target message may be, but is not limited to being, obtained by querying a message table. And acquiring the message identifier of the target message in the retry data table, and searching the resource uploading state of the target message in the message table according to the message identifier of the target message.

Alternatively, the resource upload status of the target message may be, but is not limited to being, related to the message type of the target message. The message types are not limited to include text types, picture types, media data types. The media data types include audio data, video data, and the like. In the case where the message type is a text type, the resource upload state of the default target message is a state that has been uploaded to the server.

Optionally, in a case that the message type is a picture type or a media data type, the resource upload status of the target message is determined by determining whether the target message is uploaded to the server. In the case where the target message has been uploaded to the server, it is determined that the resource upload status of the target message is an uploaded status. In the case that the target message is not uploaded to the server, determining that the resource upload state of the target message is an upload-not state.

Optionally, when the message resource of the target message is uploaded to the server, the resource uploading state value in the message table is updated to be in the uploading state.

The latest message sending state of the current target message is determined by obtaining the message sending state after the target message is updated, so that inaccuracy of the message sending state of the target message caused by untimely updating of the retry data table is avoided, and the success rate of message retransmission is improved by further ensuring that the target message is the message which is not sent successfully at present due to network reasons. Meanwhile, the resource uploading state of the target message is acquired, and whether the message resource needs to be uploaded to the server for message retransmission is judged based on message retransmission, so that the situation that the message transmission failure rate is increased due to the influence on the message transmitted for the first time caused by more network resources occupied by the message retransmission needing to upload the message resource and the influence on the normal message transmission is avoided. And meanwhile, the automatic message retransmission failure caused by message resource uploading of the retransmission message is avoided.

As an optional implementation, retransmitting the target message based on the resource upload status includes: removing the target message in the retry data table under the condition that the resource uploading state indicates that the message resource of the target message is not uploaded to the server; and in the case that the resource uploading state indicates that the message resource of the target message is uploaded to the server, retransmitting the target message.

Alternatively, in the case that the message resource of the target message is not uploaded to the server, if the target message is retransmitted, the message resource of the target message needs to be uploaded to the server. Under the condition of the message type picture type or the media data type of the target message, uploading of the message resource to the server needs to consume more network resources, and the uploading success rate of the message resource cannot be ensured, so that the target message fails to be retransmitted due to unsuccessful uploading of the message resource.

By confirming the uploading state of the message resource of the target message and retransmitting the target message under the condition that the uploading state of the message resource indicates that the target message is uploaded, the target message can be successfully retransmitted, and the retransmission success rate of the target message is improved.

As an optional implementation, in retransmitting the target message based on the target message status, the method includes:

acquiring the attribute state of the target message, wherein the target message state comprises the attribute state, and the attribute state comprises the retransmission times and the storage duration of the target message in a retry data table;

and under the condition that the retransmission times are less than the preset time threshold and the storage time length is less than the preset time threshold, retransmitting the target message.

Alternatively, the storage duration may be, but is not limited to, calculated by obtaining the sending time of the target message. And calculating the time difference between the current time and the sending time as the storage duration of the target message.

Alternatively, the number of retransmissions may be, but is not limited to, acquired by acquiring the number of transmissions of the target message. The number of transmissions is reduced by one as the number of retransmissions of the target message.

Alternatively, the sending time and the sending times of the target message may be, but are not limited to, obtained by querying a message table. And acquiring the message identifier of the target message in the retry data table, and searching the sending time and the sending times of the target message in the message table according to the message identifier of the target message. The transmission time recorded in the message table is the time when the target message is transmitted for the first time, and the transmission times are all the transmission times of the target message.

Optionally, in the case that the storage duration of the target message is less than the preset time threshold, the target message is retransmitted. And retransmitting the target message when the retransmission number of the target message is less than a predetermined number threshold. And under the condition that the storage time length of the target message does not exceed the preset time threshold and the retransmission times are less than the preset time threshold, retransmitting the target message.

The storage duration and the retransmission times of the target message are determined to measure the timeliness of the target message, the message of which the storage duration and the retransmission times exceed the preset standard is regarded as the message of losing timeliness, the retransmission of the message of losing timeliness is cancelled, and only the target message with timeliness is retransmitted, so that the network resource occupied by the message of retransmitting losing timeliness is avoided, the message retransmission failure is avoided, and the success rate of message retransmission is improved.

As an optional implementation manner, after obtaining the attribute state of the target message, the method further includes:

searching a target message in a server;

confirming to retransmit the target message under the condition that the target message is not found in the server;

in the event that the target message is found in the server, the target message in the retry data table is removed.

Optionally, whether to retransmit the target message is confirmed by looking up the existence status of the target message at the server. In case the target message status indicates to retransmit the target message, the target message is looked up in the server for indicating whether the target message has been sent by the server. The messages which have been sent by the server can be inquired in the server, and the messages which have been sent by the server are stored in the server. And under the condition that the server has sent the target message, the target message can be found in the server, the target message is successfully sent by the server, the target message is not removed from the retry data table in time, and at the moment, the target message in the retry data table is removed. And under the condition that the server does not send the target message, the target message is not stored in the server, and the target message is still in the state of unsuccessful sending at present, and then the target message is retransmitted.

The target message is searched in the server to confirm whether the target message is successfully transmitted or not, so that the target message can be prevented from being retransmitted within the time when the retry data table is not updated due to the successful transmission of the target message, the target message can be prevented from being retransmitted due to the fact that the feedback of the successful transmission of the message is not received due to the weak network strength of the target terminal, after the attribute information of the target message is screened, the state of the target message is confirmed again through the query server before retransmission, the waste of network resources due to the repeated transmission of the target message is avoided, the retransmission failure of other messages due to the occupation of the network resources is avoided, and the retransmission success rate of the message is improved.

As an optional implementation, the target message is retransmitted based on the target message status, including:

acquiring sending type information of a target message, wherein the sending type information comprises: directly sending or forwarding;

and retransmitting the target message according to the transmission type information.

Alternatively, the transmission type information of the target message may be, but is not limited to, acquired by referring to a message table. And acquiring the message identifier of the target message in the retry data table, and searching the sending type information of the target message in the message table according to the message identifier of the target message. The transmission type information is used to indicate a transmission mode of the message. The sending mode of the message can be divided into the following steps due to the message viewing authority: directly sent and forwarded. The direct sending means that the sending form of the message is not limited, and the message can be viewed. The forwarding means that the message cannot be viewed in a direct transmission form due to the authority limit, and can be viewed only in a transmission form of forwarding.

When the message is retransmitted, the sending type information of the message is determined, and the target message is retransmitted according to the sending mode indicated by the sending type information, so that the message sending failure caused by the sending mode not meeting the sending requirement is avoided, the message retransmitting success rate is improved, the network resource waste caused by repeated retransmission of the message is avoided, and the effective utilization rate of the network resource is improved.

As an optional implementation, the retransmitting the target message includes:

acquiring a plurality of target messages for batch sending;

and retransmitting the plurality of target messages in batches.

Alternatively, the bulk retransmission is to establish a transmission order of the target messages based on the transmission time of the target messages, and transmit the plurality of target messages in the transmission order.

The sending sequence of the target message can be ensured through batch retransmission, and messy message sequence caused by singly retransmitting the target message is avoided, so that the sending sequence of the message is ensured in the process of retransmitting the message.

As an optional implementation manner, after retransmitting the target message based on the target message status, the method further includes:

removing the target message in the retry data table;

and updating the message sending state of the target message of the message table to be the sent state.

Optionally, in the case that the target message is retransmitted and the retransmission of the target message is successful, the target message in the retry data table is removed, and meanwhile, the message sending state of the target message in the message table is updated, and the message sending state is updated from sending to sent.

Alternatively, the retransmission process of the target message may be, but is not limited to, as shown in fig. 4. Taking long connection recovery as an example that the network strength reaches a predetermined network requirement, the retransmission target message first performs S401 to confirm the long link recovery. In the case of long link recovery, S402 is executed to obtain a retry data table. When the retry data table is acquired, S403 is executed to determine whether the retry data table stores data. If it is determined that the retry data table currently stores data, it is determined that a message that has not been successfully transmitted due to a network cause currently exists. S404 is executed to query the target message in the message table. And inquiring in the message table according to the message identification in the retry data table. S405 is executed to determine whether the target message is queried. If yes, that is, if the target message is found in the message table according to the message identifier, S406 is executed to determine whether the message transmission status is in transmission. If it is determined as yes, that is, if the message transmission status of the target message is in transmission, S407 is executed to determine whether the resource upload status is uploaded. If yes, that is, the resource uploading status of the target message is uploaded, and the message resource corresponding to the target message is uploaded to the server, S408 is executed to determine whether the retransmission number is smaller than the number threshold. If yes, that is, if the number of retransmissions of the target message is less than the number threshold, S409 is executed to determine whether the storage duration is less than the time threshold. If the determination is yes, that is, the storage duration determined by the first sending time and the current time of the target message is less than the preset time threshold, S410 is executed to determine whether the target message does not exist in the server. If it is determined that the target message is not currently stored in the server and is actually not successfully transmitted, S411 is executed to retransmit the target message. After retransmitting the target message, S412 is performed to determine whether the retransmission is successful. If the retransmission of the target message is successful, S413 is executed to remove the data corresponding to the target message in the retry data table. The retry data table is updated to ensure that unsuccessfully transmitted messages are stored in the retry data table. If the target message is not successfully retransmitted, S414 is performed, and the target message is transmitted +1 times. And updating the sending times of the target message in the message table, and updating the message table in the original sending times plus 1.

Fig. 5 is a block diagram illustrating a message processing apparatus according to an example embodiment. Referring to fig. 5, the apparatus includes an acquisition unit 501 and a retransmission unit 502.

An obtaining unit 501, configured to sequentially obtain target messages from a retry data table in a database, where the target messages are messages that are not successfully sent due to a network reason, and the retry data table is used to store all messages in a sending state;

a retransmitting unit 502, configured to, in a case where a preset network requirement is met, query a message table for storing message statuses of all messages for a target message in a target message status, and retransmit the target message based on the target message status.

Optionally, the retransmission unit 502 includes: and the first removing module is used for removing the target message from the retry data table under the condition that the target message is not found in the message table.

Optionally, the retransmission unit 502 includes:

the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring the resource uploading state of a target message under the condition that the message sending state in the target message state is the sending state, and the target message state comprises the message sending state and the resource uploading state;

and the retransmission module is used for retransmitting the target message based on the resource uploading state, wherein the resource uploading state is used for indicating the state that the message resource of the target message is uploaded to the server.

Optionally, the retransmission module includes:

the second removing module is used for removing the target message in the retry data table under the condition that the resource uploading state indicates that the message resource of the target message is not uploaded to the server;

and the first retransmission module is used for retransmitting the target message under the condition that the resource uploading state indicates that the message resource of the target message is uploaded to the server.

Optionally, the retransmission unit 502 includes:

the second acquisition module is used for acquiring the attribute state of the target message, wherein the target message state comprises the attribute state, and the attribute state comprises the retransmission times and the storage duration of the target message in the retry data table;

the second retransmission module is used for retransmitting the target message under the condition that the retransmission times are smaller than the preset time threshold and the storage duration is smaller than the preset time threshold;

and the third removing module is used for removing the target message in the retry data table under the condition that the retransmission times are larger than or equal to the preset time threshold or the storage time is larger than or equal to the preset time threshold.

Optionally, the message processing apparatus further includes a query unit, configured to, after obtaining the attribute status of the target message, include:

the searching module is used for searching the target message in the server;

the confirmation module is used for confirming the target message to be retransmitted under the condition that the target message is not found in the server;

and the fourth removing module is used for removing the target message in the retry data table under the condition that the target message is found in the server.

Optionally, the retransmission unit 502 includes:

a third obtaining module, configured to obtain sending type information of the target message, where the sending type information includes: directly sending or forwarding;

and the third retransmission module is used for retransmitting the target message according to the sending type information.

Optionally, the retransmission unit 502 includes:

the fourth acquisition module is used for acquiring a plurality of target messages which are indicated to be sent in batches;

and the batch module is used for retransmitting the target messages in batches.

Optionally, the message processing apparatus includes an updating unit, configured to, after retransmitting the target message based on the target message status, include:

a fifth removal module, configured to remove the target message from the retry data table;

and the updating module is used for updating the message sending state of the target message in the message table to be the sent state.

In the embodiment of the application, the target message which is not successfully sent due to the network reason is recorded in the retry data table, in case of meeting the network requirements of message transmission, the target message state of the target message is inquired from the message table, the target message is retransmitted according to the status of the target message, the target message which is not successfully transmitted due to the network is recorded by using a retry data table, and the messages which are not successfully sent due to non-network reasons are removed, only if the messages which are successfully sent due to the network reasons meet the network requirements, the target message is retransmitted according to the target message state, the retransmission of the target message according to the message state of the target message is achieved, therefore, the success rate of the target message retransmission is improved, the technical effect of improving the success rate of the message automatic retransmission is realized, and the technical problem of low success rate of the message automatic retransmission is solved.

With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Fig. 6 illustrates an electronic device for implementing the message processing method according to an exemplary embodiment. The electronic device comprises a memory 602 and a processor 604, wherein the memory 602 stores a computer program, and the processor 604 is arranged to execute the steps of any of the above method embodiments by means of the computer program.

Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.

Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:

s1, sequentially acquiring target messages from a retry data table of the database, wherein the target messages are messages which are not successfully sent due to network reasons, and the retry data table is used for storing all messages in a sending state;

and S2, under the condition of meeting the preset network requirement, inquiring the target message state of the target message in a message table, and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all messages.

Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 6 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an IOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 6 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.

The memory 602 may be used to store software programs and modules, such as program instructions/modules corresponding to the message processing method and apparatus in the embodiments of the present invention, and the processor 604 executes various functional applications and data processing by running the software programs and modules stored in the memory 602, that is, implementing the message processing method described above. The memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 602 may further include memory located remotely from the processor 604, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 602 may be, but not limited to, specifically configured to store information such as a target message. As an example, as shown in fig. 6, the memory 602 may include, but is not limited to, the obtaining unit 502 and the retransmitting unit 504 in the message processing apparatus. In addition, other module units in the message processing apparatus may also be included, but are not limited to, and are not described in detail in this example.

Optionally, the transmitting device 606 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 606 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 606 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.

In addition, the electronic device further includes: a display 608 for displaying the target message; and a connection bus 610 for connecting the respective module parts in the above-described electronic apparatus.

In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.

According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the message processing aspect described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:

s1, sequentially acquiring target messages from a retry data table of the database, wherein the target messages are messages which are not successfully sent due to network reasons, and the retry data table is used for storing all messages in a sending state;

and S2, under the condition of meeting the preset network requirement, inquiring the target message state of the target message in a message table, and retransmitting the target message based on the target message state, wherein the message table is used for storing the message states of all messages.

Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.

In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种应答消息的生成方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!