Method and intermediary device for optimizing data access performance
By introducing an intermediate device between the client and the server to parse, cache, or redirect data access requests, the problem of excessive network overhead in storage devices and database clusters is solved, thus improving data access performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2021-07-15
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, excessive network overhead occurs during data access between storage devices and database clusters, leading to a decline in overall performance.
By introducing an intermediate device between the client and the server, the client's message characteristics are parsed and the data is provided through local caching or redirection, reducing direct access to the remote server.
It effectively reduces network overhead on the server side, improves the overall performance and efficiency of data access, and reduces redundant traffic.
Smart Images

Figure CN115617862B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data access technology, and more specifically, to a method and intermediate device for optimizing data access performance. Background Technology
[0002] The modern internet needs to process large amounts of data, so the performance requirements for servers are getting higher and higher, such as databases (DB) or storage devices. Databases or storage devices are generally deployed in a cluster.
[0003] For example, when a storage device receives a message from a client, if the data requested in that message is on another storage device, the current storage device needs to retrieve the requested data from the other storage device, increasing its network overhead. Similarly, when a database node in a database cluster receives a message requesting data that is on another database node, that database node needs to redirect the message to forward it to the other database node, also increasing its network overhead. Summary of the Invention
[0004] This application provides a method and intermediate device for optimizing data access performance. This technical solution can reduce the network overhead of the server, thereby improving the overall performance of data access.
[0005] In a first aspect, a method for optimizing data access performance is provided. The method is applied to an intermediate device in a communication network, where the intermediate device is a network device between a client and a server. The client may be one or more, and the server may be one or more. The method includes: the intermediate device parsing a received first message to obtain characteristics of the first message, wherein the first message originates from a terminal of one of the clients, the first message is used to request data from a server, and the characteristics are used to indicate the data requested by the first message, the characteristics being carried in a portion of the first message corresponding to application layer data; and, if the intermediate device stores the data requested by the first message, the intermediate device sends the data requested by the first message to the terminal.
[0006] The client can be located in a terminal device, the server can be a storage device, a storage device cluster, a database or a database cluster, etc., and the intermediate device can be a programmable network device, or a P4 switch, a network processor, a field-programmable gate array, etc.
[0007] It should be understood that the intermediate device, client, and server can be in the same trusted area, for example, in the same trusted communication network. In this case, the data in the first message does not need to be encrypted. Therefore, the intermediate device can directly extract the application layer data part of the first message.
[0008] In this way, the intermediate device located between the server and the client can parse the received first message to obtain the application layer characteristics within the message. These characteristics indicate the data requested by the first message. In other words, the intermediate device can understand the requested data information by parsing the first message. Furthermore, the intermediate device itself stores some data, allowing it to query the data locally. If the intermediate device holds the requested data, it can send that data to the terminal. This technical solution avoids retrieving data from a remote server, thereby reducing server network overhead and improving overall data access performance.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the features of the first message include the values of a plurality of fields arranged according to a rule, the rule indicating the order in which the plurality of fields correspond in the features of the first message.
[0010] In other embodiments, the characteristics of the first message may also include the value of a single field.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the plurality of fields include the Distributed Aggregate Table (SGL) field and the Start Logical Block Address (start LBA) field.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the server includes one or more, the intermediate device stores the mapping relationship between the features of the first message and the server identifier, and the method further includes: when the intermediate device does not store the data requested by the first message, the intermediate device sends a second message to the server corresponding to the features of the first message in a redirection manner according to the features of the first message and the mapping relationship between the features of the first message and the server identifier, wherein the data requested by the second message is the same as that of the first message.
[0013] The server identifier can be an address or an identity ID, etc. The address can be a network address, such as an IP address, or a media access control address, etc. The ID can also be a tag ID when tagging technology is used.
[0014] In one embodiment of this application, the redirection refers to the intermediate device modifying the header of the first message to obtain a second message, which can access the corresponding server according to the header, wherein the data requested by the second message is the same as the data requested by the first message.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data of the storage device.
[0016] For example, the first message carries the address of the block data and the length of the block data.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, the first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
[0018] For example, the data requested in the first message is a record in the database.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the intermediate device receiving a third message, the third message being used to request data from one of the servers, the third message originating from one of the terminals in the client; when the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device storing the data requested by the third message in the intermediate device.
[0020] The third message can come from the same terminal as the first message, or it can come from a different terminal.
[0021] It should be understood that when the number of times the data requested by the third message is requested exceeds the threshold, it means that the data requested by the third message is frequently requested by the terminal or other terminals. In other words, the data can be understood as hot data. In this case, the intermediate device can cache the data in the intermediate device, so that the intermediate device can directly send the data to the terminal without having to request the data from the remote server, thereby improving the efficiency of data access.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the data of the third message request stored by the intermediate device is requested by the intermediate device from the storage device; or the data of the third message request stored by the intermediate device is obtained by the intermediate device from a message sent by the storage device to the client.
[0023] It should be understood that the intermediate device can actively request the data requested by the third message from the storage device, or it can obtain the data requested by the third message from the response message sent by the storage device to the terminal and store the data.
[0024] In this example, when the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device can send a request message to the storage device to request the data requested by the third message and store the data.
[0025] Alternatively, when the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device can intercept the message sent by the storage device to the client to obtain the data requested by the third message and store the data.
[0026] The message sent by the storage device to the client is a response to the client's request message. In other words, the message is a response message sent by the storage device to the client after receiving the client's request message.
[0027] In conjunction with the first aspect, in some implementations of the first aspect, the intermediate device stores the data requested by the first message in a cache.
[0028] In one embodiment of this application, the intermediate device stores the data requested by the first message in a cache. When other messages also request the data, the intermediate device can directly send the data to the terminal, thereby improving the efficiency of data access.
[0029] In conjunction with the first aspect, in some implementations of the first aspect, the application layer field included in the characteristics of the first message is a key-value string.
[0030] Secondly, an intermediate device in a communication network is provided, the intermediate device being a network device between a client and a server, wherein the client is one or more and the server is one or more, comprising: a processing unit, configured to parse a received first message to obtain the characteristics of the first message, the first message originating from a device of one of the clients, the first message being used to request data from a device of one of the servers, the characteristics being used to indicate the data requested by the first message, the characteristics being carried in a portion of the first message corresponding to application layer data; and a transceiver unit, configured to send the data requested by the first message to a terminal if the intermediate device stores the data requested by the first message.
[0031] In conjunction with the second aspect, in some implementations of the second aspect, the features of the first message include the values of a plurality of fields arranged according to a rule, the rule indicating the order in which the plurality of fields correspond in the features of the first message.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the plurality of fields include the SGL field of the Distributed Aggregate Table and the start LBA field of the Start Logical Block Address.
[0033] In conjunction with the second aspect, in some implementations of the second aspect, the server includes one or more, the intermediate device stores a mapping relationship between the characteristics of the first message and the server identifier, and the transceiver unit is further configured to: when the intermediate device does not store the data requested by the first message, the intermediate device, based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the server identifier, send a second message to the server corresponding to the characteristics of the first message in a redirection manner, wherein the data requested by the second message is the same as that of the first message.
[0034] In conjunction with the second aspect, in some implementations of the second aspect, the first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data from the storage device.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
[0036] In conjunction with the second aspect, in some implementations of the second aspect, the transceiver unit is further configured to: receive a third message, the third message being used to request data from one of the servers, the third message originating from one of the terminals in the client; the processing unit is further configured to, when the number of times the data requested by the third message is requested exceeds a threshold, store the data requested by the third message in the intermediate device.
[0037] In conjunction with the second aspect, in some implementations of the second aspect, the data of the third message request stored by the intermediate device is requested by the intermediate device from the storage device; or the data of the third message request stored by the intermediate device is obtained by the intermediate device from a message sent by the storage device to the client.
[0038] In conjunction with the second aspect, in some implementations of the second aspect, the intermediate device stores the data requested by the first message in a cache.
[0039] In conjunction with the second aspect, in some implementations of the second aspect, the application layer field included in the characteristics of the first message is a key-value string.
[0040] Thirdly, an intermediate device in a communication network is provided, comprising one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause a method for optimizing data access performance as described in the first aspect above and any possible implementation thereof to be performed.
[0041] Fourthly, a chip is provided, the chip including a processor and a communication interface, the communication interface being used to receive signals and transmit the signals to the processor, the processor processing the signals such that a method for optimizing data access performance as described in the first aspect and any possible implementation thereof is executed.
[0042] Fifthly, a computer-readable storage medium is provided, wherein computer instructions are stored therein, which, when executed on a computer, cause a method for optimizing data access performance as described in the first aspect and any possible implementation thereof to be performed.
[0043] In a sixth aspect, a computer program product is provided, including computer instructions that, when executed on an intermediate device, cause a method for optimizing data access performance as described in the first aspect and any possible implementation thereof to be performed. Attached Figure Description
[0044] Figure 1 This is a schematic diagram illustrating a client accessing a database according to an embodiment of this application.
[0045] Figure 2 This is a schematic diagram of a client accessing a storage device according to an embodiment of this application.
[0046] Figure 3 This is a schematic diagram of a scheme for optimizing database performance provided in an embodiment of this application.
[0047] Figure 4 This is a schematic diagram of another scheme for optimizing database performance provided in an embodiment of this application.
[0048] Figure 5 This is a schematic diagram of the network forwarding device provided in the embodiments of this application.
[0049] Figure 6 This is a schematic diagram of a method for optimizing data access performance provided in an embodiment of this application.
[0050] Figure 7 This is a schematic flowchart illustrating a method for optimizing data access performance provided in an embodiment of this application.
[0051] Figure 8 This is a schematic diagram of a client accessing a storage device according to an embodiment of this application.
[0052] Figure 9 This is a schematic diagram illustrating an optimized data access performance provided in an embodiment of this application.
[0053] Figure 10 This is a schematic diagram illustrating a client accessing a database according to an embodiment of this application.
[0054] Figure 11 This is a schematic diagram illustrating an optimized data access performance provided in an embodiment of this application.
[0055] Figure 12 This is a schematic diagram illustrating a client accessing a storage device according to an embodiment of this application.
[0056] Figure 13 This is a schematic diagram of a method for optimizing data access performance provided in an embodiment of this application.
[0057] Figure 14 This is a schematic diagram illustrating a client accessing a database according to an embodiment of this application.
[0058] Figure 15 This is a schematic diagram of a scheme for optimizing database performance provided in an embodiment of this application.
[0059] Figure 16 This is a schematic block diagram of an intermediate device in a communication network provided in an embodiment of this application. Detailed Implementation
[0060] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0061] The network device described in the embodiments of this application can be a device for communicating with terminal devices. For example, the network device can be a network switch, router, etc., or a wireless controller in a cloud radio access network (CRAN) scenario. Alternatively, the network device can be a relay station, access point, vehicle-mounted device, wearable device, or a network device in a future 5G network or a network device in a future evolved PLMN network. The embodiments of this application are not limited to these.
[0062] Figure 1 This is a schematic diagram of a client accessing a database provided in an embodiment of this application.
[0063] See Figure 1Databases are typically deployed in clusters. Cluster nodes may be distributed across multiple host servers in the form of virtual machines or containers, or they may run directly on the server host. Nodes distributed across different servers are virtualized into a single service via Ethernet.
[0064] For example, Figure 1 Server 2 includes database node 1, database node 2, and database node 3, meaning that server 2 contains multiple databases (DBs).
[0065] Specifically, such as Figure 1 As shown, the process of client 110 accessing the database may include steps 101 to 105.
[0066] It should be understood that the client 110 can also be referred to as a user, and there can be one or more clients.
[0067] Step 101: Client 110 sends a message to cluster 130 to access certain data, etc., and the message will first pass through network forwarding device 120.
[0068] It should be understood that when a client requests data from cluster 130, the data request message will be forwarded to cluster 130 via network forwarding device 120.
[0069] Step 102: The network forwarding device 120 forwards the message to the database node 1 in the server 1.
[0070] It should be understood that in step 102, the data actually accessed by the message may not be in database node 1. In this case, the cluster computing module in database node 1 can use the cluster algorithm to calculate the location of the database node where the data actually accessed by the message is located, and then redirect the message, for example, by modifying the quintuple information of the message.
[0071] It should also be understood that in step 102, the network forwarding device 120 randomly sends the packet to database node 1 in server 1. In other embodiments, the network forwarding device 120 may also send the packet to database node 2 in server 2.
[0072] Step 103: Database node 1 sends the redirected message to network forwarding device 120.
[0073] Step 104: Network forwarding device 120 sends the redirected message to target database node n.
[0074] In step 104, the target database node of the redirected message is database node n in server N.
[0075] Step 105: Database node n encapsulates the data accessed by the message, then modifies the message to obtain a reply message, and sends the reply message to network forwarding device 120.
[0076] Step 106: Network forwarding message 120 sends the reply message to the client.
[0077] As can be seen, when a client accesses a node, if the data the client is accessing resides on another cluster node, the current node will calculate the location of the database node containing the data based on the cluster algorithm. It will then initiate a redirection message, redirecting the data over the network to the target database node where the data actually resides. This target database node then sends the data back to the client. During this process, the server may need to perform redirection operations. The redirected traffic is redundant in the entire network, additionally consuming network forwarding devices and the server's network input / output.
[0078] Figure 2 This is a schematic diagram of a client accessing a storage device according to an embodiment of this application.
[0079] A Storage Area Network (SAN) is a high-speed network dedicated to storage operations. A SAN connects hosts and storage devices, providing a dedicated communication channel between any host and any storage device. A SAN isolates storage devices from servers, enabling storage resource sharing at the server level.
[0080] Internet Protocol SAN (IP SAN) is a SAN carried on an IP network. The storage protocol is carried at the fourth layer and above of the IP network.
[0081] See Figure 2 A storage device can include a controller and physical storage media, which can be connected via a bus. The controller can abstract multiple logical unit numbers (LUNs) mapped to the physical storage media. The front-end interface of the storage device can receive IP SAN messages. The controller parses the storage protocol carried by the IP SAN message to determine the operation of the target LUN corresponding to the message, and sends it to the physical storage media corresponding to the target LUN via the bus. Clients can use IP SAN messages to operate the physical storage media of remote storage devices via IP networks.
[0082] Storage devices can be deployed in clusters, so the data requested by the front-end interface of a storage device may not be the data contained in the storage device. In this case, the storage device needs to pull the data requested by the message into the storage device and form a reply message.
[0083] For example, the storage device can send a synchronization message requesting data synchronization to another storage device where the data requested in the message actually resides. The other storage device sends the data requested in the message to the storage device, which then encapsulates the data requested in the message to form a reply message. The synchronization message can be sent or received via an external network or an internal connection.
[0084] like Figure 2 As shown, the process of client 210 or client accessing storage device may include steps 201 to 206.
[0085] 201. Client 210 sends a message to storage device cluster 230 to request storage services. This message first passes through network forwarding device 220.
[0086] It should be understood that when a client sends a message to the storage device cluster 230 to request storage services, the message will be forwarded to the storage device cluster 230 via the network forwarding device 220.
[0087] The client 210 can also be called a user, and there can be one or more clients.
[0088] 202. Network forwarding device 220 accesses data in storage device 2 through the front-end interface of storage device 2.
[0089] 203. If the data requested by the client's message is not in storage device 2, but in storage device 1, then storage device 2 sends a data synchronization message to storage device 1.
[0090] 204. Storage device 1 sends the data requested by the message to storage device 2.
[0091] 205. Storage device 2 encapsulates the data requested by the message to form a reply message, and sends the reply message to network forwarding device 220 through the front-end interface.
[0092] 206. The network forwarding device forwards the reply message to the client 210.
[0093] As can be seen from the above steps, when a client accesses the storage service, if the data ultimately accessed is not in the current storage device, the storage device needs to migrate the data from other storage devices and then respond with a message. This process additionally consumes the performance of the storage device.
[0094] To improve the performance of data access to databases or storage devices, one approach is to use a data plane development kit (DPDK), another is to use a smart network interface card (NIC), and yet another is to use a hot data cache. These will be discussed in the following sections. Figure 2 and Figure 3 The above-mentioned technical solutions will be introduced separately.
[0095] Figure 3 This is a schematic diagram of a scheme for optimizing database performance provided in an embodiment of this application.
[0096] The storage device may include a dedicated device for storage services or a general-purpose server that runs storage service software.
[0097] See Figure 3 In (a) of this technical solution, DPDK is used to improve data processing performance and throughput for data access. Client 310 sends a message to network switching device 320 to access certain data; network forwarding device 320 then sends the message to storage device 330. By employing DPDK technology, storage device 330 can improve network performance by reducing mechanisms such as context switching. However, it suffers from problems such as large network traffic jitter and uneven distribution of traffic across central processing unit (CPU) cores.
[0098] See Figure 3 In (b) of this technical solution, a smart network interface card (NIC) is used to improve the performance of the storage device. Client 310 sends a message to network switching device 320 to access certain data; network forwarding device 320 then forwards the message to storage device 340. This technical solution installs a smart NIC in storage device 340 to replace a traditional NIC, thereby improving the network performance of the storage device. However, it often requires the installation of multiple smart NICs, resulting in high cost, high power consumption, and incompatibility with chassis sizes.
[0099] Figure 4 This is a schematic diagram of another scheme for optimizing data access performance provided in the embodiments of this application.
[0100] The storage device may include a dedicated device for storage services or a general-purpose server that runs storage service software.
[0101] See Figure 4In (a) of the above, the technical solution uses hot data caching technology to improve the speed and efficiency of user access to storage devices or databases, thereby improving the performance of storage devices or databases. Client 410 sends a message to storage device 430 to access certain data. This message first passes through network forwarding device 420; network forwarding device 420 then sends the message to server 430. A portion of server 430 is deployed as a hot data cache 431, which stores frequently accessed hot data. When client 410 accesses hot data, it can directly access this hot data cache 431, thus improving the speed of client 410's access to storage devices or databases. Hot data has high real-time performance. However, the server needs to deploy a proxy or use other technologies to process hot data. Operations such as hot data statistics and display are still additional overhead for the server.
[0102] See Figure 4 In (b), a hot data cache 411 is deployed in the user client 410, which can be accessed by the nearest client, which is faster and has no network bandwidth limitations.
[0103] However, the client needs to know in advance which data is hot data. This hot data is also synchronized from the server to the client via Ethernet. The inconsistency of hot data can take a long time. If the hot data changes rapidly, it will cause the hot data on the user's client to be constantly synchronized.
[0104] Figure 5 This is a schematic diagram of the intermediate device provided in the embodiments of this application.
[0105] See Figure 5 In (a), the intermediate device 200a can be Figure 1 Network forwarding devices, such as switches or routers (black box devices), are characterized by fixed service functions and internal resource space already occupied by various services. For example, the internal resources of such devices can be divided into resource 1 to resource N, and each resource is already occupied by its corresponding service. Therefore, implementing new functional requirements on traditional network forwarding devices is complex and cumbersome.
[0106] See Figure 5 In (b) of this paper, the services provided by the programmable network device 200b are not fixed. Services can be flexibly created and loaded according to its own needs. New services, such as service 4, can be quickly developed and launched, and the space resources occupied by service 4 can be flexibly defined. Therefore, the programmable network device can flexibly implement the required functions.
[0107] In view of this, this application provides a method for optimizing data access performance and an intermediate device in a communication network. This method can improve the performance of storage devices or databases, thereby increasing the efficiency of client access to storage devices or databases.
[0108] Figure 6 This is a schematic diagram of a method for optimizing data access performance provided in an embodiment of this application.
[0109] like Figure 6 As shown, the intermediate device located between the client and the server can be a network device, such as a programmable network device. There can be one client and one server.
[0110] In one possible implementation, the intermediate device 520 can receive a first message sent from the client's terminal. If the intermediate device 520 determines that the data requested by the first message exists in the intermediate device, it can send the requested data to the client's terminal. This eliminates the need to retrieve the requested data from a remote server (e.g., a database or storage device), thereby improving data access efficiency. Furthermore, it reduces server-side performance overhead.
[0111] In some other possible implementations, if the intermediate device 520 does not store the data requested by the first message, the intermediate device can determine the target server where the data requested by the first message is located, and can forward the message to the corresponding target server 530 by redirection. This can avoid the first message being redirected between servers, thereby reducing the overhead of redundant traffic on the server and improving the performance of the server.
[0112] The method for optimizing data access performance in this application will be described in detail below with reference to specific embodiments, but will not be described in detail here.
[0113] Figure 7 This is a schematic flowchart illustrating a method for optimizing data access performance provided in an embodiment of this application. The method can be applied to an intermediate device in a communication network. This intermediate device can be a network device between a client and a server. There can be one or more clients and one or more servers. The method may include steps 401 to 402.
[0114] The client can be carried in a terminal device, such as a mobile phone or a personal computer. The server can include a storage device or a database. For example, the intermediate device can be a programmable network device located between the terminal device and the storage device, or a P4 switch, network processor (NP), router, field-programmable gate array (FPGA), etc.
[0115] 401, The intermediate device parses the received first message to obtain the characteristics of the first message, the first message comes from a terminal of one of the clients, the first message is used to request data from a server, the characteristics are used to indicate the data requested by the first message, and the characteristics are carried in the part of the first message corresponding to application layer data.
[0116] In this step, the intermediate device receives a first message sent by the terminal where the client is located. The first message may be a message for requesting storage services. For example, the first message may request data from the storage device or from the database. The intermediate device may parse the first message to obtain its characteristics.
[0117] For example, the message parsing module in the intermediate device can extract features from the first message according to parsing rules. These features can be used to indicate the data requested by the first message, and can be carried in the portion of the first message corresponding to application layer data. Therefore, the intermediate device can extract the application layer data portion of the first message to obtain the features of the first message.
[0118] In this case, the intermediate device, client, and server can be in the same trusted area, for example, in the same trusted communication network. In this case, the data in the first message does not need to be encrypted. Therefore, the intermediate device can directly extract the application layer data part of the first message.
[0119] The resolution rule can be pre-cached by the intermediate device, or it can be sent from the server to the intermediate device through the control plane, or it can be learned by the intermediate device itself.
[0120] Optionally, the features of the first message include the values of a plurality of fields arranged according to a rule, the rule indicating the order in which the plurality of fields correspond in the features of the first message.
[0121] Optionally, these multiple fields may include the SGL field (Distributed Aggregate Table) and the start LBA field (Start Logical Block Address).
[0122] In some embodiments, when the server uses non-volatile memory express over fabrics (NOF) as the network, and the multiple fields are SGL and start logical block address, the first message may be characterized by having an ordered SGL and start logical block address, for example, SGL first and start logical block address second, or start logical block address first and SGL second.
[0123] In other embodiments, these multiple fields may also be the SGL and start logical block address (start LBA) fields, as well as other fields available in the NOF protocol.
[0124] Optionally, the application layer fields included in the characteristics of the first message are key-value strings.
[0125] In some embodiments, when the server uses the redisserialization protocol (RESP), the application layer field of the first message is a key-value string.
[0126] Optionally, the first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data of the storage device.
[0127] For example, when the first message is used to request data from the storage device, the data requested by the first message may be block data in the storage device. For example, the first message carries the address and length of the block data.
[0128] Optionally, the first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
[0129] For example, when the first message is used to request data from the database, the data requested by the first message can be a record in the database.
[0130] Optionally, the server may include one or more intermediate devices, and the intermediate device stores the mapping relationship between the features of the first message and the server identifier. The method further includes: when the intermediate device does not store the data requested by the first message, the intermediate device sends a second message to the server corresponding to the features of the first message in a redirection manner according to the features of the first message and the mapping relationship between the features of the first message and the server identifier. The data requested by the second message is the same as that of the first message.
[0131] The server identifier can be an address or an identity document (ID). The address can be a network address, such as an IP address, or a media access control address (MAC) address, etc. The ID can also be a tag ID when tagging technology is used.
[0132] The server identifier can be one-to-one with the server, that is, each server corresponds to a server identifier. The features of the first message can also have a one-to-one correspondence with the server identifier, that is, the features in the first message can correspond to a server identifier, so the corresponding server can be found through the features in the first message.
[0133] It should be understood that the mapping relationship between the characteristics of the first message and the server identifier may be pre-stored in the intermediate device, or the mapping relationship may be sent from the server to the intermediate device through the control plane, etc.
[0134] It should be understood that this redirection refers to the intermediate device being able to modify the header of the first message to obtain a second message, which can then access the corresponding server according to its header. The data requested by the second message is the same as the data requested by the first message.
[0135] For example, an intermediate device can modify the five-tuple information of the first message to obtain a modified second message, but the data requested by the second message is the same as that of the first message.
[0136] In this way, when the intermediate device does not have the data requested by the first message, the corresponding server node can be obtained according to the mapping relationship between the characteristics of the first message and the server identifier. Thus, the modified first message can be accurately sent to the corresponding server node, thereby reducing the redirection of the first message between internal server nodes, reducing redundant traffic between server nodes, and thus improving server performance.
[0137] Optionally, if the server node accessible by the first message is consistent with the server node corresponding to the characteristics of the first message according to the message header, the intermediate device directly sends the first message to the corresponding server node.
[0138] In one embodiment of this application, when the intermediate device does not store the data requested by the first message, and the server node accessible by the first message is the same as the server node corresponding to the characteristics of the first message, the intermediate device does not need to modify the message header of the first message and can directly send the first message to the corresponding server node.
[0139] 402, if the intermediate device has stored the data of the first message request, the intermediate device sends the data of the first message request to the terminal.
[0140] If the intermediate device has already obtained the data requested by the first message by parsing the first message in step 401, and has stored the data requested by the first message in the intermediate device, then the intermediate device can send the data requested by the first message to the terminal device.
[0141] For example, the intermediate device is equipped with a cache that stores data frequently accessed by the terminal device. When the intermediate device determines that the data requested by the first message belongs to this part of the data, the intermediate device can encapsulate the data requested by the first message to form a new reply message and send the reply message to the terminal device.
[0142] Specifically, the intermediate device can encapsulate messages according to reply rules to form reply messages. These reply rules can be pre-cached, or they can be sent from the server to the intermediate device through the control plane, or they can be learned by the intermediate device itself, etc.
[0143] It should be understood that the intermediate device may also be a network forwarding device that integrates the above functions. In this case, the network forwarding device may not be programmable, and the embodiments of this application do not limit this.
[0144] In this way, the intermediate device can parse the messages sent by the terminal device to obtain the application layer characteristics within the message. These characteristics indicate the data requested by the message. In other words, the intermediate device can understand the requested data information by parsing the first message. Furthermore, the intermediate device itself can store some data, allowing it to query locally. If the intermediate device determines that it has the requested data, it can directly send that data to the terminal device. This technical solution avoids message redirection between server nodes, thereby reducing server performance overhead and improving the efficiency of client access to the server.
[0145] Optionally, the method may further include: the intermediate device receiving a third message, the third message being used to request data from a server, the third message originating from a terminal of one of the clients;
[0146] When the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device stores the data requested by the third message in the intermediate device.
[0147] The third message, like the first message, is used to request data from a server. When the number of requests for data in the third message exceeds a threshold, the intermediate device can store the data requested by the third message in the intermediate device.
[0148] For example, the threshold can be dynamically configured by the control plane, and the specific value is not limited in this application embodiment.
[0149] It should be understood that the third message may come from the same client or the same terminal as the first message, or it may come from different terminals or clients. This application embodiment does not limit this.
[0150] Optionally, the data of the third message request stored in the intermediate device is requested by the intermediate device from the storage device; or the data of the third message request stored in the intermediate device is obtained by the intermediate device from a message sent by the storage device to the client.
[0151] In this example, when the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device can send a request message to the storage device to request the data requested by the third message and store the data.
[0152] Alternatively, when the number of times the data requested by the third message is requested exceeds a threshold, the intermediate device can intercept the message sent by the storage device to the client to obtain the data requested by the third message and store the data.
[0153] The message sent by the storage device to the client is a response to the client's request message. In other words, the message is a response message sent by the storage device to the client after receiving the client's request message.
[0154] The data requested by the third message can be stored in the cache of the intermediate device.
[0155] Optionally, the intermediate device stores the data requested by the first message in a cache.
[0156] In some embodiments, when the intermediate device does not have the data requested by the first message, the intermediate device can obtain the data requested by the first message from the reply message sent by the storage device or database to the client. In this case, the intermediate device can store the data requested by the first message in the cache of the intermediate device.
[0157] It should be understood that the following text can be combined with... Figures 8-15 Further introduction Figure 7 The various technical solutions in the process.
[0158] Figure 8This is a schematic diagram of a client accessing a storage device according to an embodiment of this application.
[0159] like Figure 8 As shown, in one possible implementation, the step of the client terminal 710 accessing the storage device through the intermediate device 720 may include steps 701 to 703a. The intermediate device may be a network device between the client and the storage device, such as a network switch.
[0160] 701. The intermediate device receives a message sent by the terminal where the client is located. The traffic analysis module in the intermediate device can determine whether the message accesses hot data based on the characteristic data in the message.
[0161] The intermediate device is equipped with a hot data area for caching hot data. This hot data can be pre-stored in the intermediate device by the storage device, or it can be sent to the intermediate device in real time by the storage device through the control plane.
[0162] 702a, if it is determined that the message accesses hot data, the message is sent to the hot data area of the intermediate device for processing.
[0163] In other embodiments, when it is determined that the data requested by the message is stored in an intermediate device, the message is sent to a data buffer.
[0164] 703a, the hot data area encapsulates the hot data accessed by the message to form a reply message, and sends the reply message to the terminal.
[0165] When the intermediate device determines that the terminal's message accesses hot data, it can directly encapsulate the hot data to form a reply message, thus avoiding the need to access the storage device remotely. This improves the speed and efficiency of data access and further reduces the performance consumption of the storage device.
[0166] In another possible implementation, the step of the client 710 accessing the storage device through the intermediate device 720 may include steps 701 to 704b.
[0167] 701. The intermediate device receives a message sent by the terminal. The flow analysis module in the intermediate device can determine whether the message accesses hot data based on the characteristic data in the message.
[0168] 702b, if it is determined that the message is not for accessing hot data, the message is sent to the corresponding storage device 1.
[0169] In other embodiments, when the data requested by the message is not in the intermediate device, the message is sent to the corresponding storage device 1.
[0170] 703b, storage device 1 encapsulates the data requested by the message to obtain a reply message, and sends the reply message to intermediate device 720.
[0171] 704b, the intermediate device 720 sends the reply message to the client 710.
[0172] In one embodiment of this application, when the intermediate device determines that the client's message does not access hot data, or that the data accessed by the message does not exist in the intermediate device, the intermediate device can determine the storage device where the requested data is located based on the characteristics in the message, and directly send the message to the corresponding storage device, thereby improving the efficiency of data access. In the following, this will be combined with... Figures 12-13 This technical solution is presented in the context of [the present invention]. It should be understood that... Figures 12-13 The technical solutions in the middle can be Figure 8 Based on this, for example, in other embodiments, it can be... Figure 8 Technical solutions and Figure 12 or Figure 13 The technical solutions are combined with those in the text.
[0173] Figure 9 This is a schematic diagram illustrating an optimized data access performance provided in an embodiment of this application.
[0174] See Figure 9 Storage device cluster 1 may include storage array 1, storage array 2, ..., storage array n.
[0175] In one embodiment of this application, intermediate device 820 receives a first message sent by client 810.
[0176] Specifically, the message matching module 821 in the intermediate device 820 filters the first message according to the message matching rules. When it is determined that the first message belongs to the message for accessing the storage service, the first message is sent to the message parsing module 822. When it is determined that the first message does not belong to the message for accessing the storage service, the first message is forwarded to the original message forwarding module.
[0177] It should be understood that in this embodiment, the message matching module 821 sending the first message to the message parsing module 822 is merely illustrative. In other embodiments, the message matching module 821 may also send the first message to other message parsing modules, such as the message parsing module 825.
[0178] The message matching rule may include at least one of the following: source address; destination address; source port; destination port; application layer protocol fields.
[0179] It should be understood that the message matching rule can be sent from the storage device cluster to the intermediate device via the configuration interface through the control plane. For example, the message matching rule can be sent from storage device cluster 1 to intermediate device 820 via configuration interface 824 through control plane 1, or it can be pre-cached in intermediate device 820. The message matching rule can also be sent from control plane 2 of storage device cluster 2 to intermediate device 820. This application embodiment does not limit this.
[0180] The message parsing module 822 can parse the first message according to the parsing rules to obtain the characteristics of the first message. The characteristics of the first message can include the values of multiple fields arranged according to the rules, and the rules can indicate the order of the multiple fields in the characteristics of the first message.
[0181] These multiple fields include the SGL field (Distributed Aggregate Table) and the start LBA field (Start Logical Block Address). The rule can be that the SGL field comes first, followed by the start LBA field; or the rule can be that the SGL field comes second, followed by the start LBA field.
[0182] In some embodiments, when using the network-borne non-volatile memory standard NOF, the plurality of fields are the SGL field and the start LBA field.
[0183] In some embodiments, when using the Data Structure Server Serialization Protocol (RESP), the first message features application layer fields that are key-value strings.
[0184] The message parsing module 822 sends the parsed features of the first message to the traffic analysis module 823. The traffic analysis module 823 determines whether the message requests hot data based on the number of times the data requested by the first message has been counted. In some embodiments, if the message parsing module 822 fails to parse the features of the first message, it forwards the first message to the original message forwarding module.
[0185] If the number of times the data requested by the first message is counted is greater than a first preset value, then the data requested by the first message is determined to be hot data. When it is determined that the data requested by the first message is hot data, the first message can be transferred to the hot data module 829. If the number of times the data requested by the first message is counted is less than or equal to the first preset value, then it is determined that the data requested by the first message is not hot data, and the first message is forwarded to the original message forwarding module.
[0186] When the data requested in the first message is hot data, the hot data module 829 can obtain the data value of the hot data according to the feature value in the first message, and encapsulate the data requested in the first message according to the message reply rules to obtain the reply message.
[0187] The message reply rules can include: address modification at layers 2 and 3; status field modification at the service layer; and verification field correction rules. These reply rules can be sent from storage device cluster 1 to intermediate device 820 via configuration interface 824 through control plane 1, or they can be pre-cached in intermediate device 820.
[0188] It should be understood that the hot data contained in this hot data module may be sent from the storage device cluster to the intermediate device via the control plane. For example, the hot data contained in this hot data module 829 may be sent from the storage device cluster 1 to the intermediate device via the control plane 1.
[0189] Alternatively, the hot data contained in the hot data module may be pre-stored in the intermediate device, or the hot data contained in the hot data module may be obtained by the intermediate device from the message sent from storage device cluster 1 to the client.
[0190] When hot data changes, the intermediate device can send a hot data synchronization request to storage device cluster 1, receive a message containing hot data from storage device cluster 1, and update the hot data in the message to the hot data module.
[0191] The hot data module 829 sends the reply message to the client 810.
[0192] In this way, the intermediate device located between the client and the storage device can parse the received message and determine whether the message requests hot data. When the message requests hot data, the intermediate device can directly send the requested data to the client. This technical solution eliminates the need to retrieve the requested data from the remote storage device; the intermediate device can directly handle the message, thereby improving data access efficiency and reducing the performance consumption of the storage device.
[0193] It should be understood that Figure 8 The technical solution can be used as Figure 9 A portion of it. In other embodiments, it may also be... Figure 9 Technical solutions and Figure 12 or Figure 13 The technical solutions are combined with those in the text. Figure 10 This is a schematic diagram illustrating a client accessing a database according to an embodiment of this application.
[0194] See Figure 10 Each server may include multiple database container nodes, and these multiple servers can form a database cluster 930. The intermediate device 920 can be found in [reference needed]. Figure 7 The relevant description in the document.
[0195] It should be understood that steps 901 to 903a can be found in the relevant descriptions of steps 701 to 703a, and for the sake of brevity, they will not be repeated here.
[0196] 902b: When the traffic analysis module determines that the message is not a request for hot data, it sends the message to the corresponding database node.
[0197] 903b, the database node encapsulates the data requested in the message to form a reply message, and sends the reply message to the intermediate device 920.
[0198] 904b, the intermediate device 920 sends the reply message to the client 910.
[0199] In this way, when the intermediate device determines that the client's message requests hot data, it can directly encapsulate the hot data to form a reply message, thus avoiding the need to access the database node remotely, thereby improving the speed and efficiency of data access and further reducing the performance consumption of the database.
[0200] Furthermore, when the intermediate device determines that the client's message does not request hot data, or that the requested data does not exist in the intermediate device, the intermediate device can determine the database node where the requested data resides based on the characteristics of the message, and directly send the message to the corresponding database node, thereby improving data access efficiency. In the following text, this will be combined with... Figures 14-15 This technical solution is presented in the context of [the present invention]. It should be understood that... Figures 14-15 The technical solutions in the middle can be Figure 10 Based on this, for example, in other embodiments, it can be... Figure 10 Technical solutions and Figure 14 or Figure 15 The technical solutions are combined with those in the text.
[0201] Figure 11 This is a schematic diagram illustrating an optimized data access performance provided in an embodiment of this application.
[0202] See Figure 11 Each database cluster can include Figure 10 Servers 1 through n.
[0203] It should be understood that the descriptions of the message matching module, message parsing module, traffic analysis module, hot data module, and configuration interface for the intermediate device 820 in this application embodiment can be found in [reference needed]. Figure 8 The description in the text will not be repeated here for the sake of brevity.
[0204] In this way, the intermediate device located between the client and the database can parse the received message and determine whether the message requests hot data. When the message requests hot data, the intermediate device can directly send the requested data to the client. This technical solution eliminates the need to retrieve the requested data from the remote database node; the intermediate device can directly handle the message, thereby improving data access efficiency and reducing database performance overhead.
[0205] It should be understood that Figure 11 The technical solutions may include Figure 10 The technical solution. In other embodiments, it is also possible to use... Figure 11 Technical solutions and Figure 14 or Figure 15 The technical solutions are combined with those in the text.
[0206] Figure 12 This is a schematic diagram illustrating a client accessing a storage device according to an embodiment of this application.
[0207] like Figure 12 As shown, the process of the terminal where the client is located accessing the storage device may include steps 1101 to 1104.
[0208] 1101, intermediate device 1120 receives the first message sent by client 1110.
[0209] The path calculation module 1121 in the intermediate device 1120 can determine the target storage device where the data requested by the first message is located based on the characteristics of the first message.
[0210] In some embodiments, the path calculation module 1121 determines the target storage device where the data requested by the first message is located based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the storage device identifier.
[0211] Specifically, the path calculation module 1121 can calculate the characteristics of the first message according to the path calculation algorithm, and determine the target storage device where the data requested by the first message is located based on the calculation result and the mapping relationship between the characteristics of the first message and the storage device identifier. For example, the path calculation module 1121 can perform a modulo operation on the characteristics of the first message according to a hash algorithm (such as CRC16, CRC32, or other hash polynomial parameters). The path calculation module 1121 can also use other algorithms to calculate the characteristics of the first message, which is not limited in this embodiment.
[0212] 1102, intermediate device 1120 forwards the message to the target storage device.
[0213] In one possible implementation, the intermediate device sends a second message to the target storage device via redirection, the second message requesting the same data as the first message.
[0214] It should be understood that the second message may be obtained by the intermediate device modifying the five-tuple information of the header of the first message according to the location of the target storage device, so that the intermediate device can forward the second message to the target storage device.
[0215] In another possible implementation, if the five-tuple information in the header of the first message already corresponds to the target storage device, then the intermediate device does not need to redirect and can directly forward the first message to the target storage device.
[0216] 1103, the target storage device encapsulates the data requested by the first message to form a reply message, and sends the reply message to the intermediate device 1120.
[0217] 1104, intermediate device 1120 forwards the reply message to client 1110.
[0218] It should be understood that the intermediate device offloads the packet path redirection function to the storage device, thereby reducing the performance consumption of the storage device. Furthermore, this scheme avoids packet redirection between storage devices, thus reducing redundant traffic within the storage device and increasing throughput.
[0219] Figure 13 This is a schematic diagram of a method for optimizing data access performance provided in an embodiment of this application.
[0220] See Figure 13 Storage device cluster 1 may include storage array 1, storage array 2, ..., storage array n.
[0221] In one embodiment of this application, intermediate device 1220 receives a first message sent by client 1210.
[0222] Specifically, the message matching module 1221 in the intermediate device 1220 filters the first message according to the message matching rules. When it is determined that the first message belongs to the message for accessing the storage service, it determines the storage device cluster 1 corresponding to the first message and then forwards the first message to the message parsing module 1222. When it is determined that the first message does not belong to the message for accessing the storage service, it forwards the first message to the original message forwarding module.
[0223] It should be understood that in one embodiment of this application, the message matching module 1221 filters the first message according to the message matching rules. When it is determined that the first message belongs to the message for accessing storage services, it determines the storage device cluster 1 corresponding to the first message and then forwards the first message to the message parsing module 1222. This is merely illustrative. In other embodiments, the message parsing module 2 in the intermediate device 1220 may also filter the first message according to the message matching rules. When it is determined that the first message belongs to the message for accessing storage services, it determines the storage device cluster 2 corresponding to the first message and then forwards the first message to the message parsing module 2.
[0224] The message matching rule may include at least one of the following: source address; destination address; source port; destination port; application layer protocol fields.
[0225] The message parsing module 1222 can parse the first message according to the parsing rules to obtain the characteristics of the first message. The characteristics of the first message can include the values of multiple fields arranged according to the rules, and the rules can indicate the order of the multiple fields in the characteristics of the first message.
[0226] These multiple fields include the SGL field (Distributed Aggregate Table) and the start LBA field (Start Logical Block Address). The rule can be that the SGL field comes first, followed by the start LBA field; or the rule can be that the SGL field comes second, followed by the start LBA field.
[0227] It should be understood that the fields included in this first feature differ under different protocols. For example, when using the Non-Volatile Memory (NOF) standard carried over a network, the features of the first message include multiple fields, namely the SGL field and the start LBA field. When using the Data Structure Server Serialization Protocol (RESP), the application layer field included in the features of the first message is a key-value string.
[0228] The message parsing module 1222 sends the parsed features of the first message to the path calculation module 1223. The path calculation module 1222 determines the target storage device where the data requested by the first message is located based on the features of the first message and the mapping relationship between the features of the first message and the storage device identifier.
[0229] Specifically, the path calculation module 1123 can calculate the characteristics of the first message according to the path calculation algorithm, and determine the target storage device where the data requested by the first message is located based on the calculation result and the mapping relationship between the characteristics of the first message and the storage device identifier. For example, the path calculation module 1123 can perform a modulo operation on the characteristics of the first message according to a hash algorithm (such as CRC16, CRC32, or other hash polynomial parameters). The path calculation module 1123 can also use other algorithms to calculate the characteristics of the first message, which is not limited in this embodiment.
[0230] The storage device identifier can be an address or an ID. The address can be a network address, such as an IP address or a MAC address, and the ID can be a tag ID using tag technology.
[0231] In some embodiments, after the target storage device is determined, the path calculation module 1223 sends a second message to the target storage device via redirection. The data requested in the second message is the same as the data requested in the first message. The second message may be obtained by an intermediate device modifying the five-tuple information in the header of the first message according to the location of the target storage device, thereby enabling the intermediate device to forward the second message to the target storage device.
[0232] In other embodiments, once the target storage device is determined, if the five-tuple information in the header of the first message already corresponds to the target storage device, the intermediate device does not need to redirect and can directly forward the first message to the target storage device.
[0233] It should be understood that the message matching rules, message parsing rules, mapping relationship between the features of the first message and the storage device identifier, path calculation algorithm, etc., can be sent from the storage device cluster to the intermediate device 1220 via the configuration interface 1224 through the control plane; or, the above rules can be pre-stored in the intermediate device 1220.
[0234] It should be understood that intermediate devices can determine the target storage device corresponding to the first message based on the mapping relationship between the characteristics of the first message and the storage device identifier. This allows the modified first message to be accurately sent to the corresponding storage device, thereby reducing the redirection of the first message between storage devices, reducing redundant traffic between storage devices, and thus improving the performance of the storage devices.
[0235] Figure 14 This is a schematic diagram illustrating a client accessing a database according to an embodiment of this application.
[0236] like Figure 14As shown, a single server includes one or more DB container nodes, and multiple servers constitute a DB cluster. The intermediate device 1320 includes a path calculation module 1321. This intermediate device 520 can be a programmable network forwarding device, or a P4 switch, network processor, field-programmable gate array, etc. In this embodiment, the process of a client accessing the database may include steps 1301 to 1304.
[0237] 1301, Intermediate device 1320 receives the first message sent by client 1310.
[0238] Specifically, the path calculation module 1321 in the intermediate device 1320 determines the target database node where the data requested by the first message is located based on the characteristics of the first message.
[0239] In some embodiments, the path calculation module 1321 determines the target database node where the data requested by the first message is located based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the database identifier.
[0240] Specifically, the path calculation module 1321 can calculate the characteristics of the first message according to the path calculation algorithm, and determine the target database node where the data requested by the first message is located based on the calculation result and the mapping relationship between the characteristics of the first message and the database identifier. For example, the path calculation module 1321 can perform a modulo operation on the characteristics of the first message according to a hash algorithm (such as CRC16, CRC32, or other hash polynomial parameters). The path calculation module 1321 can also use other algorithms to calculate the characteristics of the first message, which is not limited in this embodiment.
[0241] 1302, intermediate device 1320 forwards the message to the target database node.
[0242] In one possible implementation, the intermediate device sends a second message to the target database node via redirection, and the data requested in the second message is the same as that in the first message.
[0243] It should be understood that the second message may be obtained by the intermediate device modifying the five-tuple information of the header of the first message according to the location of the target database node, so that the intermediate device can forward the second message to the target database node.
[0244] In another possible implementation, if the five-tuple information in the header of the first message already corresponds to the target database node, then the intermediate device does not need to redirect and can directly forward the first message to the target database node.
[0245] 1303, the target database node encapsulates the data requested in the first message to form a reply message, and sends the reply message to the intermediate device 1320.
[0246] 1304, intermediate device 1320 forwards the reply message to client 1310.
[0247] In one embodiment of this application, the intermediate device has a path calculation module that can calculate the target database node where the data actually accessed by the message is located, so that the message can be directly forwarded to the target database node, thereby reducing the process of message redirection between nodes within the database cluster and thus improving the performance of the database.
[0248] Figure 15 This is a schematic diagram of a scheme for optimizing database performance provided in an embodiment of this application.
[0249] See Figure 15 Each database cluster can include Figure 14 Servers 1 through n.
[0250] It should be understood that the descriptions of the message matching module, message parsing module, path calculation module, and configuration interface for the intermediate device 1420 in this application embodiment can be found in [reference needed]. Figure 12 The description in the text will not be repeated here for the sake of brevity.
[0251] In this way, the intermediate device located between the client and the database can parse the received message and calculate the target database node where the data actually accessed by the message is located. Thus, it can directly forward the message or forward it to the target database node through redirection, thereby avoiding the process of message redirection between nodes within the database cluster and improving database performance.
[0252] The above text combined Figures 1-15 This application describes in detail the method embodiments for optimizing data access performance. The following will be combined with... Figure 16 The device embodiments of this application are described below. The device embodiments correspond to the method embodiments, so any parts not described in detail can be found in the relevant descriptions in the method embodiments above.
[0253] Figure 16 This is a schematic block diagram of an intermediate device in a communication network provided in an embodiment of this application.
[0254] like Figure 16 As shown, the intermediate device 1500 is a network device between a client and a server. The client can be one or more, and the server can be one or more. The intermediate device 1500 may include a processing unit 1510 and a transceiver unit 1520.
[0255] The processing unit 1510 is used to parse the received first message to obtain the characteristics of the first message, the first message comes from a device in the client, the first message is used to request data from a device in the server, the characteristics are used to indicate the data requested by the first message, and the characteristics are carried in the part of the first message corresponding to application layer data.
[0256] The transceiver unit 1520 is used to send the data of the first message request to the terminal when the intermediate device stores the data of the first message request.
[0257] The processing unit 1510 may be the message matching module, message parsing module, traffic analysis module, path calculation module, etc. in the above embodiments.
[0258] The transceiver unit 1520 may be the unit responsible for sending and receiving messages in the above embodiment.
[0259] Optionally, the features of the first message include the values of a plurality of fields arranged according to a rule, the rule indicating the order in which the plurality of fields correspond in the features of the first message.
[0260] Optionally, the plurality of fields include the Distributed Aggregate Table (SGL) field and the Start Logical Block Address (start LBA) field.
[0261] Optionally, the server may include one or more, the intermediate device stores a mapping relationship between the characteristics of the first message and the server identifier, and the transceiver unit 1520 is further configured to:
[0262] If the intermediate device does not store the data requested by the first message, the intermediate device, based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the server identifier, sends a second message to the server corresponding to the characteristics of the first message in a redirection manner. The data requested by the second message is the same as that of the first message.
[0263] Optionally, the first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data from the storage device.
[0264] Optionally, the first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
[0265] Optionally, the transceiver unit 1520 is further configured to: receive a third message, the third message being used to request data from one of the servers, the third message originating from one of the clients;
[0266] The processing unit 1510 is further configured to store the data of the third message request in the intermediate device when the number of times the data requested by the third message is greater than a threshold.
[0267] Optionally, the data of the third message request stored in the intermediate device is requested by the intermediate device from the storage device; or the data of the third message request stored in the intermediate device is obtained by the intermediate device from a message sent by the storage device to the client.
[0268] Optionally, the intermediate device stores the data requested by the first message in a cache.
[0269] Optionally, the application layer field included in the features of the first message is a key-value string.
[0270] This application also provides an intermediate device in a communication network, including one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by one or more processors, cause the method for optimizing data access performance as described in any of the above embodiments to be executed.
[0271] This application also provides a chip, which includes a processor and a communication interface. The communication interface is used to receive signals and transmit the signals to the processor. The processor processes the signals so that the method for optimizing data access performance as described in any of the above embodiments is executed.
[0272] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the method for optimizing data access performance as described in any of the above embodiments to be performed.
[0273] This application provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to achieve the method for optimizing data access performance described in the above embodiments.
[0274] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the methods for optimizing data access performance in the above-described method embodiments.
[0275] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0276] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0277] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0278] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0279] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0280] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0281] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0282] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for optimizing data access performance, characterized in that, The method is applied to an intermediate device in a communication network, wherein the intermediate device is a network device between a client and a server, the client being one or more, and the server being one or more, and the method includes: The intermediate device parses the received first message to obtain the characteristics of the first message. The first message comes from a terminal of one of the clients. The first message is used to request data from a server. The characteristics are used to indicate the data requested by the first message. The characteristics are carried in the part of the first message corresponding to the application layer data. If the intermediate device stores the data of the first message request, the intermediate device sends the data of the first message request to the terminal; If the intermediate device does not store the data requested by the first message, the intermediate device sends a second message to the server corresponding to the characteristics of the first message in a redirection manner, based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the server identifier. The data requested by the second message is the same as that of the first message. The intermediate device stores the mapping relationship between the characteristics of the first message and the server identifier. The step of sending a second message to a server corresponding to the characteristics of the first message via redirection includes: Modify the 5-tuple information of the first message to obtain the second message; Send the second message to the server that corresponds to the characteristics of the first message.
2. The method according to claim 1, characterized in that, The features of the first message include the values of multiple fields arranged according to a rule, the rule indicating the order in which the multiple fields correspond in the features of the first message.
3. The method according to claim 2, characterized in that, The multiple fields include the Distributed Aggregate Table (SGL) field and the Start Logical Block Address (start LBA) field.
4. The method according to any one of claims 1 to 3, characterized in that, The first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data from the storage device.
5. The method according to any one of claims 1 to 3, characterized in that, The first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
6. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The intermediate device receives a third message, which is used to request data from one of the servers, and the third message comes from one of the terminals of the clients. When the number of times the data requested by the third message is greater than a threshold, the intermediate device stores the data requested by the third message in the intermediate device.
7. The method according to claim 6, characterized in that, The data requested in the third message stored in the intermediate device is requested by the intermediate device from the storage device; or The data of the third message request stored in the intermediate device is obtained by the intermediate device from the message sent from the storage device to the client.
8. The method according to any one of claims 1 to 3, characterized in that, The intermediate device stores the data requested by the first message in a cache.
9. The method according to claim 1, characterized in that, The first message is characterized by application layer fields that are key-value strings.
10. An intermediate device in a communication network, characterized in that, The intermediate device is a network device between the client and the server. There are one or more clients and one or more servers, including: A processing unit is configured to parse a received first message to obtain the characteristics of the first message, the first message originating from a device in one of the clients, the first message being used to request data from a device in the server, the characteristics being used to indicate the data requested by the first message, the characteristics being carried in the portion of the first message corresponding to application layer data; The transceiver unit is configured to send the data of the first message request to the device that sent the first message when the intermediate device has stored the data of the first message request. The transceiver unit is further configured to: when the intermediate device does not store the data requested by the first message, the intermediate device sends a second message to the server corresponding to the characteristics of the first message in a redirection manner based on the characteristics of the first message and the mapping relationship between the characteristics of the first message and the server identifier, wherein the data requested by the second message is the same as that of the first message, and the intermediate device stores the mapping relationship between the characteristics of the first message and the server identifier. Specifically, the transceiver unit is used for: Modify the 5-tuple information of the first message to obtain the second message; Send the second message to the server that corresponds to the characteristics of the first message.
11. The device according to claim 10, characterized in that, The features of the first message include the values of multiple fields arranged according to a rule, the rule indicating the order in which the multiple fields correspond in the features of the first message.
12. The device according to claim 11, characterized in that, The multiple fields include the Distributed Aggregate Table (SGL) field and the Start Logical Block Address (start LBA) field.
13. The device according to any one of claims 10 to 12, characterized in that, The first message is specifically used to request data from the storage device, and the data specifically requested by the first message is block data from the storage device.
14. The device according to any one of claims 10 to 12, characterized in that, The first message is specifically used to request data from the database, and the data specifically requested by the first message is a record in the database.
15. The device according to any one of claims 10 to 12, characterized in that, The transceiver unit is also used for: Receive a third message, the third message being used to request data from one of the servers, the third message originating from one of the terminals in the client; The processing unit is further configured to store the data requested by the third message in the intermediate device when the number of times the data requested by the third message is requested exceeds a threshold.
16. The device according to claim 15, characterized in that, The data requested in the third message stored in the intermediate device is requested by the intermediate device from the storage device; or The data of the third message request stored in the intermediate device is obtained by the intermediate device from the message sent from the storage device to the client.
17. The device according to any one of claims 10 to 12, characterized in that, The intermediate device stores the data requested by the first message in a cache.
18. The device according to any one of claims 10 to 12, characterized in that, The first message is characterized by application layer fields that are key-value strings.
19. An intermediate device in a communication network, characterized in that, It includes one or more processors; one or more memories; said one or more memories storing one or more computer programs, said one or more computer programs including instructions that, when executed by said instructions by said one or more processors, cause the method for optimizing data access performance as described in any one of claims 1 to 9 to be performed.
20. A chip, characterized in that, The chip includes a processor and a communication interface, the communication interface being used to receive signals and transmit the signals to the processor, the processor processing the signals such that the method for optimizing data access performance as described in any one of claims 1 to 9 is executed.
21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the method for optimizing data access performance as described in any one of claims 1 to 9 to be performed.