CN111245709A - Message pushing method and device, electronic equipment and storage medium - Google Patents

Message pushing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111245709A
CN111245709A CN202010084898.0A CN202010084898A CN111245709A CN 111245709 A CN111245709 A CN 111245709A CN 202010084898 A CN202010084898 A CN 202010084898A CN 111245709 A CN111245709 A CN 111245709A
Authority
CN
China
Prior art keywords
pushed
message
sequence number
pushing
current message
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.)
Pending
Application number
CN202010084898.0A
Other languages
Chinese (zh)
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010084898.0A priority Critical patent/CN111245709A/en
Publication of CN111245709A publication Critical patent/CN111245709A/en
Pending legal-status Critical Current

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/224Monitoring or handling of messages providing notification on incoming messages, e.g. pushed notifications of received messages
    • 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/226Delivery according to priorities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the disclosure discloses a message pushing method, a message pushing device, electronic equipment and a storage medium, wherein the method comprises the following steps: packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed; and pushing the packaged current message to be pushed to a client corresponding to the identification information. The technical scheme of the embodiment of the disclosure ensures that additional time consumption is not increased in a pushing link, solves the problem of strong dependence of a service storage layer, improves the message pushing efficiency, and can ensure the orderliness of each message.

Description

Message pushing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, and in particular, to a message pushing method and device, an electronic device, and a storage medium.
Background
In a video conference scenario, a process is involved in which a server frequently pushes messages to clients, for example, voice information of a conference host is continuously pushed to each participating client.
In a video conference scene, the current message pushing method is as follows: when the business service generates a message to be pushed, the business service stores the message to be pushed by itself, maintains the generation sequence and the sequence number of the message, stores a cursor for identifying the sequence number of the latest pushed message through a communication component frontier, when the business service pushes the message, the business service firstly sends a trigger signal to the frontier to inform the frontier that a new message is to be pushed, then the frontier pulls the message behind the cursor from the business service through the cursor, and finally the frontier pushes the pulled message according to the sequence and updates the cursor.
The message pushing method has the following defects: all message pushing storage layers which seriously depend on business services cannot carry out message pushing once the storage layers are unavailable; and each time message pushing is performed, the message pushing efficiency is reduced due to long time consumption of RPC (remote procedure Call).
Disclosure of Invention
The embodiment of the disclosure provides a message pushing method and device, an electronic device and a storage medium, which improve message pushing efficiency, remove dependence on a storage layer, and ensure the order of messages.
In a first aspect, an embodiment of the present disclosure provides a message pushing method, which is applied to a server, and the method includes:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
and pushing the packaged current message to be pushed to a client corresponding to the identification information.
In a second aspect, an embodiment of the present disclosure provides a message pushing method, which is applied to a client, and the method includes:
receiving a packaged current message to be pushed, which is pushed by a server side;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
In a third aspect, an embodiment of the present disclosure further provides a message pushing system, where the system includes: a service end and a client end, wherein,
wherein, the server side includes:
the packaging module is used for packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, and the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
the push module is used for pushing the packaged current message to be pushed to the target client;
the client comprises:
the receiving module is used for receiving the packaged current message to be pushed, which is pushed by the server side;
the determining module is used for determining whether the pushing sequence of the current message to be pushed is correct or not based on the pushing sequence information included in the packed current message to be pushed; if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed;
and the pushing module is used for pushing the correct message to be pushed to the service layer.
In a fourth aspect, an embodiment of the present disclosure further provides an apparatus, where the apparatus includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a message push method as in any of the embodiments of the present disclosure.
In a fifth aspect, the embodiments of the present disclosure further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the message pushing method according to any one of the embodiments of the present disclosure.
According to the technical scheme of the embodiment, the current message to be pushed is packaged according to the identification information of the current message to be pushed, so that the packaged current message to be pushed comprises pushing sequence information, and the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed; the packaged current message to be pushed is pushed to the client corresponding to the identification information, the client receives the packaged current message to be pushed by the server, and whether the pushing sequence of the current message to be pushed is correct or not is determined based on the pushing sequence information included in the packaged current message to be pushed, so that the message pushing efficiency is improved, the dependence on a storage layer is eliminated, and the ordering of each message can be ensured.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic flow chart of a message pushing method according to a first embodiment of the present disclosure;
fig. 2 is a schematic diagram of a working architecture of a server according to a first embodiment of the disclosure;
fig. 3 is a schematic flow chart of a message pushing method according to a second embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating operations of ensuring message timing according to a second embodiment of the disclosure;
fig. 5 is a schematic diagram of a memory structure according to a second embodiment of the disclosure;
fig. 6 is a schematic flow chart of a message pushing method according to a third embodiment of the present disclosure;
fig. 7 is a schematic diagram of a message loss guarantee provided in a third embodiment of the present disclosure;
fig. 8 is a schematic diagram of a message order assurance provided in a third embodiment of the present disclosure;
fig. 9 is a flowchart illustrating another message pushing method according to a third embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a message pushing system according to a fourth embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device according to a fifth embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
Example one
Fig. 1 is a schematic flow chart of a message pushing method according to a first embodiment of the present disclosure, where the method is applicable to a scenario in which a server pushes a message to a client, and typically, for example, in a video conference scenario, the message pushing method is applicable to a scenario in which a server pushes a message to a participating client. The method can be executed by a message pushing device, which can be implemented in the form of software and/or hardware and is integrated into a server.
As shown in fig. 1, the message pushing method provided in this embodiment includes the following steps:
and step 110, packaging the current message to be pushed according to the identification information of the current message to be pushed, so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed.
Illustratively, the packaging the current message to be pushed according to the identification information of the current message to be pushed, so that the packaged current message to be pushed includes the pushing sequence information, including:
determining a real-time sequence number of the current message to be pushed based on an increasing rule;
compared with the current message to be pushed, acquiring the historical sequence number of the last message to be pushed corresponding to the identification information from a first database;
packaging the current message to be pushed, the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed and the identification information;
and updating the historical sequence number of the last message to be pushed corresponding to the identification information in the first database to be the real-time sequence number of the current message to be pushed.
Specifically, refer to a schematic diagram of a working architecture of a server shown in fig. 2, which includes service services, a push gateway, databases redis and abese, and a push component (or referred to as a push pipe) backbone/frontier. When a business service generates a message to be pushed, the message to be pushed is pushed to a pushing gateway, the pushing gateway is responsible for receiving the message to be pushed by the business service, packaging the message to be pushed, constructing a pushing task, simultaneously sequentially storing the messages to be pushed according to a certain dimensionality, and finally calling a communication component backbone to push the message to be pushed to a client (specifically, a run component of the client). The communication component backbone is a basic component and is responsible for receiving a request of a push gateway, positioning the front instance where a specific protocol connection exists according to the ID, and calling the corresponding front instance to push the message. And maintaining long connection between the frontier instance and the client, and after receiving a request of a communication component backhaul, transmitting a message to the corresponding client through a websocket protocol. The communication component backhaul may be understood as a push message link according to a certain dimension, and messages between the dimensions are independent and do not affect each other. In a video conferencing scenario, the push dimension is the conference room ID, i.e., roomID ID. Redis is a cache database used for storing the latest sid under each roomID, i.e. the historical sequence number pre _ sid of the previous message to be pushed compared with the current message to be pushed. The Abase is a high-performance database with a bottom layer based on rocksDB and a protocol layer compatible with a redis protocol, supports sequential arrangement key value pairs, and is used for performing associated storage on the current message to be pushed and the real-time sequence number of the current message to be pushed as well as the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed and the identification information.
Specifically, the service informs a current message to be pushed to a push gateway in a Remote Procedure Call (RPC) mode, the push gateway determines a real-time sequence number sid of the current message to be pushed based on an increment rule, and the push gateway obtains a historical sequence number pre _ sid of a previous message to be pushed, which is in a roomm dimension and is compared with the current message to be pushed, from a roomm (conference room ID) removed area carried by the current message to be pushed. Then the push gateway packages the current message to be pushed, the real-time sequence number sid of the current message to be pushed, the historical sequence number pre _ sid of the previous message to be pushed, and the roomID, and sets the real-time sequence number sid of the current message to be pushed as the historical sequence number pre _ sid of the next message to be pushed next to the roomID in the redis.
And step 120, pushing the packaged current message to be pushed to a client corresponding to the identification information.
And the push gateway calls the communication component backbone to push the packaged current message to be pushed to the client. Specifically, the communication component backbone locates, according to the roommid to be pushed, which frontier instance the specific protocol connection websocket connection exists on, and invokes the corresponding frontier instance to push the message. And maintaining long connection between the frontier instance and the client, and after receiving a request of a communication component backhaul, transmitting a message to the corresponding client through a websocket protocol. When a client receives a packaged current message to be pushed, which is pushed by a frontier, whether the pushing sequence of the current message to be pushed is correct is determined based on pushing sequence information included in the packaged current message to be pushed; if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer; and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
Specifically, the pushing sequence information includes: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
Correspondingly, determining whether the push sequence of the current message to be pushed is correct based on the push sequence information included in the packed current message to be pushed includes:
if the historical sequence number of the last message to be pushed is the same as the standard sequence number stored by the client (the standard sequence number is the real-time sequence number of the latest message received by the client, namely the historical sequence number of the last message to be pushed is compared with the current message to be pushed), determining that the pushing sequence of the current message to be pushed is correct, and updating the stored standard sequence number to the real-time sequence number of the current message to be pushed;
and if the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect.
If the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect, including:
if the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, determining that the current message to be pushed is a processed message, and discarding the current message to be pushed;
and if the historical sequence number of the last message to be pushed is greater than the standard sequence number stored by the client, determining that packet loss or packet disorder exists.
According to the technical scheme of the embodiment, the current message to be pushed is packaged according to the identification information of the current message to be pushed, so that the packaged current message to be pushed comprises pushing sequence information, and the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed; the packaged current message to be pushed is pushed to the client corresponding to the identification information, the client receives the packaged current message to be pushed by the server, and whether the pushing sequence of the current message to be pushed is correct or not is determined based on the pushing sequence information included in the packaged current message to be pushed, so that the message pushing efficiency is improved, the dependence on a storage layer is eliminated, and the ordering of each message can be ensured.
Example two
Fig. 3 is a flowchart illustrating a message pushing method according to a second embodiment of the disclosure. On the basis of the above embodiment, the present embodiment further optimizes the scheme, specifically, the server performs backup storage on each message to be pushed, so that when the client finds that the received push messages are out of order, the client can determine the message to be pushed with correct time sequence from the messages backed up by the server, thereby improving the reliability of message pushing and ensuring the order of each message.
As shown in fig. 3, the method includes:
and 310, packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed.
Wherein the push sequence information comprises: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
Step 320, storing the current message to be pushed and the real-time sequence number of the current message to be pushed in a second database in a correlated manner; and storing the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed compared with the current message to be pushed and the identification information in a second database in an associated manner.
Specifically, referring to a working diagram for ensuring a message timing sequence shown in fig. 4, a business service informs a current message to be pushed to a push gateway through a Remote Procedure Call (RPC) mode, the push gateway determines a real-time sequence number sid of the current message to be pushed based on an increment rule, and the push gateway obtains a historical sequence number pre _ sid of a previous message to be pushed, which is in a roomm ID dimension and is compared with the current message to be pushed, from a roomm (conference room ID) removed carried by the current message to be pushed. Then the push gateway packages the current message to be pushed, the real-time sequence number sid of the current message to be pushed, the historical sequence number pre _ sid of the previous message to be pushed, and the roomID, and sets the real-time sequence number sid of the current message to be pushed as the historical sequence number pre _ sid of the next message to be pushed next to the roomID in the redis. The push gateway stores the current message to be pushed and the real-time sequence number sid of the current message to be pushed in a second database abase according to a form of [ table _ name ] sid- - -packet, that is, the key value is [ table _ name ] sid, and the corresponding value is a message body packet. Storing the real-time sequence number sid of the current message to be pushed, the historical sequence number pre _ sid of the last message to be pushed compared with the current message to be pushed, and the identification information roomID in a second database abese in an associated manner, that is, the key value is [ table _ name ] { roomID } sid, and the corresponding value is the message body sid: pre _ sid. Each message and its associated information is typically stored for a period of 24 hours.
The corresponding storage structure can be seen in a schematic storage structure shown in fig. 5, where in the first set of key value pairs, table _ name represents a table name of abase, sid represents a message id, and packet represents content of a message, and a message body is stored in this structure. In the second group of key value pairs, table _ name represents the table name of abase, roomm ID is the ID of a video conference room, sid is the message ID, and pre _ sid is the sid of the previous packet, and the message sequence under each video conference room is maintained according to the structure (sid is sequentially from small to large). The reason for storing the message content packet and the historical sequence number pre _ sid separately is that: some push tasks are to push the same message to multiple video conference rooms, but the historical sequence number pre _ sid of each video conference room is different (and the real-time sequence number sid is consistent), so the message content packet and the historical sequence number pre _ sid are stored separately and mapped by the real-time sequence number sid, so that when the client finds that the received messages are out of order, the client actively pulls the messages with the correct time sequence to the server, and the messages with the correct time sequence can be quickly positioned.
And step 330, pushing the packaged current message to be pushed to a client corresponding to the identification information.
And step 340, receiving a message request parameter fed back by the client, and acquiring a candidate message to be pushed from the second database according to the request parameter.
Wherein the request parameters include: a standard sequence number and identification information;
correspondingly, the obtaining of the candidate message to be pushed from the second database according to the request parameter includes:
and determining the message to be pushed, which corresponds to the identification information in the request parameter and has a real-time sequence number greater than the standard sequence number, in the second database as a candidate message to be pushed, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and the historical sequence number of the previous message to be pushed compared with the candidate message to be pushed.
And step 350, pushing the candidate message to be pushed to the client.
According to the technical scheme of the embodiment of the disclosure, the current message to be pushed and the real-time sequence number of the current message to be pushed are stored in a second database in an associated manner; storing the real-time sequence number of the current message to be pushed, the historical sequence number of the previous message to be pushed compared with the current message to be pushed and the identification information in a second database in an associated manner, acquiring candidate messages to be pushed from the second database according to the request parameters when receiving message request parameters fed back by a client, specifically determining the messages to be pushed which correspond to the identification information in the request parameters in the second database and have the real-time sequence number larger than the standard sequence number as the candidate messages to be pushed, wherein the candidate messages to be pushed comprise the real-time sequence number of the candidate messages to be pushed and the historical sequence number of the previous message to be pushed compared with the candidate messages to be pushed, and pushing the candidate messages to be pushed to the client by the technical means of pushing the candidate messages to be pushed to the client, so that the problem of messy order of messages due to sending on a downlink between a pushing gateway and a front is solved, and because the rpc message loss problem caused by calling failure is solved, the message loss problem on the downlink push link caused by unexpected disconnection of the websocket long connection is solved, extra time consumption of the push link is not increased, the problem of strong dependence of a service storage layer is solved, and the reliability of message push is improved.
EXAMPLE III
Fig. 6 is a flowchart illustrating a message pushing method according to a third embodiment of the disclosure. On the basis of the foregoing embodiment, the message pushing method provided in this embodiment is applied to the client corresponding to the server described in the foregoing embodiment, specifically, each client participating in a video conference. The method can be executed by a message pushing device, which can be implemented in the form of software and/or hardware and is integrated in a client.
As shown in fig. 6, the method includes:
and step 610, receiving the packaged current message to be pushed, which is pushed by the server.
Step 620, determining whether the pushing sequence of the current message to be pushed is correct or not based on the pushing sequence information included in the packaged current message to be pushed, if the pushing sequence of the current message to be pushed is correct, executing step 630, otherwise executing step 640.
Wherein the push sequence information comprises: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
Correspondingly, determining whether the push sequence of the current message to be pushed is correct based on the push sequence information included in the packed current message to be pushed includes:
if the historical sequence number of the last message to be pushed is the same as the standard sequence number stored by the client, determining that the pushing sequence of the current message to be pushed is correct, and updating the stored standard sequence number to the real-time sequence number of the current message to be pushed;
and if the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect.
If the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect, including:
if the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, determining that the current message to be pushed is a processed message, and discarding the current message to be pushed;
and if the historical sequence number of the last message to be pushed is greater than the standard sequence number stored by the client, determining that packet loss or packet disorder exists.
The client stores the real-time sequence number sid of the latest message received and processed by the client, that is, the historical sequence number pre _ sid of the last message to be pushed, relative to the current message to be pushed, and the packaged message to be pushed, which is pushed to the client by the server, includes the historical sequence number pre _ sid of the last message to be pushed, so that the client can determine whether the sequence of the currently received message to be pushed is correct by comparing the received historical sequence number pre _ sid with the standard sequence number stored in the client. If the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, the current message to be pushed is determined to be a processed message, and the current message to be pushed is discarded, so that the duplicate removal processing of the message to be pushed is realized.
Step 630, pushing the current message to be pushed to a service layer.
Step 640, determining a correct message to be pushed, and pushing the correct message to be pushed to a service layer.
Wherein the determining of the correct message to be pushed includes:
uploading the standard sequence number and the current identification information to a server by calling a pull interface, so that the server acquires a candidate message to be pushed, which corresponds to the identification information and has a real-time sequence number larger than the standard sequence number, from a set database based on the standard sequence number and the identification information, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and a historical sequence number of a previous message to be pushed compared with the candidate message to be pushed;
and receiving candidate messages to be pushed sent from the server, and determining correct messages to be pushed according to the standard sequence number, the real-time sequence number and the historical sequence number.
In order to avoid that the main program falls into the call dead cycle of the pull interface when the correct message to be pushed does not exist, the limitation on the call times of the pull interface is increased, the retry is limited to 3 times at most every time, if the pull interface is called for 3 times, the correct message to be pushed is not obtained, the obtaining is abandoned, and the overall stability of the message pushing performance is improved.
Further, when the client is unbound from the video conference room ID or exits the video conference room, the client is cleared of the stored standard sequence number.
Further, referring to a schematic diagram of a message loss guarantee shown in fig. 7, the left side of the dotted line represents message packets that are pushed to the client one by one in time sequence, a real-time sequence number sid of a first message packet is 3, and a historical sequence number pre _ sid of a corresponding previous message is 2; the second packet has sid of 4, pre _ sid of 3, and so on. To the right of the dotted line is a standard sequence number last _ sid maintained by the client (specifically, by the last tool in the client), representing the sid of the latest packet received and processed. When a run receives a message packet (sid is 3, pre _ sid is 2), assuming that this is the first message packet, there is no sequence problem, and the run will update its last _ sid to the sid of this message packet, that is, to last _ sid is 3. When the next message packet (sid is 4, pre _ sid is 3) arrives, last matches with pre _ sid of the received message packet (that is, 3), and if the last matches with pre _ sid of the received message packet, it is found that packet loss does not occur, the currently received message packet is processed normally, and meanwhile last _ sid is updated to 4. At this time, if the message packet (sid is 5, and pre _ sid is 4) is lost, and the next message packet (sid is 6, and pre _ sid is 5) arrives, the run finds that the pre _ sid (5) of the received message packet is greater than the standard sequence number last _ sid (4) stored by itself, it considers that a packet loss occurs, and performs pulling by using the standard sequence number last _ sid 4 stored by itself to the service end (specifically, the push gateway), and the push gateway returns the run to the client side with the real-time sequence number greater than the message packet (sid 5, pre _ sid is 4) and the packet (sid is 6, pre _ sid is 5) with the standard sequence number last _ sid 4. run matches again with its own stored last _ sid (4), finds that the message packet (sid 5, pre _ sid 4) is the correct message packet that should be processed, processes and updates, and so on.
Further, referring to fig. 8, a schematic diagram of message order assurance is shown, where the left side of the dotted line is a time-sequential message packet, and the right side of the dotted line is a run stored standard sequence number last _ sid. Before the message packet (sid ═ 5, pre _ sid ═ 4) is out of order, the processing steps have already been mentioned above, and are not described in detail here. Assuming that at this time, the message packets (sid is 5, and pre _ sid is 4) do not arrive at the run of the client in the order, but the next message packet (sid is 6, and pre _ sid is 5) preferentially arrives at the run of the client, and the run finds that pre _ sid (5) of the received message packet is greater than last _ sid (4) stored by itself, so that the run determines that the packet loss phenomenon occurs, and uses last _ sid stored by itself to push the gateway to pull the message. The push gateway returns the message packet (sid-5, pre _ sid-4) and the packet (sid-6, pre _ sid-5) to the run. The run uses the stored last _ sid of the run to demap again with 4, and finds that the message packet (sid 5, pre _ sid 4) is the correct message packet to be processed, and then processes and updates the message packet, that is, the last _ sid stored in the run is updated to 5. If a packet which is just out of order (sid is 5 and pre _ sid is 4) arrives, run finds that the pre _ sid is smaller than the last _ sid stored by itself, that is, judges that the packet is a processed message packet, discards the message packet, ensures the sequential processing of messages, prevents the negative effect of repeated processing of message packets caused by introducing a guarantee mechanism, and improves the reliability of message pushing.
Further, regarding the processing and degradation policy of the first message packet, specifically:
the server and the client end rut reach negotiation, when the historical sequence number pre _ sid in the received message packet is 1, the message packet is the first packet, and the message packet is directly processed.
And (3) degradation strategy: when the historical sequence number pre _ sid in the received message packet is 0, which represents that the server database or the service is abnormal, the message guarantee mechanism carries out degradation, directly processes the received message packet, and simultaneously clears the stored standard sequence number last _ sid. If the historical sequence number of the last message to be pushed is 0, pushing the current message to be pushed to a service layer; the stored standard sequence number is updated to 0.
Further, pushing the current message to be pushed to a service layer includes:
establishing a websocket protocol connection with a service layer;
and pushing the current message to be pushed to a service layer through websocket protocol connection.
The client is a video conference client, and correspondingly, before pushing the current message to be pushed to the service layer through the websocket protocol connection, the method further includes:
determining a time difference between the receiving time of the current message to be pushed and the websocket protocol connection establishment time;
and if the time difference does not exceed the threshold, triggering and executing the step of pushing the current message to be pushed to a service layer through the websocket protocol connection, otherwise, synchronizing the set state of the video conference client at the current moment. The set state includes at least one of: the on state or the off state of a microphone of the video conference client, the on state or the off state of a camera of the video conference client, and the busy line or the idle state of the video conference client. For example, the timeliness of pushing a ringing message is only 1 minute, if the message reaches the communication component rust of the client but does not reach the service layer of the client, at this time, the websocket protocol connection between the communication component rust and the service layer is disconnected, the network is connected after half an hour, at this time, the ringing message is continuously pushed, which is not meaningful, even wrong, so that if the time difference exceeds the threshold value, the relevant message is not pushed, but a synchronization operation is performed, and the overall performance of message pushing is improved.
According to the technical scheme, the problem of message disorder caused by concurrency on the downlink push link between the push gateway and the front and the problem of message loss caused by rpc call failure are solved, the problem of message loss on the downlink push link caused by unexpected disconnection of websocket long connection is solved, extra time consumption of the push link is not increased, the problem of strong dependence of a service storage layer is solved, and the reliability of message push is improved.
Further, referring to a flow diagram of another message pushing method shown in fig. 9, a server pushes a message packet to a run component of a client through a component frontier, where the run component refers to a tool component developed by using a run language and providing capabilities such as basic network communication, persistent cache, and general logic for the client, and is part of a client (app). And the rust determines whether the sequence of the received message packets is correct or not according to the standard sequence number stored in the rust and the historical sequence number in the received message packets, and if so, the message packets are processed, namely, the message packets are further pushed to a service layer of the client, and the standard sequence number stored in the rust is updated. And if the received message packets are determined to be incorrect in sequence, pulling the correct message packets to the server.
Example four
Fig. 10 is a message pushing system provided in a fourth embodiment of the present disclosure, where the system includes: a server 1010 and a client 1020;
the server 1010 includes:
a packaging module 1011, configured to package a current message to be pushed according to identification information of the current message to be pushed, so that the packaged current message to be pushed includes pushing sequence information, where the pushing sequence information is used to determine correctness of a pushing sequence of the current message to be pushed;
a pushing module 1012, configured to push the packaged current message to be pushed to the target client;
the client 1020 includes:
a receiving module 1021, configured to receive a packaged current message to be pushed, which is pushed by a server;
a determining module 1022, configured to determine whether a push sequence of the current message to be pushed is correct based on push sequence information included in the packaged current message to be pushed; if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed;
and the pushing module 1023 is used for pushing the correct message to be pushed to the service layer.
On the basis of the above technical solution, the packing module 1011 includes:
the determining unit is used for determining a real-time sequence number of the current message to be pushed based on an increasing rule;
the acquisition unit is used for acquiring a historical sequence number of a last message to be pushed corresponding to the identification information from a first database compared with the current message to be pushed;
the packaging unit is used for packaging the current message to be pushed, the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed and the identification information;
and the updating unit is used for updating the historical sequence number of the last message to be pushed corresponding to the identification information in the first database into the real-time sequence number of the current message to be pushed.
On the basis of the above technical solutions, the server 1010 further includes: the storage module is used for storing the current message to be pushed and the real-time sequence number of the current message to be pushed in a second database in a correlation manner; and storing the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed compared with the current message to be pushed and the identification information in a second database in an associated manner.
On the basis of the above technical solutions, the server 1010 further includes: the receiving module is used for receiving the message request parameters fed back by the client;
the acquisition module is used for acquiring the candidate messages to be pushed from the second database according to the request parameters;
the pushing module 1012 is further configured to push the candidate message to be pushed to the client.
On the basis of the above technical solutions, the request parameter includes: a standard sequence number and identification information;
correspondingly, the obtaining module is specifically configured to:
and determining the message to be pushed, which corresponds to the identification information in the request parameter and has a real-time sequence number greater than the standard sequence number, in the second database as a candidate message to be pushed, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and the historical sequence number of the previous message to be pushed compared with the candidate message to be pushed.
On the basis of the above technical solutions, the identification information includes: room identification of a video conference room.
On the basis of the above technical solutions, the push sequence information includes: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
On the basis of the foregoing technical solutions, the determining module 1022 is specifically configured to: if the historical sequence number of the last message to be pushed is the same as the standard sequence number stored by the client, determining that the pushing sequence of the current message to be pushed is correct, and updating the stored standard sequence number to the real-time sequence number of the current message to be pushed;
if the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, determining that the current message to be pushed is a processed message, and discarding the current message to be pushed;
and if the historical sequence number of the last message to be pushed is greater than the standard sequence number stored by the client, determining that packet loss or packet disorder exists.
On the basis of the above technical solutions, the determining module 1022 is further configured to:
uploading the standard sequence number and the current identification information to a server by calling a pull interface, so that the server acquires a candidate message to be pushed, which corresponds to the identification information and has a real-time sequence number larger than the standard sequence number, from a set database based on the standard sequence number and the identification information, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and a historical sequence number of a previous message to be pushed compared with the candidate message to be pushed;
and receiving candidate messages to be pushed sent from the server, and determining correct messages to be pushed according to the standard sequence number, the real-time sequence number and the historical sequence number.
On the basis of the above technical solutions, the client 1020 further includes:
and the updating module is configured to update the stored standard sequence number to 0 if the historical sequence number of the last message to be pushed is 0, and the corresponding pushing module 1023 is configured to push the current message to be pushed to a service layer.
On the basis of the above technical solutions, the pushing module 1023 includes:
the establishing unit is used for establishing websocket protocol connection with the service layer;
and the pushing unit is used for pushing the current message to be pushed to a service layer through websocket protocol connection.
On the basis of the above technical solutions, the client is a video conference client, and correspondingly, the client 1020 further includes:
the time difference determining module is used for determining the time difference between the receiving time of the current message to be pushed and the establishment time of the websocket protocol connection before the current message to be pushed is pushed to a service layer through the websocket protocol connection;
correspondingly, the pushing unit is further configured to push the current message to be pushed to a service layer through a websocket protocol connection if the time difference does not exceed the threshold;
and the synchronization module is used for synchronizing the set state of the video conference client at the current moment if the time difference exceeds a threshold value.
On the basis of the above technical solutions, the setting state includes at least one of the following: the on state or the off state of a microphone of the video conference client, the on state or the off state of a camera of the video conference client, and the busy line or the idle state of the video conference client.
According to the technical scheme, the problem of message disorder caused by concurrency on the downlink push link between the push gateway and the front and the problem of message loss caused by rpc call failure are solved, the problem of message loss on the downlink push link caused by unexpected disconnection of websocket long connection is solved, extra time consumption of the push link is not increased, the problem of strong dependence of a service storage layer is solved, and the reliability of message push is improved.
The message pushing device provided by the embodiment of the disclosure can execute the message pushing method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the embodiments of the present disclosure.
EXAMPLE five
Referring now to fig. 11, a schematic diagram of an electronic device (e.g., the terminal device or the server in fig. 11) 400 suitable for implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 11, the electronic device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage means 406 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 406 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 11 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 409, or from the storage means 406, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
The terminal provided by the embodiment of the present disclosure and the message pushing method provided by the embodiment of the present disclosure belong to the same inventive concept, and technical details that are not described in detail in the embodiment of the present disclosure may be referred to the embodiment of the present disclosure, and the embodiment of the present disclosure have the same beneficial effects.
EXAMPLE six
The disclosed embodiments provide a computer storage medium on which a computer program is stored, which when executed by a processor implements the message push method provided by the above embodiments.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
and pushing the packaged current message to be pushed to a client corresponding to the identification information.
Or, receiving a packaged current message to be pushed, which is pushed by the server;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a cell does not in some cases constitute a limitation on the cell itself, for example, an editable content display cell may also be described as an "editing cell".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example one ] there is provided a message pushing method applied to a server, the method including:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
and pushing the packaged current message to be pushed to a client corresponding to the identification information.
According to one or more embodiments of the present disclosure, an [ example two ] provides a message pushing method, where optionally, the packing a current message to be pushed according to identification information of the current message to be pushed, so that the packed current message to be pushed includes pushing sequence information, including:
determining a real-time sequence number of the current message to be pushed based on an increasing rule;
compared with the current message to be pushed, acquiring the historical sequence number of the last message to be pushed corresponding to the identification information from a first database;
packaging the current message to be pushed, the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed and the identification information;
and updating the historical sequence number of the last message to be pushed corresponding to the identification information in the first database to be the real-time sequence number of the current message to be pushed.
According to one or more embodiments of the present disclosure, [ example three ] there is provided a message pushing method, further comprising:
storing the current message to be pushed and the real-time sequence number of the current message to be pushed in a second database in a correlated manner;
and storing the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed compared with the current message to be pushed and the identification information in a second database in an associated manner.
According to one or more embodiments of the present disclosure, [ example four ] there is provided a message pushing method, further comprising:
receiving message request parameters fed back by a client;
acquiring candidate messages to be pushed from the second database according to the request parameters;
and pushing the candidate message to be pushed to the client.
According to one or more embodiments of the present disclosure, [ example five ] there is provided a message pushing method, optionally, the request parameter includes: a standard sequence number and identification information;
correspondingly, the obtaining of the candidate message to be pushed from the second database according to the request parameter includes:
and determining the message to be pushed, which corresponds to the identification information in the request parameter and has a real-time sequence number greater than the standard sequence number, in the second database as a candidate message to be pushed, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and the historical sequence number of the previous message to be pushed compared with the candidate message to be pushed.
According to one or more embodiments of the present disclosure, [ example six ] there is provided a message pushing method, optionally, the identification information includes: room identification of a video conference room.
According to one or more embodiments of the present disclosure, [ example seven ] there is provided a message pushing method applied to a client, the method comprising:
receiving a packaged current message to be pushed, which is pushed by a server side;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
According to one or more embodiments of the present disclosure, [ example eight ] there is provided a message pushing method, optionally, the pushing order information includes: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
According to one or more embodiments of the present disclosure, in an example nine, there is provided a message pushing method, optionally, determining whether a pushing order of a current message to be pushed is correct based on pushing order information included in the packaged current message to be pushed, including:
if the historical sequence number of the last message to be pushed is the same as the standard sequence number stored by the client, determining that the pushing sequence of the current message to be pushed is correct, and updating the stored standard sequence number to the real-time sequence number of the current message to be pushed;
and if the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect.
According to one or more embodiments of the present disclosure, in [ example ten ], a message pushing method is provided, where optionally, if a historical sequence number of the last message to be pushed is not the same as a stored standard sequence number, determining that a pushing sequence of a current message to be pushed is incorrect, including:
if the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, determining that the current message to be pushed is a processed message, and discarding the current message to be pushed;
and if the historical sequence number of the last message to be pushed is greater than the standard sequence number stored by the client, determining that packet loss or packet disorder exists.
According to one or more embodiments of the present disclosure, [ example eleven ] there is provided a message pushing method, optionally, the determining a correct message to be pushed includes:
uploading the standard sequence number and the current identification information to a server by calling a pull interface, so that the server acquires a candidate message to be pushed, which corresponds to the identification information and has a real-time sequence number larger than the standard sequence number, from a set database based on the standard sequence number and the identification information, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and a historical sequence number of a previous message to be pushed compared with the candidate message to be pushed;
and receiving candidate messages to be pushed sent from the server, and determining correct messages to be pushed according to the standard sequence number, the real-time sequence number and the historical sequence number.
According to one or more embodiments of the present disclosure, [ example twelve ] there is provided a message pushing method, optionally, further comprising:
if the historical sequence number of the last message to be pushed is 0, pushing the current message to be pushed to a service layer;
the stored standard sequence number is updated to 0.
According to one or more embodiments of the present disclosure, an [ example thirteen ] provides a message pushing method, optionally, pushing the current message to be pushed to a service layer, including:
establishing a websocket protocol connection with a service layer;
and pushing the current message to be pushed to a service layer through websocket protocol connection.
According to one or more embodiments of the present disclosure, in an example fourteen, a message pushing method is provided, optionally, where the client is a video conference client, and correspondingly, before pushing the current message to be pushed to a service layer through a websocket protocol connection, the method further includes:
determining a time difference between the receiving time of the current message to be pushed and the websocket protocol connection establishment time;
and if the time difference does not exceed the threshold, triggering and executing the step of pushing the current message to be pushed to a service layer through the websocket protocol connection, otherwise, synchronizing the set state of the video conference client at the current moment.
According to one or more embodiments of the present disclosure, [ example fifteen ] there is provided a message pushing method, optionally, the setting state includes at least one of: the on state or the off state of a microphone of the video conference client, the on state or the off state of a camera of the video conference client, and the busy line or the idle state of the video conference client.
According to one or more embodiments of the present disclosure, [ example sixteen ] there is provided a message pushing system, the system comprising:
a service end and a client end, wherein,
wherein, the server side includes:
the packaging module is used for packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, and the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
the push module is used for pushing the packaged current message to be pushed to the target client;
the client comprises:
the receiving module is used for receiving the packaged current message to be pushed, which is pushed by the server side;
the determining module is used for determining whether the pushing sequence of the current message to be pushed is correct or not based on the pushing sequence information included in the packed current message to be pushed; if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed;
and the pushing module is used for pushing the correct message to be pushed to the service layer.
According to one or more embodiments of the present disclosure, [ example seventeen ] there is provided an electronic device comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a message push method as follows:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
pushing the packaged current message to be pushed to a client corresponding to the identification information;
or, implementing the message pushing method as follows:
receiving a packaged current message to be pushed, which is pushed by a server side;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
According to one or more embodiments of the present disclosure, [ example eighteen ] there is provided a storage medium containing computer-executable instructions which, when executed by a computer processor, are operable to perform a message push method of:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
pushing the packaged current message to be pushed to a client corresponding to the identification information;
or, implementing the message pushing method as follows:
receiving a packaged current message to be pushed, which is pushed by a server side;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (18)

1. A message pushing method is applied to a server side and is characterized by comprising the following steps:
packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, wherein the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
and pushing the packaged current message to be pushed to a client corresponding to the identification information.
2. The method according to claim 1, wherein the packaging the current message to be pushed according to the identification information of the current message to be pushed, so that the packaged current message to be pushed includes push sequence information, including:
determining a real-time sequence number of the current message to be pushed based on an increasing rule;
compared with the current message to be pushed, acquiring the historical sequence number of the last message to be pushed corresponding to the identification information from a first database;
packaging the current message to be pushed, the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed and the identification information;
and updating the historical sequence number of the last message to be pushed corresponding to the identification information in the first database to be the real-time sequence number of the current message to be pushed.
3. The method of claim 1 or 2, further comprising:
storing the current message to be pushed and the real-time sequence number of the current message to be pushed in a second database in a correlated manner;
and storing the real-time sequence number of the current message to be pushed, the historical sequence number of the last message to be pushed compared with the current message to be pushed and the identification information in a second database in an associated manner.
4. The method of claim 3, further comprising:
receiving message request parameters fed back by a client;
acquiring candidate messages to be pushed from the second database according to the request parameters;
and pushing the candidate message to be pushed to the client.
5. The method of claim 4, wherein the request parameters comprise: a standard sequence number and identification information;
correspondingly, the obtaining of the candidate message to be pushed from the second database according to the request parameter includes:
and determining the message to be pushed, which corresponds to the identification information in the request parameter and has a real-time sequence number greater than the standard sequence number, in the second database as a candidate message to be pushed, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and the historical sequence number of the previous message to be pushed compared with the candidate message to be pushed.
6. The method according to claim 1 or 2,
the identification information includes: room identification of a video conference room.
7. A message pushing method is applied to a client side and is characterized by comprising the following steps:
receiving a packaged current message to be pushed, which is pushed by a server side;
determining whether the push sequence of the current message to be pushed is correct or not based on the push sequence information included in the packed current message to be pushed;
if the pushing sequence of the current message to be pushed is correct, pushing the current message to be pushed to a service layer;
and if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed, and pushing the correct message to be pushed to a service layer.
8. The method of claim 7, wherein the push sequence information comprises: the real-time sequence number of the current message to be pushed and the historical sequence number of the last message to be pushed compared with the current message to be pushed.
9. The method of claim 8, wherein determining whether the push order of the current message to be pushed is correct based on push order information included in the packaged current message to be pushed comprises:
if the historical sequence number of the last message to be pushed is the same as the standard sequence number stored by the client, determining that the pushing sequence of the current message to be pushed is correct, and updating the stored standard sequence number to the real-time sequence number of the current message to be pushed;
and if the historical sequence number of the last message to be pushed is different from the stored standard sequence number, determining that the pushing sequence of the current message to be pushed is incorrect.
10. The method of claim 9, wherein determining that the push sequence of the current message to be pushed is incorrect if the historical sequence number of the last message to be pushed is not the same as the stored standard sequence number comprises:
if the historical sequence number of the last message to be pushed is smaller than the standard sequence number stored by the client, determining that the current message to be pushed is a processed message, and discarding the current message to be pushed;
and if the historical sequence number of the last message to be pushed is greater than the standard sequence number stored by the client, determining that packet loss or packet disorder exists.
11. The method of claim 9, wherein the determining the correct message to be pushed comprises:
uploading the standard sequence number and the current identification information to a server by calling a pull interface, so that the server acquires a candidate message to be pushed, which corresponds to the identification information and has a real-time sequence number larger than the standard sequence number, from a set database based on the standard sequence number and the identification information, wherein the candidate message to be pushed comprises the real-time sequence number of the candidate message to be pushed and a historical sequence number of a previous message to be pushed compared with the candidate message to be pushed;
and receiving candidate messages to be pushed sent from the server, and determining correct messages to be pushed according to the standard sequence number, the real-time sequence number and the historical sequence number.
12. The method according to any one of claims 8-11, further comprising:
if the historical sequence number of the last message to be pushed is 0, pushing the current message to be pushed to a service layer;
the stored standard sequence number is updated to 0.
13. The method according to any of claims 7-11, wherein pushing the current message to be pushed to a service layer comprises:
establishing a websocket protocol connection with a service layer;
and pushing the current message to be pushed to a service layer through websocket protocol connection.
14. The method of claim 13, wherein the client is a video conference client, and correspondingly, before pushing the current message to be pushed to a service layer through a websocket protocol connection, the method further comprises:
determining a time difference between the receiving time of the current message to be pushed and the websocket protocol connection establishment time;
and if the time difference does not exceed the threshold, triggering and executing the step of pushing the current message to be pushed to a service layer through the websocket protocol connection, otherwise, synchronizing the set state of the video conference client at the current moment.
15. The method of claim 14, wherein the set state comprises at least one of: the on state or the off state of a microphone of the video conference client, the on state or the off state of a camera of the video conference client, and the busy line or the idle state of the video conference client.
16. A message push system, comprising: a service end and a client end, wherein,
wherein, the server side includes:
the packaging module is used for packaging the current message to be pushed according to the identification information of the current message to be pushed so that the packaged current message to be pushed comprises pushing sequence information, and the pushing sequence information is used for determining the correctness of the pushing sequence of the current message to be pushed;
the push module is used for pushing the packaged current message to be pushed to the target client;
the client comprises:
the receiving module is used for receiving the packaged current message to be pushed, which is pushed by the server side;
the determining module is used for determining whether the pushing sequence of the current message to be pushed is correct or not based on the pushing sequence information included in the packed current message to be pushed; if the pushing sequence of the current message to be pushed is incorrect, determining the correct message to be pushed;
and the pushing module is used for pushing the correct message to be pushed to the service layer.
17. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the message push method of any of claims 1-6, 7-15.
18. A storage medium containing computer-executable instructions for performing the message push method of any one of claims 1-6, 7-15 when executed by a computer processor.
CN202010084898.0A 2020-02-10 2020-02-10 Message pushing method and device, electronic equipment and storage medium Pending CN111245709A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010084898.0A CN111245709A (en) 2020-02-10 2020-02-10 Message pushing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010084898.0A CN111245709A (en) 2020-02-10 2020-02-10 Message pushing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111245709A true CN111245709A (en) 2020-06-05

Family

ID=70878198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010084898.0A Pending CN111245709A (en) 2020-02-10 2020-02-10 Message pushing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111245709A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787107A (en) * 2020-06-30 2020-10-16 北京字节跳动网络技术有限公司 Message processing method and device, readable medium and electronic equipment
CN111901619A (en) * 2020-07-23 2020-11-06 北京达佳互联信息技术有限公司 Message pushing method and device
CN112689018A (en) * 2020-12-29 2021-04-20 中通服公众信息产业股份有限公司 Quick message pushing method
CN113556352A (en) * 2021-07-27 2021-10-26 北京字跳网络技术有限公司 Information pushing method and device, terminal equipment and storage medium
CN113595870A (en) * 2021-06-29 2021-11-02 北京百度网讯科技有限公司 Push message processing method and device, electronic equipment and storage medium
CN113992462A (en) * 2021-11-23 2022-01-28 京东方科技集团股份有限公司 System and method for pushing conference information and related equipment
CN114647685A (en) * 2022-03-28 2022-06-21 北京字节跳动网络技术有限公司 Data processing method, device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103607302A (en) * 2013-11-19 2014-02-26 华为技术有限公司 Fault information report method, monitoring equipment and management equipment
CN105897439A (en) * 2016-04-05 2016-08-24 上海上讯信息技术股份有限公司 Message pushing method and message pushing equipment
CN106027379A (en) * 2016-07-28 2016-10-12 贵州中科汉天下信息技术有限公司 Push message receiving processing method
CN107147724A (en) * 2017-05-23 2017-09-08 深圳市金立通信设备有限公司 A kind of information push method, server and computer-readable recording medium
CN109802995A (en) * 2018-12-13 2019-05-24 深圳壹账通智能科技有限公司 Information push method, device, equipment and storage medium
CN110072128A (en) * 2019-04-22 2019-07-30 北京开广信息技术有限公司 The real-time method for pushing and server of Media Stream
CN110086797A (en) * 2019-04-22 2019-08-02 北京开广信息技术有限公司 The real-time reception method and client of Media Stream

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103607302A (en) * 2013-11-19 2014-02-26 华为技术有限公司 Fault information report method, monitoring equipment and management equipment
CN105897439A (en) * 2016-04-05 2016-08-24 上海上讯信息技术股份有限公司 Message pushing method and message pushing equipment
CN106027379A (en) * 2016-07-28 2016-10-12 贵州中科汉天下信息技术有限公司 Push message receiving processing method
CN107147724A (en) * 2017-05-23 2017-09-08 深圳市金立通信设备有限公司 A kind of information push method, server and computer-readable recording medium
CN109802995A (en) * 2018-12-13 2019-05-24 深圳壹账通智能科技有限公司 Information push method, device, equipment and storage medium
CN110072128A (en) * 2019-04-22 2019-07-30 北京开广信息技术有限公司 The real-time method for pushing and server of Media Stream
CN110086797A (en) * 2019-04-22 2019-08-02 北京开广信息技术有限公司 The real-time reception method and client of Media Stream

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787107A (en) * 2020-06-30 2020-10-16 北京字节跳动网络技术有限公司 Message processing method and device, readable medium and electronic equipment
CN111787107B (en) * 2020-06-30 2023-03-24 北京字节跳动网络技术有限公司 Message processing method and device, readable medium and electronic equipment
CN111901619A (en) * 2020-07-23 2020-11-06 北京达佳互联信息技术有限公司 Message pushing method and device
CN111901619B (en) * 2020-07-23 2023-10-31 北京达佳互联信息技术有限公司 Message pushing method and device
CN112689018A (en) * 2020-12-29 2021-04-20 中通服公众信息产业股份有限公司 Quick message pushing method
CN112689018B (en) * 2020-12-29 2023-03-10 中通服公众信息产业股份有限公司 Quick message pushing method
CN113595870A (en) * 2021-06-29 2021-11-02 北京百度网讯科技有限公司 Push message processing method and device, electronic equipment and storage medium
CN113556352A (en) * 2021-07-27 2021-10-26 北京字跳网络技术有限公司 Information pushing method and device, terminal equipment and storage medium
CN113992462A (en) * 2021-11-23 2022-01-28 京东方科技集团股份有限公司 System and method for pushing conference information and related equipment
CN114647685A (en) * 2022-03-28 2022-06-21 北京字节跳动网络技术有限公司 Data processing method, device, equipment and medium
CN114647685B (en) * 2022-03-28 2024-04-12 北京字节跳动网络技术有限公司 Data processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN111245709A (en) Message pushing method and device, electronic equipment and storage medium
CN110662085B (en) Message sending method, device, readable medium and electronic equipment
CN111294385B (en) Data transmission method and device, readable medium and electronic equipment
US20220086262A1 (en) Network packet processing method and apparatus and network server
CN114039703B (en) Data transmission method, device, equipment and medium
CN111309747A (en) Data synchronization method, system and device
CN111314439A (en) Data sending method and device and electronic equipment
CN112256733A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN113596328B (en) Camera calling method and device and electronic equipment
CN112713969B (en) Data transmission method and device and system using same
CN114938395A (en) Service response method, device, equipment and storage medium
CN115225586B (en) Data packet transmitting method, device, equipment and computer readable storage medium
CN111355784A (en) Method, device, medium and electronic equipment for processing request information
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN113360348B (en) Abnormal request processing method and device, electronic equipment and storage medium
CN115914380A (en) Communication delay optimization method of cloud computing resource manager based on ZLib compression algorithm
CN112416887A (en) Information interaction method and device and electronic equipment
CN112311840A (en) Multi-terminal data synchronization method, device, equipment and medium
CN113556352B (en) Information pushing method and device, terminal equipment and storage medium
CN110633324A (en) Method, apparatus, electronic device and computer readable medium for synchronizing data
CN115993942B (en) Data caching method, device, electronic equipment and computer readable medium
CN113535428B (en) Method, device, equipment and medium for processing request message and response message
CN114363449B (en) Service state switching method and device, electronic equipment and storage medium
CN114785794B (en) Resource allocation method, device, equipment, medium and system
CN114417905B (en) Information transmission method, apparatus, device and computer readable 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200605

RJ01 Rejection of invention patent application after publication