Information Interaction System and Information Interaction Method

By generating calibration sequences for interactive information in the information interaction system and sorting them on the server side, the inconsistency of information sequence caused by changes in the network environment is solved, and the order consistency of interactive information is achieved.

CN114296509BActive Publication Date: 2025-05-30BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111641079.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-05-30
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Changes in the network environment have led to inconsistent information order among information interactors, and the existing technology has not yet proposed an effective solution.

Method used

Calibration is performed when the interactive terminal establishes a connection with the server, and a calibration sequence is generated for each interactive information, carrying the calibration sequence to send interactive information, and the server uses the calibration sequence to sort and update the interactive information.

Benefits of technology

Ensure that all interactive information that communicates between interactive terminals remains in a consistent order, solving the problem of inconsistent information order caused by changes in the network environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296509B_ABST
    Figure CN114296509B_ABST
Patent Text Reader

Abstract

The present application relates to an information interaction system and an information interaction method. The system includes: a first interaction terminal, which sends a calibration information request to a server when establishing a connection with the server, and generates a corresponding calibration sequence for each interaction information according to the first calibration information returned by the server every time it sends interaction information under the current connection, and sends the interaction information carrying the calibration sequence; a server, which returns the first calibration information to the first interaction terminal when receiving the calibration information request; when receiving the interaction information, sorts the interaction information by using the calibration sequence, updates the calibration sequence; forwards the sorted interaction information to a second interaction terminal, and returns the updated calibration sequence to the first interaction terminal; and a second interaction terminal, which receives and displays the interaction information. The above solution solves the technical problem that the information order between information interaction parties is inconsistent due to changes in the network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technologies, and in particular, to an information interaction system and an information interaction method. Background Art

[0002] With the wide popularization of the Internet, the transmission of data and the interaction of information have changed from the way of delivering by horse, carriage, and mail to online delivery based on the Internet, which greatly improves the efficiency of information interaction. However, information interaction based on the Internet also has drawbacks. For example, problems such as unstable network and latency often lead to the possible inconsistency of the information order between the two or more parties during the information interaction process, which may result in information differences, and what the receiving party sees is not the original meaning of the sending party.

[0003] Regarding the problem of inconsistent information order between information interaction parties caused by changes in the network environment, no effective solution has been proposed yet. Summary of the Invention

[0004] This application provides an information interaction system and an information interaction method to solve the technical problem of inconsistent information order between information interaction parties caused by changes in the network environment.

[0005] According to one aspect of the embodiments of this application, this application provides an information interaction system, including:

[0006] A first interaction terminal, configured to send a calibration information request to the server when establishing a connection with the server, and for each interaction information sent to the server under the current connection, generate a corresponding calibration sequence based on the first calibration information returned by the server, and send the interaction information carrying the calibration sequence;

[0007] A server, configured to return the first calibration information to the first interaction terminal when receiving the calibration information request, where the first calibration information is used to determine the way of generating a calibration sequence in the current connection; when receiving the interaction information, sort the interaction information using the calibration sequence and update the calibration sequence; forward the sorted interaction information to a second interaction terminal, and return the updated calibration sequence to the first interaction terminal;

[0008] A second interaction terminal, configured to receive and display the interaction information.

[0009] Optionally, the first interaction terminal is further configured to:

[0010] Replace the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the way of generating a calibration sequence in different connections.

[0011] Optionally, the first interaction terminal is specifically configured to:

[0012] Extract the synchronization clock embedded by the server from the first calibration information, where the synchronization clock is synchronized with the clock of the server itself;

[0013] Determine the client sequence of the interaction information by using the synchronization clock, where the client sequence includes at least one of the sending timestamp, sending serial number, and information check code of the interaction information; and,

[0014] Generate the calibration sequence by using the first server sequence, connection establishment time, and the client sequence, where the first server sequence is the server sequence returned by the server to the first interaction terminal and stored locally by the first interaction terminal last time, and the server sequence is the sequential sequence assigned by the server to each interaction information sent to the first interaction terminal.

[0015] Optionally, the first interaction terminal is further configured to:

[0016] Receive the second server sequence returned by the server in response to the interaction information, and replace the first server sequence in the calibration sequence corresponding to the interaction information with the second server sequence to keep the sequence in the server synchronized, where the second server sequence is the sequential sequence assigned by the server to the interaction information; and,

[0017] Store the updated calibration sequence and the second server sequence.

[0018] Optionally, the server is further configured to:

[0019] Map and store the updated calibration sequence and the interaction information.

[0020] Optionally, the server is specifically configured to:

[0021] Extract the connection establishment time from the calibration sequence according to a preset rule, where the preset rule includes the location and character length of the connection establishment time;

[0022] Use the interaction information with the same connection establishment time as a group of interaction information, and sort the interaction information based on the group according to the connection establishment time;

[0023] In the same group of interaction information, extract the client sequence from the calibration sequence according to the preset rule, and sort the interaction information in the same group according to the client sequence, where the preset rule includes the location and character length of the client sequence; and,

[0024] According to the sorting order of the interaction information, assign a corresponding server sequence to each piece of the interaction information, and replace the original server sequence in the calibration sequence with the newly assigned server sequence, where the server sequence increases according to the sorting order.

[0025] Optionally, the server is specifically configured to:

[0026] Send the latest server sequence to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence; and

[0027] In the case of receiving an information acquisition request sent by the second interaction terminal for the sequence difference, determine the interaction information corresponding to the sequence difference and return the interaction information to the second interaction terminal.

[0028] Optionally, the second interaction terminal is further configured to:

[0029] In the case of receiving the latest server sequence sent by the server, determine the sequence difference between the locally existing server sequence and the latest server sequence;

[0030] Send an information acquisition request for the sequence difference to the server; and,

[0031] Receive and display the interaction information corresponding to the sequence difference.

[0032] Optionally, the server is further configured to:

[0033] In the case where the connection establishment time of the newly received interaction information is less than the connection establishment time of the stored interaction information and / or the client sequence of the newly received interaction information is less than the client sequence of the stored interaction information, re-sort the interaction information according to the connection establishment time and / or the client sequence, and re-assign the server sequence to the re-sorted interaction information;

[0034] Determine the smallest server sequence for which the interaction information has changed after re-sorting;

[0035] Send a server sequence discard instruction to the second interaction terminal, so that the second interaction terminal discards the server sequence and information that are greater than or equal to the smallest server sequence; and,

[0036] Send the latest server sequence after re-sorting to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence, and pulls the interaction information corresponding to the sequence difference from the server.

[0037] Optionally, the second interaction terminal is further configured to:

[0038] When receiving the server-side sequence discard instruction sent by the server, determine the minimum server-side sequence indicating discard;

[0039] Discard the server-side sequences and information stored in the local memory that are greater than or equal to the minimum server-side sequence; and

[0040] When receiving the latest server-side sequence sent by the server, determine the sequence difference between the locally existing server-side sequence and the latest server-side sequence, and pull from the server the interaction information corresponding to the sequence difference.

[0041] According to another aspect of the embodiments of the present application, the present application provides an information interaction method, including:

[0042] When establishing a connection with the server, the first interaction terminal sends a calibration information request to the server;

[0043] When receiving the calibration information request sent by the first interaction terminal, the server returns first calibration information to the first interaction terminal, where the first calibration information is used to determine the method of generating a calibration sequence in the current connection;

[0044] The first interaction terminal receives the first calibration information returned by the server in response to the calibration information request, and replaces the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the method of generating a calibration sequence in different connections;

[0045] When the first interaction terminal sends interaction information to the server each time in the current connection, it generates a corresponding calibration sequence for each piece of interaction information according to the first calibration information, and sends the interaction information carrying the calibration sequence;

[0046] When receiving the interaction information sent by the first interaction terminal, the server sorts the interaction information by using the calibration sequence carried in the interaction information, and updates the calibration sequence;

[0047] The server forwards the sorted interaction information to the second interaction terminal, and returns the updated calibration sequence to the first interaction terminal; and maps and stores the updated calibration sequence and the interaction information;

[0048] The second interaction terminal receives and displays the interaction information.

[0049] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the related technologies:

[0050] The technical solution of the present application provides an information interaction system, including: a first interaction terminal, configured to send a calibration information request to a server when establishing a connection with the server, and for each interaction information sent to the server under the current connection, generate a corresponding calibration sequence according to the first calibration information returned by the server, and send the interaction information carrying the calibration sequence; a server, configured to return the first calibration information to the first interaction terminal when receiving the calibration information request, where the first calibration information is used to determine the manner of generating the calibration sequence in the current connection; when receiving the interaction information, sort the interaction information by using the calibration sequence and update the calibration sequence; forward the sorted interaction information to the second interaction terminal, and return the updated calibration sequence to the first interaction terminal; a second interaction terminal, configured to receive and display the interaction information. By calibrating when the interaction terminal establishes a connection with the server and attaching the calibration sequence to each interaction information sent by the interaction terminal, the server can sort the interaction information sent by the interaction terminal according to the calibration sequence, and can timely adjust the order of the interaction information according to the calibration sequence in the case of out-of-order interaction information, so that all the interaction information exchanged between the interaction terminals maintains the same order, solving the technical problem that the information order between information interaction parties is inconsistent due to changes in the network environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings here are incorporated into the specification and form a part of this specification, showing the embodiments consistent with the present application and used together with the specification to explain the principles of the present application.

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or the related technologies. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0053] Figure 1 It is a schematic diagram of the hardware environment of an optional information interaction method provided according to an embodiment of the present application;

[0054] Figure 2 It is a schematic flow chart of an optional information interaction method applied to a first interaction terminal provided according to an embodiment of the present application;

[0055] Figure 3 It is a schematic flow chart of an optional information interaction method applied to a server provided according to an embodiment of the present application;

[0056] Figure 4A schematic structural diagram of an optional electronic device provided by an embodiment of the present application. Detailed implementation manners

[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0058] In subsequent descriptions, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of description of the present application, and have no specific meaning in themselves. Therefore, "module" and "component" can be used interchangeably.

[0059] To solve the problems mentioned in the background art, according to one aspect of the embodiments of the present application, an embodiment of an information interaction method is provided.

[0060] Optionally, in the embodiments of the present application, the above information interaction method can be applied to a hardware environment composed of a first interaction terminal 101, a server 103, and a second interaction terminal 105 as shown in Figure 1 As shown, the server 103 is connected to the first interaction terminal 101 and the second interaction terminal 105 through a network, and can be used to provide services (such as information interaction services) for the interaction terminal or the client installed on the interaction terminal. A database 107 can be set on the server or independently of the server to provide data storage services for the server 103. The above network includes but is not limited to: wide area network, metropolitan area network, or local area network. The first interaction terminal 101 and the second interaction terminal 105 include but are not limited to PCs, mobile phones, tablet computers, etc. Figure 1 As shown, the server 103 is connected to the first interaction terminal 101 and the second interaction terminal 105 through a network, and can be used to provide services (such as information interaction services) for the interaction terminal or the client installed on the interaction terminal. A database 107 can be set on the server or independently of the server to provide data storage services for the server 103. The above network includes but is not limited to: wide area network, metropolitan area network, or local area network. The first interaction terminal 101 and the second interaction terminal 105 include but are not limited to PCs, mobile phones, tablet computers, etc.

[0061] The information interaction method includes:

[0062] Step 1, when the first interaction terminal establishes a connection with the server, it sends a calibration information request to the server;

[0063] Step 2, when the server receives the calibration information request sent by the first interaction terminal, it returns first calibration information to the first interaction terminal, where the first calibration information is used to determine the manner of generating a calibration sequence in the current connection;

[0064] Step 3, the first interaction terminal receives the first calibration information returned by the server in response to the calibration information request, and replaces the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the manner of generating a calibration sequence in different connections;

[0065] Step 4, each time the first interaction terminal sends interaction information to the server under the current connection, it generates a corresponding calibration sequence for each interaction information according to the first calibration information, and sends the interaction information carrying the calibration sequence;

[0066] Step 5, when the server receives the interaction information sent by the first interaction terminal, it sorts the interaction information using the calibration sequence carried in the interaction information and updates the calibration sequence;

[0067] Step 6, the server forwards the sorted interaction information to the second interaction terminal, and returns the updated calibration sequence to the first interaction terminal; and maps and stores the updated calibration sequence and the interaction information;

[0068] Step 7, the second interaction terminal receives and displays the interaction information.

[0069] To describe the technical solution of the present application more clearly and in detail, the following will be described separately for each end.

[0070] In the embodiment of the present application, the information interaction method executed by the first interaction terminal 101, as Figure 2 shown, this method may include the following steps:

[0071] Step S202, when establishing a connection with the server, send a calibration information request to the server;

[0072] Step S204, receive the first calibration information returned by the server in response to the calibration information request, and replace the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the manner of generating a calibration sequence in different connections; and

[0073] Step S206, each time the interaction information is sent to the server under the current connection, generate a corresponding calibration sequence for each interaction information according to the first calibration information, and send the interaction information carrying the calibration sequence, so that the server sorts the interaction information using the calibration sequence and forwards the sorted interaction information to the second interaction terminal.

[0074] Through the above steps S202 to S206, when the present application establishes a connection with the server through the interaction terminal, calibration is performed, and each interaction message sent by the interaction terminal carries a calibration sequence, so that the server can sort the interaction messages sent by the interaction terminal according to the calibration sequence, and can timely adjust the order of the interaction messages according to the calibration sequence in the case of out-of-order interaction messages, so that all the interaction messages exchanged between the interaction terminals maintain the same order, and the technical problem of inconsistent information order between information interaction parties caused by changes in the network environment is solved.

[0075] In the embodiment of the present application, the first interaction terminal is the sender of interaction messages between multiple interaction terminals, and the second interaction terminal is the receiver of interaction messages between the multiple interaction terminals. The same interaction terminal can be used as both the first interaction terminal and the second interaction terminal.

[0076] In step S202, each time the interaction terminal establishes a connection with the server, it needs to send a calibration information request to the server, and the server will return the calibration information dedicated to this connection.

[0077] In step S204, since the above first calibration information is the calibration information dedicated to this connection returned by the server in response to the calibration information request, it is necessary to replace the second calibration information used in the previous connection with the first calibration information used in this connection.

[0078] In step S206, each interaction message sent by the first interaction terminal in this connection generates a corresponding calibration sequence according to the above first calibration information, and the corresponding calibration sequence is carried when sending the interaction message. This calibration sequence represents the sending order of all the interaction messages sent by the first interaction terminal. When the server receives each interaction message, it extracts the calibration sequence to determine the position of the just-received interaction message. Normally, the sorting result of the interaction messages according to the calibration sequence is at the end of the information list. If the interaction messages are out of order due to network instability, network latency, etc., for example, the first interaction terminal sequentially sends interaction message A and interaction message B, and the order received by the server is interaction message B and interaction message A. At this time, the server can sort the interaction messages according to the calibration sequence and then forward the sorted interaction messages to the second interaction terminal to ensure that all the interaction messages exchanged between the interaction terminals maintain the same order.

[0079] Optionally, in step S206, generating a corresponding calibration sequence for each interaction message according to the first calibration information includes:

[0080] Step 1, extract the synchronization clock embedded by the server from the first calibration information, where the synchronization clock is synchronized with the server's own clock;

[0081] Step 2, determine the client sequence of the interaction information by using the synchronous clock, where the client sequence includes at least one of the sending timestamp, sending serial number, and information verification code of the interaction information; and,

[0082] Step 3, generate a calibration sequence by using the first server sequence, connection establishment time, and client sequence, where the first server sequence is the server sequence returned by the server stored locally in the first interaction terminal for the last time, and the server sequence is the sequential sequence assigned by the server to each interaction information sent to the first interaction terminal.

[0083] In the embodiment of the present application, the first calibration information returned by the server is used to determine the method of generating the calibration sequence in this connection. First of all, it is clock synchronization. The server embeds the synchronous clock that is completely synchronized with its own clock into the first calibration information. After the first interaction terminal extracts the synchronous clock, it uses the synchronous clock to record time throughout this connection, avoiding the situation that the calibration sequence generated according to the first calibration information is incorrect due to the asynchronous clock between the local clock of the first interaction terminal and the server clock. Based on this synchronous clock, the first interaction terminal can determine the client sequence clientSeq, and the client sequence can include the sending timestamp, sending serial number, and information verification code of the interaction information recorded based on this synchronous clock, device identification, user identification, and other identification features.

[0084] The first interaction terminal can also determine the connection establishment time between the first interaction terminal and the server based on this synchronous clock. The time when the first interaction terminal initiates the connection can be used as the connection establishment time, or the time when the server sends the first calibration information can be used as the connection establishment time. Among them, when the time when the first interaction terminal initiates the connection is used as the connection establishment time, the connection establishment time based on the synchronous clock can be determined based on the time difference between this synchronous clock and the local clock of the first interaction terminal; when the time when the server sends the first calibration information is used as the connection establishment time, when the server returns the first calibration information, the connection establishment time is carried.

[0085] The server can also assign a server sequence serverSeq to each interaction information sent by the first interaction terminal to record the order of the interaction information. Under normal network conditions, the order of the interaction information sent by the first interaction terminal is the same as the order of the interaction information received by the server. The order of the server sequence assigned by the server to each interaction information is the same as the order of receiving the interaction information, and the server sequence increases. In the case of unstable network, network delay, etc., due to out-of-order messages, the server can first sort the interaction information according to the calibration sequence. When it is detected that there are out-of-order messages, a new server sequence is re-assigned to the out-of-order messages, so that the increasing order of the server sequence of the interaction information is consistent with the order of the interaction information sent by the first interaction terminal.

[0086] In the embodiment of the present application, the first interaction terminal may generate a calibration sequence for this interaction message by using the above client sequence, connection establishment time, and server sequence. However, since this interaction message is newly sent and the server has not received it and assigned a server sequence for it, the first server sequence assigned by the server for the previous interaction message needs to be used to generate the calibration sequence for this interaction message. Of course, after the server receives the interaction message and assigns a server sequence for it, it will return the newly assigned server sequence to the first interaction terminal for storage, so as to generate the calibration sequence for the next interaction message. That is, after the first interaction terminal sends an interaction message carrying the calibration sequence, the method further includes:

[0087] Step 1, receive the second server sequence returned by the server in response to the interaction message, and replace the first server sequence in the calibration sequence corresponding to the interaction message with the second server sequence to keep the sequence in the server synchronized, where the second server sequence is the sequential sequence assigned by the server for the interaction message; and,

[0088] Step 2, store the updated calibration sequence and the second server sequence.

[0089] In the embodiment of the present application, the second server sequence is the latest server sequence assigned by the server for this interaction message. After obtaining the second server sequence, the first interaction terminal needs to update the calibration sequence of this message, that is, replace the first server sequence with the second server sequence. The server performs the same operation, so that the server sequence increases, and the calibration sequences on the first interaction terminal and the server are kept consistent.

[0090] In the present application, calibration is performed when the interaction terminal and the server establish a connection, and each interaction message sent by the interaction terminal carries a calibration sequence, so that the server can sort the interaction messages sent by the interaction terminal according to the calibration sequence, and can timely adjust the order of the interaction messages according to the calibration sequence in the case of out-of-order interaction messages, so that all the interaction messages exchanged between the interaction terminals are kept in the same order, solving the technical problem of inconsistent information order between information interaction parties caused by changes in the network environment.

[0091] In the embodiment of the present application, the information interaction method executed by the server 103, as Figure 3 shown, the method may include the following steps:

[0092] Step S302, in the case of receiving a calibration information request sent by the first interaction terminal, return the first calibration information to the first interaction terminal, where the first calibration information is used to determine the method of generating the calibration sequence in the current connection;

[0093] Step S304, when receiving the interaction information sent by the first interaction terminal, sort the interaction information by using the calibration sequence carried in the interaction information, and update the calibration sequence;

[0094] Step S306, forward the sorted interaction information to the second interaction terminal, and return the updated calibration sequence to the first interaction terminal; and,

[0095] Step S308, map and store the updated calibration sequence and the interaction information.

[0096] Through the above steps S302 to S308, when the present application establishes a connection through the interaction terminal and the server, calibration is performed, and each piece of interaction information sent by the interaction terminal carries the calibration sequence, so that the server can sort the interaction information sent by the interaction terminal according to the calibration sequence, and can timely adjust the order of the interaction information according to the calibration sequence in the case of out-of-order interaction information, so that all the interaction information exchanged between the interaction terminals maintains the same order, and solves the technical problem that the information order between information interaction parties is inconsistent due to changes in the network environment.

[0097] In step S302, the first calibration information is specifically used to determine the manner in which the first interaction terminal generates the calibration sequence for each piece of interaction information in this connection. The first calibration information may include the synchronization clock of the server itself. After the first interaction terminal extracts the synchronization clock, it uses the synchronization clock to record time throughout this connection, so as to avoid the situation that the calibration sequence generated according to the first calibration information is incorrect due to the out-of-synchronization between the local clock of the first interaction terminal and the server clock.

[0098] In step S304, sorting the interaction information by using the calibration sequence carried in the interaction information and updating the calibration sequence includes:

[0099] Step 1, extract the connection establishment time from the calibration sequence according to a preset rule, where the preset rule includes the location and character length of the connection establishment time;

[0100] Step 2, regard the interaction information with the same connection establishment time as the same group of interaction information, and sort the interaction information based on the group according to the connection establishment time;

[0101] Step 3, in the same group of interaction information, extract the client sequence from the calibration sequence according to a preset rule, and sort the interaction information in the same group according to the client sequence, where the preset rule includes the location and character length of the client sequence; and,

[0102] Step 4: According to the sorting order of the interaction information, assign a corresponding server sequence to each piece of interaction information, and replace the original server sequence in the calibration sequence with the newly assigned server sequence, where the server sequences increase in the sorting order.

[0103] In the embodiment of the present application, the preset rule corresponds to the first calibration information, including the composition settings of all calibration sequences in this connection, such as the location and character length of the connection establishment time, the location and character length of the client sequence, etc. The server first extracts the connection establishment time from the calibration sequence according to the preset rule, groups the interaction information according to the connection establishment time, and regards the interaction information with the same connection establishment time as the same group of interaction information. Multiple groups are sorted in the order of the connection establishment time. In the same group, the server extracts the client sequence from the calibration sequence according to the preset rule to sort the interaction information within the group. Since the client sequence includes information such as the sending timestamp and sending serial number of the interaction information determined based on the synchronous clock, the server can obtain the same sorting order as the order in which the first interaction terminal sends the interaction information after sorting the interaction information according to these information. Finally, the server assigns a corresponding server sequence to each piece of interaction information according to the sorting order of the interaction information, and replaces the original server sequence in the calibration sequence with the newly assigned server sequence.

[0104] Optionally, the sorting of the interaction information can determine the sorting range through a time window. For example, if the time window is 1 minute, after the server receives new interaction information, it sorts the new interaction information with all the interaction information received within 1 minute. This time window can be set as needed. If the sorting result shows that there is out-of-order interaction information, reassign the server sequence to the out-of-order interaction messages according to the re-sorted order.

[0105] In step S304, forwarding the sorted interaction information to the second interaction terminal includes:

[0106] Step 1: Send the latest server sequence to the second interaction terminal so that the second interaction terminal can determine the sequence difference between the locally existing server sequence and the latest server sequence; and

[0107] Step 2: When receiving an information acquisition request sent by the second interaction terminal for the sequence difference, determine the interaction information corresponding to the sequence difference;

[0108] Step 3: Return the interaction information to the second interaction terminal.

[0109] In the embodiments of the present application, after the server sorts the interaction information, an information list that is exactly the same as the order in which the first interaction terminal sends the interaction information is obtained. Each interaction information is assigned a server sequence number that increases sequentially according to the sending order. The server can send the latest server sequence number in the information list to the second interaction terminal, so that the second interaction terminal can determine the sequence difference between the server sequence number that already exists locally and the latest server sequence number, and then the second interaction terminal can fetch the interaction information corresponding to the sequence difference from the server. The interaction information fetched by the second interaction terminal is also displayed according to the server sequence number. Therefore, the information lists on the first interaction terminal, the server, and the second interaction terminal are exactly the same.

[0110] The above server sequence numbers can be pre-generated, and when a new interaction information is received, a pre-generated server sequence number is assigned to the interaction information according to the sorting order, as long as it is ensured that the numbers increase sequentially. It is also possible to newly generate server sequence numbers for the sorted interaction information when a new interaction information is received. The above latest server sequence number sent by the server to the second interaction terminal can be the latest assigned one or the latest generated one.

[0111] Optionally, after forwarding the sorted interaction information to the second interaction terminal, the method further includes:

[0112] Step 1, when the connection establishment time of the newly received interaction information is less than the connection establishment time of the stored interaction information and / or the client sequence number of the newly received interaction information is less than the client sequence number of the stored interaction information, re-sort the interaction information according to the connection establishment time and / or the client sequence number, and re-assign server sequence numbers to the re-sorted interaction information;

[0113] Step 2, determine the smallest server sequence number at which the re-sorted interaction information has changed;

[0114] Step 3, send a server sequence number discard instruction to the second interaction terminal, so that the second interaction terminal discards the server sequence numbers and information that are greater than or equal to the smallest server sequence number; and,

[0115] Step 4, send the latest server sequence number after re-sorting to the second interaction terminal, so that the second interaction terminal can determine the sequence difference between the server sequence number that already exists locally and the latest server sequence number, and fetch the interaction information corresponding to the sequence difference from the server.

[0116] In an embodiment of the present application, if the connection establishment time in the calibration sequence of the newly received interaction information is less than the connection establishment time of the stored interaction information, the interaction information is excluded from the sorting range of the current connection, and the new interaction information is sorted in the actual information group. If the client sequence in the calibration sequence of the newly received interaction information is less than the client sequence of the stored interaction information, re-sorting is performed in the information group of the current connection, and a new server sequence is re-assigned to the interaction information after re-sorting. The server determines the minimum server sequence of the interaction information whose order has changed after re-sorting, and sends a server sequence discard instruction to the second interaction terminal, so that the second interaction terminal discards the server sequences and information greater than or equal to the minimum server sequence, and finally sends the latest server sequence after re-sorting to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence, and pulls the interaction information corresponding to the sequence difference from the server.

[0117] Optionally, the server may include a server cluster composed of a primary server and a secondary server. When the primary server executes the above method steps, they are synchronized to the secondary server to form a master-slave synchronization. Thus, when the primary server fails and cannot continue to provide services, the secondary server can immediately continue to provide services. For example, when the primary server and the secondary server synchronize the server sequences, when the primary server fails, the secondary server continues to assign new server sequences to the interaction information sent by the first interaction terminal based on the synchronized server sequences, and notifies the second interaction terminal to pull the interaction information corresponding to the latest server sequence.

[0118] In the present application, calibration is performed when the interaction terminal establishes a connection with the server, and each interaction information sent by the interaction terminal carries a calibration sequence, so that the server can sort the interaction information sent by the interaction terminal according to the calibration sequence, and can timely adjust the order of the interaction information according to the calibration sequence in the case of out-of-order interaction information, so that all the interaction information exchanged between the interaction terminals maintains the same order, solving the technical problem of inconsistent information order between information interaction parties caused by changes in the network environment.

[0119] According to another aspect of the embodiments of the present application, an information interaction system is provided, including:

[0120] A first interaction terminal, configured to send a calibration information request to the server when establishing a connection with the server, and generate a corresponding calibration sequence for each interaction information according to the first calibration information returned by the server each time an interaction information is sent to the server under the current connection, and send the interaction information carrying the calibration sequence;

[0121] A server, which is configured to return the first calibration information to the first interaction terminal when receiving the calibration information request, where the first calibration information is used to determine the way to generate a calibration sequence in the current connection; when receiving the interaction information, sort the interaction information by using the calibration sequence and update the calibration sequence; forward the sorted interaction information to a second interaction terminal, and return the updated calibration sequence to the first interaction terminal;

[0122] A second interaction terminal, which is configured to receive and display the interaction information.

[0123] Optionally, the first interaction terminal is further configured to:

[0124] Replace the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the way to generate a calibration sequence in different connections.

[0125] Optionally, the first interaction terminal is specifically configured to:

[0126] Extract the synchronization clock embedded by the server from the first calibration information, where the synchronization clock is synchronized with the clock of the server itself;

[0127] Determine the client sequence of the interaction information by using the synchronization clock, where the client sequence includes at least one of the sending timestamp, sending serial number, and information check code of the interaction information; and,

[0128] Generate the calibration sequence by using the first server sequence, connection establishment time, and the client sequence, where the first server sequence is the server sequence returned by the server to the first interaction terminal and stored locally by the first interaction terminal for the last time, and the server sequence is the sequential sequence assigned by the server to each interaction information sent to the first interaction terminal.

[0129] Optionally, the first interaction terminal is further configured to:

[0130] Receive the second server sequence returned by the server in response to the interaction information, and replace the first server sequence in the calibration sequence corresponding to the interaction information with the second server sequence to keep in sync with the sequence in the server, where the second server sequence is the sequential sequence assigned by the server to the interaction information; and,

[0131] Store the updated calibration sequence and the second server sequence.

[0132] Optionally, the server is further configured to:

[0133] Store the updated calibration sequence and the interactive information mapping.

[0134] Optionally, the server is specifically configured to:

[0135] Extract the connection establishment time from the calibration sequence according to a preset rule, where the preset rule includes the location and character length of the connection establishment time;

[0136] Use the interactive information with the same connection establishment time as a group of interactive information, and sort the interactive information based on groups according to the connection establishment time;

[0137] In the same group of interactive information, extract the client sequence from the calibration sequence according to the preset rule, and sort the interactive information in the same group according to the client sequence, where the preset rule includes the location and character length of the client sequence; and,

[0138] According to the sorting order of the interactive information, assign a corresponding server sequence to each piece of interactive information, and replace the original server sequence in the calibration sequence with the newly assigned server sequence, where the server sequence increases according to the sorting order.

[0139] Optionally, the server is specifically configured to:

[0140] Send the latest server sequence to the second interactive terminal, so that the second interactive terminal determines the sequence difference between the locally existing server sequence and the latest server sequence; and

[0141] When receiving an information acquisition request sent by the second interactive terminal for the sequence difference, determine the interactive information corresponding to the sequence difference and return the interactive information to the second interactive terminal.

[0142] Optionally, the second interactive terminal is further configured to:

[0143] When receiving the latest server sequence sent by the server, determine the sequence difference between the locally existing server sequence and the latest server sequence;

[0144] Send an information acquisition request for the sequence difference to the server; and,

[0145] Receive and display the interactive information corresponding to the sequence difference.

[0146] Optionally, the server is further configured to:

[0147] In the case where the connection establishment time of the received new interaction information is less than the connection establishment time of the stored interaction information and / or the client sequence of the new interaction information is less than the client sequence of the stored interaction information, reorder the interaction information according to the connection establishment time and / or the client sequence, and reassign the server sequence to the reordered interaction information;

[0148] Determine the minimum server sequence at which the reordered interaction information changes;

[0149] Send a server sequence discard instruction to the second interaction terminal, so that the second interaction terminal discards the server sequence and information greater than or equal to the minimum server sequence; and,

[0150] Send the latest server sequence after reordering to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence, and pulls the interaction information corresponding to the sequence difference from the server.

[0151] Optionally, the second interaction terminal is further configured to:

[0152] In the case of receiving the server sequence discard instruction sent by the server, determine the minimum server sequence indicating discard;

[0153] Discard the server sequence and information stored in the local memory that are greater than or equal to the minimum server sequence; and,

[0154] In the case of receiving the latest server sequence sent by the server, determine the sequence difference between the locally existing server sequence and the latest server sequence, and pull the interaction information corresponding to the sequence difference from the server.

[0155] According to another aspect of the embodiments of the present application, the present application provides an electronic device, as Figure 4 shown, including a memory 401, a processor 403, a communication interface 405 and a communication bus 407. A computer program that can run on the processor 403 is stored in the memory 401. The memory 401 and the processor 403 communicate through the communication interface 405 and the communication bus 407. When the processor 403 executes the computer program, the steps of the above method are implemented.

[0156] In the above-mentioned electronic device, the memory and the processor communicate through a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0157] The memory can include a Random Access Memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located far from the aforementioned processor.

[0158] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0159] According to another aspect of the embodiments of the present application, there is also provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of any of the above embodiments.

[0160] Optionally, in the embodiments of the present application, the computer-readable medium is configured to store program code for the processor to execute the above steps.

[0161] Optionally, the specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be elaborated here.

[0162] When the embodiments of the present application are specifically implemented, reference can be made to the above various embodiments, and they have corresponding technical effects.

[0163] It will be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or any combination thereof.

[0164] For a software implementation, the techniques described herein can be implemented by units that execute the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented within the processor or external to the processor.

[0165] Those of ordinary skill in the art will appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0166] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0167] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical functional division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0168] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0170] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes. It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0171] The above description is only the specific implementation manners of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. An information interaction system, characterized in that, it includes: A first interaction terminal, which is used to send a calibration information request to the server when establishing a connection with the server, and for each interaction information sent to the server under the current connection, generate a corresponding calibration sequence based on the first calibration information returned by the server, and send the interaction information carrying the calibration sequence; A server, which is used to return the first calibration information to the first interaction terminal when receiving the calibration information request, where the first calibration information is used to determine the method of generating the calibration sequence in the current connection; when receiving the interaction information, sort the interaction information using the calibration sequence and update the calibration sequence; forward the sorted interaction information to the second interaction terminal, and return the updated calibration sequence to the first interaction terminal; A second interaction terminal, which is used to receive and display the interaction information; The calibration sequence includes a client sequence, a connection establishment time, and a server sequence. Specifically, the first interaction terminal is used to: extract the synchronous clock embedded by the server from the first calibration information, where the synchronous clock is synchronized with the server's own clock; use the synchronous clock to determine the client sequence of the interaction information, where the client sequence includes at least one of the sending timestamp, sending serial number, and information check code of the interaction information; and generate the calibration sequence using the first server sequence, the connection establishment time, and the client sequence, where the first server sequence is the server sequence returned by the server to the first interaction terminal and stored locally by the first interaction terminal for the last time, and the server sequence is the sequential sequence assigned by the server to each interaction information sent to the first interaction terminal.

2. The system according to claim 1, characterized in that, the first interaction terminal is further used to: replace the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the method of generating the calibration sequence in different connections.

3. The system according to claim 1, characterized in that, the first interaction terminal is further used to: receive the second server sequence returned by the server in response to the interaction information, and replace the first server sequence in the calibration sequence corresponding to the interaction information with the second server sequence to keep in sync with the sequence in the server, where the second server sequence is the sequential sequence assigned by the server to the interaction information; and store the updated calibration sequence and the second server sequence.

4. The system according to claim 1, characterized in that, the server is further used to: map and store the updated calibration sequence and the interaction information.

5. The system according to claim 1, characterized in that, specifically, the server is used to: extract the connection establishment time from the calibration sequence according to a preset rule, where the preset rule includes the location and character length of the connection establishment time; Take the interaction information with the same connection establishment time as the same group of interaction information, and sort the interaction information based on groups according to the connection establishment time; In the same group of interaction information, extract the client sequence from the calibration sequence according to the preset rule, and sort the interaction information in the same group according to the client sequence, where the preset rule includes the location and character length of the client sequence; and, According to the sorting order of the interaction information, assign a corresponding server sequence to each piece of interaction information, and replace the original server sequence in the calibration sequence with the newly assigned server sequence, where the server sequence increases according to the sorting order.

6. The system according to claim 1, wherein, the server is specifically configured to: Send the latest server sequence to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence; and In the case of receiving an information acquisition request sent by the second interaction terminal for the sequence difference, determine the interaction information corresponding to the sequence difference and return the interaction information to the second interaction terminal.

7. The system according to claim 1, wherein, the second interaction terminal is further configured to: In the case of receiving the latest server sequence sent by the server, determine the sequence difference between the locally existing server sequence and the latest server sequence; Send an information acquisition request for the sequence difference to the server; and, Receive and display the interaction information corresponding to the sequence difference.

8. The system according to any one of claims 6 or 7, wherein, the server is further configured to: In the case where the connection establishment time of the newly received interaction information is less than the connection establishment time of the stored interaction information and / or the client sequence of the newly received interaction information is less than the client sequence of the stored interaction information, re-sort the interaction information according to the connection establishment time and / or the client sequence, and re-assign the server sequence to the re-sorted interaction information; Determine the smallest server sequence for which the interaction information has changed after re-sorting; Send a server sequence discard instruction to the second interaction terminal, so that the second interaction terminal discards the server sequence and information greater than or equal to the smallest server sequence; and, Send the latest server sequence after re-sorting to the second interaction terminal, so that the second interaction terminal determines the sequence difference between the locally existing server sequence and the latest server sequence, and pulls the interaction information corresponding to the sequence difference from the server.

9. The system according to claim 8, wherein, the second interaction terminal is further configured to: In the case of receiving the server sequence discard instruction sent by the server, determine the smallest server sequence indicating discard; Discard the server sequence and information stored in the local memory that are greater than or equal to the smallest server sequence; and, Upon receiving the latest server sequence sent by the server, determine the sequence difference between the locally existing server sequence and the latest server sequence, and pull from the server the interaction information corresponding to the sequence difference.

10. An information interaction method, applied to the information interaction system as claimed in claim 1, characterized in that it includes: When establishing a connection with the server, the first interaction terminal sends a calibration information request to the server; Upon receiving the calibration information request sent by the first interaction terminal, the server returns first calibration information to the first interaction terminal, where the first calibration information is used to determine the way of generating a calibration sequence in the current connection; The first interaction terminal receives the first calibration information returned by the server in response to the calibration information request, and replaces the second calibration information used in the previous connection with the first calibration information, where different calibration information is used to determine the way of generating a calibration sequence in different connections; When the first interaction terminal sends interaction information to the server each time under the current connection, it generates a corresponding calibration sequence for each interaction information according to the first calibration information, and sends the interaction information carrying the calibration sequence; Upon receiving the interaction information sent by the first interaction terminal, the server sorts the interaction information by using the calibration sequence carried in the interaction information, and updates the calibration sequence; The server forwards the sorted interaction information to the second interaction terminal, and returns the updated calibration sequence to the first interaction terminal; and maps and stores the updated calibration sequence and the interaction information; The second interaction terminal receives and displays the interaction information.

Citation Information

Patent Citations

  • Data synchronization method, terminal equipment and computer readable storage medium

    CN112328701A