CN114257632B - Method and device for reconnecting broken wire, electronic equipment and readable storage medium - Google Patents

Method and device for reconnecting broken wire, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114257632B
CN114257632B CN202111575977.2A CN202111575977A CN114257632B CN 114257632 B CN114257632 B CN 114257632B CN 202111575977 A CN202111575977 A CN 202111575977A CN 114257632 B CN114257632 B CN 114257632B
Authority
CN
China
Prior art keywords
client
user data
server
reconnection
component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111575977.2A
Other languages
Chinese (zh)
Other versions
CN114257632A (en
Inventor
史国君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202111575977.2A priority Critical patent/CN114257632B/en
Publication of CN114257632A publication Critical patent/CN114257632A/en
Application granted granted Critical
Publication of CN114257632B publication Critical patent/CN114257632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • 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/04Real-time or near real-time messaging, e.g. instant messaging [IM]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure provides a disconnection reconnection method, a disconnection reconnection device, electronic equipment and a storage medium, which can be applied to the technical field of data processing. The method comprises the following steps: acquiring a connection relation between at least one client and a server through a reconnection component, binding the connection relation to the reconnection component, and connecting the client and the server through the reconnection component; monitoring a connection state between at least one client and a server through a reconnection component; when the connection state is normal disconnection, the connection relation is released from the reconnection assembly; when the user is abnormally disconnected, marking and storing the user data of the client and the server according to the connection relation, and generating temporary user data; and in order to reconnect, checking the temporary user data and the latest user data of at least one client and the server after reconnection according to the connection relation, and recovering the data transmission between the client and the server after the checking is passed. The method can effectively improve the disconnection reconnection efficiency.

Description

Method and device for reconnecting broken wire, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a disconnection reconnection method, an apparatus, an electronic device, and a readable storage medium.
Background
Along with the development of internet technology, the application of instant messaging technology is more and more widespread, and in the process of instant messaging between a client and a server, there may be a sudden disconnection between the client and the server due to network disconnection, network switching or signal transmission, and the login connection before the client is unavailable, after the network is restored, in the process of performing disconnection reconnection, the user needs to log in authentication again, the disconnection reconnection efficiency is lower, and the reconnection speed is slower.
Disclosure of Invention
In view of the above, the present disclosure provides a disconnection reconnection method, apparatus, electronic device, and readable storage medium, which can effectively improve the disconnection reconnection efficiency of an instant messaging system.
According to a first aspect of the present disclosure, a method for reconnecting a disconnection is provided, and the method is applied to a distributed instant messaging system, where the distributed instant messaging system includes a client, a router, a server, and a reconnection component, and the reconnection component connects the client and the router and connects the router and the server; the method includes, but is not limited to: acquiring a connection relation between at least one client and a server through a reconnection component, and binding the connection relation to the reconnection component, wherein the reconnection component is connected with the client and the server; monitoring a connection state between the at least one client and the server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection; when the connection state is normal disconnection, the reconnection component releases the connection relation from the reconnection component; when the connection state is abnormal disconnection, the reconnection component marks and stores the user data of the at least one client and the server according to the connection relation to generate temporary user data; and when the connection state is reconnection, the reconnection component checks the temporary user data with the latest user data of at least one client and the server after reconnection according to the connection relation, and after the checking is passed, data transmission between the at least one client and the server is recovered.
In some exemplary embodiments of the present disclosure, after obtaining, by a reconnection component, a connection relationship of at least one client and a server, binding the connection relationship to a connector of the reconnection component, the method further includes: after at least one client and the server are successfully connected, the client and the server are identified, and the identification information and the connection relation information of the client and the server are stored in a database.
In some exemplary embodiments of the present disclosure, the reconnection component marks and stores user data of the at least one client and the server according to the connection relationship, and generating temporary user data includes: the reconnection component marks first user data of the client side when disconnected according to the identification information, stores the first user data in a first storage position and generates first temporary user data; the reconnection component marks second user data of the service end when the reconnection component is disconnected according to the identification information, and stores the second user data in a second storage position to generate second temporary user data; the first temporary user data and the second temporary user data have a set expiration time.
In some exemplary embodiments of the present disclosure, binding the connection relationship to the reconnection component includes binding a connector to the reconnection component; when the reconnection of the client and the server is detected, the method further comprises: the client and/or the server reads the identification information and the connection relation information stored in the database, and determines the corresponding connector in the reconnection assembly according to the identification information and the connection relation information.
In some exemplary embodiments of the present disclosure, the latest user data includes first latest user data of a client and second latest user data of a server, and the verifying, by the reconnection component according to the connection relationship, the temporary user data with the latest user data of at least one of the client and the server after reconnection includes: the connector acquires a data verification identifier of the client, and verifies the relation between the first temporary user data and the first latest user data based on the data verification identifier; verifying a relationship between the second temporary user data and the second latest user data; the first latest user data is associated with the second latest user data through the connection relationship information.
In some exemplary embodiments of the present disclosure, the resuming the data transmission between the at least one client and the server includes: and sending the first temporary user data and/or the first latest user data to the server side, and sending the second latest user data to the client side.
In some exemplary embodiments of the present disclosure, storing user data of at least one client and server includes: and determining a storage mode and a storage position of the user data according to the types of the user data of the at least one client and the server.
In a second aspect of the present disclosure, a device for reconnecting a broken wire is provided, and the device is applied to a distributed instant messaging system, where the distributed instant messaging system includes a client, a router, a server, and a reconnection component, where the reconnection component connects the client and the router and connects the router and the server; the devices include, but are not limited to:
the binding module is configured to acquire the connection relation between at least one client and the server through the reconnection component, bind the connection relation to the reconnection component, and connect the client and the server through the reconnection component;
The connection state monitoring module monitors the connection state between the at least one client and the server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection; the connection state monitoring module is configured to: when the connection state is normal disconnection, the connection relation is released from the reconnection component; when the connection state is abnormal disconnection, the reconnection component marks and stores the user data of the at least one client and the server according to the connection relation to generate temporary user data; and when the connection state is reconnection, the reconnection component checks the temporary user data with the latest user data of at least one client and the server after reconnection according to the connection relation, and after the checking is passed, data transmission between the at least one client and the server is recovered.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; and a storage device for storing executable instructions which, when executed by the processor, implement a method according to the above.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon executable instructions which, when executed by a processor, implement a method according to the above.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method according to the above.
According to the embodiment of the disclosure, the reconnection component is arranged between the client and the server, so that the quick disconnection reconnection of the client and the server is realized, and the disconnection reconnection efficiency of the instant messaging system is effectively improved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates a schematic diagram of a system architecture to which a wire disconnection reconnection method of an embodiment of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow chart of a wire break reconnection method according to an embodiment of the disclosure;
fig. 3 schematically illustrates a flowchart of a disconnection reconnection method according to an embodiment of the present disclosure after operation S210;
fig. 4 schematically illustrates a flowchart of a disconnection reconnection method according to an embodiment of the present disclosure after operation S250;
FIG. 5 schematically illustrates a flow chart of data transfer between a recovery client and a server according to a broken reconnection method according to an embodiment of the disclosure;
fig. 6 schematically illustrates a block diagram of a wire break reconnection device according to an embodiment of the present disclosure;
fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a wire-break reconnection method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related personal information of the user all conform to the regulations of related laws and regulations, necessary security measures are taken, and the public order harmony is not violated.
In order to solve the problems of low efficiency and low reconnection speed of Instant Messaging (IM) disconnection reconnection in the related art, the disclosure provides a disconnection reconnection method which is applied to a distributed instant messaging system, wherein the distributed instant messaging system comprises a client, a router, a server and a reconnection component, and the reconnection component is connected with the client and the router as well as the router and the server; methods include, but are not limited to: acquiring a connection relation between at least one client and a server through the reconnection component, and binding the connection relation to a connector of the reconnection component after the at least one client and the server are successfully connected; monitoring the connection state between at least one client and the server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection; when the connection state is normal disconnection, the reconnection component releases the connection relation from the connector; when the connection state is abnormal disconnection, the reconnection component marks and stores the user data of at least one client and the server according to the connection relation, and temporary user data is generated; when the connection state is reconnection, the reconnection component checks the temporary user data with the latest user data of at least one client and the server after reconnection according to the connection relation, and after the checking is passed, data transmission between the at least one client and the server is recovered.
According to the embodiment of the disclosure, the reconnection component is arranged between the client and the server, so that the quick disconnection reconnection of the client and the server is realized, and the disconnection reconnection efficiency of the instant messaging system is effectively improved.
Fig. 1 schematically illustrates a schematic diagram of a system architecture to which a wire disconnection reconnection method of an embodiment of the present disclosure may be applied. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios. It should be noted that, the disconnection reconnection method and the disconnection reconnection device provided by the embodiments of the present disclosure may be used in the related aspects of the data processing technical field and the financial field, and may also be used in any field other than the financial field, and the disconnection reconnection method and the disconnection reconnection device provided by the embodiments of the present disclosure do not limit the application field.
As shown in fig. 1, an exemplary system architecture 100, to which the disconnect reconnection method may be applied, may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the disconnection reconnection method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the disconnection reconnection device provided in the embodiments of the present disclosure may be generally provided in the server 105. The disconnection reconnection method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster other than the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the disconnection reconnection apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The disconnection reconnection method of the disclosed embodiment will be described in detail below by way of fig. 2 to 5.
The disconnection reconnection method disclosed by the invention can be applied to a distributed instant messaging system, wherein the distributed instant messaging system comprises a client, a router, a server and a reconnection component, and the reconnection component is used for connecting the client with the router and connecting the router with the server.
In the embodiment of the disclosure, the distributed instant messaging system comprises a plurality of clients and a plurality of service ends, and the router is arranged between the clients and the service ends and is used for selecting connection lines of the clients and/or the service ends so as to realize information transmission between the clients and/or the service ends. The reconnection component is used for connecting the client and the router and connecting the router and the server, thereby realizing the disconnection reconnection method of the disclosure.
Fig. 2 schematically illustrates a flow chart of a disconnection reconnection method according to an embodiment of the present disclosure. As shown in fig. 2, the disconnection reconnection method 200 of the embodiment of the present disclosure includes operations S210 to S250.
In operation S210, the connection relationship between the at least one client and the server is acquired through the reconnection component, and the connection relationship is bound to the reconnection component, and the reconnection component connects the client and the server.
In the embodiment of the disclosure, the distributed instant messaging system includes a plurality of clients and a plurality of servers, and the reconnection component obtains a connection relationship between at least one client and a server, for example, when one client is connected to the server, the connection relationship between the client and the server is obtained, and when there are a plurality of connections between the client and the server, the connection relationship between each client and the server is obtained. When the client and the server are successfully connected, the connection relationship is bound to the reconnection component, for example, the connection relationship is bound to a connector of the reconnection component. In addition, the connection relationship is bound only after the client and the server are successfully connected, and if the connection (such as login information error) is not successfully established between the client and the server, the client and the server have no connection relationship. After the client and the server are successfully connected, the connection relation between the client and the server which are successfully connected is bound through the connector.
In the embodiment of the disclosure, each connector can bind one or more connection relations between the client and the server, and the function of quick reconnection after disconnection can be realized by binding the connection relation between the server and the client through the reconnection component. The connector is arranged in the reconnection component, and the function of the connector is to bind the connection relation between the client and the server, so that the connection relation between the client and the server in the connector can be read after the subsequent disconnection is reconnected.
In operation S220, the connection state between the at least one client and the server is monitored by the reconnection component, the connection state including normal disconnection, abnormal disconnection, reconnection.
In the embodiment of the present disclosure, the connection state is a state indicating whether or not a connection between the client and the server is normal. The normal disconnection indicates that the user of the client performs login and then re-performs login operation, for example, cancel login at the server or log off at the server. The abnormal disconnection means that after a user of the client logs in through authentication normally, the user of the client is disconnected abnormally due to network abnormality, signal abnormality, etc., and when the user of the client is disconnected abnormally, the user of the client does not log out or log out, but the connection between the client and the server is disconnected due to other reasons. Reconnection means that after the user of the client disconnects the client and the server due to network abnormality, signal abnormality, etc., the client and the server are reconnected due to network restoration or signal restoration, so that normal communication connection can be performed. The reconnection component performs different operations when monitoring different connection states of the client and the server.
In operation S230, the connection relationship is released from the reconnection component upon normal disconnection.
In the embodiment of the disclosure, when the connection state of the client and the server is normal disconnection, it is indicated that the user of the client has performed login logout or logout operation, and the disconnection of the client and the server is due to the operation of the user. At this time, the reconnection component releases the connection relationship between the client and the server from the reconnection component, specifically, releases the connection relationship from the connector of the reconnection component, so that the released connector can bind the connection relationship between other clients and the server, thereby effectively saving hardware resources.
In operation S240, when the connection is abnormally disconnected, user data of at least one client and server are marked and stored according to the connection relationship, and temporary user data is generated.
In the embodiment of the present disclosure, when the connection state between the client and the server is an abnormal disconnection, the abnormal disconnection is due to the disconnection between the client and the server caused by a network connection, a signal, and the like, and at this time, the user of the client does not necessarily know that the client and the server lose the connection. When the reconnection component detects that the client and the server belong to abnormal disconnection, the reconnection component marks and stores the user data of at least one client and the server with connection relation to generate temporary user data. The temporary user data is used for the subsequent step of disconnection reconnection, so that the operations such as data recovery and the like are facilitated. How the user data is marked and stored in particular will be described in detail later.
After the abnormal disconnection, the reconnection component continues to monitor the connection state between the client and the server, and when detecting that the client segment and the server are disconnected and reconnected, operation S250 is performed. In an embodiment of the present disclosure, the reconnection in operation S250 represents a reconnection after disconnection, not a reconnection after a client logs off from a server.
In operation S250, when reconnecting, the temporary user data and the latest user data of the at least one client and the server after reconnecting are checked according to the connection relationship, and after the checking is passed, data transmission between the at least one client and the server is resumed.
In the embodiment of the disclosure, when the reconnection component detects that the connection relationship between the client and the server is changed from abnormal disconnection to reconnection, at this time, the reconnection component acquires the latest user data of at least one of the client and the server after reconnection, checks the latest user data with temporary user data, and resumes data transmission between the client and the server after reconnection after the checking is passed, for example, data which is not transmitted during disconnection of the client is transmitted to the server, or data which is not transmitted during disconnection of the server is transmitted to the client, and the like, thereby realizing the function of quickly establishing connection after reconnection between the client and the server after disconnection, and quickly realizing the function of data transmission and improving the efficiency of disconnection reconnection.
Fig. 3 schematically illustrates a flowchart of a disconnection reconnection method according to an embodiment of the present disclosure after operation S210. As shown in fig. 3, after operation S210, operation S260 is further included.
In an embodiment of the present disclosure, after obtaining, by the reconnection component, the connection relationship between the at least one client and the server, the disconnection reconnection method of the present disclosure further includes operation S260. In operation S260, after at least one client and the server are successfully connected, the client and the server are identified, and the identification information and the connection relationship information of the client and the server are stored in the database.
For example, the identification of the client and the server includes identifying the client and the server having a connection relationship, and generating identification information, for example, specific information of the client and the server may be obtained through the identification information. In addition, connection relation information can be generated, and the connection relation between the client and the server can be obtained through the connection relation information. The corresponding client and the corresponding server can be obtained through the identification information, and the connection relationship between the client and the server can be obtained through the connection relationship information, so that the user data of the client and the server after disconnection and reconnection can be conveniently obtained.
Fig. 4 schematically illustrates a flowchart of a disconnection reconnection method according to an embodiment of the present disclosure after operation S250.
As shown in fig. 4, the disconnection reconnection method of the present disclosure further includes operation S270. In an embodiment of the present disclosure, upon detecting that the client and the server are reconnected, operation S270 is performed.
In an embodiment of the present disclosure, binding the connection relationship to the reconnection component includes binding the connection relationship to a connector of the reconnection component.
In operation S270, the client and/or the server reads the identification information and the connection relationship information stored in the database, and determines a corresponding connector in the reconnection component according to the identification information and the connection relationship information.
For example, when the connection relationship between the client and the server is normally disconnected, the connection relationship between the client and the server cannot be obtained in the connector. The corresponding connector in the reconnection assembly can be determined by reading the identification information and the connection relation information stored in the database by the client and/or the server, so that whether the connection relation between the client and the server is normal disconnection or reconnection after abnormal disconnection is further verified.
In an embodiment of the present disclosure, the reconnection component marks and stores user data of at least one client and a server according to a connection relationship, and generating temporary user data includes: the reconnection component marks the first user data of the client side when disconnected according to the identification information, stores the first user data in a first storage position and generates first temporary user data; the reconnection component marks second user data of the service end when disconnected according to the identification information, stores the second user data in a second storage position and generates second temporary user data; the first temporary user data and the second temporary user data have a set expiration time.
In the embodiment of the disclosure, the reconnection component identifies the client and the server, and generates identification information of the client and the server, wherein the identification information of the client and the identification information of the server may be the same or different, and information of the client and/or the server may be obtained through the identification information.
In the process of generating temporary user data, for a client, marking the first user data of the client when disconnected according to the identification information of the client, and generating the first temporary user data. And marking the second user data of the service end when the service end is disconnected according to the identification information of the service end, and generating second temporary user data. The first temporary user data and the second temporary user data may be stored in different locations or may be stored in the same location.
The storage mode and the storage position of the user data can be determined according to the type of the user data of at least one client and the server. For example, for message data, temporary data may be stored in kafka and other message queues, or temporary data may be stored by redis, or may be stored using permanent storage. For different user data types, there may be mysql, redis, mongodb data storage modes that may be selected, and so on.
In an embodiment of the present disclosure, the latest user data includes a first latest user data of a client and a second latest user data of a server, and the verifying, by the reconnection component, the temporary user data and the reconnected latest user data of at least one of the client and the server according to the connection relationship includes: the method comprises the steps that a connector obtains a data verification identifier of a client, and the relation between first temporary user data and first latest user data is verified based on the data verification identifier; verifying a relationship between the second temporary user data and the second latest user data; the first latest user data is associated with the second latest user data through the connection relationship information.
For example, after the client and the server are reconnected, for the client, the reconnection component obtains a data verification identifier of the client, and verifies the first temporary user data and the first latest user data of the client. The data check identifier may be a timestamp, for example, the first temporary user data has a timestamp when disconnected, the first latest user data has a timestamp after reconnection, and by comparing the timestamp of the first temporary user data with the timestamp of the first latest user data and the time interval of disconnection between the client and the server, it is determined whether there is corresponding agreement between the first temporary user data and the first latest user data. If the data of the client after reconnection and the data of the client before disconnection are different, the verification is not passed.
For another example, after the client and the server are reconnected, for the server, the reconnection component checks a relationship between the second temporary user data and the second latest user data, and if the second temporary user data at the server corresponds to the second latest user data, the check passes.
In the embodiment of the present disclosure, the first latest user data and the second latest user data are associated through connection relationship information, for example, before disconnection, the first temporary user data of the client and the second temporary user data of the server are associated through connection relationship information, and after the first temporary user data is acquired through connection relationship information, the second temporary user data may be further acquired. Similarly, after the client and the server are connected, whether the first latest user data corresponds to the second latest user data or not can be checked through the connection relation information.
Fig. 5 schematically illustrates a flow chart of data transmission between a recovery client and a server according to a broken reconnection method according to an embodiment of the disclosure.
As shown in fig. 5, the flow 500 of recovering data transmission between the client and the server includes operations S510 to S520.
In operation S510, the first temporary user data and/or the first latest user data are transmitted to the server.
In the embodiment of the present disclosure, after the verification is completed, if there is a certain difference between the first temporary user data and the first latest user data, for example, the first latest user data includes more data to be sent to the server by the user, the first latest user data may be selected to be sent to the server. For another example, if there is no difference between the data in the first latest user data and the first temporary user data, the first temporary user data and/or the first latest user data may be selected to be transmitted to the server.
In operation S520, the second latest user data is transmitted to the client.
After the verification of the second temporary user data and the second latest user data is completed, the second latest user data is selected to be sent to the client, so that the data transmitted from the server to the client is ensured to be the latest data.
In the embodiment of the disclosure, the reconnection component is arranged between the client and the server, so that the quick disconnection reconnection of the client and the server is realized, and the disconnection reconnection efficiency of the instant messaging system is effectively improved.
Fig. 6 schematically illustrates a block diagram of a disconnection reconnection device according to an embodiment of the present disclosure.
As shown in fig. 6, the disconnection reconnection apparatus 600 of the embodiment of the present disclosure includes a binding module 610 and a connection status monitoring module 620.
The disconnection reconnection device 600 is applied to a distributed instant messaging system, and the distributed instant messaging system comprises a client, a router, a server and a reconnection component, wherein the reconnection component is connected with the client and the router and is connected with the router and the server.
The binding module 610 is configured to obtain a connection relationship between at least one client and a server through the reconnection component, and bind the connection relationship to the reconnection component. In an exemplary embodiment of the present disclosure, the binding module 610 may be used to perform the aforementioned operation S210, which is not described herein in detail.
The connection state monitoring module 620 monitors a connection state between at least one client and a server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection; the connection status monitoring module 620 is configured to: when the connection state is normal disconnection, the connection relation is released from the reconnection assembly; when the connection state is abnormal disconnection, marking and storing user data of at least one client and at least one server according to the connection relation, and generating temporary user data; when the connection state is reconnection, checking the temporary user data and the latest user data of at least one client and the server after reconnection according to the connection relation, and recovering data transmission between the at least one client and the server after the checking is passed. In an exemplary embodiment of the present disclosure, the connection status monitoring module 620 may be used to perform the foregoing operations S220 to S250, which are not described herein.
In embodiments of the present disclosure, any of the plurality of modules of the binding module 610 and the connection status monitoring module 620 may be combined in one module to be implemented, or any of the plurality of modules may be split into a plurality of modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the binding module 610 and the connection status monitoring module 620 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging the circuits, or in any one of or a suitable combination of any of the three. Alternatively, at least one of the binding module 610 and the connection status monitoring module 620 may be at least partially implemented as a computer program module which, when executed, may perform the corresponding functions.
Fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a wire-break reconnection method according to an embodiment of the disclosure. The electronic device shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. Note that the program may be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs that, when executed, implement the disconnection reconnection method according to an embodiment of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: 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), 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 context of this 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. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 702 and/or RAM 703 and/or one or more memories other than ROM 702 and RAM 703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to implement the wire disconnection reconnection method provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium in the form of signals, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts 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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (10)

1. A method of reconnection for a broken wire, applied to a distributed instant messaging system, the method comprising:
acquiring a connection relation between at least one client and a server through a reconnection component, and binding the connection relation to the reconnection component, wherein the reconnection component is connected with the client and the server;
Monitoring a connection state between the at least one client and the server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection;
releasing the connection relationship from the reconnection assembly during normal disconnection;
when the abnormal disconnection is carried out, marking and storing the user data of the at least one client and the server according to the connection relation, and generating temporary user data;
after reconnection is completed, verifying the temporary user data with the latest user data of at least one client and the server after reconnection according to the connection relation, and recovering data transmission between the at least one client and the server after verification is passed.
2. The method of claim 1, after obtaining the connection relationship between the at least one client and the server through the reconnection component, the method further comprising:
after at least one client and the server are successfully connected, the client and the server are identified, and the identification information and the connection relation information of the client and the server are stored in a database.
3. The method of claim 2, wherein the marking and storing the user data of the at least one client and the server according to the connection relationship, and generating temporary user data comprises:
The reconnection component marks first user data of the client side when disconnected according to the identification information, stores the first user data in a first storage position and generates first temporary user data;
the reconnection component marks second user data of the service end when the reconnection component is disconnected according to the identification information, and stores the second user data in a second storage position to generate second temporary user data;
the first temporary user data and the second temporary user data have a set expiration time.
4. The method of claim 3, wherein binding the connection relationship to the reconnection component comprises binding a connector to the reconnection component;
when the reconnection of the client and the server is detected, the method further comprises:
the client and/or the server reads the identification information and the connection relation information stored in the database, and determines the corresponding connector in the reconnection assembly according to the identification information and the connection relation information.
5. The method of claim 4, wherein,
the latest user data comprises first latest user data of the client and second latest user data of the server,
the verifying the temporary user data with the latest user data of at least one client and server after reconnection according to the connection relation comprises:
The connector acquires a data verification identifier of the client, and verifies the relation between the first temporary user data and the first latest user data based on the data verification identifier;
verifying a relationship between the second temporary user data and the second latest user data;
the first latest user data is associated with the second latest user data through the connection relationship information.
6. The method of claim 5, wherein,
the resuming of the data transmission between the at least one client and the server comprises:
transmitting the first temporary user data and/or the first latest user data to the server side, and
and sending the second latest user data to the client.
7. The method of claim 1, wherein storing user data for at least one of a client and a server comprises:
and determining a storage mode and a storage position of the user data according to the types of the user data of the at least one client and the server.
8. An apparatus for reconnecting a broken wire, applied to a distributed instant messaging system, the apparatus comprising:
the binding module is configured to acquire the connection relation between at least one client and the server through the reconnection component, bind the connection relation to the reconnection component, and connect the client and the server through the reconnection component;
The connection state monitoring module monitors the connection state between the at least one client and the server through the reconnection component, wherein the connection state comprises normal disconnection, abnormal disconnection and reconnection; the connection state monitoring module is configured to: releasing the connection relationship from the reconnection assembly during normal disconnection; when the abnormal disconnection is carried out, marking and storing the user data of the at least one client and the server according to the connection relation, and generating temporary user data; after reconnection is completed, verifying the temporary user data with the latest user data of at least one client and the server after reconnection according to the connection relation, and recovering data transmission between the at least one client and the server after verification is passed.
9. An electronic device, comprising:
one or more processors;
storage means for storing executable instructions which when executed by the processor implement the method according to any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, implement the method according to any of claims 1 to 7.
CN202111575977.2A 2021-12-21 2021-12-21 Method and device for reconnecting broken wire, electronic equipment and readable storage medium Active CN114257632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111575977.2A CN114257632B (en) 2021-12-21 2021-12-21 Method and device for reconnecting broken wire, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111575977.2A CN114257632B (en) 2021-12-21 2021-12-21 Method and device for reconnecting broken wire, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114257632A CN114257632A (en) 2022-03-29
CN114257632B true CN114257632B (en) 2023-06-02

Family

ID=80796564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111575977.2A Active CN114257632B (en) 2021-12-21 2021-12-21 Method and device for reconnecting broken wire, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114257632B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827240A (en) * 2022-06-30 2022-07-29 成都云智北斗科技有限公司 Network disconnection reconnection method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516587A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Instant communication client terminal disconnection reconnection method and device
CN109040295A (en) * 2018-08-30 2018-12-18 上海九山电子科技有限公司 Determination method and device, terminal and the storage medium of abnormal broken line

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103516587A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Instant communication client terminal disconnection reconnection method and device
CN109040295A (en) * 2018-08-30 2018-12-18 上海九山电子科技有限公司 Determination method and device, terminal and the storage medium of abnormal broken line

Also Published As

Publication number Publication date
CN114257632A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
US11509505B2 (en) Method and apparatus for operating smart network interface card
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN108900562B (en) Login state sharing method and device, electronic equipment and medium
CN111478974B (en) Network connection method and device, electronic equipment and readable storage medium
CN110896362B (en) Fault detection method and device
CN114257632B (en) Method and device for reconnecting broken wire, electronic equipment and readable storage medium
CN108449186B (en) Security verification method and device
CN110275701B (en) Data processing method, device, medium and computing equipment
CN112953769B (en) Data transmission method, device, computer system and readable storage medium
CN114244700B (en) Port processing method and device, electronic equipment and computer readable storage medium
CN113296911B (en) Cluster calling method, cluster calling device, electronic equipment and readable storage medium
CN113190812A (en) Login method, system, electronic equipment and storage medium
CN114020513A (en) Method and device for processing log information
CN112272211A (en) Service request processing method, device and system
CN111552907A (en) Message processing method, device, equipment and storage medium
CN108288135B (en) System compatibility method and device, computer readable storage medium and electronic equipment
CN116527284B (en) Data storage security determination method, device, equipment and storage medium
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN114793232B (en) Service processing method, device, electronic equipment and storage medium
CN114465963B (en) Switch abnormity detection method and device, electronic equipment and computer readable medium
CN115103005A (en) Request response method and device, electronic equipment and storage medium
CN115118762A (en) Session processing method, client and system
CN116012158A (en) Service processing method, device, equipment and storage medium
CN116414668A (en) Data processing method, device, electronic equipment and storage medium
CN115714805A (en) Cross-platform communication connection method and system and electronic equipment

Legal Events

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