CN116828032A - Method and device for realizing session consistency - Google Patents

Method and device for realizing session consistency Download PDF

Info

Publication number
CN116828032A
CN116828032A CN202310696562.3A CN202310696562A CN116828032A CN 116828032 A CN116828032 A CN 116828032A CN 202310696562 A CN202310696562 A CN 202310696562A CN 116828032 A CN116828032 A CN 116828032A
Authority
CN
China
Prior art keywords
session
information
connection
consistency
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310696562.3A
Other languages
Chinese (zh)
Inventor
景峰
刘彬
肖意
刘国运
闫建良
王光树
陈智宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Oceanbase Technology Co Ltd
Original Assignee
Beijing Oceanbase Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Oceanbase Technology Co Ltd filed Critical Beijing Oceanbase Technology Co Ltd
Priority to CN202310696562.3A priority Critical patent/CN116828032A/en
Publication of CN116828032A publication Critical patent/CN116828032A/en
Pending legal-status Critical Current

Links

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/148Migration or transfer of sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • 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/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

One or more embodiments of the present disclosure provide a method and an apparatus for implementing session consistency, which relate to the field of computer technology. The method comprises the steps of responding to a session switching instruction for switching from a first session to a second session, and obtaining state information stored in a session management platform, wherein the state information comprises connection information of the first session; and acquiring target session information recorded in the first session according to the connection information of the first session so as to enable the session information in the first session and the second session to have consistency. According to the scheme provided by the specification, the second session can directly acquire the session information recorded in the first session, so that the session information of the first session and the second session is ensured to have consistency.

Description

Method and device for realizing session consistency
Technical Field
One or more embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and apparatus for implementing session consistency.
Background
In a distributed system, sessions on each node guarantee consistency of session information through a session synchronization mechanism. In the session synchronization mechanism of the related art, in order to ensure synchronization efficiency, session information is often synchronized by forwarding by the session management platform, however, because the session management platform may have errors in the forwarding process (for example, forwarding data is incomplete, downtime occurs in the forwarding process, etc.), and each node cannot sense if an error occurs, there is a great risk in practical application.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method and apparatus for implementing session consistency.
In order to achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present disclosure, a method for implementing session consistency is provided, including:
responding to a session switching instruction for switching from a first session to a second session, and acquiring state information stored in a session management platform, wherein the state information comprises connection information of the first session;
and acquiring target session information recorded in the first session according to the connection information of the first session so as to enable the session information in the first session and the second session to have consistency.
According to a second aspect of one or more embodiments of the present disclosure, there is provided an implementation apparatus of session consistency, including:
the first acquisition module is used for responding to a session switching instruction for switching from the first session to the second session and acquiring state information stored in the session management platform, wherein the state information comprises connection information of the first session;
and the second acquisition module is used for acquiring the target session information recorded in the first session according to the connection information of the first session so as to enable the session information in the first session and the second session to have consistency.
According to a third aspect of one or more embodiments of the present specification, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method as in the first aspect by executing executable instructions.
According to a fourth aspect of one or more embodiments of the present description, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps as the method of the first aspect.
According to the implementation method of session consistency, the second session can be enabled to respond to the session switching instruction for switching from the first session to the second session, and the state information stored in the session management platform is acquired, wherein the state information comprises the connection information of the first session. And the second session can obtain the target session information recorded in the first session according to the connection information of the first session. According to the scheme provided by the specification, the second session can directly acquire the session information recorded in the first session, so that the session information of the first session and the second session is ensured to have consistency.
Drawings
Fig. 1 is a schematic system architecture of a method for implementing session consistency according to an exemplary embodiment.
Fig. 2 is a flow chart of a method for implementing session consistency according to an exemplary embodiment.
Fig. 3 is a flow chart of a method for verifying session consistency according to an exemplary embodiment.
Fig. 4 is a flow chart of a session synchronization method according to an exemplary embodiment.
Fig. 5 is a flow chart of yet another session synchronization method provided by an exemplary embodiment.
Fig. 6 is a schematic diagram of an apparatus according to an exemplary embodiment.
Fig. 7 is a schematic structural diagram of a device for implementing session consistency according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying claims.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
For ease of understanding, the terms appearing in the specification will first be explained.
Session (Session) can be understood as a context between a client and a server from the beginning of a communication to the end of the communication. After the user establishes a connection with the server through the client, a session corresponding to the connection is created in the server so as to record session information generated by the user in the process of the interaction. The session information is usually information with a continuous state, for example, the session information may include user login information to ensure that the user is in a login state.
Session consistency refers to consistency between sessions in different nodes in a distributed system. Because each node in the distributed system is independent, the session generated by the user in one connection is distributed among a plurality of nodes, so that the session on each node needs to be ensured to have consistency, and the reliability and the correctness of the data are further ensured.
In a stand-alone system, after a user establishes a connection with a server through a client, the server may create a session corresponding to the connection, and store session information of the user by using the session, so long as the user does not disconnect the connection, the session information may be kept for a period of time, for example, the session information may include user login information to ensure that the user is in a login state.
With the development of computer technology, a single-machine system is gradually replaced by a distributed system, and although the system is still an integral system in view of a client, for a server, service data are split and deployed on different nodes, and the nodes are independent from each other and can be connected through remote procedure calls (Remote Procedure Call, RPC).
Therefore, only one piece of session information exists in the standalone system originally, and the session information should be synchronized to each node in the distributed system, so that each node can sense the session information of the user, and thus the capability of providing services for the user is provided.
In the related art, the session on different nodes can be synchronized by configuring the session management platform, however, in the synchronization process, the session management platform may be offline, or the session information is incompletely synchronized due to the communication mode between the session management platform and the nodes, and the faults may cause the transmission error of the session synchronization process, so that the sessions on different nodes are inconsistent.
In view of this, the implementation method of session consistency provided in the present specification may enable the second session to obtain state information stored in the session management platform in response to a session switching instruction for switching from the first session to the second session, where the state information includes connection information of the first session. And the second session can obtain the target session information recorded in the first session according to the connection information of the first session. According to the scheme provided by the specification, the second session can directly acquire the session information recorded in the first session, so that the session information of the second session of the first session is ensured to have consistency.
The present exemplary embodiment will be described in detail below with reference to the accompanying drawings and examples.
First, application scenarios related to the embodiments of the present specification will be described. The methods provided herein may be applied to any distributed system, such as a distributed database. The system architecture of the present illustrative embodiment will be described below using a distributed database as an example.
Fig. 1 shows an exemplary system architecture diagram of a session consistency implementation method or a session consistency implementation apparatus that may be applied to embodiments of the present description.
As shown in fig. 1, the system architecture 100 includes a terminal 101, a database management system 102, and a distributed database 103.
The terminal 101 may include a mobile phone, a smart tv, a tablet computer, a notebook computer, or a personal computer (PC, personal Computer), among others. A client may also be provided on the terminal 101, which may be an application client or a browser client, etc.
The database management system 102 may be deployed on a server, in which a session management platform is integrated, and may provide session management capabilities externally.
The distributed database 103 may be composed of a plurality of independent nodes, each of which may be connected by remote procedure calls (Remote Procedure Call, RPC). The nodes in the distributed database may be independent physical machines or may be different virtual machines on the same physical machine, which is not limited in this embodiment of the present disclosure.
In some embodiments, database management system 102 establishes a bridge between terminal 101 and distributed database 103 over a network, enabling forwarding of requests sent by terminal 101 to any node in distributed database 103. The network may be a wide area network or a local area network, or a combination of the two.
In some embodiments, when the data currently requested to be queried by the user and the data previously requested to be queried are stored in different nodes in the distributed database 103, the database management system 102 may forward the current query request of the user to the corresponding node and issue a session switch instruction. At this time, the node corresponding to the current query request of the user may execute the method for implementing session consistency provided in the embodiment of the present disclosure, so as to ensure consistency of session information before and after session switching.
Those skilled in the art will appreciate that the number of terminals, database management systems, and distributed databases shown in fig. 1 are merely illustrative, and any number of terminals, database management systems, and distributed databases may be provided as desired, and this is not a limitation in this specification.
The following describes in detail a method for implementing session consistency provided in the embodiments of the present disclosure with reference to specific embodiments.
Fig. 2 is a flow diagram of a method for implementing session consistency, which may be performed by any electronic device, for example, by a node in a distributed database, according to an exemplary embodiment. As shown in fig. 2, the method for implementing session consistency provided in the embodiment of the present disclosure includes the following steps.
S201, in response to a session switch instruction from the first session to the second session, the second session obtains state information stored in the session management platform, wherein the state information includes connection information of the first session.
It should be noted that the session management platform may be used to manage sessions on various nodes in a distributed environment, for example, create, delete, or modify sessions.
For example, in an application scenario of the distributed database, when the session management platform receives an initial access request of a client to the distributed database, a session corresponding to the access request may be created on each node of the distributed database. For example, a first session is created on a first node of the distributed database and a second session is created on a second node of the distributed database.
After the Session is created, a Session identification (Session ID) corresponding to the Session may be returned to the client. When the client sends a request next time, the corresponding session information in the node can be obtained by carrying the session identifier in the request header. When a client is disconnected, the session management platform may delete the session corresponding to the client, thereby freeing up storage space on the node.
Furthermore, in the application scenario of a distributed database, the session management platform may be integrated in the database management system. For example, for an Oceanbase database, the Oceanbase developer center (OceanBase Developer Center, ODC) can be used to manage sessions generated in database connections.
It should be noted that the session switching instruction may enable the user to switch between sessions on different nodes.
Illustratively, it is assumed that a first session is created at a first node and a second session is created at a second node, the first node and the second node being two different nodes in the same distributed system. At this time, if the previous access request of the user is forwarded to the first node by the session management system and the current access request is forwarded to the second node by the session management system, a session switching instruction for switching from the first session to the second session will be generated when the current access request is executed.
In an exemplary scenario of the distributed database, if the data that the user requested to query last time is located at the first node and the data that the user requested to query currently is located at the second node, a switch instruction for switching from the first session to the second session will be generated when the current query request is executed.
It should be noted that, the state information of the first session may be information generated during the communication between the client and the node where the first session is located. In this embodiment of the present disclosure, the state information may include connection information of the first session, so that other sessions may establish a connection with the first session according to the connection information of the first session.
In some embodiments, the state information is sent by the first session to the session management platform before the second session obtains the state information stored in the session management platform.
The state information may be fed back to the session management platform in real time by the first session, may be fed back to the session management platform when the state information is changed by the first session, or may be actively acquired by the session management platform after receiving the session switching instruction, which is not limited in this specification.
S202, the second session obtains target session information recorded in the first session according to the connection information of the first session, so that the session information in the first session and the session information in the second session are consistent.
It should be noted that, the consistency of the session information refers to that the session information in the first session and the second session, which needs to be guaranteed to be consistent, are identical. As described above, the session information is generally information having a continuous state, and for example, the session information may include user login information, and by keeping the session information in which the user login information is recorded in the first session consistent with the second session, the user can be kept in the login state when switching from the first session to the second session.
In the embodiment of the present disclosure, since the second session may directly obtain the session information recorded in the first session, the session information recorded in the first session may be directly used as the session information of the second session, so as to ensure consistency of the session information in the first session and the second session.
In some embodiments, according to the connection information of the first session, a connection may be established between the second session and the first session, and according to the established connection, the target session information recorded in the first session may be obtained.
Illustratively, the first session and the second session are created at different nodes, and the connection information of the first session includes node connection information and session identification information of the first session. The connection between the second session and the first session may be established according to the following: determining a node corresponding to the first session according to the node connection information; and positioning the node corresponding to the first session according to the session identification information so as to establish connection between the second session and the first session. The node connection information may be an IP address and a port number of the node where the first session is located.
In some embodiments, the connection established between the second session and the first session may be an RPC connection. Because the first session and the second session are respectively deployed at different nodes, data between the two cannot be directly called, and the semantics of the call and the data for conveying the call need to be expressed through a network.
In some embodiments, the state information in S201 further includes initial session information for the first session. Wherein the initial session information is session information of the first session stored in the session management platform. That is, the initial session information is session information previously transmitted to the session management platform by the first session.
In the case that the state information includes the initial session information, the second session may use the initial session information as session information of the second session after receiving the state information, so that the client may quickly access a new session in a session switching process.
It should be noted that, the initial session information and the target session information are both session information of the first session. The difference is that the initial session information is the session information that the first session is sent to the session management platform in advance and forwarded by the session management platform to the second session, and the target session information is the session information that the first session is directly sent to the second session.
In an ideal state, the content of the initial session information is the same as that of the target session information, and the difference is only that the transmission paths are different, but in actual operation, the initial session information may be wrong in the transmission process. At this time, since the initial session information is sent to the second session by the session management platform, the first session cannot sense whether the session management platform successfully sends the initial session information to the second session or not, and cannot sense whether the initial session information sent to the second session is correct or not, so when the initial session information is wrong in the transmission process, the session information of the first session is inconsistent with the session information of the second session. Therefore, in order to ensure that the session information in the first session and the second session have consistency, the initial session information in the second session may also be checked.
Illustratively, the second session may continue to verify the initial session information by comparing the initial session information with the target session information acquired in S202. If the target session information is inconsistent with the initial session information, the second session can send alarm information to the session management platform so as to prompt related technicians to timely remove faults.
In some embodiments, if the target session information and the initial session information are inconsistent, the second session may also directly use the target session information as the session information of the second session. That is, the second session may overwrite the initial session information acquired from the state information with the target session information directly acquired from the first session, thereby ensuring consistency.
In some embodiments, after the second session obtains the target session information recorded in the first session, a session information acknowledgement message may be returned to the first session, so as to ensure strong consistency of session information in the first session and the second session. That is, when the first session does not receive the session information confirmation message returned by the second session within the preset period of time, it may be considered that the target session information is not successfully transmitted, and the session information in the second session is not yet verified.
According to the scheme provided by the specification, the second session can directly acquire the session information recorded in the first session, so that the consistency of the session information of the first session and the second session can be ensured. In addition, when an error occurs in the process of transmitting session information to the second session, the first session and the second session are connected by communication, so that the error can be perceived by both communication parties, and faults can be found timely.
Having introduced the basic concept of the implementation method of session consistency provided in the embodiments of the present specification, three specific embodiments of the present specification will be described in detail below with reference to fig. 3, fig. 4 and fig. 5.
Fig. 3 is a flow chart of a method for verifying session consistency according to an exemplary embodiment. As shown in fig. 3, the method for verifying session consistency provided in the embodiment of the present disclosure includes the following steps.
S301, the first session sends status information (including connection information and initial session information) to the session management platform.
Specifically, the connection information includes an IP address, a port number, and session identification information of a node where the first session is located. The initial session information is session information of the first session.
The state information may be sent to the session management platform by the first session in real time, or may be sent to the session management platform by the first session when the state information is changed, which is not limited in the embodiment of the present specification.
S302, the session management platform synchronizes the state information to the second session.
Specifically, after receiving a session switching instruction from the first session to the second session, the session management platform may synchronize the received connection information and the initial session information to the second session. The second session may provide a service to the client using the initial session information after receiving the initial session information.
S303, the second session establishes connection with the first session.
Specifically, in order to avoid an error of the initial session information sent by the session management platform, the second session may establish a connection with the first session according to the received connection information, so as to complete verification of the initial session information.
S304, the first session sends target session information to the second session.
Specifically, the first session may send target session information to the second session over the established connection, wherein the target session information is session information that the first session directly sends to the second session.
S305, the second session verifies whether the target session information and the initial session information are identical.
Specifically, the second session may check whether the initial session information and the target session information are identical after receiving the target session information. If the initial session information is consistent, the initial session information is correct, otherwise, the corresponding alarm information can be sent to the session management platform, wherein the alarm information is used for prompting that the initial session information used in the current second session possibly has errors.
Fig. 4 is a flow chart of a session synchronization method according to an exemplary embodiment. The embodiment provided in fig. 4 differs from the embodiment provided in fig. 3 in that in the embodiment provided in fig. 4, there is no verification step, but the target session information is directly used as the session information of the second session, so that the consistency of the session information in the first session and the second session is ensured.
Specifically, as shown in fig. 4, the session synchronization method provided in the embodiment of the present disclosure includes the following steps.
S401, the first session sends status information (including connection information and initial session information) to the session management platform.
S402, the session management platform synchronizes the state information to the second session.
S403, the second session establishes connection with the first session.
S404, the first session sends target session information to the second session.
S405, the second session uses the target session information as session information of the second session.
Specifically, since the purpose of the embodiments of the present specification is to ensure consistency of session information in the first session and the second session. Since the initial session information relayed through the session management platform may send an error in the process of synchronizing to the second session, the error cannot be perceived. Thus, the target session information received from the first session may be directly used as the session information of the first session to ensure consistency of the session information.
The foregoing focuses on the differences between the embodiment provided in fig. 4 and the embodiment provided in fig. 3, and the rest of the non-detailed portions may refer to the description in the embodiment provided in fig. 3, which is not repeated for brevity.
Fig. 5 is a flow chart of a session synchronization method according to an exemplary embodiment. The embodiment provided in fig. 5 is different from the embodiment provided in fig. 4 in that the state information in the embodiment provided in fig. 5 only includes the connection information of the first session, and does not include the initial session information, thereby avoiding redundant transmission of the session information and improving the session synchronization efficiency.
Specifically, as shown in fig. 5, the session synchronization method provided in the embodiment of the present disclosure includes the following steps.
S501, the first session sends status information (including connection information) to the session management platform.
S502, the session management platform synchronizes the state information to the second session.
S503, the second session establishes connection with the first session.
S504, the first session sends the target session information to the second session.
S505, the second session uses the target session information as session information of the second session.
Specifically, since the consistency of the session information can be ensured through S504 and S505, in order to avoid the problem that the session synchronization process is slow due to the redundant transmission of the session information, the embodiment of the present disclosure may only carry the connection information of the first session in the state information, and enable the second session to provide services for the client after obtaining the target session information from the first session according to the connection information.
In an exemplary embodiment, in order to ensure that the second session has strong consistency with the session information of the first session, after receiving the target session information sent by the first session, the second session may return a session information acknowledgement message to the first session, thereby forming a closed loop on the session synchronization flow, so that the first session may perceive the synchronization result, and ensure the strong consistency of the session information in the first session and the second session.
The foregoing focuses on the differences between the embodiment provided in fig. 5 and the embodiment provided in fig. 4, and the rest of the non-detailed portions may refer to the description in the embodiment provided in fig. 4, which is not repeated for brevity.
Fig. 6 is a schematic diagram of an apparatus according to an exemplary embodiment. Referring to fig. 6, at the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile storage 610, although other hardware required by other services is possible. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 602 reading a corresponding computer program from the non-volatile memory 610 into the memory 608 and then running. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Referring to fig. 7, fig. 7 provides a device 700 for implementing session consistency, which can be applied to the apparatus shown in fig. 6 to implement the technical solution of the present specification. The apparatus 700 for implementing session consistency may include:
a first obtaining module 701, configured to obtain state information stored in a session management platform in response to a session switching instruction for switching from a first session to a second session, where the state information includes connection information of the first session;
the second obtaining module 702 is configured to obtain, according to the connection information of the first session, the target session information recorded in the first session, so that session information in the first session and the second session have consistency.
In some embodiments, the state information further includes initial session information for the first session. The first obtaining module 701 is further configured to use the initial session information as session information of the second session. The second obtaining module 702 is further configured to verify consistency of the target session information and the initial session information; and if the target session information is inconsistent with the initial session information, sending alarm information to the session management platform.
In some embodiments, if the target session information and the initial session information are inconsistent, the second obtaining module 702 is further configured to use the target session information as the session information of the second session.
In some embodiments, the state information is sent by the first session to the session management platform before the state information stored in the session management platform is obtained.
In some embodiments, the second obtaining module 702 is further configured to establish a connection between the second session and the first session according to the connection information of the first session; and acquiring target session information recorded in the first session according to the established connection.
In some embodiments, the first session and the second session are created at different nodes, and the connection information includes node connection information and session identification information of the first session. The second obtaining module 702 is further configured to determine, according to the node connection information, a node corresponding to the first session; and positioning the node corresponding to the first session according to the session identification information so as to establish connection between the second session and the first session.
In some embodiments, the connection established between the second session and the first session is a remote procedure call, RPC, connection.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The foregoing description of the preferred embodiment(s) is (are) merely intended to illustrate the embodiment(s) of the present invention, and it is not intended to limit the embodiment(s) of the present invention to the particular embodiment(s) described.

Claims (10)

1. A method for realizing session consistency includes:
responding to a session switching instruction for switching from a first session to a second session, and acquiring state information stored in a session management platform, wherein the state information comprises connection information of the first session;
and acquiring target session information recorded in the first session according to the connection information of the first session so as to enable the session information in the first session and the session information in the second session to have consistency.
2. The method of claim 1, the state information further comprising initial session information for the first session, the method further comprising, after the acquiring the state information stored in the session management platform:
taking the initial session information as session information of the second session;
after the target session information recorded in the first session is acquired according to the connection information of the first session, the method further includes:
verifying the consistency of the target session information and the initial session information;
and if the target session information is inconsistent with the initial session information, sending alarm information to the session management platform.
3. The method of claim 2, if the target session information and the initial session information are inconsistent, the method further comprising:
and taking the target session information as the session information of the second session.
4. The method of claim 1, the status information being sent by the first session to the session management platform prior to the acquiring the status information stored in the session management platform.
5. The method of claim 1, wherein the obtaining, according to the connection information of the first session, the target session information recorded in the first session includes:
establishing connection between the second session and the first session according to the connection information of the first session;
and acquiring target session information recorded in the first session according to the established connection.
6. The method of claim 5, the first session and the second session being created at different nodes, the connection information comprising node connection information and session identification information of the first session;
the establishing a connection between the second session and the first session according to the connection information of the first session includes:
determining a node corresponding to the first session according to the node connection information;
and positioning the first session in the node corresponding to the first session according to the session identification information so as to establish connection between the second session and the first session.
7. The method of claim 5, the connection established between the second session and the first session is a remote procedure call, RPC, connection.
8. An implementation apparatus for session consistency, comprising:
the first acquisition module is used for responding to a session switching instruction for switching from a first session to a second session and acquiring state information stored in the session management platform, wherein the state information comprises connection information of the first session;
and the second acquisition module is used for acquiring the target session information recorded in the first session according to the connection information of the first session so as to enable the session information in the first session and the second session to have consistency.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 7.
CN202310696562.3A 2023-06-12 2023-06-12 Method and device for realizing session consistency Pending CN116828032A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310696562.3A CN116828032A (en) 2023-06-12 2023-06-12 Method and device for realizing session consistency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310696562.3A CN116828032A (en) 2023-06-12 2023-06-12 Method and device for realizing session consistency

Publications (1)

Publication Number Publication Date
CN116828032A true CN116828032A (en) 2023-09-29

Family

ID=88111976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310696562.3A Pending CN116828032A (en) 2023-06-12 2023-06-12 Method and device for realizing session consistency

Country Status (1)

Country Link
CN (1) CN116828032A (en)

Similar Documents

Publication Publication Date Title
JP6756924B2 (en) Blockchain-based consensus methods and devices
CN111726399B (en) Docker container secure access method and device
CN111935315A (en) Block synchronization method and device
CN111488291B (en) Pressure testing method, device and system for block chain network
CN107580032B (en) Data processing method, device and equipment
TWI716822B (en) Method and device for correcting transaction causality, and electronic equipment
CN108228581B (en) Zookeeper compatible communication method, server and system
EP3779692B1 (en) Blockchain data processing
CN115277727B (en) Data disaster recovery method, system, device and storage medium
CN115150419B (en) Configuration and access method and system for hybrid cloud object storage
CN113411363A (en) Uploading method of image file, related equipment and computer storage medium
CN114416224A (en) Method and device for calling micro service under multi-micro service environment
CN107528703B (en) Method and equipment for managing node equipment in distributed system
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN106708881B (en) Interaction method and device based on network file system
CN115098528B (en) Service processing method, device, electronic equipment and computer readable storage medium
CN116828032A (en) Method and device for realizing session consistency
CN114157669B (en) Message transmission method and device
US20220067032A1 (en) Transaction confirmation methods and apparatuses in blockchain network
CN114757777A (en) Optimal link selection method and device for block chain and electronic equipment
CN108733805B (en) File interaction method, system, computer equipment and storage medium
CN110162415B (en) Method, server, device and storage medium for processing data request
CN113656496A (en) Data processing method and system
CN110502460B (en) Data processing method and node
CN113391759A (en) Communication method and device

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