A session connection monitoring method, device, equipment and storage medium
By using a heartbeat request and response mechanism, the external platform and the third party interact to confirm the connection status, which solves the problem of accurate monitoring of session connection status, realizes fast and accurate connection status detection and disconnection status identification, and improves the reliability of transaction processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2024-12-06
- Publication Date
- 2026-07-07
AI Technical Summary
How to accurately monitor the session connection status between enterprises and third parties, especially when there are network fluctuations or changes in status, to ensure rapid identification of connection status and timely detection of disconnection status.
The external platform interacts with third parties to confirm the connection status by sending heartbeat requests and responses. This includes sending a first heartbeat request to confirm the connection status, receiving a first heartbeat response to confirm the connection status, or sending a second heartbeat response to confirm the exit status. If no response is received, a connection establishment request is sent to confirm the disconnected status. The accuracy is ensured by recording the status through heartbeat logs and periodically checking the status.
It enables fast and accurate monitoring of session connection status, ensuring timely detection and recovery when connection status changes, and improving the reliability and stability of transaction processing.
Smart Images

Figure CN119728483B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a session connection monitoring method, apparatus, device and storage medium. Background Technology
[0002] When businesses frequently transact with third parties, their external platforms can establish session connections to facilitate online transactions and monitor the status of these connections (including whether they are connected or disconnected) in real time. Accurately monitoring the status of these session connections is a pressing technical challenge that needs to be addressed. Summary of the Invention
[0003] This application provides a session connection monitoring method, apparatus, device, and storage medium for accurately monitoring the status of session connections.
[0004] On one hand, embodiments of this application provide a session connection monitoring method applied to an external connection platform, the method comprising:
[0005] Send a first heartbeat request to a third party, the first heartbeat request including that the external platform is in a connected state, the first heartbeat request being used to request the status of the third party;
[0006] If a first heartbeat response is received from the third party within the first time period, and the first heartbeat response indicates that the third party is in a connected state, then based on the connection state of the external platform and the connection state of the third party, it is determined that the session connection between the external platform and the third party is in a connected state.
[0007] Optionally, the above method further includes:
[0008] If a second heartbeat response is received from the third party during the first time period, and the second heartbeat response includes the third party being in an exit state, then based on the exit state of the third party, it is determined that the session connection between the external platform and the third party is in a disconnected state.
[0009] Optionally, the above method further includes:
[0010] If no heartbeat response is received from the third party within the first time period, a connection establishment request is sent to the third party. The connection establishment request is used to request the establishment of a session connection between the external platform and the third party. The connection establishment request includes the external platform being logged in.
[0011] Based on the login status of the external platform, it is determined that the session connection between the external platform and the third party is disconnected.
[0012] Optionally, the above method further includes:
[0013] Send a second heartbeat request to the third party, wherein the second heartbeat request includes the external platform being in an exited state;
[0014] Based on the exit status of the external platform, it is determined that the session connection between the external platform and the third party is disconnected.
[0015] Optionally, the above method further includes:
[0016] Receive transaction information from the third party and process the transaction information;
[0017] In the event that the processing of the transaction information fails, determine the reason for the failure.
[0018] If the transaction information processing fails due to a session connection issue, then the first heartbeat request is sent to the third party.
[0019] If the transaction information processing fails due to business logic reasons, the transaction information will be transferred to the manual platform.
[0020] Optionally, the above method further includes:
[0021] The status of the session connection between the external platform and the third party is displayed on the front-end platform.
[0022] Optionally, the above method further includes:
[0023] If the session connection between the external platform and the third party is disconnected, a disconnection notification message is sent.
[0024] On one hand, embodiments of this application provide a session connection monitoring device, the device comprising:
[0025] The transceiver module is used to send a first heartbeat request to a third party. The first heartbeat request includes the external platform being in a connected state and is used to request the status of the third party.
[0026] The determination module is configured to determine that the session connection between the external platform and the third party is in a connected state if a first heartbeat response sent by the third party is received within a first time period, and the first heartbeat response includes the third party being in a connected state, based on the connection state of the external platform and the connection state of the third party.
[0027] Optionally, the determining module is further configured to:
[0028] If a second heartbeat response is received from the third party during the first time period, and the second heartbeat response includes the third party being in an exit state, then based on the exit state of the third party, it is determined that the session connection between the external platform and the third party is in a disconnected state.
[0029] Optionally, the transceiver module is further configured to: if no heartbeat response is received from the third party within the first time period, send a connection establishment request to the third party, wherein the connection establishment request is used to request the establishment of a session connection between the external platform and the third party; the connection establishment request includes the external platform being logged in.
[0030] The determining module is further configured to: determine, based on the login status of the external platform, that the session connection between the external platform and the third party is in a disconnected state.
[0031] Optionally, the transceiver module is specifically used to: send a second heartbeat request to the third party, wherein the second heartbeat request includes the external platform being in an exited state;
[0032] The determining module is specifically used to: determine, based on the exit status of the external platform, that the session connection between the external platform and the third party is in a disconnected state.
[0033] Optionally, the transceiver module is specifically used to: receive transaction information from the third party and process the transaction information;
[0034] The determining module is specifically used to: determine the reason for the failure to process the transaction information in the event of a failure to process the transaction information;
[0035] The transceiver module is specifically used to: if the reason for the failure of the transaction information processing is a session connection problem, then send the first heartbeat request to the third party;
[0036] The sending and receiving module is specifically used to: if the reason for the failure to process the transaction information is due to business logic reasons, then transfer the transaction information to the manual platform.
[0037] Optionally, it also includes a display module, which is specifically used for:
[0038] The status of the session connection between the external platform and the third party is displayed on the front-end platform.
[0039] Optionally, the transceiver module is further configured to:
[0040] If the session connection between the external platform and the third party is disconnected, a disconnection notification message is sent.
[0041] On one hand, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described session connection monitoring method.
[0042] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described session connection monitoring method.
[0043] On one hand, embodiments of this application provide a computer program product, including a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described session connection monitoring method.
[0044] In this embodiment, the external platform sends a first heartbeat request to a third party. The first heartbeat request includes information indicating that the external platform is in a connected state and is used to request the third party's status. If the external platform receives a first heartbeat response from the third party within a first time period, and the first heartbeat response includes information indicating that the third party is in a connected state, then the external platform determines that the session connection between the external platform and the third party is in a connected state based on the connection status of both the external platform and the third party. In the above method, the external platform can quickly and accurately determine that the session connection between the external platform and the third party is in a connected state based on the connection status of both the external platform and the third party. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 A schematic diagram of a system architecture provided for an embodiment of this application;
[0047] Figure 2 A flowchart illustrating a session connection monitoring method provided in an embodiment of this application;
[0048] Figure 3 A flowchart illustrating a session connection monitoring method provided in an embodiment of this application;
[0049] Figure 4 A flowchart illustrating a transaction information processing method provided in an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of the structure of a session connection monitoring device provided in an embodiment of this application;
[0051] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0053] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0054] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0055] The acquisition, transmission, storage, and use of data in this application all comply with the requirements of relevant national laws and regulations.
[0056] refer to Figure 1 This is a session connection monitoring system architecture diagram applicable to the embodiments of this application. The session connection monitoring system architecture diagram includes at least a terminal device 101, an external connection platform 102, and a third party 103.
[0057] Terminal device 101 has a target application installed for monitoring session connections. This application can be a pre-installed client, a web application, or a mini-program embedded in other applications. Terminal device 101 can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these.
[0058] External platform 102 responds to the target application and establishes a session connection with third party 103. External platform 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.
[0059] Third party 103 can establish a session connection with external platform 102. Third party 103 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms.
[0060] Terminal device 101 and external platform 102 can be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions on this. External platform 102 and third party 103 can be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions on this.
[0061] Terminal device 101 responds to the user's session connection monitoring operation by sending a session connection monitoring command to external platform 102. After receiving the session connection monitoring command, external platform 102 sends a first heartbeat request to third party 103. The first heartbeat request includes information that the external platform is in a connected state and is used to request the status of the third party. If external platform 102 receives a first heartbeat response from third party 103 within a first time period, and the first heartbeat response includes information that the third party is in a connected state, then external platform 102 determines that the session connection between external platform 102 and third party 103 is in a connected state based on the connection status of external platform 102 and third party 103.
[0062] based on Figure 1 The system architecture diagram described above, and the embodiments of this application provide a flow chart of a session connection monitoring method, such as... Figure 2 As shown, the process of this method is as follows: Figure 1 The interaction between the external platform 102 and the third party 103, as shown, includes the following steps:
[0063] S201, the external platform sends a first heartbeat request to the third party; correspondingly, the third party receives the first heartbeat request sent by the external platform.
[0064] In this embodiment of the application, before executing S201, the external platform may first send a connection establishment request to the third party, wherein the connection establishment request is used to request the establishment of a session connection between the external platform and the third party.
[0065] If the external platform does not receive a connection establishment response from the third party within the first time period, where the connection establishment response indicates a successful establishment of a session connection between the external platform and the third party, then the external platform confirms that the session connection establishment between the external platform and the third party has failed. In the event of a failed session connection establishment between the external platform and the third party, the external platform may resend a connection establishment request to the third party.
[0066] If the external platform receives a connection establishment response from the third party within the first time period, the external platform confirms that the session connection between the external platform and the third party has been successfully established. With the session connection between the external platform and the third party successfully established, both the external platform and the third party are in a connected state, therefore the session connection between the external platform and the third party is also in a connected state.
[0067] Because the states of the external platform and the third party can change dynamically, the state of the session connection between the external platform and the third party also changes dynamically. To facilitate continuous monitoring of the session connection state, the external platform can execute... Figure 2 The steps are shown.
[0068] In S201 above, the first heartbeat request may include the external platform being in a connected state. For ease of explanation, the first heartbeat request can identify the external platform being in a connected state through fields. For example, the first heartbeat request includes flag1=0, where flag1 is the identifier of the external platform, 0 indicates a connected state, and flag1=0 indicates that the external platform is in a connected state.
[0069] In addition, the first heartbeat request can also be used to request the status of a third party.
[0070] S202, if the third party is in a connected state, the third party generates a first heartbeat response, wherein the first heartbeat response includes the fact that the third party is in a connected state.
[0071] In the embodiments of this application, for ease of explanation, the first heartbeat response can identify that the third party is in a connected state through a field. For example, the first heartbeat response includes flag2=0, where flag2 is the identifier of the third party, 0 indicates the connected state, and flag2=0 indicates that the third party is in a connected state.
[0072] S203, the third party sends the first heartbeat response to the external platform.
[0073] S204. If the external platform receives the first heartbeat response from the third party within the first time period, the external platform determines that the session connection between the external platform and the third party is in a connected state based on the connection state of the external platform and the connection state of the third party, and then terminates the connection.
[0074] In this embodiment, if both the external platform and the third party are connected, the session connection between the external platform and the third party is also connected. If the external platform and / or the third party are disconnected, the session connection between the external platform and the third party is disconnected. The disconnected state of the external platform or the third party may include, but is not limited to, logged-in, logged-out, or faulty states.
[0075] Optionally, in S204 above, the external platform can determine that the session connection between the external platform and the third party is in a connected state through any one of the following implementation methods A1 or A2.
[0076] In implementation method A1, after receiving the first heartbeat response, the external platform determines that the session connection between the external platform and the third party is in a connected state based on the connection status of the external platform and the connection status of the third party.
[0077] In the above-described implementation A1, after receiving the first heartbeat response, the external platform can output the connection status of the external platform in the first heartbeat request and the connection status of the third party in the first heartbeat response to the heartbeat log. Then, based on the connection status of the external platform and the third party recorded in the heartbeat log, the external platform determines that the session connection between the external platform and the third party is in a connected state.
[0078] In implementation method A2, the external platform can periodically determine whether the session connection between the external platform and the third party is in a connected state based on the connection status of the external platform and the connection status of the third party.
[0079] In the above-described implementation A2, the external platform can periodically output the connection status of the external platform in the first heartbeat request and the connection status of the third party in the first heartbeat response to the heartbeat log. Then, the external platform determines that the session connection between the external platform and the third party is in a connected state based on the connection status of the external platform and the third party recorded in the heartbeat log.
[0080] S205, if the third party is in an exit state, the third party generates a second heartbeat response, wherein the second heartbeat response includes the fact that the third party is in an exit state.
[0081] In the above S205, after the third party receives the first heartbeat request sent by the external platform, if the third party wants to exit the session connection, it can execute the steps in S205 before exiting the session connection, that is, generate a second heartbeat response.
[0082] In the embodiments of this application, for ease of explanation, the second heartbeat response can identify that the third party is in an exit state through a field. For example, the second heartbeat response includes flag2=2, where flag2 is the identifier of the third party, 2 indicates the exit state, and flag2=2 indicates that the third party is in an exit state.
[0083] S206, the third party sends a second heartbeat response to the external platform.
[0084] S207, if the external platform receives a second heartbeat response from the third party within the first time period, the external platform determines that the session connection between the external platform and the third party is disconnected based on the third party's exit status, and then terminates the connection.
[0085] Optionally, in the above S207, the external platform can determine that the session connection between the external platform and the third party is disconnected through any of the following implementations B1 or B2.
[0086] In implementation method B1, after receiving the second heartbeat response, the external platform determines that the session connection between the external platform and the third party is disconnected based on the connection status of the external platform and the exit status of the third party.
[0087] In the above-described implementation B1, after receiving the second heartbeat response, the external platform can output the connection status of the external platform in the first heartbeat request and the exit status of the third party in the second heartbeat response to the heartbeat log. Then, based on the connection status of the external platform and the exit status of the third party recorded in the heartbeat log, the external platform determines that the session connection between the external platform and the third party is disconnected.
[0088] In implementation method B2, the external platform can periodically determine whether the session connection between the external platform and the third party is disconnected based on the connection status of the external platform and the exit status of the third party.
[0089] In the above-described implementation B2, the external platform can periodically output the connection status of the external platform in the first heartbeat request and the exit status of the third party in the second heartbeat response to the heartbeat log. Then, based on the connection status of the external platform and the exit status of the third party recorded in the heartbeat log, the external platform determines that the session connection between the external platform and the third party is disconnected.
[0090] S208, if the external platform does not receive a heartbeat response from the third party within the first time period, the external platform sends a connection establishment request to the third party. The connection establishment request is used to request the establishment of a session connection between the external platform and the third party. The connection establishment request includes the external platform being logged in.
[0091] In this embodiment of the application, the heartbeat response in S208 above includes a first heartbeat response and a second heartbeat response, that is, the external platform neither receives the first heartbeat response sent by the third party nor the second heartbeat response sent by the third party during the first time period.
[0092] It should be understood that if a third party is in a faulty state, it will be unable to send heartbeat responses to the external platform.
[0093] S209, The external platform determines that the session connection between the external platform and the third party is disconnected based on the login status of the external platform.
[0094] Optionally, in S209 above, the external platform can determine that the session connection between the external platform and the third party is disconnected through any one of the following implementation methods C1 or C2.
[0095] In implementation method C1, if the external platform does not receive a heartbeat response from the third party within the first time period, it determines that the session connection between the external platform and the third party is disconnected based on the login status of the external platform.
[0096] In the above implementation method C1, after the external platform does not receive a heartbeat response from the third party within the first time period, it can output the login status of the external platform in the connection establishment request to the heartbeat log. Then, based on the login status of the external platform recorded in the heartbeat log, the external platform determines that the session connection between the external platform and the third party is disconnected.
[0097] In implementation method C2, the external platform can periodically determine whether the session connection between the external platform and the third party is disconnected based on the login status of the external platform.
[0098] In the above implementation method C2, the external platform can periodically output the login status of the external platform in the connection establishment request to the heartbeat log. Then, the external platform determines that the session connection between the external platform and the third party is disconnected based on the login status of the external platform recorded in the heartbeat log.
[0099] exist Figure 2 In the steps shown, the external platform sends a first heartbeat request to the third party. This first heartbeat request includes information indicating that the external platform is in a connected state and is used to request the third party's status. If the external platform receives a first heartbeat response from the third party within a first time period, and this response includes information indicating that the third party is in a connected state, then the external platform determines that the session connection between the external platform and the third party is in a connected state based on both the external platform's connection state and the third party's connection state. In this method, the external platform can quickly and accurately determine that the session connection between the external platform and the third party is in a connected state based on both its own connection state and the third party's connection state.
[0100] If the external platform receives a second heartbeat response from the third party within the first time period, and the second heartbeat response indicates that the third party is in an exit state, then the external platform determines that the session connection between the external platform and the third party is disconnected based on the third party's exit state. In the above method, the external platform can quickly and accurately determine that the session connection between the external platform and the third party is disconnected based on the third party's exit state.
[0101] If the external platform does not receive a heartbeat response from the third party within the first time period, it sends a connection establishment request to the third party. This request requests the establishment of a session connection between the external platform and the third party; the connection establishment request includes the external platform being logged in. Subsequently, based on its login status, the external platform determines that the session connection between the external platform and the third party is disconnected. In this method, the external platform can quickly and accurately determine that the session connection between the external platform and the third party is disconnected based on its login status.
[0102] Optionally, during execution Figure 2 During the session connection monitoring method shown, the following can also be executed: Figure 3 The following steps are shown:
[0103] S301, the external platform sends a second heartbeat request to a third party.
[0104] Before executing S301, if the external platform wants to exit the session connection, it can generate a second heartbeat request before exiting the session connection. The second heartbeat request may include the external platform being in an exited state.
[0105] For ease of explanation, the second heartbeat request can use fields to indicate that the external platform is in an exited state. For example, the second heartbeat request includes flag1=2, where flag1 is the identifier of the external platform and 2 indicates an exited state. flag1=2 means that the external platform is in an exited state.
[0106] S302, the external platform determines that the session connection between the external platform and the third party is disconnected based on the exit status of the external platform.
[0107] In S302 above, the external platform can periodically determine whether the session connection between the external platform and the third party is disconnected based on the exit status of the external platform.
[0108] Specifically, the external platform can periodically output the exit status of the external platform in the second heartbeat request to the heartbeat log. Then, the external platform determines that the session connection between the external platform and the third party is disconnected based on the exit status of the external platform recorded in the heartbeat log.
[0109] exist Figure 3 In the steps shown, the external platform can quickly and accurately determine that the session connection between the external platform and the third party is disconnected based on the external platform's exit status.
[0110] Optionally, when performing the above Figure 2 or Figure 3 In the steps shown, the external connection platform can also display the status of the session connection between the external connection platform and the third party on the front-end platform, so that the technical personnel of the external connection platform can easily obtain the status of the session connection between the external connection platform and the third party. In addition, if the session connection between the external connection platform and the third party is disconnected, the external connection platform can also send a disconnection notification message to the technical personnel to notify them in a timely and accurate manner, which helps to restore the session connection between the external connection platform and the third party to a connected state as soon as possible.
[0111] Optionally, during execution Figure 2 During the session connection monitoring method shown, the following can also be executed: Figure 4 The following steps are shown:
[0112] S401, a third party sends transaction information to an external platform; correspondingly, the external platform receives the transaction information sent by the third party.
[0113] S402, the external platform processes transaction information.
[0114] S403, In the event that the external platform fails to process the transaction information, the external platform determines the reason for the failure to process the transaction information.
[0115] In the above S403, if the external platform successfully processes the transaction information, no further processing will be performed.
[0116] S404 If the reason for the failure of transaction information processing is a session connection problem, the external platform sends a first heartbeat request to the third party.
[0117] In the above S404, the reasons for session connection failure include, but are not limited to, the inability to receive a transaction response during transaction information processing. For example, the transaction information is that account A transfers 10,000 yuan to account B. When the external platform processes the transaction, it first deducts 10,000 yuan from account A, but does not receive a response from account A confirming that the deduction was successful. Therefore, the external platform confirms that the transaction information processing has failed, and the reason for the failure is a session connection problem.
[0118] It should be understood that session connection failures are generally caused by network fluctuations leading to unstable session connections between the external platform and the third party. Therefore, when the reason for transaction information processing failure is a session connection issue, the external platform can execute... Figure 2 The step in this process involves sending a first heartbeat request to a third party to determine whether the session connection between the external platform and the third party is in a connected state.
[0119] S405 If the reason for the failure to process the transaction information is due to business logic reasons, the external platform will transfer the transaction information to the manual platform.
[0120] For example, the transaction information is that account A transfers 10,000 yuan to account B. Account A's account balance is 1,000 yuan. When the external platform processes the transaction, it first deducts 10,000 yuan from account A. The platform then receives a response that the deduction failed. Therefore, the external platform confirms that the transaction processing failed, and the reason for the failure is a business logic issue.
[0121] In one possible implementation, after the external platform transfers the transaction information to the human platform, the transaction information can be processed by humans.
[0122] In one possible implementation, the external platform can also output the reason for the transaction information processing failure to the front-end platform for display, so as to notify the business personnel responsible for the transaction information.
[0123] Figure 4 The steps shown provide a method for processing transaction information between an external platform and a third party.
[0124] Based on the same technical concept, embodiments of this application provide a session connection monitoring device, such as... Figure 5 As shown, the session connection monitoring device 500 includes:
[0125] The transceiver module 501 is used to send a first heartbeat request to a third party. The first heartbeat request includes the external platform being in a connected state and is used to request the status of the third party.
[0126] The determination module 502 is configured to determine that the session connection between the external platform and the third party is in a connected state if a first heartbeat response sent by the third party is received within a first time period, and the first heartbeat response includes the third party being in a connected state, based on the connection state of the external platform and the connection state of the third party.
[0127] Optionally, the determining module 502 is further configured to:
[0128] If a second heartbeat response is received from the third party during the first time period, and the second heartbeat response includes the third party being in an exit state, then based on the exit state of the third party, it is determined that the session connection between the external platform and the third party is in a disconnected state.
[0129] Optionally, the transceiver module 501 is further configured to: if no heartbeat response is received from the third party within the first time period, send a connection establishment request to the third party, wherein the connection establishment request is used to request the establishment of a session connection between the external platform and the third party; the connection establishment request includes the external platform being logged in.
[0130] The determining module 502 is further configured to: determine, based on the login status of the external platform, that the session connection between the external platform and the third party is in a disconnected state.
[0131] Optionally, the transceiver module 501 is specifically used to: send a second heartbeat request to the third party, wherein the second heartbeat request includes the external platform being in an exited state;
[0132] The determining module 502 is specifically used to: determine, based on the exit status of the external platform, that the session connection between the external platform and the third party is in a disconnected state.
[0133] Optionally, the transceiver module 501 is specifically used to: receive transaction information from the third party and process the transaction information;
[0134] The determining module 502 is specifically used to: determine the reason for the failure of the transaction information processing in the event of a failure to process the transaction information;
[0135] The transceiver module 501 is specifically used to: if the reason for the failure of the transaction information processing is a session connection problem, send the first heartbeat request to the third party;
[0136] The transceiver module 501 is specifically used to: if the reason for the failure of the transaction information processing is due to business logic reasons, then transfer the transaction information to the manual platform.
[0137] Optionally, it also includes a display module 503, which is specifically used for:
[0138] The status of the session connection between the external platform and the third party is displayed on the front-end platform.
[0139] Optionally, the transceiver module 501 is further configured to:
[0140] If the session connection between the external platform and the third party is disconnected, a disconnection notification message is sent.
[0141] Based on the same technical concept, embodiments of this application provide a computer device, which may be a terminal or a server, such as... Figure 6 As shown, it includes at least one processor 601 and a memory 602 connected to at least one processor. In this embodiment, the specific connection medium between the processor 601 and the memory 602 is not limited. Figure 6 Taking the connection between the processor 601 and the memory 602 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0142] In this embodiment of the application, the memory 602 stores instructions that can be executed by at least one processor 601. By executing the instructions stored in the memory 602, at least one processor 601 can perform the steps included in the above-described session connection monitoring method.
[0143] The processor 601 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It monitors session connections by running or executing instructions stored in the memory 602 and accessing data stored in the memory 602. Optionally, the processor 601 may include one or more processing units. The processor 601 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0144] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0145] Memory 602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 602 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 602 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 602 may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0146] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described session connection monitoring method.
[0147] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0148] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0150] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0151] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for monitoring session connections, characterized in that, Applied to external platforms, including: After receiving the session connection monitoring instruction sent by the terminal device, a first heartbeat request is sent to the third party. The first heartbeat request includes the external platform being in a connected state. The first heartbeat request is used to request the status of the third party. The session connection monitoring instruction is sent by the terminal device in response to the user's session connection monitoring operation. If a first heartbeat response is received from the third party within the first time period, and the first heartbeat response includes the fact that the third party is in a connected state, then the connection status of the external platform and the connection status of the third party are periodically output to the heartbeat log. Based on the connection status of the external platform and the connection status of the third party, it is determined that the session connection between the external platform and the third party is in a connected state; If the first heartbeat response includes the third party being in a connected state and the external platform being in a disconnected state, then the session connection between the external platform and the third party is in a disconnected state. If a second heartbeat response is received from the third party during the first time period, and the second heartbeat response includes the third party being in an exit state, then based on the exit state of the third party, it is determined that the session connection between the external platform and the third party is in a disconnected state. If the second heartbeat response includes the third party being in an exited state and the external platform being in a disconnected state, then the session connection between the external platform and the third party is in a disconnected state.
2. The method as described in claim 1, characterized in that, Also includes: If no heartbeat response is received from the third party within the first time period, a connection establishment request is sent to the third party. The connection establishment request is used to request the establishment of a session connection between the external platform and the third party. The connection establishment request includes the external platform being logged in. Based on the login status of the external platform, it is determined that the session connection between the external platform and the third party is disconnected.
3. The method as described in claim 1, characterized in that, Also includes: Send a second heartbeat request to the third party, wherein the second heartbeat request includes the external platform being in an exited state; Based on the exit status of the external platform, it is determined that the session connection between the external platform and the third party is disconnected.
4. The method as described in claim 1, characterized in that, Also includes: Receive transaction information from the third party and process the transaction information; In the event that the processing of the transaction information fails, determine the reason for the failure. If the transaction information processing fails due to a session connection issue, then the first heartbeat request is sent to the third party. If the transaction information processing fails due to business logic reasons, the transaction information will be transferred to the manual platform.
5. The method according to any one of claims 1-4, characterized in that, Also includes: The status of the session connection between the external platform and the third party is displayed on the front-end platform.
6. The method as described in claim 5, characterized in that, Also includes: If the session connection between the external platform and the third party is disconnected, a disconnection notification message is sent.
7. A session connection monitoring device, characterized in that, include: The sending module is used to receive a session connection monitoring instruction sent by the terminal device and then send a first heartbeat request to a third party. The first heartbeat request includes the external platform being in a connected state. The first heartbeat request is used to request the status of the third party. The session connection monitoring instruction is sent by the terminal device in response to the user's session connection monitoring operation. The determination module is used to periodically output the connection status of the external platform and the connection status of the third party to the heartbeat log if it receives a first heartbeat response sent by the third party within a first time period, wherein the first heartbeat response includes the third party being in a connected state. Based on the connection status of the external platform and the connection status of the third party, it is determined that the session connection between the external platform and the third party is in a connected state; If the first heartbeat response includes the third party being in a connected state and the external platform being in a disconnected state, then the session connection between the external platform and the third party is in a disconnected state. If a second heartbeat response is received from the third party during the first time period, and the second heartbeat response includes the third party being in an exit state, then based on the exit state of the third party, it is determined that the session connection between the external platform and the third party is in a disconnected state. If the second heartbeat response includes the third party being in an exited state and the external platform being in a disconnected state, then the session connection between the external platform and the third party is in a disconnected state.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the method according to any one of claims 1 to 6.