Request processing method and device, electronic equipment and storage medium
By managing message queues on monitoring nodes and optimizing processing efficiency, the problem of low read and write request processing efficiency when object storage devices in distributed storage systems are in data reconstruction state, and faster request return time is achieved.
Patent Information
- Application Number
- CN202411084612.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-17
AI Technical Summary
In a distributed storage system, when the object storage device is in a data reconstruction state, the processing efficiency of data read and write requests is low, resulting in a prolonged return time, especially when the cluster size is large and the number of nodes is large, it is easy to cause the request return timeout.
Create a working message queue and a waiting message queue on the monitoring node, record the length of the working message queue. When it reaches half, determine whether the message is a maintenance table update message, and put other messages into the waiting queue, and prioritize the maintenance table update message , to improve the processing efficiency of data read and write requests.
By optimizing message queue management, the processing efficiency of data read and write requests is improved, the request return time is reduced, and the request timeout is avoided due to extended message processing of the main monitoring node.
Smart Images

Figure CN119149265A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed storage technology, and in particular to a request processing method, device, electronic device and storage medium. Background Art
[0002] With the development of virtualization, cloud computing and big data, distributed storage systems have become the main way of data storage. Distributed storage systems are a data storage method that stores data in multiple storage servers. Compared with traditional centralized storage, distributed storage systems have the advantages of high performance, scalability and low cost, and are widely used in cloud computing, Internet of Things, big data and other application scenarios. Among them, the fault detection function of the distributed storage system can timely detect the fault of the storage node and issue an alarm, which can ensure the stability and reliability of the system.
[0003] When the object storage device is in the data reconstruction state, data read and write requests need to wait for the placement group to complete data negotiation before they can be returned normally. Figure 1 , Figure 2 As shown, the existing request processing method is as follows:
[0004] (1) When the object storage device is not in the data reconstruction state, the main monitoring node is only responsible for daily information update and maintenance, information query and acquisition, etc.
[0005] (2) When the object storage device is in the data reconstruction state, that is, when the placement group needs to negotiate data, since the message queue of the main monitoring node meets the first-in-first-out processing principle of the single-threaded queue, the data read and write request needs to wait for the main monitoring node to complete the data negotiation before it can return normally. At this time, the data read and write request will be affected by other message processing on the main monitoring node, which will extend the return time of the entire data read and write request. When the cluster is large and the number of nodes is large, there will be more daily maintenance messages, and the data read and write request processing time will be longer, which is more likely to cause the request return timeout.
[0006] Therefore, there is an urgent need to propose a request processing method, device, electronic device and storage medium that can improve the processing efficiency of requests. Summary of the invention
[0007] Based on this, it is necessary to provide a request processing method, device, electronic device and storage medium that can improve the processing efficiency of requests in response to the above technical problems.
[0008] In a first aspect, a request processing method is provided, the method comprising:
[0009] Receive a data read / write request, and send the data read / write request to a target object storage device;
[0010] In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue;
[0011] In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message;
[0012] In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0013] In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0014] The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
[0015] In one embodiment, the target object storage device is determined by:
[0016] The target object storage device is determined by:
[0017] receiving a data read request, wherein the data read request includes storage location information of target data;
[0018] Generate a first query request according to the storage location information of the target data, and send the first query request to the metadata server;
[0019] Receiving data pool identification information returned by the metadata server according to the first query request;
[0020] Determine, according to the data pool identification information, location information of at least one object storage device, wherein the at least one object storage device stores the target data;
[0021] Sending a second query request to the at least one object storage device according to the location information of the at least one object storage device;
[0022] receiving the total number of data read operations to be processed and being processed within a preset time period returned by each object storage device according to the second query request;
[0023] Dividing the total number of data read operations of the at least one object storage device in the preset time period by the length of the preset time period to obtain an average number of data read operations of the at least one object storage device in the preset time period;
[0024] The target object storage device is determined according to an average number of data reads of each object storage device within a preset time period.
[0025] In one embodiment, determining the target object storage device according to the average number of data reads of each object storage device within a preset time period includes:
[0026] Determining a weight of an average number of data reads of each object storage device within a preset time period according to an average number of data reads of each object storage device within a preset time period;
[0027] Determining a read operation cost of the at least one object storage device according to an average number of data reads of each object storage device within a preset time period;
[0028] The target object storage device is determined according to the read operation cost of the at least one object storage device.
[0029] In one embodiment, determining the target object storage device according to the read operation cost of the at least one object storage device includes:
[0030] sorting the read operation cost values of the at least one object storage device from small to large, and generating a sorting result of the at least one object storage device;
[0031] According to the ranking result of the at least one object storage device, the object storage device corresponding to the read operation cost value ranked first is determined as the target object storage device.
[0032] In one embodiment, the method further comprises:
[0033] Determine placement group identification information corresponding to the target data according to the data read request;
[0034] The determining, according to the data pool identification information, location information of at least one object storage device includes:
[0035] Determining target identification information of the placement group according to the data pool identification information and the placement group identification information;
[0036] The target identification information of the placement group is calculated according to a data distribution algorithm to determine the location information of the at least one object storage device.
[0037] In one embodiment, the target object storage device is determined by:
[0038] receiving a data write request, wherein the data write request includes target data;
[0039] According to the size of each object, the target data is divided into at least one object;
[0040] Map each object to the corresponding placement group according to the data distribution algorithm, where an object can only be mapped to one placement group;
[0041] Each placement group is mapped to at least one target object storage device according to the data distribution algorithm.
[0042] In one embodiment, the method further comprises:
[0043] Receiving a data read / write request sent by at least one client, wherein the data read / write request includes a delay value and a read / write frequency value of the at least one client;
[0044] The clients whose delay value is less than the delay threshold are regarded as the first type of clients, and the clients whose delay value is greater than or equal to the delay threshold are regarded as the second type of clients;
[0045] Determining a request processing order of the first type of clients according to the read / write frequency values of the first type of clients, wherein the greater the read / write frequency value of the first type of clients, the higher the request processing priority;
[0046] The request processing order of the second type of clients is determined according to the delay value of the second type of clients, wherein the larger the delay value of the second type of clients is, the higher the request processing priority is.
[0047] In a second aspect, a request processing device is provided, the device comprising:
[0048] A receiving and transmitting module, the receiving and transmitting module is used to receive a data read and write request and send the data read and write request to a target object storage device;
[0049] A creation and recording module, wherein the creation and recording module is used to create a working message queue and a waiting message queue on the monitoring node in response to the target object storage device currently being in a data reconstruction state, and record a current length of the working message queue;
[0050] A judgment module, the judgment module is used to judge whether the next message entering the working message queue is the maintenance table update message in response to the current length of the working message queue being equal to half of the maximum length of the working message queue and the current working message queue not including the maintenance table update message;
[0051] A storage and judgment module, the storage and judgment module is used for responding that the next message entering the working message queue is other messages, putting the other messages into the waiting message queue, and judging whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0052] A judgment and update module, the judgment and update module is used to respond to the next message entering the working message queue being the maintenance table update message, and update the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0053] A transmission and processing module, wherein the transmission and processing module is used to return the maintenance table update message to the target object storage device and process the data read and write request through the target object storage device.
[0054] In a third aspect, an electronic device is provided, comprising one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, which, when read and executed by the one or more processors, execute the steps of the method described in any one of the first aspects above.
[0055] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any one of the first aspects are performed.
[0056] In a fifth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of the above-mentioned first aspects are implemented.
[0057] The above-mentioned request processing method, device, electronic device and storage medium are through setting a working message queue and a waiting message queue on the monitoring node; when the target object storage device is in a data reconstruction state, recording the current length of the working message queue; when the current length of the working message queue is half of the maximum length of the working message queue, and the current working message queue does not include a maintenance table update message, judging whether the next message entering the working message queue is a maintenance table update message; if the next message entering the working message queue is other messages, putting the other messages into the waiting message queue; if the next message entering the working message queue is a maintenance table update message, updating the object storage device maintenance table in the monitoring node; processing data read and write requests through the target object storage device, thereby improving the request processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flowchart of a request processing method when there is no data reconstruction in the background technology;
[0059] Figure 2 It is a flowchart of a request processing method when there is data reconstruction in the background technology;
[0060] Figure 3 A flowchart of a request processing method in one embodiment of the present application;
[0061] Figure 4 This is a structural block diagram of a request processing device in one embodiment of the present application;
[0062] Figure 5 This is a diagram of the internal structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] Embodiment 1
[0065] In one embodiment, Figure 3 As shown, a request processing method is provided, the method comprising:
[0066] Receive a data read / write request, and send the data read / write request to a target object storage device;
[0067] In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue;
[0068] In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message;
[0069] In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0070] In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0071] The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
[0072] Specifically, when the current length of the working message queue is less than half of the maximum length and the current working message queue includes a maintenance table update message, the data read request is processed in the order in the working message queue; the above-mentioned monitoring node is generally a main monitoring node, and when the backup monitoring node receives a maintenance table update message, the maintenance table update message is forwarded to the main monitoring node for processing; after other messages are placed in the waiting message queue, other messages in the waiting queue are placed one by one in the working message queue at preset time intervals, such as 1 second; after updating the object storage device maintenance table in the main monitoring node, the maintenance table update message is forwarded to the target object storage device through the backup monitoring node.
[0073] Specifically, a working message queue and a waiting message queue are set on the monitoring node; when the target object storage device is in a data reconstruction state, the current length of the working message queue is recorded; when the current length of the working message queue is half of the maximum length of the working message queue, and the current working message queue does not include a maintenance table update message, it is determined whether the next message entering the working message queue is a maintenance table update message; if the next message entering the working message queue is other messages, the other messages are placed in the waiting message queue; if the next message entering the working message queue is a maintenance table update message, the object storage device maintenance table in the monitoring node is updated; data read and write requests are processed by the target object storage device, thereby improving the request processing efficiency.
[0074] In one embodiment, the target object storage device is determined by:
[0075] receiving a data read request, wherein the data read request includes storage location information of target data;
[0076] Generate a first query request according to the storage location information of the target data, and send the first query request to the metadata server;
[0077] Receiving data pool identification information returned by the metadata server according to the first query request;
[0078] Determine, according to the data pool identification information, location information of at least one object storage device, wherein the at least one object storage device stores the target data;
[0079] Sending a second query request to the at least one object storage device according to the location information of the at least one object storage device;
[0080] receiving the total number of data read operations to be processed and being processed within a preset time period returned by each object storage device according to the second query request;
[0081] Dividing the total number of data read operations of the at least one object storage device in the preset time period by the length of the preset time period to obtain an average number of data read operations of the at least one object storage device in the preset time period;
[0082] The target object storage device is determined according to an average number of data reads of each object storage device within a preset time period.
[0083] Specifically, according to the average number of data reads of the object storage device, the best target object storage device for reading the target data is screened out, thereby improving the reading speed of the target data.
[0084] In one embodiment, determining the target object storage device according to the average number of data reads of each object storage device within a preset time period includes:
[0085] Determining a weight of an average number of data reads of each object storage device within a preset time period according to an average number of data reads of each object storage device within a preset time period;
[0086] Determining a read operation cost of the at least one object storage device according to an average number of data reads of each object storage device within a preset time period;
[0087] The target object storage device is determined according to the read operation cost of the at least one object storage device.
[0088] In one embodiment, determining the target object storage device according to the read operation cost of the at least one object storage device includes:
[0089] sorting the read operation cost values of the at least one object storage device from small to large, and generating a sorting result of the at least one object storage device;
[0090] According to the ranking result of the at least one object storage device, the object storage device corresponding to the read operation cost value ranked first is determined as the target object storage device.
[0091] In one embodiment, the method further comprises:
[0092] Determine placement group identification information corresponding to the target data according to the data read request;
[0093] The determining, according to the data pool identification information, location information of at least one object storage device includes:
[0094] Determining target identification information of the placement group according to the data pool identification information and the placement group identification information;
[0095] The target identification information of the placement group is calculated according to a data distribution algorithm to determine the location information of the at least one object storage device.
[0096] Specifically, the location of the object storage device is determined according to the placement group identification information and the data pool identification information, so as to further determine the target object storage device later.
[0097] In one embodiment, the target object storage device is determined by:
[0098] receiving a data write request, wherein the data write request includes target data;
[0099] According to the size of each object, the target data is divided into at least one object;
[0100] Map each object to the corresponding placement group according to the data distribution algorithm, where an object can only be mapped to one placement group;
[0101] Each placement group is mapped to at least one target object storage device according to the data distribution algorithm.
[0102] In one embodiment, the method further comprises:
[0103] Receiving a data read / write request sent by at least one client, wherein the data read / write request includes a delay value and a read / write frequency value of the at least one client;
[0104] The clients whose delay value is less than the delay threshold are regarded as the first type of clients, and the clients whose delay value is greater than or equal to the delay threshold are regarded as the second type of clients;
[0105] Determining a request processing order of the first type of clients according to the read / write frequency values of the first type of clients, wherein the greater the read / write frequency value of the first type of clients, the higher the request processing priority;
[0106] The request processing order of the second type of clients is determined according to the delay value of the second type of clients, wherein the larger the delay value of the second type of clients is, the higher the request processing priority is.
[0107] Specifically, the client request processing order is determined based on the delay value and read and write frequency, so that the storage cluster can give priority to the corresponding client requests based on the actual business requests, avoiding losses caused by blocking important requests, improving the quality and stability of distributed storage client network communication services, and improving user service experience.
[0108] In one embodiment, the target object storage device includes at least one placement group, and after returning the maintenance table update message to the target object storage device, the method further includes:
[0109] Determine, according to the maintenance table update message, a placement group that needs to be updated and a current version number of the object storage device maintenance table in the placement group;
[0110] Adding the placement group to a version update queue at a position corresponding to a current version number of the object storage device maintenance table, wherein the version update queue includes a mapping relationship between the version number of the object storage device maintenance table and the placement group;
[0111] According to the update priority of the version number, the version numbers in the version update queue are sorted from low to high to generate a version sorting result;
[0112] Dequeue the corresponding placement groups in sequence according to the version sorting result, and update the version of the object storage device maintenance table in the dequeued placement groups;
[0113] The version update queue is a storage structure of key-value pairs, the key is the version number of the object storage device maintenance table, and the value is all placement groups having the version number of the object storage device maintenance table.
[0114] Specifically, by setting a version update queue, the placement group corresponding to the version number in the version update queue is dequeued according to the update priority of the version number, and the version of the object storage device maintenance table in the dequeued placement group is updated, so that the placement group corresponding to the high-priority version number (low version number) is dequeued first, and when the current version number of the object storage device maintenance table in the placement group is too different from the latest version number, the object storage device maintenance tables of all placement groups are synchronized. At the same time, it also avoids the waste of thread resources caused by no substantial processing of the thread when the placement group corresponding to the high version number in the first-in-first-out queue in the prior art is dequeued, reduces unnecessary dequeue processing, and improves the speed of data recovery to a certain extent.
[0115] It should be understood that although Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0116] Embodiment 2
[0117] In one embodiment, Figure 4 As shown, a request processing device is provided, the device comprising:
[0118] A receiving and transmitting module, the receiving and transmitting module is used to receive a data read and write request and send the data read and write request to a target object storage device;
[0119] A creation and recording module, wherein the creation and recording module is used to create a working message queue and a waiting message queue on the monitoring node in response to the target object storage device currently being in a data reconstruction state, and record a current length of the working message queue;
[0120] A judgment module, the judgment module is used to judge whether the next message entering the working message queue is the maintenance table update message in response to the current length of the working message queue being equal to half of the maximum length of the working message queue and the current working message queue not including the maintenance table update message;
[0121] A storage and judgment module, the storage and judgment module is used for responding that the next message entering the working message queue is other messages, putting the other messages into the waiting message queue, and judging whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0122] A judgment and update module, the judgment and update module is used to respond to the next message entering the working message queue being the maintenance table update message, and update the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0123] A transmission and processing module, wherein the transmission and processing module is used to return the maintenance table update message to the target object storage device and process the data read and write request through the target object storage device.
[0124] In one embodiment, the apparatus further includes a determination module, and the determination module is used to determine a target object storage device, including:
[0125] receiving a data read request, wherein the data read request includes storage location information of target data;
[0126] Generate a first query request according to the storage location information of the target data, and send the first query request to the metadata server;
[0127] Receiving data pool identification information returned by the metadata server according to the first query request;
[0128] Determine, according to the data pool identification information, location information of at least one object storage device, wherein the at least one object storage device stores the target data;
[0129] Sending a second query request to the at least one object storage device according to the location information of the at least one object storage device;
[0130] receiving the total number of data read operations to be processed and being processed within a preset time period returned by each object storage device according to the second query request;
[0131] Dividing the total number of data read operations of the at least one object storage device in the preset time period by the length of the preset time period to obtain an average number of data read operations of the at least one object storage device in the preset time period;
[0132] The target object storage device is determined according to an average number of data reads of each object storage device within a preset time period.
[0133] In one embodiment, the determination module is used to determine the target object storage device, including:
[0134] Determining a weight of an average number of data reads of each object storage device within a preset time period according to an average number of data reads of each object storage device within a preset time period;
[0135] Determining a read operation cost of the at least one object storage device according to an average number of data reads of each object storage device within a preset time period;
[0136] The target object storage device is determined according to the read operation cost of the at least one object storage device.
[0137] In one embodiment, the determination module is used to determine the target object storage device, including:
[0138] sorting the read operation cost values of the at least one object storage device from small to large, and generating a sorting result of the at least one object storage device;
[0139] According to the ranking result of the at least one object storage device, the object storage device corresponding to the read operation cost value ranked first is determined as the target object storage device.
[0140] In one embodiment, the determination module is used to determine the target object storage device, including:
[0141] Determine placement group identification information corresponding to the target data according to the data read request;
[0142] The determining, according to the data pool identification information, location information of at least one object storage device includes:
[0143] Determining target identification information of the placement group according to the data pool identification information and the placement group identification information;
[0144] The target identification information of the placement group is calculated according to a data distribution algorithm to determine the location information of the at least one object storage device.
[0145] In one embodiment, the determination module is used to determine the target object storage device, including:
[0146] receiving a data write request, wherein the data write request includes target data;
[0147] According to the size of each object, the target data is divided into at least one object;
[0148] Map each object to the corresponding placement group according to the data distribution algorithm, where an object can only be mapped to one placement group;
[0149] Each placement group is mapped to at least one target object storage device according to the data distribution algorithm.
[0150] In one embodiment, the apparatus further comprises:
[0151] A receiving module, the receiving module is used to receive a data read and write request sent by at least one client, wherein the data read and write request includes a delay value and a read and write frequency value of the at least one client;
[0152] A comparison and classification module, the comparison and classification module is used to classify clients with delay values less than a delay threshold as first-type clients, and clients with delay values greater than or equal to the delay threshold as second-type clients;
[0153] A first determination module, the first determination module is used to determine the request processing order of the first type of client according to the read and write frequency value of the first type of client, wherein the greater the read and write frequency value of the first type of client, the higher the request processing priority;
[0154] The second determination module is used to determine the request processing order of the second type of client according to the delay value of the second type of client, wherein the larger the delay value of the second type of client is, the higher the request processing priority is.
[0155] For the specific definition of the request processing device, please refer to the definition of the request processing method above, which will not be repeated here. Each module in the above request processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0156] Embodiment 3
[0157] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0158] Receive a data read / write request, and send the data read / write request to a target object storage device;
[0159] In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue;
[0160] In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message;
[0161] In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0162] In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0163] The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
[0164] When the program instructions are read and executed by the one or more processors, the program instructions may also perform operations corresponding to the steps in the above method embodiments, and the above description may be referred to, which will not be repeated here. Figure 5 , which exemplarily shows the architecture of an electronic device, which may specifically include a processor 510, a video display adapter 511, a disk drive 512, an input / output interface 513, a network interface 514, and a memory 520. The processor 510, the video display adapter 511, the disk drive 512, the input / output interface 513, the network interface 514, and the memory 520 may be communicatively connected via a communication bus 530.
[0165] Among them, the processor 510 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.
[0166] The memory 520 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 520 can store an operating system 521 for controlling the operation of the electronic device 500, and a basic input and output system (BIOS) 522 for controlling the low-level operation of the electronic device 500. In addition, a web browser 523, a data storage manager 524, and an icon font processing system 525, etc. can also be stored. The above-mentioned icon font processing system 525 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided in the present application is implemented by software or firmware, the relevant program code is stored in the memory 520 and is called and executed by the processor 510.
[0167] The input / output interface 513 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0168] The network interface 514 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0169] The bus 530 comprises a pathway for transmitting information between the various components of the device (eg, the processor 510, the video display adapter 511, the disk drive 512, the input / output interface 513, the network interface 514, and the memory 520).
[0170] In addition, the electronic device 500 can also obtain information on specific collection conditions from the virtual resource object collection condition information database 541 for use in condition judgment, etc.
[0171] It should be noted that, although the electronic device 500 only shows a processor 510, a video display adapter 511, a disk drive 512, an input / output interface 513, a network interface 514, a memory 520, a bus 530, etc., in the specific implementation process, the electronic device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.
[0172] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling an electronic device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0173] Embodiment 4
[0174] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0175] Receive a data read / write request, and send the data read / write request to a target object storage device;
[0176] In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue;
[0177] In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message;
[0178] In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0179] In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0180] The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
[0184] Embodiment 5
[0185] In one embodiment, a computer program product is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0186] Receive a data read / write request, and send the data read / write request to a target object storage device;
[0187] In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue;
[0188] In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message;
[0189] In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message;
[0190] In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message;
[0191] The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
[0192] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer program product. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0194] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A request processing method, characterized in that: The method comprises: Receive a data read / write request, and send the data read / write request to a target object storage device; In response to the target object storage device currently being in a data reconstruction state, creating a working message queue and a waiting message queue on the monitoring node, and recording a current length of the working message queue; In response to the current length of the working message queue being equal to half of the maximum length of the working message queue, and the current working message queue not including a maintenance table update message, determining whether a next message entering the working message queue is the maintenance table update message; In response to the next message entering the working message queue being other messages, putting the other messages into the waiting message queue, and determining whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message; In response to the next message entering the work message queue being the maintenance table update message, updating the object storage device maintenance table in the monitoring node according to the maintenance table update message; The maintenance table update message is returned to the target object storage device, and the data read and write request is processed by the target object storage device.
2. The method according to claim 1, characterized in that: The target object storage device is determined by: receiving a data read request, wherein the data read request includes storage location information of target data; Generate a first query request according to the storage location information of the target data, and send the first query request to the metadata server; Receiving data pool identification information returned by the metadata server according to the first query request; Determine, according to the data pool identification information, location information of at least one object storage device, wherein the at least one object storage device stores the target data; Sending a second query request to the at least one object storage device according to the location information of the at least one object storage device; receiving the total number of data read operations to be processed and being processed within a preset time period returned by each object storage device according to the second query request; Dividing the total number of data read operations of the at least one object storage device in the preset time period by the length of the preset time period to obtain an average number of data read operations of the at least one object storage device in the preset time period; The target object storage device is determined according to an average number of data reads of each object storage device within a preset time period.
3. The method according to claim 2, characterized in that: The determining the target object storage device according to the average number of data reads of each object storage device within a preset time period includes: Determining a weight of an average number of data reads of each object storage device within a preset time period according to an average number of data reads of each object storage device within a preset time period; Determining a read operation cost of the at least one object storage device according to an average number of data reads of each object storage device within a preset time period; The target object storage device is determined according to the read operation cost of the at least one object storage device.
4. The method according to claim 3, characterized in that: The determining the target object storage device according to the read operation cost of the at least one object storage device includes: sorting the read operation cost values of the at least one object storage device from small to large, and generating a sorting result of the at least one object storage device; According to the ranking result of the at least one object storage device, the object storage device corresponding to the read operation cost value ranked first is determined as the target object storage device.
5. The method according to claim 2, characterized in that: The method further comprises: Determine placement group identification information corresponding to the target data according to the data read request; The determining, according to the data pool identification information, location information of at least one object storage device includes: Determining target identification information of the placement group according to the data pool identification information and the placement group identification information; The target identification information of the placement group is calculated according to a data distribution algorithm to determine the location information of the at least one object storage device.
6. The method according to claim 1, characterized in that: The target object storage device is determined by: receiving a data write request, wherein the data write request includes target data; According to the size of each object, the target data is divided into at least one object; Map each object to the corresponding placement group according to the data distribution algorithm, where an object can only be mapped to one placement group; Each placement group is mapped to at least one target object storage device according to the data distribution algorithm.
7. The method according to claim 1, characterized in that: The method further comprises: Receiving a data read / write request sent by at least one client, wherein the data read / write request includes a delay value and a read / write frequency value of the at least one client; The clients whose delay value is less than the delay threshold are regarded as the first type of clients, and the clients whose delay value is greater than or equal to the delay threshold are regarded as the second type of clients; Determining a request processing order of the first type of clients according to the read / write frequency values of the first type of clients, wherein the greater the read / write frequency value of the first type of clients, the higher the request processing priority; The request processing order of the second type of clients is determined according to the delay value of the second type of clients, wherein the larger the delay value of the second type of clients is, the higher the request processing priority is.
8. A request processing device, characterized in that: The device comprises: A receiving and transmitting module, the receiving and transmitting module is used to receive a data read and write request and send the data read and write request to a target object storage device; A creation and recording module, wherein the creation and recording module is used to create a working message queue and a waiting message queue on the monitoring node in response to the target object storage device currently being in a data reconstruction state, and record a current length of the working message queue; A judgment module, the judgment module is used to judge whether the next message entering the working message queue is the maintenance table update message in response to the current length of the working message queue being equal to half of the maximum length of the working message queue and the current working message queue not including the maintenance table update message; A storage and judgment module, the storage and judgment module is used for responding that the next message entering the working message queue is other messages, putting the other messages into the waiting message queue, and judging whether the next message entering the working message queue is the maintenance table update message, wherein the other messages include messages other than the maintenance table update message; A judgment and update module, the judgment and update module is used to respond to the next message entering the working message queue being the maintenance table update message, and update the object storage device maintenance table in the monitoring node according to the maintenance table update message; A transmission and processing module, wherein the transmission and processing module is used to return the maintenance table update message to the target object storage device and process the data read and write request through the target object storage device.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Fault processing method and device for distributed storage system, equipment and storage medium
CN119806885A
