Data storage method and device, computer equipment, readable storage medium and product
By deploying multiple request processors in the cloud hard disk data access system and striping the data storage requests, the problem of insufficient IO capabilities of cloud hard disk is solved, data storage performance is improved and application scenarios are expanded.
Patent Information
- Application Number
- CN202411671712.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
In high-performance computing and intensive reading and writing application scenarios, existing cloud hard disks have insufficient IO capabilities and cannot meet the needs of large databases and data warehouses.
By deploying multiple request processors in the data access system of cloud hard disk, the request segmentation party controls striping the data storage request, obtains multiple sub-requests, and outputs these sub-requests to the corresponding target processor for response.
It improves the data storage performance of cloud hard disk, can handle more data storage requests per unit time, and expands the application scenarios of cloud hard disk.
Smart Images

Figure CN119473158A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud storage technology, and in particular to a data storage method, apparatus, computer equipment, readable storage medium and product. Background Art
[0002] With the development of cloud computing technology, more and more users choose to migrate their businesses to the cloud, which poses a challenge to cloud service providers in terms of diversified customer business needs. However, the maximum capacity of existing cloud hard disks is still insufficient in application scenarios such as high-performance computing and intensive read and write. For example, the maximum input / output operations per second (IOPS) of a single disk is only 33,000, the maximum input / output (IO) throughput is 350MB / S, and the single-queue IO latency is 1ms, which cannot meet the needs of large databases and data warehouses.
[0003] Therefore, it is urgent to optimize cloud hard disks and improve their IO capabilities to expand their application scenarios. Summary of the invention
[0004] Based on this, it is necessary to provide a data storage method, device, computer equipment, readable storage medium and product to address the above technical problems, which can improve the storage performance of cloud hard disks and expand the application scenarios of cloud hard disks.
[0005] In a first aspect, the present application provides a data storage method, comprising:
[0006] Determine at least one data storage request; the data storage request carries data to be stored;
[0007] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0008] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0009] Controls the target processor to respond to the corresponding sub-request.
[0010] In one of the embodiments, in the process of executing the control request splitting party to perform striping processing on each data storage request to obtain at least two sub-requests, the method further includes:
[0011] The control request splitting party allocates a request identifier to each sub-request obtained by splitting;
[0012] Accordingly, selecting a target processor corresponding to each sub-request from at least two request processors in the data access system includes:
[0013] Get the request identifier corresponding to each sub-request;
[0014] According to the request identifier corresponding to each sub-request, a target processor corresponding to each sub-request is selected from at least two request processors in the data access system.
[0015] In one embodiment, controlling the request splitter to output each sub-request to a corresponding target processor includes:
[0016] For any sub-request, the control request splitter outputs the sub-request to the lock-free queue corresponding to the corresponding target processing party;
[0017] When it is detected that there is a sub-request in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0018] In one embodiment, the method further comprises:
[0019] For any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state.
[0020] In one embodiment, controlling the target processor to respond to the corresponding sub-request includes:
[0021] The control target processor parses the sub-request to obtain the required storage location corresponding to the sub-request;
[0022] Call the hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk;
[0023] Control the target processor to store the data to be stored carried in the sub-request into the target storage address.
[0024] In one embodiment, determining at least one data storage request includes:
[0025] receiving at least one initial storage request sent by a client;
[0026] The format of the initial storage request is converted to obtain a corresponding data storage request.
[0027] In a second aspect, the present application also provides a data storage device, comprising:
[0028] A request determination module, used to determine at least one data storage request; the data storage request carries data to be stored;
[0029] a request splitting module, used to control the request splitting party to perform striping processing on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitting party;
[0030] A request allocation module, used to select a target processor corresponding to each sub-request from at least two request processors in the data access system, and control the request splitter to output each sub-request to the corresponding target processor;
[0031] The request response module is used to control the target processing party to respond to the corresponding sub-request.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Determine at least one data storage request; the data storage request carries data to be stored;
[0034] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0035] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0036] Controls the target processor to respond to the corresponding sub-request.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Determine at least one data storage request; the data storage request carries data to be stored;
[0039] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0040] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0041] Controls the target processor to respond to the corresponding sub-request.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0043] Determine at least one data storage request; the data storage request carries data to be stored;
[0044] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0045] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0046] Controls the target processor to respond to the corresponding sub-request.
[0047] The above-mentioned data storage method, apparatus, computer equipment, readable storage medium and product, when there is a data storage request, controls the request splitting party to stripe each data storage request to obtain at least two sub-requests. Further, the control request splitting party outputs each sub-request to the corresponding target processing party, and controls the target processing party to respond to the corresponding sub-request. In the above process, multiple request processing parties are deployed in the data access system of the cloud hard disk, that is, there are multiple processing threads for responding to data storage requests, which can respond to more data storage requests in unit time, improve data storage efficiency, and thus improve the data storage performance of the cloud hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 An application environment diagram of a data storage method in one embodiment;
[0050] Figure 2 A schematic diagram of a flow chart of a data storage method in one embodiment;
[0051] Figure 3 A flowchart of target processing party selection steps in one embodiment;
[0052] Figure 4 A flowchart of a request output step in one embodiment;
[0053] Figure 5 A schematic diagram of a process flow of a request response step in an embodiment;
[0054] Figure 6A flowchart of a data storage request determination step in one embodiment;
[0055] Fig. 7A is an application environment diagram of a data storage method in another embodiment;
[0056] Figure 7B A schematic diagram of a flow chart of a data storage method in another embodiment;
[0057] Figure 8 is a structural block diagram of a data storage device in one embodiment;
[0058] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] 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.
[0060] Before introducing the data storage method provided by this application, it should be noted that currently all functional modules of the IO processing of the cloud hard disk are concentrated in one thread. Therefore, when there is only one thread, the IO capability of the thread is limited, resulting in a performance bottleneck in the IO function of the cloud hard disk. This application is proposed to solve the above problem, a method that can improve the data storage performance of the cloud hard disk.
[0061] The data storage method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the data access system 104 through the network. The data storage system can store the data that the data access system 104 needs to process. The data storage system can be integrated on the data access system 104, or it can be placed on the cloud or other network servers. Specifically, the data access system 104 determines at least one data storage request; the data storage request carries the data to be stored; the data access system 104 controls the request splitter to stripe each data storage request to obtain at least two sub-requests; wherein the data access system includes a request splitter; the data access system 104 selects the target processor corresponding to each sub-request from at least two request processors in the data access system, and controls the request splitter to output each sub-request to the corresponding target processor; the data access system 104 controls the target processor to respond to the corresponding sub-request, and outputs the request processing result to the terminal 102.
[0062] In an exemplary embodiment, Figure 2As shown, a data storage method is provided, which is applied to Figure 1 The data access system 104 in the example is used as an example to illustrate, and includes the following steps:
[0063] S210, determining at least one data storage request.
[0064] The data storage request carries the data to be stored, and is used to request that the data to be stored carried therein be stored in the cloud hard disk.
[0065] In this embodiment, the initial storage request sent by the client may be directly used as the data storage request. Alternatively, after receiving the initial storage request sent by the client, the initial storage request may be processed to obtain at least one data storage request.
[0066] S220 , controlling the request splitting party to perform striping processing on each data storage request to obtain at least two sub-requests.
[0067] The data access system includes a request splitter; the request splitter is used to perform striping processing on the data storage request to split the data storage request into multiple sub-requests with the same width.
[0068] In this embodiment, after determining at least one data storage request, in order to facilitate processing of the data storage request, the control request splitting party performs striping processing on each data storage request.
[0069] S230, selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitting party to output each sub-request to the corresponding target processor.
[0070] The request processor is used to process the data storage request. For any sub-request, the corresponding target processor is the request processor used to process the sub-request.
[0071] In this embodiment, at least two request processors are deployed in the data access system, that is, in the process of processing data storage requests, the data storage requests can be input into different request processing threads respectively, thereby improving data storage efficiency.
[0072] S240, controlling the target processor to respond to the corresponding sub-request.
[0073] Specifically, in this embodiment, the target processor is controlled to respond to the sub-request to store the to-be-stored data corresponding to the sub-request to a corresponding location.
[0074] It should be noted that although the present application is a data storage method, it is understandable that the data access system of the cloud hard disk can not only store data, but also read data. In this embodiment, data reading is the reverse step of data storage, which will not be described in detail here.
[0075] In the above data storage method, when there is a data storage request, the control request splitter stripes each data storage request to obtain at least two sub-requests. Further, the control request splitter outputs each sub-request to the corresponding target processor, and controls the target processor to respond to the corresponding sub-request. In the above process, multiple request processors are deployed in the data access system of the cloud hard disk, that is, there are multiple processing threads for responding to data storage requests, which can respond to more data storage requests in unit time, improve data storage efficiency, and thus improve the data storage performance of the cloud hard disk.
[0076] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In the optional embodiment, in the process of controlling the request splitting party to stripe each data storage request to obtain at least two sub-requests, the method also includes controlling the request splitting party to assign a request identifier to each sub-request obtained by the splitting. In this case, the process of selecting the target processing party corresponding to each sub-request from the at least two sub-request processing parties in the data access system is refined.
[0077] See also Figure 3 The target processor selection steps shown include:
[0078] S310, obtaining a request identifier corresponding to each sub-request.
[0079] The request identifier is used to indicate the request type of the sub-request, and may also be numbering information for simply numbering each sub-request.
[0080] In this embodiment, when the request splitting party controls the data storage request to be striped, the request splitting party will mark each sub-request with a request identifier. Therefore, in this embodiment, the request identifier corresponding to each sub-request can be directly obtained from the request annotation of each sub-request.
[0081] S320: Select a target processor corresponding to each sub-request from at least two request processors in the data access system according to the request identifier corresponding to each sub-request.
[0082] Illustratively, in this embodiment, the correspondence between the reference identifier and the reference processor can be predetermined, and the request identifier corresponding to each sub-request and the corresponding reference processor in the correspondence are used as the target processor corresponding to the corresponding sub-request.
[0083] Exemplarily, in this embodiment, the target processor corresponding to each sub-request can also be determined in order according to the size relationship of the request identifiers corresponding to each request. For example, the request processors are sorted, and each sub-request is sorted according to the request identifier, and request processor 1 is used as the target processor of the first n sub-requests; or, the first request processor is used as the target processor of the first sub-request. This application does not impose any restrictions on the selection logic of the target processor, but in the process of selecting the target processor, the selection principle is that the sorting result will not cause IO disorder.
[0084] In the above embodiment, a target processor is assigned to each sub-request according to the request identifier of different sub-requests, and different sub-requests are assigned to different request processors (i.e., enter different threads), which will not cause IO disorder and can improve concurrency performance. It can also extract the complex and diverse work in the IO process and put it into different threads, thereby improving IO performance.
[0085] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, the process of the above control request splitting party outputting each sub-request to the corresponding target processing party is refined.
[0086] See also Figure 4 The request output steps shown include:
[0087] S410: For any sub-request, the request splitting party is controlled to output the sub-request to a lock-free queue corresponding to a corresponding target processing party.
[0088] Among them, lock-free queues allow multiple threads to access and operate safely without using traditional locking mechanisms (such as mutex locks).
[0089] S420: When it is detected that a sub-request exists in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0090] In this embodiment, the existence of sub-requests in each lock-free queue may be detected. For any target processor, when it is detected that there is a sub-request in its corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0091] It is understandable that different sub-requests in the lock-free queue have a sequential input order. In this embodiment, the target processing party can be controlled to obtain the sub-request with the earliest input time from the corresponding lock-free queue.
[0092] In the above embodiment, by setting a lock-free queue, each request processor can directly obtain the corresponding sub-request from the corresponding lock-free queue without exclusive access.
[0093] It should be noted that in order to maximize the use of the operating capacity of the central processing unit (CPU), the thread accesses the lock-free queue in the form of polling, which will inevitably cause a waste of CPU resources in the absence of IO. Accordingly, in this embodiment, for any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state. When IO arrives, the IO thread is woken up for processing, which can reasonably utilize CPU resources and take into account the improvement of IO performance.
[0094] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, the process of the control target processor responding to the corresponding sub-request is described in detail.
[0095] See also Figure 5 The request response steps shown include:
[0096] S510, controlling the target processing party to parse the sub-request to obtain the required storage location corresponding to the sub-request.
[0097] The required storage location is used to indicate the location on the cloud hard disk where the sub-request wants to store the data to be stored.
[0098] Illustratively, in this embodiment, different sub-requests carry required storage locations corresponding to corresponding data to be stored.
[0099] S520, calling a hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk.
[0100] Specifically, in this embodiment, a hard disk address determination interface is called, and based on a hard disk address determination model, a target storage address matching the required storage location is selected from various storage addresses of the cloud hard disk.
[0101] It should be noted that, in order to reduce CPU usage, in this embodiment, the hard disk address determination model is outside the data access system, and the computing power required for its operation will not affect the data access system and will not cause CPU occupation.
[0102] S530, controlling the target processor to store the to-be-stored data carried in the sub-request into the target storage address.
[0103] In the above embodiment, the tool / model for determining the target storage address is removed from the data access system so that its operation does not cause CPU occupation, thereby further improving the system IO performance.
[0104] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, the process of determining at least one data storage request is refined.
[0105] See also Figure 6 The data storage request determination steps shown include:
[0106] S610: Receive at least one initial storage request sent by a client.
[0107] The initial storage request is a disk-level request and carries data to be stored.
[0108] S620: Convert the format of the initial storage request to obtain a corresponding data storage request.
[0109] Specifically, in this embodiment, the format of the initial storage request is converted so that the data access system can recognize it and facilitate subsequent processing.
[0110] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, the data storage method is applied to Fig. 7A Taking the application scenario shown as an example, the data storage method provided by the present application is introduced in detail.
[0111] See also Figure 7B The data storage method shown includes:
[0112] S701, receiving at least one initial storage request sent by a client;
[0113] Receiving at least one initial storage request sent by a client through a LIBRBD client;
[0114] S702, converting the format of the initial storage request to obtain a corresponding data storage request;
[0115] By building an image request module (BuildImageRequest), the initial storage request is converted from a disk-level request to a data storage request that the system can recognize and process;
[0116] S703, controlling the request splitting party to perform striping processing on each data storage request to obtain at least two sub-requests;
[0117] The data access system includes a request splitter (Striper and BuildObjecterRequest); the data storage request is striped by Striper to obtain at least two sub-requests;
[0118] S704, controlling the request splitting party to assign a request identifier to each sub-request obtained by splitting;
[0119] S705, obtaining a request identifier corresponding to each sub-request;
[0120] S706, selecting a target processor corresponding to each sub-request from at least two request processors in the data access system according to the request identifier corresponding to each sub-request;
[0121] Determine the target thread (i.e., target processor) corresponding to each subrequest through the request dispatcher (DispatchObjecter and HASH OBJECT_ID);
[0122] The striped sub-requests have request boundaries. Requests are allocated according to different object IDs after striping. Different sub-requests enter different thread queues. This approach will not cause IO disorder, but can improve concurrency performance. It can also extract complex and diverse work in the IO thread and put it into different threads for processing. By improving concurrency, this can greatly improve IO performance.
[0123] S707, for any sub-request, controlling the request splitting party to output the sub-request to the lock-free queue corresponding to the corresponding target processing party;
[0124] Exemplarily, each sub-request is output to a corresponding producer thread (objectworker), thereby inputting the corresponding sub-request into a corresponding lock-free queue (lockfree_queue);
[0125] It should be noted that through boost's lockfree:queue single producer, single consumer lock-free queue, a multi-producer multi-consumer lock-free queue is implemented. The basic idea is to establish an independent lock-free queue between each producer and consumer, so that there is basically no mutual exclusion access between threads, which greatly improves IO performance;
[0126] S708, when it is detected that there is a sub-request in the corresponding lock-free queue, controlling the target processor to obtain the sub-request from the lock-free queue;
[0127] After the target processor obtains the subrequest from the lock-free queue, the subrequest enters the consumer queue (consumer_thread);
[0128] It should be noted that, for any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state;
[0129] S709, controlling the target processing party to parse the sub-request and obtain the required storage location corresponding to the sub-request;
[0130] S710, calling a hard disk address determination interface to select a target storage address that matches the required storage location from each storage address of the cloud hard disk;
[0131] Among them, calling the hard disk address determination interface is an internal process in the consumer queue and is not shown in the figure;
[0132] It should be noted that, in order to further reduce CPU usage, in this embodiment, the hard disk address determination interface is an assembly interface;
[0133] S711, controlling the target processor to store the data to be stored carried in the sub-request into the target storage address.
[0134] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0135] Based on the same inventive concept, the embodiment of the present application also provides a data storage device for implementing the data storage method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more data storage device embodiments provided below can refer to the limitations on the data storage method above, and will not be repeated here.
[0136] In an exemplary embodiment, Figure 8 As shown, a data storage device is provided, including: a request determination module 810, a request segmentation module 820, a request allocation module 830 and a request response module 840, wherein:
[0137] A request determination module 810 is used to determine at least one data storage request; the data storage request carries data to be stored;
[0138] The request splitting module 820 is used to control the request splitting party to perform striping processing on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitting party;
[0139] The request allocation module 830 is used to select a target processor corresponding to each sub-request from at least two request processors in the data access system, and control the request splitter to output each sub-request to the corresponding target processor;
[0140] The request response module 840 is used to control the target processing party to respond to the corresponding sub-request.
[0141] In one embodiment, the data storage device also includes an identifier allocation module, which is used to control the request splitting party to allocate request identifiers to each sub-request obtained by splitting; accordingly, the request allocation module 830 includes an identifier acquisition unit, which is used to obtain the request identifier corresponding to each sub-request; and a target processor selection unit, which is used to select the target processor corresponding to each sub-request from at least two request processors in the data access system according to the request identifier corresponding to each sub-request.
[0142] In one embodiment, the request allocation module 830 includes a first control unit, which is used to control the request splitting party to output the sub-request to the lock-free queue corresponding to the corresponding target processing party for any sub-request; and a second control unit, which is used to control the target processing party to obtain the sub-request from the lock-free queue when detecting the existence of the sub-request in the corresponding lock-free queue.
[0143] In one embodiment, the request allocation module 830 further includes a third control unit for controlling the corresponding request processor to enter a sleep state for any lock-free queue when it is detected that the lock-free queue has no sub-request within a preset period of time.
[0144] In one embodiment, the request response module 840 includes a fourth control unit, which is used to control the target processor to parse the sub-request to obtain the required storage location corresponding to the sub-request; a calling unit, which is used to call the hard disk address determination interface to select a target storage address that matches the required storage location from each storage address of the cloud hard disk; and a fifth control unit, which is used to control the target processor to store the data to be stored carried in the sub-request in the target storage address.
[0145] In one embodiment, the request determination module 810 includes a request receiving unit for receiving at least one initial storage request sent by a client; and a request conversion unit for converting the format of the initial storage request to obtain a corresponding data storage request.
[0146] Each module in the above data storage device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0147] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a data storage method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0148] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0150] Determine at least one data storage request; the data storage request carries data to be stored;
[0151] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0152] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0153] Controls the target processor to respond to the corresponding sub-request.
[0154] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0155] The control request splitting party allocates a request identifier to each sub-request obtained by splitting;
[0156] Get the request identifier corresponding to each sub-request;
[0157] According to the request identifier corresponding to each sub-request, a target processor corresponding to each sub-request is selected from at least two request processors in the data access system.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] For any sub-request, the control request splitter outputs the sub-request to the lock-free queue corresponding to the corresponding target processing party;
[0160] When it is detected that there is a sub-request in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] For any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] The control target processor parses the sub-request to obtain the required storage location corresponding to the sub-request;
[0165] Call the hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk;
[0166] Control the target processor to store the data to be stored carried in the sub-request into the target storage address.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] receiving at least one initial storage request sent by a client;
[0169] The format of the initial storage request is converted to obtain a corresponding data storage request.
[0170] 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:
[0171] Determine at least one data storage request; the data storage request carries data to be stored;
[0172] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0173] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0174] Controls the target processor to respond to the corresponding sub-request.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] The control request splitting party allocates a request identifier to each sub-request obtained by splitting;
[0177] Get the request identifier corresponding to each sub-request;
[0178] According to the request identifier corresponding to each sub-request, a target processor corresponding to each sub-request is selected from at least two request processors in the data access system.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] For any sub-request, the control request splitter outputs the sub-request to the lock-free queue corresponding to the corresponding target processing party;
[0181] When it is detected that there is a sub-request in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] For any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0185] The control target processor parses the sub-request to obtain the required storage location corresponding to the sub-request;
[0186] Call the hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk;
[0187] Control the target processor to store the data to be stored carried in the sub-request into the target storage address.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] receiving at least one initial storage request sent by a client;
[0190] The format of the initial storage request is converted to obtain a corresponding data storage request.
[0191] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0192] Determine at least one data storage request; the data storage request carries data to be stored;
[0193] Controlling the request splitter to perform striping on each data storage request to obtain at least two sub-requests; wherein the data access system includes the request splitter;
[0194] Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitter to output each sub-request to the corresponding target processor;
[0195] Controls the target processor to respond to the corresponding sub-request.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] The control request splitting party allocates a request identifier to each sub-request obtained by splitting;
[0198] Get the request identifier corresponding to each sub-request;
[0199] According to the request identifier corresponding to each sub-request, a target processor corresponding to each sub-request is selected from at least two request processors in the data access system.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] For any sub-request, the control request splitter outputs the sub-request to the lock-free queue corresponding to the corresponding target processing party;
[0202] When it is detected that there is a sub-request in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0204] For any lock-free queue, when it is detected that there is no sub-request in the lock-free queue within a preset period of time, the corresponding request processing party is controlled to enter a dormant state.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] The control target processor parses the sub-request to obtain the required storage location corresponding to the sub-request;
[0207] Call the hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk;
[0208] Control the target processor to store the data to be stored carried in the sub-request into the target storage address.
[0209] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0210] receiving at least one initial storage request sent by a client;
[0211] The format of the initial storage request is converted to obtain a corresponding data storage request.
[0212] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0213] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments 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 the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0214] 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 application.
[0215] The above 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 present application. 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 present application shall be subject to the attached claims.
Claims
1. A data storage method, characterized in that: A data access system applied to a cloud hard disk, the method comprising: Determine at least one data storage request; the data storage request carries data to be stored; Controlling the request splitter to perform striping on each of the data storage requests to obtain at least two sub-requests; wherein the data access system includes the request splitter; Selecting a target processor corresponding to each sub-request from at least two request processors in the data access system, and controlling the request splitting party to output each sub-request to the corresponding target processor; The target processor is controlled to respond to the corresponding sub-request.
2. The method according to claim 1, characterized in that In the process of executing the control request splitting party to perform striping processing on each of the data storage requests to obtain at least two sub-requests, the method further includes: Controlling the request splitting party to assign a request identifier to each sub-request obtained by splitting; Accordingly, selecting a target processor corresponding to each sub-request from at least two request processors in the data access system includes: Get the request identifier corresponding to each sub-request; According to the request identifier corresponding to each sub-request, a target processor corresponding to each sub-request is selected from at least two request processors in the data access system.
3. The method according to claim 1, characterized in that The controlling the request splitting party to output each of the sub-requests to a corresponding target processing party includes: For any sub-request, control the request splitter to output the sub-request to the lock-free queue corresponding to the corresponding target processor; When it is detected that a sub-request exists in the corresponding lock-free queue, the target processor is controlled to obtain the sub-request from the lock-free queue.
4. The method according to claim 3, characterized in that The method further comprises: For any lock-free queue, when it is detected that the lock-free queue has no sub-request within a preset period of time, the corresponding request processing party is controlled to enter a dormant state.
5. The method according to claim 1, characterized in that: The controlling the target processing party to respond to the corresponding sub-request includes: Controlling the target processing party to parse the sub-request to obtain the required storage location corresponding to the sub-request; Calling a hard disk address determination interface to select a target storage address that matches the required storage location from the storage addresses of the cloud hard disk; The target processor is controlled to store the data to be stored carried in the sub-request into the target storage address.
6. The method according to any one of claims 1 to 5, characterized in that The determining at least one data storage request comprises: receiving at least one initial storage request sent by a client; The format of the initial storage request is converted to obtain a corresponding data storage request.
7. A data storage device, characterized in that: The device comprises: A request determination module, configured to determine at least one data storage request; the data storage request carries data to be stored; a request splitting module, used to control the request splitting party to perform striping processing on each of the data storage requests to obtain at least two sub-requests; wherein the data access system includes the request splitting party; A request allocation module, configured to select a target processor corresponding to each sub-request from at least two request processors in the data access system, and control the request splitter to output each sub-request to the corresponding target processor; The request response module is used to control the target processing party to respond to the corresponding sub-request.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. 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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.