CN115208937B - Service request processing method and device - Google Patents
Service request processing method and device Download PDFInfo
- Publication number
- CN115208937B CN115208937B CN202210803594.4A CN202210803594A CN115208937B CN 115208937 B CN115208937 B CN 115208937B CN 202210803594 A CN202210803594 A CN 202210803594A CN 115208937 B CN115208937 B CN 115208937B
- Authority
- CN
- China
- Prior art keywords
- connection
- view
- service request
- validity period
- virtual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 31
- 238000000034 method Methods 0.000 claims abstract description 38
- 230000015654 memory Effects 0.000 claims description 22
- 238000004891 communication Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 14
- 230000005540 biological transmission Effects 0.000 claims description 13
- 238000013500 data storage Methods 0.000 claims description 10
- 230000004931 aggregating effect Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 6
- 230000002776 aggregation Effects 0.000 description 5
- 238000004220 aggregation Methods 0.000 description 5
- 230000009977 dual effect Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 208000013738 Sleep Initiation and Maintenance disease Diseases 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 206010022437 insomnia Diseases 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The invention relates to a service request processing method and a service request processing device, wherein the method ensures that the expired service request cannot be executed by maintaining the validity period of a connection view respectively at a client and a server, when the client sends the service request to the server, the service request carries the validity period of the connection view maintained in the client, the server receives the service request, and then determines whether the service request is an expired request or an effective request based on the validity period of the connection view included in the service request and the validity period of the connection view maintained by the server, thereby solving the problem that the expired request reaches the server and possibly is durable in a multi-connection scene.
Description
Technical Field
The disclosure relates to the technical field of communication, and in particular relates to a service request processing method and device.
Background
In a communication scenario, ensuring reliability of communication is often achieved by means of multiple connections. When the multi-connection mode is adopted for communication, when the active connection in use fails, the active connection is switched to the standby connection, and the reliability of communication can be ensured through the multi-connection mode.
However, multiple connections can also present problems, for example, an expired service request may reach the server and be persisted, thereby causing the server to be written with expired data. Therefore, how to solve the problem of the expiration request in the multi-connection scenario is a current urgent problem to be solved.
Disclosure of Invention
In order to solve the technical problems, the present disclosure provides a service request processing method and device.
In a first aspect, the present disclosure provides a service request processing method, including:
receiving a service request sent by a client; the service request comprises an effective period of a first connection view when the request is generated, wherein the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregation of connections respectively established between the client and the server based on a plurality of different communication protocols;
Acquiring the validity period of the second connection view; the second connection view is a state view of the virtual connection maintained by the server;
and comparing the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determining whether the service request is out of date or not based on the comparison result, and determining whether to reject or execute the service request or not based on whether the service request is out of date or not.
In some embodiments, the determining whether the service request expires based on the comparison result, and the rejecting or executing the service request based on whether the service request expires further includes:
If the comparison result indicates that the validity period of the first connection view is earlier than the validity period of the second connection view, determining that the service request is an expiration request, and refusing to execute the service request;
And if the comparison result indicates that the validity period of the first connection view is consistent with the validity period of the second connection view, or the validity period of the first connection view is later than the validity period of the second connection view, determining that the service request is a valid request, and executing the service request.
In some embodiments, the method further comprises:
And when the comparison result indicates that the validity period of the first connection view is later than that of the second connection view, updating the validity period of the second connection view to be consistent with that of the first connection view.
In some embodiments, the service request further includes an identification of the virtual connection; the obtaining the validity period of the second connection view includes:
matching the virtual connection identifier included in the service request with the virtual connection identifier respectively corresponding to each connection view maintained in the server, and determining that the connection view successfully matched is the second connection view; and the validity period of the successfully matched connection view is the validity period of the second connection view.
In some embodiments, the virtual connection comprises: a remote direct data storage connection and a transmission control protocol connection, and the remote direct data storage connection and the transmission control protocol connection employ a cold standby mode.
In a second aspect, the present disclosure provides a service request processing method, including:
Generating a service request, wherein the service request comprises the validity period of a first connection view when the request is generated; the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregation of connections respectively established between the client and the server based on a plurality of different communication protocols;
The service request is sent to a server side, so that the server side obtains a comparison result based on the comparison of the validity period of the first connection view and the validity period of the second connection view, determines whether the service request is out of date based on the comparison result, and then determines whether to reject or execute the service request based on whether the service request is out of date; the second connection view is a state view of the virtual connection maintained by the server.
In some embodiments, the service request further includes the virtual connection identifier, such that the server determines the second connection view based on the virtual connection identifier.
In some embodiments, further comprising:
And when detecting that the active connection between the server side and the virtual connection is switched among a plurality of connections corresponding to the virtual connection, updating the validity period of the first connection view.
In some embodiments, the updating the validity period of the first connection view includes:
and updating the validity period of the first connection view in a self-increasing mode.
In some embodiments, the virtual connection comprises: a remote direct data storage connection and a transmission control protocol connection, and the remote direct data storage connection and the transmission control protocol connection employ a cold standby mode.
In a third aspect, the present disclosure provides a service request processing apparatus, including:
The receiving module is used for receiving a service request sent by the client, wherein the service request comprises the validity period of the first connection view when the request is generated; wherein the first connection view indicates a state of a virtual connection maintained by the client; the virtual connection is formed by aggregation of connections respectively established between the client and the server based on a plurality of different communication protocols;
The acquisition module is used for acquiring the validity period of the second connection view; the second connection view is a state view of the virtual connection maintained by the server;
And the request processing module is used for comparing the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determining whether the service request is out of date or not based on the comparison result, and determining whether to reject or execute the service request or not based on whether the service request is out of date or not.
In a fourth aspect, the present disclosure provides a service request processing apparatus, including:
The generation module is used for generating a service request, wherein the service request comprises the validity period of the first connection view when the request is generated; the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregation of connections respectively established between the client and the server based on a plurality of different communication protocols;
The sending module is used for sending the service request to the service end, so that the service end obtains a comparison result based on the comparison of the validity period of the first connection view and the validity period of the second connection view, determines whether the service request is out of date based on the comparison result, and then determines to reject or execute the service request based on whether the service request is out of date; the second connection view is a state view of the virtual connection maintained by the server.
In a fifth aspect, the present disclosure provides an electronic device comprising: a memory and a processor;
The memory is configured to store computer program instructions;
The processor is configured to execute the computer program instructions to cause the electronic device to implement the service request processing method of any of the first aspect and the first aspect, or to implement the service request processing method of any of the second aspect and the second aspect.
In a sixth aspect, the present disclosure provides a readable storage medium comprising: computer program instructions; at least one processor of the electronic device is configured to execute the computer program instructions such that the electronic device implements the service request handling method of any of the first aspect and the first aspect, or implements the service request handling method of any of the second aspect and the second aspect.
In a seventh aspect, the present disclosure provides a computer program product, which is executed by at least one processor of an electronic device, so that the electronic device implements the service request processing method according to any one of the first aspect and the first aspect, or implements the service request processing method according to any one of the second aspect and the second aspect.
The embodiment of the disclosure provides a service request processing method and device, wherein the method ensures that an expired service request cannot be executed by maintaining the validity period of a connection view respectively at a client and a server, wherein the service request carries the validity period of the connection view maintained in the client when the client sends the service request to the server, the server receives the service request, and then determines whether the service request is an expired request or an effective request based on the validity period of the connection view included in the service request and the validity period of the connection view maintained by the server, thereby solving the problem that the expired request reaches the server and is possibly durable in a multi-connection scene.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1A is a schematic diagram of a conventional service request processing method;
FIG. 1B is a schematic diagram of a sequence corresponding to each request in the scenario shown in FIG. 1A;
fig. 2 is a flow chart of a service request processing method according to an embodiment of the disclosure;
Fig. 3 is a flow chart of a service request processing method according to another embodiment of the disclosure;
FIG. 4A is a schematic diagram of a scenario of a conventional service request processing method;
FIG. 4B is a schematic diagram illustrating a sequence corresponding to each request in the scenario shown in FIG. 4A;
fig. 5A to 5C are schematic views of a scenario of a conventional service request processing method;
Fig. 6A to fig. 6C are schematic diagrams of a scenario of a service request processing method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a service request processing device according to an embodiment of the present disclosure;
Fig. 8 is a schematic structural diagram of a service request processing device according to an embodiment of the present disclosure;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In the distributed storage field, in order to create high-performance storage components, one direction is to explore high-performance communication components, namely remote procedure call (Remote Procedure Call, RPC) components. In the conventional RPC component, the server and the client communicate through a transmission control protocol (Transmission Control Protocol, TCP) based on a kernel, and each communication needs frequent context switching and data copying, so that the data read-write performance of both ends is greatly reduced.
In order to improve the performance of RPC, in a storage oriented RPC component, a communication manner of remote direct data access (Remote Direct Memory Access, RDMA) is generally adopted to reduce the delay of data processing. In addition, the implementation of a network protocol stack is put on the hardware network card from the operating system of the device, so that the overhead of a Central Processing Unit (CPU) of the device and the delay of data in an RPC (remote procedure control) component are greatly reduced.
However, RDMA technology itself has some drawbacks, such as the retransmission mechanism of RDMA, when one intermediate packet is lost, the lost packet and all the packets thereafter need to be retransmitted, which is costly and has a high delay. In order to solve the problem of unstable RDMA network quality, an RDMA/TCP dual-connection switching scheme is proposed, when the bottom RDMA has network faults, the upper RPC judges and switches to TCP connection through fault detection and heartbeat detection, and the RDMA connection is prevented from deteriorating to affect the overall input/output (IO) quality. When the RDMA network returns to normal, the upper layer RPC may switch back to the RDMA connection. Through the double-cut mode, not only can the RDMA network with low delay and high performance be hugged, but also the service quality of the RPC can be ensured by the chain reaction of the worsening of the TCP bottom and the insomnia RDMA.
However, during a dual connection handoff, problems with stale requests (stale request) often occur. An example is illustrated with reference to the embodiment shown in fig. 1A and 1B.
Referring to fig. 1A, in a conventional dual-connection scenario, a dual connection is established between a client and a server: one is an RDMA connection and the other is a TCP connection, and the dual connection adopts a cold standby mode, i.e. only one connection is selected by the upper RPC as an active connection for transmitting data at the same time, and the other connection is used as a standby connection, as in the dual connection scenario shown in fig. 1A, it is assumed that the RDMA connection is an active connection and the TCP connection is a standby connection. When the RDMA connection fails, after the upper RPC detects an exception, the active connection is switched from the RDMA connection to the TCP connection, and the request A originally transmitted on the RDMA connection is retried to be sent through the TCP connection. In some cases, based on upper layer traffic demands, the client may initiate a write generation request B at the same logical block address (lba) and write successfully to the server over the TCP connection. Referring to the time sequence of each request reaching the server shown in fig. 1B, since the retried request a and the new request B are written with the same offset (i.e. the same logical block address), and it is assumed that the server starts reading data from the location of offset=8m, and the data that should be obtained by the request B is obtained, however, the request a that remains in the RDMA connection eventually reaches the server and is persisted, and this problem is that the location of offset=8m is written with the data of the expired request a, i.e. the expired request overwrite problem is stale request overwrite.
In order to solve the above-mentioned problems, the present disclosure provides a service request processing method, apparatus, electronic device, readable storage medium, and computer program, wherein the present disclosure solves stale request overwrite problems by proposing a concept of virtual connection and a validity period (epoch) of a connection state view corresponding to the virtual connection. Specifically, by aggregating multiple connection abstractions of the cold standby mode into one virtual connection and abstracting the state of the virtual connection into a connection view, and representing the validity period of the connection view by epoch, the validity period of the connection view is updated whenever a connection switch occurs. The service end determines whether the service request reaching the service end is out of date or not based on the validity period of the connection view carried in the request and the validity period of the connection view in the latest state maintained by the service end, and then decides to reject or execute the request, thereby solving the problem of stale request overwrite.
It should be noted that the stale request overwrite problem may exist not only in the dual-connection scenario, but also in the scenario of more connections, for example, the scenario of establishing 3 or 4 connections between the client and the server, and the service request processing method provided by the present disclosure is applicable.
The service request processing method provided by the present disclosure will be described in detail below by means of several specific embodiments in conjunction with the accompanying drawings and scenarios.
Fig. 2 is a flow chart of a service request processing method according to an embodiment of the disclosure.
Referring to fig. 2, the method of the present embodiment includes:
S201, a client generates a service request, wherein the service request comprises the validity period of a first connection view, and the first connection view is a state view of virtual connection maintained by the client.
In combination with the foregoing, a plurality of communication connections are established between the client and the server based on different communication protocols, and the plurality of connections adopt a cold standby mode, that is, only one active connection is used for transmitting data, and the other connections are standby connections, so that virtual connections between the client and the server are obtained by aggregating the plurality of connections. For example, an RDMA connection and a TCP connection are established between a client and a server, and the RDMA connection and the TCP connection are in a cold standby mode, and then a virtual connection may be understood to be formed by aggregating the RDMA connection and the TCP connection.
The connection state of the virtual connection can indicate the connection state of each connection in the virtual connection, wherein the connection state comprises: an active connection state or a standby connection state. Abstracting the connection state of the virtual connection into a connection view, configuring an effective period for the connection view, and indicating the connection state condition when the service request is generated through the effective period.
When connection switching occurs, the connection state of the virtual connection will also change, and correspondingly, the validity period corresponding to the connection view is updated in a preset manner, so that the validity periods corresponding to different connection states are different.
In addition, in the method provided by the disclosure, the client and the server respectively maintain connection views of the virtual connection, the connection view of the virtual connection maintained by the client is a first connection view, and the connection view of the virtual connection maintained by the server is a second connection view.
When the client generates the service request, the validity period of the first connection view at the current moment is increased in the service request, so that the connection state of the virtual connection at the service request generation moment can be indicated.
The client may be, but not limited to, a mobile terminal or a PC terminal. The client may trigger generation of a service request in response to a user operation or invocation of other upper layer services, etc. The present disclosure is not limited by the type of client, the implementation of triggering the generation of the service request, and the like.
S202, the client sends a service request to the server. Accordingly, the service end receives the service request.
There are multiple communication connections between the client and the server, and the client sends a service request to the server based on the current active connection.
S203, the server acquires the validity period of a second connection view, wherein the second connection view is a state view of the virtual connection maintained by the server.
The server side generally provides services for one or more clients, multiple connections can be respectively established between the server side and the one or more clients, and after the server side receives the service request, a correct second connection view needs to be identified from one or more virtual connections, so as to ensure the accuracy of a judging result of whether the service request is out of date, and avoid that valid service requests initiated by other clients are refused due to the fact that the validity period of the second connection view is wrong, so that the service requests of other clients need to be retried.
As a possible implementation manner, after the service request is received by the server, the identifier of the virtual connection included in the service request, such as the virtual connection ID, may be obtained by parsing, and matching is performed in each virtual connection maintained by the server based on the virtual connection ID, the virtual connection that is successfully matched is determined to be the virtual connection between the server and the client that initiates the service request, and the validity period of the connection view of the virtual connection that is successfully matched is determined to be the validity period of the second connection view.
S204, the server compares the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determines whether the service request is out of date based on the comparison result, and then determines whether to reject or execute the service request based on whether the service request is out of date.
And comparing the validity periods of the first connection view and the second connection view to obtain a comparison result, wherein the comparison result can indicate the time sequence between the first connection view and the second connection view.
Specifically, if the comparison result indicates that the validity period of the first connection view is earlier than that of the second connection view, determining that the service request is an expiration request, and determining that the service end refuses to execute the service request; if the comparison result indicates that the validity period of the first connection view is consistent with the validity period of the second connection view, or the validity period of the first connection view is later than the validity period of the second connection view, determining that the service request is a valid request, namely not expired, and executing the service request.
According to the method, when the client and the server respectively maintain the validity periods of the connection views, and the client sends the service request to the server, the service request carries the validity periods of the connection views maintained in the client, the server receives the service request, and then, based on the validity periods of the connection views included in the service request and the validity periods of the connection views maintained by the server, the service request is determined to be an expired request or an effective request, and the expired service request is ensured not to be executed, so that the problem that the expired request reaches the server and possibly is durable in a multi-connection scene is solved.
Fig. 3 is a flowchart illustrating a service request processing method according to another embodiment of the present disclosure. The embodiment further includes, based on the embodiment shown in fig. 2:
And S205, when the comparison result indicates that the validity period of the first connection view is later than that of the second connection view, the service end updates the validity period of the second connection view to be consistent with that of the first connection view.
Because the validity periods of the connection views are maintained in the client and the server respectively, one party of data is usually required to be selected as source data, in the scheme, the data of the client is used as source data, therefore, when the server determines that the validity period of the first connection view is later than or higher than the validity period of the second connection view through a comparison result, the client is indicated to have updated the validity period of the connection view, and the server needs to synchronously update, so that the validity period of the second connection view is updated to be consistent with the validity period of the first connection view by the server, the information at both ends of the client and the server is ensured to be synchronous, the follow-up request can be accurately processed, and the problem that the request is misjudged as an expiration request and execution is refused is avoided.
In a specific embodiment, taking the case that the client and the server establish dual connection as an example, the method provided by the present disclosure is illustrated. Wherein, the double connection is respectively: RDMA connections and TCP connections.
Referring to fig. 4A, assuming that a current active connection between a client and a server is an RDMA connection, a standby connection is a TCP connection, an initialization state is set, the client and the server maintain validity periods of connection views respectively, wherein the validity period of connection views maintained by the client is denoted as T (c), the validity period of connection views maintained by the server is denoted as T(s), and the initialization state T (c) =t(s) =0, the client sends a request 1 to the server through the RDMA connection, the request 1 carries T (c) =0, the RDMA link of the request 1 fails during transmission, the active connection between the client and the server is switched from the RDMA connection to the TCP connection, the client updates T (c) =1, and sends a retry request 1 through the TCP connection, the retry request 1 carries updated T (c) =1, the retry request 1 is sent to the server through the TCP connection, the server compares T(s) =0 and T (c) =1, and determines that T(s) is less than T (c) =1, and the retry request 1 is executed. And the server updates T(s) =t (c) =1.
After the retried request 1 reaches the server, the client may write a new data generation request 2 into the logical block address corresponding to the retried request 1, and send the new data generation request 2 to the server through the TCP connection, where the server processes the request 2.
When the request 1 transmitted by the original RDMA connection reaches the server, the server compares T(s) =1 with T (c) =0, and determines that the request 1 is an expired request, and then refuses to execute the expired request 1.
Referring to fig. 4B, according to the chronological order, the request 1 written in the same logical block address, the request 1 retried, and the request 2 retried are executed by the server to obtain corresponding results, and the request 1 initially transmitted through the RDMA connection is determined as an expired request to be rejected by the server.
Similarly, if the subsequent RDMA connection is restored, the RDMA connection may be switched as an active connection, and then the update T (c) =2 may be triggered, the retry request sent by the client and the new service request may both carry T (c) =2, and the server may determine whether the request expires according to T(s) and T (c), refuse to execute the service request with a low validity period, and ensure the accuracy of the latest data.
In an actual application scenario, interactions between multiple clients and multiple servers establish multiple connections, and if switching of each connection triggers updating of the validity period of a connection view, multiple virtual connections interfere with each other, so that service requests on other virtual connections are unnecessarily retried.
As shown in fig. 5A, in the initial state, RDMA connection and TCP connection are respectively established between the client 1 and the client 2 and the server 1, and initial T (c) =0 corresponding to the client 1 and the client 2 respectively, when the RDMA connection failure of the client 1 results in active connection switching, T (c) of the client 1 increases to 1, and a subsequent request of the client 1 carries updated T (c) =1. Referring to fig. 5B, T (c) =0 carried by the service request sent by the client 2. Referring to fig. 5C, the service request sent by the client 1 arrives at the server first, and the server compares T(s) < T (C), and updates T(s) =t (C) =1, so when the server processes the service request of the client 2, compares T(s) =1 with T (C) =0 sent by the client 2, and compares T(s) > T (C) with T(s) > T (C), the service request sent by the client 2 is refused to be executed, which results in the service request of the client 2 to be retried, which obviously causes additional network overhead and resource waste.
In conjunction with the description of the embodiment shown in fig. 1, to solve this problem, the scheme solves the interference between different clients and servers by configuring an identifier for a virtual connection to uniquely distinguish the virtual connection, and restricting the self-increase of the validity period of a connection view corresponding to the virtual connection and the processing of a service request in the virtual connection.
Wherein the identification of the virtual connection may be, but is not limited to, a numerical number, a combination of characters and numbers, or the like.
Referring to fig. 6A, in the initial state, RDMA connection and TCP connection are respectively established between the client 1 and the client 2 and the server 1, an initial T (c 1) =0 corresponding to the client 1, an initial T (c 2) =0 corresponding to the client 2, an initial T (s 1) =0 corresponding to the client 1 and an initial T (s 2) =0 corresponding to the client 1 in the server.
Assuming that the RDMA connection failure of client 1 results in an active connection switch, T (c 1) of client 1 self-increases to 1, and the subsequently sent request of client 1 carries updated T (c 1) =1. Referring to fig. 6B, T (c 2) =0 carried by the service request sent by the client 2. Referring to fig. 6C, the retried service request sent by the client 1 arrives at the server first, and the server compares and discovers T (s 1) < T (C1), updates T (s 1) =t (C1) =1, and processes the service request sent by the client 1.
The service request sent by the client 2 carries T (c 2) =0, and if the service end compares T (s 2) =t (c 2) =0, the service request sent by the client 2 is executed. If the client 2 performs connection switching, the self-increment update of T (c 2) and the self-increment update of T (s 2) are triggered, and the influence on T (s 1) and T (c 1) is avoided.
Therefore, through the identification of each virtual connection, the service requests sent by the clients can be mutually independent, interference is avoided, the service requests are ensured to be correctly processed, and network overhead and resource waste are also avoided.
Fig. 7 is a schematic structural diagram of a service request processing device according to an embodiment of the disclosure.
Referring to fig. 7, an apparatus 700 provided in this embodiment includes:
A receiving module 701, configured to receive a service request sent by a client, where the service request includes an expiration date of a first connection view when the request is generated; wherein the first connection view indicates a state of a virtual connection maintained by the client; the virtual connection is formed by aggregation of connections respectively established between the client and the server based on a plurality of different communication protocols.
An obtaining module 702, configured to obtain an expiration date of the second connection view; the second connection view is a state view of the virtual connection maintained by the server.
The request processing module 703 is configured to compare the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determine whether the service request is expired based on the comparison result, and determine to reject or execute the service request based on whether the service requirement is expired.
In some embodiments, the request processing module 703 is specifically configured to determine that the service request is an expired request and refuse to execute the service request if the comparison result indicates that the validity period of the first connection view is earlier than the validity period of the second connection view; and if the comparison result indicates that the validity period of the first connection view is consistent with the validity period of the second connection view, or the validity period of the first connection view is later than the validity period of the second connection view, determining that the service request is a valid request, and executing the service request.
In some embodiments, further comprising: and an updating module 704, configured to update the validity period of the second connection view to be consistent with the validity period of the first connection view when the comparison result indicates that the validity period of the first connection view is later than the validity period of the second connection view.
In some embodiments, the service request further includes an identification of the virtual connection; the obtaining module 702 is specifically configured to match the virtual connection identifier included in the service request with a virtual connection identifier corresponding to each connection view maintained in the server, and determine that a connection view that is successfully matched is the second connection view; and the validity period of the successfully matched connection view is the validity period of the second connection view.
In some embodiments, the virtual connection comprises: remote direct data storage connection and transmission control protocol connection.
The device provided in this embodiment may be used to implement the technical solution implemented by the service end in any of the foregoing method embodiments, and the implementation principle and the technical effects are similar, and may refer to the detailed description of the foregoing method embodiments, which is omitted herein for brevity.
Fig. 8 is a schematic structural diagram of a service request processing device according to an embodiment of the disclosure.
Referring to fig. 8, an apparatus 800 provided in this embodiment includes:
A generating module 801, configured to generate a service request, where the service request includes an expiration date of a first connection view when the request is generated; the first connection view is a state view of virtual connection maintained by the client; the virtual connection is obtained by aggregating the connections respectively established between the client and the server based on a plurality of different communication protocols.
A sending module 802, configured to send the service request to the server, so that the server obtains a comparison result based on the comparison between the validity period of the first connection view and the validity period of the second connection view, determines whether the service request is expired based on the comparison result, and determines to reject or execute the service request based on whether the service requirement is expired; the second connection view is a state view of the virtual connection maintained by the server.
In some embodiments, the service request further includes the virtual connection identifier, such that the server determines the second connection view based on the virtual connection identifier.
In some embodiments, further comprising: and the updating module 803 is configured to update the validity period of the first connection view when it is detected that an active connection with the server switches between a plurality of connections included in the virtual connection.
In some embodiments, the updating module 803 is configured to update the validity period of the first connection view in a self-increasing manner.
In some embodiments, the virtual connection comprises: remote direct data storage connection and transmission control protocol connection.
The device provided in this embodiment may be used to implement the technical solution implemented by the client in any of the foregoing method embodiments, and the implementation principle and the technical effects are similar, and may refer to the detailed description of the foregoing method embodiments, which is omitted herein for brevity.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring to fig. 9, an electronic device 900 provided in this embodiment includes: a memory 901 and a processor 902.
The memory 901 may be a separate physical unit, and may be connected to the processor 902 through the bus 903. The memory 901 and the processor 902 may be integrated, implemented by hardware, or the like.
The memory 901 is configured to store program instructions, and the processor 902 invokes the program instructions to execute the service request processing method executed by the server or the client in any of the above method embodiments.
Alternatively, when some or all of the methods of the above embodiments are implemented by software, the electronic device 900 may include only the processor 902. The memory 901 for storing a program is located outside the electronic device 900, and the processor 902 is connected to the memory through a circuit/wire for reading and executing the program stored in the memory.
The processor 902 may be a central processor (central processing unit, CPU), a network processor (network processor, NP) or a combination of CPU and NP.
The processor 902 may further comprise a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (FPGA) GATE ARRAY, generic array logic (GENERIC ARRAY logic, GAL), or any combination thereof.
Memory 901 may include volatile memory (RAM), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a hard disk (HARD DISK DRIVE, HDD) or a solid state disk (solid-state drive (SSD); the memory may also comprise a combination of the above types of memories.
The present disclosure also provides a readable storage medium comprising: computer program instructions which, when executed by at least one processor of an electronic device, cause the electronic device to implement a service request processing method performed by a server or a client in any of the method embodiments described above.
The present disclosure also provides a computer program product which, when run on a computer, causes the computer to implement a service request processing method performed by a server or a client in any of the method embodiments above.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (15)
1. A service request processing method, comprising:
receiving a service request sent by a client; the service request comprises an effective period of a first connection view when the request is generated, wherein the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregating connections respectively established between the client and the server based on a plurality of different communication protocols, the connection state of the virtual connection can indicate the connection state of each connection in the virtual connection, the connection state comprises an active connection state or a standby connection state, the first connection view is obtained by abstracting the connection state of the virtual connection, and the validity period is equal to the total times of switching the virtual connection by the client;
Acquiring the validity period of the second connection view; the second connection view is a state view of the virtual connection maintained by the server;
and comparing the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determining whether the service request is out of date or not based on the comparison result, and determining whether to reject or execute the service request or not based on whether the service request is out of date or not.
2. The method of claim 1, wherein determining whether the service request is expired based on the comparison, and determining to reject or execute the service request based on whether the service request is expired, comprises:
If the comparison result indicates that the validity period of the first connection view is earlier than the validity period of the second connection view, determining that the service request is an expiration request, and refusing to execute the service request;
And if the comparison result indicates that the validity period of the first connection view is consistent with the validity period of the second connection view, or the validity period of the first connection view is later than the validity period of the second connection view, determining that the service request is a valid request, and executing the service request.
3. The method according to claim 1, wherein the method further comprises:
And when the comparison result indicates that the validity period of the first connection view is later than that of the second connection view, updating the validity period of the second connection view to be consistent with that of the first connection view.
4. A method according to any of claims 1 to 3, wherein the service request further comprises an identification of the virtual connection; the obtaining the validity period of the second connection view includes:
matching the identifier of the virtual connection included in the service request with the identifiers of the virtual connections respectively corresponding to the connection views maintained in the server, and determining that the connection view successfully matched is the second connection view; and the validity period of the successfully matched connection view is the validity period of the second connection view.
5. A method according to any one of claims 1 to 3, wherein the virtual connection comprises: a remote direct data storage connection and a transmission control protocol connection, and the remote direct data storage connection and the transmission control protocol connection employ a cold standby mode.
6. A service request processing method, comprising:
Generating a service request, wherein the service request comprises the validity period of a first connection view when the request is generated; the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregating connections respectively established between the client and the server based on a plurality of different communication protocols, the connection state of the virtual connection can indicate the connection state of each connection in the virtual connection, the connection state comprises an active connection state or a standby connection state, the first connection view is obtained by abstracting the connection state of the virtual connection, and the validity period is equal to the total times of switching the virtual connection by the client;
The service request is sent to a server side, so that the server side obtains a comparison result based on the comparison of the validity period of the first connection view and the validity period of the second connection view, determines whether the service request is out of date based on the comparison result, and then determines whether to reject or execute the service request based on whether the service request is out of date; the second connection view is a state view of the virtual connection maintained by the server.
7. The method of claim 6, wherein the service request further includes an identification of the virtual connection, such that the server determines the second connection view based on the identification of the virtual connection.
8. The method as recited in claim 6, further comprising:
And when detecting that the active connection with the service end is switched among a plurality of connections included in the virtual connection, updating the validity period of the first connection view.
9. The method of claim 8, wherein the updating the validity period of the first connection view comprises:
and updating the validity period of the first connection view in a self-increasing mode.
10. The method according to any of claims 6 to 9, wherein the virtual connection comprises: a remote direct data storage connection and a transmission control protocol connection, and the remote direct data storage connection and the transmission control protocol connection employ a cold standby mode.
11. A service request processing apparatus, comprising:
The receiving module is used for receiving a service request sent by the client, wherein the service request comprises the validity period of the first connection view when the request is generated; wherein the first connection view indicates a status view of a virtual connection maintained by the client; the virtual connection is formed by aggregating connections respectively established between the client and the server based on a plurality of different communication protocols, the connection state of the virtual connection can indicate the connection state of each connection in the virtual connection, the connection state comprises an active connection state or a standby connection state, the first connection view is obtained by abstracting the connection state of the virtual connection, and the validity period is equal to the total times of switching the virtual connection by the client;
The acquisition module is used for acquiring the validity period of the second connection view; the second connection view is a state view of the virtual connection maintained by the server;
And the request processing module is used for comparing the validity period of the first connection view with the validity period of the second connection view to obtain a comparison result, determining whether the service request is out of date or not based on the comparison result, and determining whether to reject or execute the service request or not based on whether the service request is out of date or not.
12. A service request processing apparatus, comprising:
The generation module is used for generating a service request, wherein the service request comprises the validity period of the first connection view when the request is generated; the first connection view is a state view of virtual connection maintained by the client; the virtual connection is formed by aggregating connections respectively established between the client and the server based on a plurality of different communication protocols, the connection state of the virtual connection can indicate the connection state of each connection in the virtual connection, the connection state comprises an active connection state or a standby connection state, the first connection view is obtained by abstracting the connection state of the virtual connection, and the validity period is equal to the total times of switching the virtual connection by the client;
The sending module is used for sending the service request to the service end, so that the service end obtains a comparison result based on the comparison of the validity period of the first connection view and the validity period of the second connection view, determines whether the service request is out of date based on the comparison result, and then determines to reject or execute the service request based on whether the service request is out of date; the second connection view is a state view of the virtual connection maintained by the server.
13. An electronic device, comprising: a memory and a processor;
The memory is configured to store computer program instructions;
the processor is configured to execute the computer program instructions to cause the electronic device to implement the service request processing method of any one of claims 1 to 5, or any one of claims 6 to 10.
14. A readable storage medium, comprising: computer program instructions;
At least one processor of an electronic device executing the computer program instructions causes the electronic device to implement the service request processing method according to any one of claims 1 to 5, or any one of claims 6 to 10.
15. A computer program product, characterized in that the computer program product, when executed by an electronic device, causes the electronic device to implement the service request processing method according to any of claims 1 to 5, or any of claims 6 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210803594.4A CN115208937B (en) | 2022-07-07 | 2022-07-07 | Service request processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210803594.4A CN115208937B (en) | 2022-07-07 | 2022-07-07 | Service request processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115208937A CN115208937A (en) | 2022-10-18 |
CN115208937B true CN115208937B (en) | 2024-08-20 |
Family
ID=83580070
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210803594.4A Active CN115208937B (en) | 2022-07-07 | 2022-07-07 | Service request processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115208937B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022333A (en) * | 2018-01-09 | 2019-07-16 | 阿里巴巴集团控股有限公司 | The communication means and device of distributed system |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2002311585A1 (en) * | 2002-06-06 | 2003-12-22 | Crescendo Networks Ltd. | System and method for connecting multiple slow connections to multiple fast connections |
CN100411360C (en) * | 2006-06-30 | 2008-08-13 | 迈普(四川)通信技术有限公司 | Multi-network converged network management method |
US8560694B2 (en) * | 2008-02-01 | 2013-10-15 | Microsoft Corporation | Virtual application server with version control |
US8543608B2 (en) * | 2009-09-10 | 2013-09-24 | Oracle International Corporation | Handling of expired web pages |
US8463887B2 (en) * | 2009-12-23 | 2013-06-11 | Citrix Systems, Inc. | Systems and methods for server surge protection in a multi-core system |
US9483312B2 (en) * | 2010-08-16 | 2016-11-01 | International Business Machines Corporation | Locating service endpoints from a service registry |
US10084754B2 (en) * | 2015-12-11 | 2018-09-25 | Microsoft Technology Licensing, Llc | Virtual private network aggregation |
WO2019023976A1 (en) * | 2017-08-02 | 2019-02-07 | 福建联迪商用设备有限公司 | Service data processing method, client, server, and system |
CN109379193B (en) * | 2018-12-06 | 2021-06-29 | 佛山科学技术学院 | Dynamic replay attack prevention authentication method and device |
CN111125057B (en) * | 2019-12-05 | 2022-08-19 | 江苏苏宁物流有限公司 | Method and device for processing service request and computer system |
CN111343093B (en) * | 2020-02-28 | 2021-07-09 | 腾讯科技(深圳)有限公司 | Service data transmission method and device |
CN111556130B (en) * | 2020-04-24 | 2022-10-25 | 北京奇艺世纪科技有限公司 | Information processing method and device, electronic equipment and storage medium |
CN113114662B (en) * | 2021-04-08 | 2023-07-04 | 北京顶象技术有限公司 | Method and device for processing concurrent request by single TCP connection |
CN113761294B (en) * | 2021-09-10 | 2023-03-24 | 北京火山引擎科技有限公司 | Data management method, device, storage medium and electronic equipment |
CN114679434B (en) * | 2022-05-27 | 2022-08-26 | 武汉中科通达高新技术股份有限公司 | Session message processing system, method, computer device and storage medium |
-
2022
- 2022-07-07 CN CN202210803594.4A patent/CN115208937B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022333A (en) * | 2018-01-09 | 2019-07-16 | 阿里巴巴集团控股有限公司 | The communication means and device of distributed system |
Also Published As
Publication number | Publication date |
---|---|
CN115208937A (en) | 2022-10-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7797565B1 (en) | System and method for maintaining communication protocol connections during failover | |
EP3839749B1 (en) | Data storage method, device and server | |
US20190196728A1 (en) | Distributed storage system-based data processing method and storage device | |
JP3932994B2 (en) | Server handover system and method | |
CN112015811B (en) | Method, node and computing device for node management of blockchain systems | |
CN110460412B (en) | Method and RDMA network card for data transmission | |
CN111626858A (en) | Processing method and device for transaction, electronic equipment and computer readable medium | |
US9344363B2 (en) | Information processing system, relay device, information processing device, and information processing method | |
US7831686B1 (en) | System and method for rapidly ending communication protocol connections in response to node failure | |
US11638134B2 (en) | Methods, systems, and computer readable media for resource cleanup in communications networks | |
CN110870286B (en) | Fault tolerance processing method and device and server | |
CN113986501A (en) | Real-time database API (application program interface) uninterrupted calling method, system, storage medium and server | |
US11240302B1 (en) | Live migration of log-based consistency mechanisms for data stores | |
US7689702B1 (en) | Methods and apparatus for coordinating processing of network connections between two network protocol stacks | |
CN115208937B (en) | Service request processing method and device | |
CN112437155B (en) | Service data processing method and device and server device | |
CN117336346A (en) | IPPBX and PMS docking state conversion method, terminal equipment and medium | |
US20230039817A1 (en) | Node Control Method, System, and Apparatus | |
CN108206823B (en) | Method, system and network equipment for processing message | |
CN113626139B (en) | High-availability virtual machine storage method and device | |
CN112100556B (en) | Method and system for optimizing message pushing mode | |
CN113676894B (en) | Service processing method and equipment | |
CN112131185B (en) | Method and device for high availability of service in super-fusion distributed storage node | |
CN116804908A (en) | Data reading and writing method, device, storage node and storage medium | |
CN109254853B (en) | Data sharing method, data sharing system and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |