CN105491092B - Message pushing method and device - Google Patents
- ️Tue May 26 2020
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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 method in the embodiment of the present invention may be implemented by a message pushing device, for example, a message pushing server or other network unit that can push a message to a client, such as another client, or a network message forwarding device. For example, the message pushing device in the embodiment of the present invention may be an instant messaging server, an application background server, a web server, or an SNS (Social Networking Services) server, and may be an individual server device, or a server cluster composed of a plurality of server devices that implement specific functions.
Fig. 1 is a schematic flow chart of a message pushing method in an embodiment of the present invention, where as shown in the figure, the message pushing method in the embodiment may include:
s101, before a target message is pushed to a client, version identification information of the client is obtained.
The target message may be an instant messaging message, an application event message, a system message, an SNS message, or a web message, etc. Specifically, after determining that the target message needs to be pushed to the client, the message pushing apparatus first determines whether the client supports reading the target message by executing S101 to S103 in this embodiment. The version identification information of the client may include any one of a platform type (e.g., android version, ios version, windows version), a language type (chinese version, english version, japanese version), a main function type (e.g., light chat version, real-time talk version, standard version), and a version number (e.g., 1.0, 2.0, 3.0).
In an optional embodiment, the message pushing apparatus may obtain the version identification information of the client by obtaining login status information of the client, where the login status information may be reported by the client at any time during or after login, and may include a login account, an online status, and version identification information of the client. In an optional embodiment, the login state management server may be responsible for managing login state information of the client corresponding to each user, and the login state information of the corresponding client may be acquired from the login state management server when the message push device needs the message push device.
And S102, acquiring the message reading capability of the client according to the version identification information.
Specifically, when the clients of the respective versions are pushed out, the message reading capability of the client of each version and the version identification information of the version are recorded, so that a corresponding relationship between the version identification information and the message reading capability of the client of the version is established, and before the message pushing device pushes the target message to the client, the message reading capability of the client of the version corresponding to the obtained version identification information can be searched in the corresponding relationship between the preset version identification information and the message reading capability of the client of the version according to the obtained version identification information. An exemplary message reading capability of a version client may be as shown in fig. 7, which includes at least one reading capability supported by the version client, and is outlined in the figure to indicate that the version client supports the reading capability.
In an optional embodiment, the version capability management server may be responsible for managing the message reading capability of each version client, and when the message pushing device needs, the message reading capability of the client may be acquired from the version capability management server according to the acquired version identification information.
S103, judging whether the client supports reading the target message according to the message reading capability of the client.
Namely, whether the client can display the target message is judged according to the message reading capability of the client. If the target message is a voice message, if the message pushing device determines that the client supports playing the voice message according to the message reading capability of the client, the client is determined to support reading the target message, otherwise, the client is determined not to support reading the target message.
In an optional embodiment, the message pushing device may first obtain a message type of the target message, further obtain at least one reading capability required by the target message according to a correspondence between a preset message type and a reading capability required by the preset message type, then determine whether the message reading capability of the client includes all the reading capabilities required by the target message, determine that the client supports reading the target message if the message reading capability of the client includes all the reading capabilities required by the target message, and otherwise determine that the client does not support reading the target message. In this embodiment, the developer may define or set the reading capability that the client needs to support in order to display the message of the type when each new message type is defined, so that the message pushing device may obtain the reading capability required by different message types when needed.
And S104, if the client does not support reading the target message, performing version compatibility processing on the target message.
In a specific implementation, the message pushing device may convert the target message into a message type of a specific format, where the message type of the specific format may be, for example, a text message or a message type that can be supported by the client, or may generate a notification message according to the type or content of the target message as a target message subjected to version compatibility processing, where the target message is, for example, a voice message, and if the client does not support a corresponding reading capability, the message pushing device may generate a text message, "friend AA has sent a voice message to you, and because the current version of the client does not support successful reception"; for another example, the target message is a video sharing message, which carries target video data or can call a video playing function of the receiver client to play specified video data, if the client does not support the corresponding reading capability, the message pushing device can generate a text message carrying an access link or address of the specified video data, so that the client can play the specified video data in other ways according to the access link or address after receiving the text message.
S105, pushing the target message subjected to the version compatibility processing to the client.
The embodiment of the invention acquires the message reading capability of the target client before sending the target message, and performs version compatible processing on the target message when the client does not support reading the target message, thereby ensuring that the client can successfully process the received message and avoiding the situations of error reporting or work suspension of the client and the like.
Fig. 2 is a schematic flow chart of a message pushing method in another embodiment of the present invention, as shown in the figure, the message pushing method in this embodiment may include:
s201, obtaining login state information of the client, wherein the login state information comprises a login account number, an online state and version identification information of the client.
The login state information may be reported by the client at any time during or after login, and may include a login account, an online state, version identification information, and the like of the client. In an optional embodiment, the login state management server may be responsible for managing login state information of the client corresponding to each user, and the login state information of the corresponding client may be acquired from the login state management server when the message push device needs the message push device. Specifically, after determining that a target message needs to be pushed to a client, the message pushing device first obtains login state information of the client to determine whether the client supports reading the target message. In an optional embodiment, the message pushing apparatus may first determine, according to a message filtering or shielding rule preset by the client, whether to perform message filtering or shielding processing on the target message for the client, and after determining that the target message needs to be pushed to the client, execute the message pushing method in this embodiment.
S202, obtaining the message reading capability of the client according to the version identification information, wherein the message reading capability comprises at least one reading capability supported by the client.
Specifically, when the clients of the respective versions are pushed out, the message reading capability of the client of each version and the version identification information of the version are recorded, so that a corresponding relationship between the version identification information and the message reading capability of the client of the version is established, and before the message pushing device pushes the target message to the client, the message reading capability of the client of the version corresponding to the obtained version identification information can be searched in the corresponding relationship between the preset version identification information and the message reading capability of the client of the version according to the obtained version identification information. An exemplary message reading capability of a version client may be as shown in fig. 7, which is outlined to indicate that the version client supports the reading capability.
In an optional embodiment, the version capability management server may be responsible for managing the message reading capability of each version client, and when the message pushing device needs, the message reading capability of the client may be acquired from the version capability management server according to the acquired version identification information.
S203, obtaining the message type of the target message.
The message type may include a text message, a voice message, a video message, a rich text message, or any of the above messages carrying a particular message format, such as a text message with a message tail, a rich text message with user signature information (a photograph or text content), and so forth.
For example, the message pushing apparatus may determine the message type of the target message according to a message type identifier carried by the target message.
S204, acquiring at least one reading capability required by the target message according to the corresponding relation between the preset message type and the required reading capability.
In this embodiment, a developer may define or set, in advance, the reading capability that the client needs to support in order to display a message of a new message type each time the new message type is defined, so that the message pushing device may acquire the reading capability that is needed by different message types when needed.
S205, determine whether the message reading capability of the client includes all reading capabilities required by the target message. If so, S209 is performed, otherwise, S206 is performed.
S206, determining that the client does not support reading the target message.
And S207, performing version compatibility processing on the target message.
In a specific implementation, the message pushing device may convert the target message into a message type of a specific format, where the message type of the specific format may be, for example, a text message or a message type that can be supported by the client, or may generate a notification message according to the type or content of the target message as a target message subjected to version compatibility processing, where the target message is, for example, a voice message, and if the client does not support a corresponding reading capability, the message pushing device may generate a text message, "friend AA has sent a voice message to you, and because the current version of the client does not support successful reception"; for another example, the target message is a video sharing message, which carries target video data or can call a video playing function of the receiver client to play specified video data, if the client does not support the corresponding reading capability, the message pushing device can generate a text message carrying an access link or address of the specified video data, so that the client can play the specified video data in other ways according to the access link or address after receiving the text message.
In an optional embodiment, the message pushing apparatus may determine the message type supported by the client according to the message reading capability of the client and a correspondence between a preset message type and a required reading capability thereof, and further convert the target message into the message type supported by the client. For example, the message reading capability of the client includes a reading capability a, a reading capability B, and a reading capability C supported by the client, and further, according to a correspondence between a preset message type and a reading capability required by the client, if it is found that the reading capability required by the voice message is the reading capability a, the reading capability B, and the reading capability C, it is determined that the client supports the message type of the voice message, the message pushing device may convert the target message into the voice message when the client does not support the message type of the target message, and if the target message is originally a video message, the voice data may be extracted from the video message, and the converted target message is the voice message carrying the extracted voice data.
S208, pushing the target message subjected to the version compatibility processing to the client.
S209, determining that the client supports reading the target message.
S210, pushing the target message to the client. I.e. push the targeted message directly to the client.
The embodiment of the invention acquires the message reading capability of the target client before sending the target message, and performs version compatible processing on the target message when the client does not support reading the target message, thereby ensuring that the client can successfully process the received message and avoiding the situations of error reporting or work suspension of the client and the like.
Fig. 3 is a schematic flow chart of a message pushing method in another embodiment of the present invention, where as shown in the figure, the message pushing method in this embodiment may include:
s301, obtaining login state information of the client, wherein the login state information comprises a login account number, an online state and version identification information of the client.
The login state information may be reported by the client at any time during or after login, and may include a login account, an online state, version identification information, and the like of the client. In an optional embodiment, the login state management server may be responsible for managing login state information of the client corresponding to each user, and the login state information of the corresponding client may be acquired from the login state management server when the message push device needs the message push device. Specifically, after determining that a target message needs to be pushed to a client, the message pushing device first obtains login state information of the client to determine whether the client supports reading the target message. In an optional embodiment, the message pushing apparatus may first determine, according to a message filtering or shielding rule preset by the client, whether to perform message filtering or shielding processing on the target message for the client, and after determining that the target message needs to be pushed to the client, execute the message pushing method in this embodiment.
S302, obtaining the message reading capability of the client according to the version identification information, wherein the message reading capability comprises at least one reading capability supported by the client.
Specifically, when the clients of the respective versions are pushed out, the message reading capability of the client of each version and the version identification information of the version are recorded, so that a corresponding relationship between the version identification information and the message reading capability of the client of the version is established, and before the message pushing device pushes the target message to the client, the message reading capability of the client of the version corresponding to the obtained version identification information can be searched in the corresponding relationship between the preset version identification information and the message reading capability of the client of the version according to the obtained version identification information. An exemplary message reading capability of a version client may be as shown in fig. 7, which is outlined to indicate that the version client supports the reading capability.
In an optional embodiment, the version capability management server may be responsible for managing the message reading capability of each version client, and when the message pushing device needs, the message reading capability of the client may be acquired from the version capability management server according to the acquired version identification information.
S303, obtaining the message type of the target message.
The message type may include a text message, a voice message, a video message, a rich text message, or any of the above messages carrying a particular message format, such as a text message with a message tail, a rich text message with user signature information (a photograph or text content), and so forth.
For example, the message pushing apparatus may determine the message type of the target message according to a message type identifier carried by the target message.
S304, acquiring at least one reading capability required by the target message according to the corresponding relation between the preset message type and the reading capability required by the preset message type.
In this embodiment, a developer may define or set, in advance, the reading capability that the client needs to support in order to display a message of a new message type each time the new message type is defined, so that the message pushing device may acquire the reading capability that is needed by different message types when needed.
S305, determining that all reading capabilities required by the target message are not included in the message reading capabilities of the client.
S306, determining that the client does not support reading the target message
S307, determining the message type supported by the client according to the corresponding relation between the preset message type and the reading capability required by the preset message type.
Specifically, the message pushing device may determine the message type supported by the client according to the message reading capability of the client and a corresponding relationship between a preset message type and the required reading capability, for example, the message reading capability of the client includes a reading capability a, a reading capability B, and a reading capability C supported by the client, and further, according to the corresponding relationship between the preset message type and the required reading capability, if it is found that the reading capability required by the voice message is the reading capability a, the reading capability B, and the reading capability C, it determines the message type that the client supports the voice message, and further, may obtain all the message types supported by the client according to the above determination method.
S308, converting the target message into the message type supported by the client.
The message pushing device may convert the target message into the message type supported by the client after determining the message type supported by the client, for example, convert the target message into a text message if determining that the client supports a text message. Furthermore, in an optional embodiment, the optional substitute types of each message type may be preset, and priorities of a plurality of optional substitute types may also be set, for example, the optional substitute types of the video message are a voice message and a text message, and the priority of the voice message is higher than the priority of the text message, if it is determined that the client does not currently support the video message but supports the voice message and the text message, the message pushing apparatus may convert the target message into the voice message according to the priority when it is determined that the target message whose message type is the video message needs to be pushed to the client, for example, may extract voice data from the video message, and the converted target message is a voice message carrying the extracted voice data.
S309, pushing the converted target message to the client.
The embodiment of the invention acquires the message reading capability of the target client before sending the target message, and performs version compatible processing on the target message when the client does not support reading the target message, thereby ensuring that the client can successfully process the received message and avoiding the situations of error reporting or work suspension of the client and the like.
Fig. 4 is a schematic structural diagram of a message pushing apparatus in an embodiment of the present invention, where the message pushing apparatus in the embodiment of the present invention at least includes:
the version
identifier obtaining module410 is configured to obtain version identifier information of a client before pushing a target message to the client.
The target message may be an instant messaging message, an application event message, a system message, an SNS message, or a web message, etc. The version identification information of the client may include any one of a platform type (e.g., android version, ios version, windows version), a language type (chinese version, english version, japanese version), a main function type (e.g., light chat version, real-time talk version, standard version), and a version number (e.g., 1.0, 2.0, 3.0).
In an optional embodiment, the version
identifier obtaining module410 may obtain the version identifier information of the client by obtaining login status information of the client, where the login status information may be reported by the client at any time during or after login, and may include a login account, an online status, version identifier information, and the like of the client. In an alternative embodiment, the login status management server may be responsible for managing the login status information of the client corresponding to each user, and the version
identifier obtaining module410 obtains the login status information of the corresponding client from the login status management server.
A reading
capability obtaining module420, configured to obtain, according to the version identification information, a message reading capability of the client.
Specifically, when the clients of the respective versions are pushed out, the message reading capability of each version client and the version identification information of the version may be recorded, so as to establish a corresponding relationship between the version identification information and the message reading capability of the version client, and the reading
capability obtaining module420 may search the message reading capability of the version client corresponding to the obtained version identification information in the corresponding relationship between the preset version identification information and the message reading capability of the version client according to the obtained version identification information. An exemplary message reading capability of a version client may be as shown in fig. 7, which includes at least one reading capability supported by the version client, and is outlined in the figure to indicate that the version client supports the reading capability.
In an alternative embodiment, the version capability management server may be responsible for managing the message reading capability of each version client, and the reading
capability obtaining module420 may obtain the message reading capability of the client from the version capability management server according to the obtained version identification information.
A reading
capability judging module430, configured to judge, according to the message reading capability of the client, whether the client supports reading the target message.
Namely, whether the client can display the target message is judged according to the message reading capability of the client. If the target message is a voice message, if it is determined that the client supports playing the voice message according to the message reading capability of the client, the reading
capability determining module430 determines that the client supports reading the target message, otherwise, it is determined that the client does not support reading the target message.
Further in an optional embodiment, the reading
capability determining module430 further includes:
a message
type obtaining unit431, configured to obtain a message type of the target message.
The message type may include a text message, a voice message, a video message, a rich text message, or any of the above messages carrying a particular message format, such as a text message with a message tail, a rich text message with user signature information (a photograph or text content), and so forth.
For example, the message
type obtaining unit431 may determine the message type of the target message according to the message type identifier carried by the target message.
A reading
capability obtaining unit432, configured to obtain at least one reading capability required by the target message according to a correspondence between a preset message type and a reading capability required by the preset message type;
in this embodiment, the developer may define or set the reading capability that the client needs to support in order to display the message of the type in advance when each new message type is defined, so that the reading
capability acquiring unit432 may acquire the reading capability required by different message types when needed.
A reading
capability judging unit433, configured to judge whether all reading capabilities required for reading the target message are included in the message reading capability of the client, if so, determine that the client supports reading the target message, and otherwise, determine that the client does not support reading the target message.
The version
compatibility processing module440 is configured to perform version compatibility processing on the target message if the reading capability determining module determines that the client does not support reading the target message.
In a specific implementation, the version-
compatible processing module440 may convert the target message into a message type of a specific format, where the message type of the specific format may be, for example, a text message or a message type that can be supported by the client, or may generate a notification message according to the type or content of the target message as a target message after version-compatible processing, where for example, the target message is a voice message, and if the client does not support a corresponding reading capability, the version-
compatible processing module440 converts the target message into a text message, "friend AA has sent a voice message to you, because your client does not support the current version to successfully receive"; for another example, the target message is a video sharing message, which carries target video data or can call a video playing function of the receiver client to play specified video data, if the client does not support the corresponding reading capability, the version
compatibility processing module440 may generate a text message carrying an access link or address of the specified video data, so that the client can play the specified video data in other manners according to the access link or address after receiving the text message.
In an alternative embodiment, the version-
compatible processing module440, as shown in fig. 6, may further include:
the message
type obtaining unit441 is configured to determine the message type supported by the client according to the message reading capability of the client and a corresponding relationship between a preset message type and a required reading capability of the preset message type.
For example, the message reading capability of the client includes a reading capability a, a reading capability B, and a reading capability C supported by the client, and then the reading capability required by the voice message is determined to be the reading capability a, the reading capability B, and the reading capability C according to the correspondence between the preset message type and the reading capability required by the preset message type, then the message
type obtaining unit441 may determine the message type that the client supports the voice message, and further may obtain all the message types supported by the client according to the above determination method.
A
message converting unit442, configured to convert the target message into a message type supported by the client.
The
message conversion unit442 may convert the target message into the message type supported by the client after determining the message type supported by the client, for example, convert the target message into a text message if determining that the client supports a text message. Further, in an optional embodiment, the optional substitute types of each message type may be preset, and priorities of a plurality of optional substitute types may also be set, for example, the optional substitute types of the video message are a voice message and a text message, and the priority of the voice message is higher than the priority of the text message, if it is determined that the client does not currently support the video message but supports the voice message and the text message, the
message conversion unit442 may convert the target message into the voice message according to the priority when it is determined that the target message whose message type is the video message needs to be pushed to the client, for example, voice data may be extracted from the video message, and the converted target message is a voice message carrying the extracted voice data.
The
message pushing module450 is configured to push the target message subjected to the version compatibility processing to the client.
The message pushing device of the embodiment of the invention acquires the message reading capability of the target client before sending the target message, and performs version compatibility processing on the target message when the client does not support reading the target message, thereby ensuring that the client can successfully process the received message and avoiding the situations of error reporting or work suspension of the client and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.