Request processing method, device, system, equipment, medium and product

By using the request queue and the central processor on the server, the delay problem in the client and server request processing process is solved, and low-latency and high-versatility request processing is achieved, which is suitable for distributed storage systems.

CN120567933APending Publication Date: 2025-08-29TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510629609.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

In the prior art, the delay is high in the process of request processing between the client and the server, especially when the CPU needs to intervene in processing request queues and execution, resulting in a long response time.

Method used

The network card is used to receive client requests and add them to the request queue. According to the request type field, whether the processing result value needs to be returned, and directly return a reply signal to the client to confirm that the request is completed, reducing the delay of requests without result values; the central processor cycles through the request queue, and generates a reply message only when the result value needs to be returned, reducing CPU load.

Benefits of technology

It realizes low latency and high universality, takes into account the efficiency and flexibility of request processing, reduces latency of resultless requests, reduces CPU load, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120567933A_ABST
    Figure CN120567933A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and particularly provides a request processing method, device, system and equipment, a medium and a product. The method comprises the steps that a network card receives a processing request from a client, adds the processing request into a request queue, and returns a reply signal to the client if it is determined that a processing result value does not need to be returned for the processing request according to a request type field carried by the processing request, the client confirms that the processing request is completed based on the reply signal and releases related resources occupied by the processing request; the central processing unit executes corresponding processing for each processing request in the request queue; and if it is determined that a corresponding processing result value needs to be returned for the processing request, returning a reply message containing the processing result value to the client from which the processing request comes. Therefore, low delay and universality of request processing can be considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, system, device, medium, and product for request processing. Background Art

[0002] In some communication scenarios, the client and the server exchange data through a request processing mechanism. In related technologies, the client and the server usually use Remote Procedure Call (RPC) to exchange data.

[0003] Specifically, the client sends a request to the server. The server's central processing unit (CPU) processes each request in turn and, after completing each request, returns a response to the client based on the result. Upon receiving the response from the server, the client determines that the request is complete and releases the resources used by the request.

[0004] However, using this approach, the entire request processing process (i.e., from the client sending the request until the client receives the reply) requires the server's CPU intervention (including CPU request queuing and request execution), resulting in high latency. Summary of the Invention

[0005] To solve the above technical problems, embodiments of the present application provide a method, apparatus, system, device, medium, and product for request processing.

[0006] On the one hand, an embodiment of the present application provides a request processing method, which is applied to a server, the server including a network card and a central processing unit, and the method includes:

[0007] The network card receives a processing request from the client and adds the processing request to a request queue. If it is determined based on the request type field carried in the processing request that no processing result value needs to be returned for the processing request, the network card returns a reply signal to the client, so that the client confirms the completion of the processing request based on the reply signal and releases the related resources occupied by the processing request.

[0008] The central processing unit performs corresponding processing for each processing request in the request queue; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

[0009] In one embodiment, adding a processing request to a request queue includes:

[0010] Insert the processing request into the tail of the request queue;

[0011] The queue length of the request queue is updated to determine whether there is a processing request in the request queue according to the queue length.

[0012] In one embodiment, for each processing request in the request queue, executing corresponding processing includes:

[0013] The following steps are executed in a loop:

[0014] If the queue length of the request queue is greater than zero, the first processing request at the head of the request queue is taken out;

[0015] Update the queue length of the request queue;

[0016] Call the function corresponding to the first processing request to execute the first processing request.

[0017] In one embodiment, if it is determined based on the request type field carried in the processing request that a processing result value does not need to be returned for the processing request, a reply signal is returned to the client, including:

[0018] Get the request type field and request ID in the processing request; the request ID is used to identify the processing request;

[0019] If it is determined based on the request type field that the processing request has no processing result value, a reply signal including the request identifier is returned to the corresponding client.

[0020] In one embodiment, the method further comprises:

[0021] The request queue is stored in a persistent storage device on the server side so that the request queue can be loaded from the persistent storage device after the system crashes and restarts.

[0022] On the one hand, an embodiment of the present application provides a request processing device, which is applied to a server, the server including a network card and a central processing unit, and the device includes:

[0023] a receiving unit, configured to receive a processing request from a client through a network card, add the processing request to a request queue, and, if it is determined, based on a request type field carried in the processing request, that no processing result value needs to be returned for the processing request, return a reply signal to the client, so that the client confirms completion of the processing request based on the reply signal and releases related resources occupied by the processing request;

[0024] The processing unit is used to perform corresponding processing for each processing request in the request queue through the central processing unit; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

[0025] In one embodiment, the receiving unit is configured to:

[0026] Insert the processing request into the tail of the request queue;

[0027] The queue length of the request queue is updated to determine whether there is a processing request in the request queue according to the queue length.

[0028] In one embodiment, the processing unit is configured to:

[0029] The following steps are executed in a loop:

[0030] If the queue length of the request queue is greater than zero, the first processing request at the head of the request queue is taken out;

[0031] Update the queue length of the request queue;

[0032] Call the function corresponding to the first processing request to execute the first processing request.

[0033] In one embodiment, the processing unit is configured to:

[0034] Get the request type field and request ID in the processing request; the request ID is used to identify the processing request;

[0035] If it is determined based on the request type field that the processing request has no processing result value, a reply signal including the request identifier is returned to the corresponding client.

[0036] In one embodiment, the receiving unit is further configured to:

[0037] The request queue is stored in a persistent storage device on the server side so that the request queue can be loaded from the persistent storage device after the system crashes and restarts.

[0038] On the one hand, an embodiment of the present application provides a distributed storage system, including a server and at least one client;

[0039] The server is configured to: execute the steps of the method provided in any of the above-mentioned optional implementations of request processing;

[0040] Each client is used to: send a processing request to the server, and when receiving a reply signal or reply message returned by the server based on the processing request, confirm that the processing request is completed and release the relevant resources occupied by the processing request.

[0041] In one aspect, an embodiment of the present application provides an electronic device, including:

[0042] processor; and

[0043] The memory stores computer instructions, where the computer instructions are used to cause the processor to execute the steps of the method provided in any of the various optional implementations of any of the request processing methods described above.

[0044] On the one hand, an embodiment of the present application provides a computer-readable storage medium storing computer instructions, which are used to enable a computer to execute the steps of the method provided in various optional implementations of any of the above request processing.

[0045] On the one hand, an embodiment of the present application provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the steps of the method provided in various optional implementations of any of the above-mentioned request processing.

[0046] The request processing method in the embodiment of the present application includes a network card receiving a processing request from a client and adding the processing request to a request queue, and if it is determined based on the request type field carried by the processing request that there is no need to return a processing result value for the processing request, then a reply signal is returned to the client, so that the client confirms the completion of the processing request based on the reply signal and releases the relevant resources occupied by the processing request; the central processing unit performs corresponding processing for each processing request in the request queue; if it is determined that a corresponding processing result value needs to be returned for the processing request, then a reply message containing the processing result value is returned to the client from which the processing request originated. In this way, both low latency and versatility of request processing can be taken into account. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is an example diagram of a distributed storage system in an embodiment of the present application.

[0048] Figure 2 This is a flowchart of a request processing method in an embodiment of the present application.

[0049] Figure 3 This is an example diagram of a timing sequence of request processing in an embodiment of the present application.

[0050] Figure 4 This is a structural block diagram of a request processing device in an embodiment of the present application.

[0051] Figure 5 It is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solutions of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0053] In distributed storage systems, clients and servers can typically interact with each other in a variety of ways. One related technology uses RPC (Remote Procedure Call) for data exchange. Specifically, a client sends a request to a server. The server's CPU processes each request and returns a response based on the results. Upon receiving the response from the server, the client determines that the request has been processed, freeing up resources associated with the request.

[0054] However, using this approach, the entire request processing process (i.e., from the client sending a request until the client receives a reply) requires the intervention of the server's CPU (including CPU request queuing and request execution). Each request needs to be processed by the CPU before the corresponding reply can be returned. Therefore, when there are many requests, the response time of many requests is long and the latency is high.

[0055] Another related technology uses single-sided primitives based on Remote Direct Memory Access (RDMA) for data exchange. Specifically, the client sends a single-sided primitive, WRITE / READ. The server receives and executes the WRITE / READ primitive via the network interface controller (NIC), and returns the result to the client.

[0056] However, this approach relies on a pre-agreed memory layout and cannot execute complex request logic (such as data query and conditional update). It is difficult to adapt to business scenarios that require logical calculations and has a limited scope of application.

[0057] Based on the defects of the above-mentioned related technologies, the embodiments of the present application provide a method, device, system, equipment, medium and product for request processing, aiming to achieve low latency in request processing.

[0058] A method for request processing is provided in an embodiment of the present application. The method can be applied to electronic devices. The present application does not limit the type of electronic device. It can be any type of device suitable for implementation, such as a server, etc. The present application will not elaborate on this.

[0059] In an application scenario, a request processing method provided in an embodiment of the present application is applied to a distributed storage system, which may include at least one server and at least one client.

[0060] See Figure 1 The figure shows an example diagram of a distributed storage system. Figure 1 The distributed storage system including a server and multiple terminal devices is used as an example for description. The server is provided with a server. The terminal devices are provided with a client.

[0061] The client is used to send a processing request to the server and receive a reply signal or a reply message returned by the server based on the processing request.

[0062] The server includes a network card and a CPU. The network card is used to receive processing requests from the client and add the received processing requests to the request queue. If, based on the request type field carried by the processing request, it is determined that there is no need to return a processing result value for the processing request (i.e., there will be no processing result value after the processing request is executed), a reply signal is returned to the client. The CPU is used to perform corresponding processing for each processing request in the request queue. If it is determined that a corresponding processing result value needs to be returned for the processing request (i.e., there will be a processing result value after the processing request is executed), a reply message containing the processing result value is returned to the client from which the processing request originated.

[0063] Optionally, the server may also include a persistent storage device. The request queue may be stored in the persistent storage device or in the server's memory.

[0064] See Figure 2 FIG. 1 is a flowchart of a request processing method in an embodiment of the present application, which is applied to Figure 1 In the server, the following is combined Figure 1 The method is described below. The specific implementation process of the method is as follows:

[0065] Step 201: The network card receives a processing request from the client and adds the processing request to the request queue. If it is determined based on the request type field carried by the processing request that there is no need to return a processing result value for the processing request, a reply signal is returned to the client, so that the client confirms the completion of the processing request based on the reply signal and releases the relevant resources occupied by the processing request.

[0066] In one embodiment, when executing step 201, the network card may perform the following steps:

[0067] S2011: Receive a processing request from a client.

[0068] In one embodiment, the client sends a processing request to the server, and a network card in the server receives the processing request.

[0069] S2012: Add the processing request to the request queue.

[0070] In one implementation, the processing request is inserted into the tail of the request queue; the queue length of the request queue is updated to determine whether there is a processing request in the request queue based on the queue length.

[0071] In actual applications, you can also set the request queue insertion method or select other request queuing methods according to the actual application scenario, which is not limited here.

[0072] Furthermore, the request queue may be stored in the server's memory or persistent storage device.

[0073] In one embodiment, the request queue is stored in a persistent storage device in the server, so that the request queue is loaded from the persistent storage device after the system crashes and restarts.

[0074] As an example, after a server crashes and restarts, it scans all processing requests in the request queue from the persistent storage device and executes each processing request in sequence.

[0075] S2013: If it is determined, based on the request type field carried in the processing request, that there is no need to return a processing result value for the processing request, a reply signal is returned to the client.

[0076] In one embodiment, the request type field and request identifier in the processing request are obtained. If it is determined based on the request type field carried by the processing request that there is no need to return a processing result value for the processing request, a reply signal including the request identifier is returned to the client.

[0077] The request type field can be used to determine whether a processing request contains a processing result value. The request identifier uniquely identifies the processing request. The reply signal is generated by the network card and is a special network packet. The reply signal contains the identifier of the processing request (i.e., the request identifier). After receiving the reply signal, the client can determine the processing request based on the request identifier in the reply signal.

[0078] In this way, the client sends a processing request to the server. If the processing request does not need to return a processing result value, it waits for the reply signal of the network card. Otherwise, the CPU returns the processing result value. Among them, the processing result value can also be called a return value.

[0079] Step 202: The central processing unit performs corresponding processing for each processing request in the request queue; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

[0080] In one embodiment, when executing step 202, the following steps may be performed:

[0081] S2021: The central processing unit executes corresponding processing for each processing request in the request queue.

[0082] In one embodiment, the following steps are performed in a loop:

[0083] If the queue length of the request queue is greater than zero, the first processing request at the head is taken out from the request queue; the queue length of the request queue is updated; and the function corresponding to the first processing request is called to execute the first processing request.

[0084] Among them, the request queue supports three operations: insertion operation, removal operation and length operation.

[0085] The insert operation is used to insert a processing request at the end of the request queue. The remove operation is used to return (i.e., remove) the processing request at the head of the request queue and delete the request from the request queue. The length operation is used to return (i.e., output) the number of requests in the request queue (i.e., the queue length).

[0086] S2022: If it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message including the processing result value is returned to the client from which the processing request originated.

[0087] In one implementation, if it is determined that a processing result value is obtained after executing the processing request, a reply message including the processing result value and a request identifier is returned to the corresponding client.

[0088] Furthermore, after receiving the reply message returned by the server, the client determines that the processing request is completed and releases the related resources occupied by the processing request.

[0089] See Figure 3 The following is an example of a request processing sequence diagram. Figure 3 The following example illustrates the method for processing the above request. Figure 3 In this scenario, the server includes a network card and CPU, and stores request queues and data. The server stores data in key-value pairs. The network card receives and processes requests from the same or different clients.

[0090] The processing request sent by the client to the server can include two types of requests, namely set and get. Set is used to perform data updates, that is, to persistently update the stored value (value) mapped by the specified key (key) to the given parameter. This operation is a stateless change and does not generate any return value after execution. For example, set<k,a> It means to update the value of the data with key k to a. There is no return value after execution. get is used to perform data query. This operation retrieves the corresponding stored value by key and returns the query result (i.e. return value) to the client as a response. This operation has an explicit data return feature. For example, get <k>It means reading the value corresponding to the data with key k and returning it to the client, so this request has a return value.

[0091] The following describes the server's request processing process in chronological order.

[0092] Time t0: The request queue is empty and the server stores key-value pairs<k,v0> .

[0093] Time t1: The network card receives a request set sent by a client<k,v1> , and insert it to the tail of the request queue; since set has no return value, the network card directly returns a reply signal to the client; when the client receives the reply signal, it can ensure that the request is completed and release the related resources occupied by it.

[0094] Time t2: The network card receives a request set sent by a client<k,v2> , insert it to the end of the request queue and directly return the reply signal. When the client receives the reply signal, it can ensure that the request is completed and release the related resources occupied by it. At the same time, the CPU executes the request set at the head of the current request queue.<k,v1> , the server<k,v0> Updated to<k,v1> .

[0095] Time t3: The network card receives the request get <k>, insert it to the tail of the request queue; since get has a return value, the network card does not need to return a reply signal. At the same time, the CPU executes the request set at the head of the current request queue<k,v2> , the server<k,v1> Updated to<k,v2> .

[0096] Time t4: The CPU continues to execute the request at the head of the request queue, that is, get <k>, and obtains the return value v2; since get has a return value, the CPU generates a reply message containing the return value v2 and sends the reply message to the request get <k>The client of the source. Once the client receives the reply message, it is guaranteed that the request is completed and the related resources occupied by it are released.

[0097] Among them, request processing is performed in a request queue manner, so that for any two processing requests initiated by clients, if processing request A has been completed before processing request B starts (that is, the execution result of processing request A is visible to other clients), then processing request B will definitely be able to observe the result of processing request A. From the perspective of all clients, the order of processing requests is globally consistent, which can ensure the correctness of the system.

[0098] In an embodiment of the present application, on the one hand, the received processing request is added to the request queue through the network card, and for the processing request that does not have a processing result value, a reply signal is directly returned to the client, thereby reducing the delay of the processing request without a return value, and the client confirms the completion of the processing request based on the reply signal, and can promptly release the relevant resources occupied by the processing request without waiting for the CPU to execute the processing request before confirming the completion and releasing the resources. On the other hand, the processing requests in the request queue are processed by the CPU cycle, and for the processing request that has a processing result value, a reply message containing its processing result value is returned to the client. Since the CPU does not need to perform operations such as inserting the processing request into the queue, the load on the CPU is reduced and the system performance is improved. Furthermore, any type of processing request can also be processed, with strong versatility and a wide range of applications, taking into account the low latency and versatility of request processing.

[0099] Based on the same inventive concept, a device for request processing is also provided in the embodiment of the present application. Since the principle of solving the problem by the above-mentioned device and equipment is similar to that of a method for request processing, the implementation of the above-mentioned device can refer to the implementation of the method, and the repeated parts will not be repeated. The device can be applied to electronic devices. This application does not limit the type of electronic device. It can be any type of device suitable for implementation, such as terminal devices and servers, etc. This application will not go into details. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.

[0100] See Figure 4 , which is a block diagram of a request processing apparatus in an embodiment of the present application. In some embodiments, the request processing apparatus of the present application example includes:

[0101] The receiving unit 401 is configured to receive a processing request from a client through a network card, add the processing request to a request queue, and, if it is determined based on the request type field carried in the processing request that no processing result value needs to be returned for the processing request, return a reply signal to the client, so that the client confirms the completion of the processing request based on the reply signal and releases related resources occupied by the processing request;

[0102] The processing unit 402 is used to perform corresponding processing for each processing request in the request queue through the central processing unit; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

[0103] In one implementation, the receiving unit 401 is configured to:

[0104] Insert the processing request into the tail of the request queue;

[0105] The queue length of the request queue is updated to determine whether there is a processing request in the request queue according to the queue length.

[0106] In one implementation, the processing unit 402 is configured to:

[0107] The following steps are executed in a loop:

[0108] If the queue length of the request queue is greater than zero, the first processing request at the head of the request queue is taken out;

[0109] Update the queue length of the request queue;

[0110] Call the function corresponding to the first processing request to execute the first processing request.

[0111] In one implementation, the processing unit 402 is configured to:

[0112] Get the request type field and request ID in the processing request; the request ID is used to identify the processing request;

[0113] If it is determined based on the request type field that the processing request has no processing result value, a reply signal including the request identifier is returned to the corresponding client.

[0114] In one implementation, the receiving unit 401 is further configured to:

[0115] The request queue is stored in a persistent storage device on the server side so that the request queue can be loaded from the persistent storage device after the system crashes and restarts.

[0116] The request processing method in the embodiment of the present application includes a network card receiving a processing request from a client and adding the processing request to a request queue, and if it is determined based on the request type field carried by the processing request that there is no need to return a processing result value for the processing request, then a reply signal is returned to the client, so that the client confirms the completion of the processing request based on the reply signal and releases the relevant resources occupied by the processing request; the central processing unit performs corresponding processing for each processing request in the request queue; if it is determined that a corresponding processing result value needs to be returned for the processing request, then a reply message containing the processing result value is returned to the client from which the processing request originated. In this way, both low latency and versatility of request processing can be taken into account.

[0117] In an embodiment of the present application, an electronic device is further provided, including:

[0118] processor; and

[0119] The memory stores computer instructions, where the computer instructions are used to enable the processor to execute the method of any of the above embodiments.

[0120] In an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method of any of the above-mentioned embodiments.

[0121] An embodiment of the present application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device implements any of the above-mentioned methods.

[0122] Figure 5 FIG. 5 shows a schematic structural diagram of an electronic device 5000. Figure 5 As shown, the electronic device 5000 includes: a processor 5010 and a memory 5020, and optionally, may also include a power supply 5030, a display unit 5040, and an input unit 5050.

[0123] The processor 5010 is the control center of the electronic device 5000. It uses various interfaces and lines to connect various components, and performs various functions of the electronic device 5000 by running or executing software programs and / or data stored in the memory 5020, thereby monitoring the electronic device 5000 as a whole.

[0124] In the embodiment of the present application, the processor 5010 executes the various steps in the above embodiment when calling the computer program stored in the memory 5020.

[0125] Optionally, the processor 5010 may include one or more processing units. Preferably, the processor 5010 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and applications, and the modem processor primarily processes wireless communications. It is understood that the modem processor may not be integrated into the processor 5010. In some embodiments, the processor and memory may be implemented on a single chip. In some embodiments, they may also be implemented on separate chips.

[0126] The memory 5020 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, various applications, etc., and the data storage area may store data created based on the use of the electronic device 5000. In addition, the memory 5020 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0127] The electronic device 5000 also includes a power supply 5030 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 5010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0128] The display unit 5040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 5000. In the embodiment of the present application, it is mainly used to display the display interface of each application in the electronic device 5000 and objects such as text and pictures displayed on the display interface. The display unit 5040 may include a display panel 5041. The display panel 5041 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0129] The input unit 5050 can be used to receive information such as numbers or characters input by the user. The input unit 5050 may include a touch panel 5051 and other input devices 5052. The touch panel 5051, also known as a touch screen, can receive user touch operations on or near it (for example, operations performed by the user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 5051).

[0130] Specifically, the touch panel 5051 can detect user touch operations and the signals generated by the touch operations, convert these signals into touch point coordinates, send them to the processor 5010, and receive and execute commands sent by the processor 5010. In addition, the touch panel 5051 can be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 5052 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, a joystick, etc.

[0131] Of course, the touch panel 5051 can cover the display panel 5041. When the touch panel 5051 detects a touch operation on or near it, it transmits the information to the processor 5010 to determine the type of touch event. Then, the processor 5010 provides corresponding visual output on the display panel 5041 according to the type of touch event. Figure 5 In the embodiment, the touch panel 5051 and the display panel 5041 are two independent components to realize the input and output functions of the electronic device 5000, but in some embodiments, the touch panel 5051 and the display panel 5041 can be integrated to realize the input and output functions of the electronic device 5000.

[0132] The electronic device 5000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the electronic device 5000 may also include other components such as a camera. Since these components are not the key components used in the embodiments of this application, Figure 5 It is not shown and will not be described in detail.

[0133] Those skilled in the art will understand that Figure 5 The electronic device is merely an example and does not limit the electronic device. The electronic device may include more or fewer components than shown in the figure, or may include a combination of certain components or different components.

[0134] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.< / k> < / k> < / k> < / k>

Claims

1. A method for request processing, characterized in that: Applied to a server, the server including a network card and a central processing unit, the method includes: The network card receives a processing request from a client, adds the processing request to a request queue, and if it is determined, based on a request type field carried in the processing request, that no processing result value needs to be returned for the processing request, returns a reply signal to the client, so that the client confirms completion of the processing request based on the reply signal and releases related resources occupied by the processing request; The central processing unit performs corresponding processing for each processing request in the request queue; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

2. The method according to claim 1, characterized in that Adding the processing request to a request queue comprises: Inserting the processing request into the tail of the request queue; The queue length of the request queue is updated to determine whether there is a processing request in the request queue according to the queue length.

3. The method according to claim 2, characterized in that The step of executing corresponding processing for each processing request in the request queue includes: The following steps are executed in a loop: If the queue length of the request queue is greater than zero, taking out the first processing request at the head of the request queue; Updating the queue length of the request queue; Call the function corresponding to the first processing request to execute the first processing request.

4. The method according to any one of claims 1 to 3, characterized in that If it is determined, according to the request type field carried by the processing request, that there is no need to return a processing result value for the processing request, returning a reply signal to the client, comprising: Obtaining a request type field and a request identifier in the processing request; the request identifier is used to identify the processing request; If it is determined according to the request type field that the processing request has no processing result value, a reply signal including the request identifier is returned to the corresponding client.

5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The request queue is stored in a persistent storage device in the server, so that the request queue is loaded from the persistent storage device after the system crashes and restarts.

6. A request processing device, characterized in that Applied to a server, the server includes a network card and a central processing unit, and the device includes: a receiving unit, configured to receive a processing request from a client through the network card, add the processing request to a request queue, and, if it is determined, based on a request type field carried in the processing request, that no processing result value needs to be returned for the processing request, return a reply signal to the client, so that the client confirms the completion of the processing request based on the reply signal and releases related resources occupied by the processing request; The processing unit is used to perform corresponding processing for each processing request in the request queue through the central processing unit; if it is determined that a corresponding processing result value needs to be returned for the processing request, a reply message containing the processing result value is returned to the client from which the processing request originated.

7. A distributed storage system, characterized in that: Includes a server and at least one client; The server is used to: execute the method according to any one of claims 1 to 5; Each client is used to: send a processing request to the server, and when receiving a reply signal or reply message returned by the server based on the processing request, confirm that the processing request is completed and release the relevant resources occupied by the processing request.

8. An electronic device, characterized in that: include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 5.

10. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, wherein when the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method according to any one of claims 1 to 5.