Data processing method and device, computer device, storage medium and program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGKE TENGLONG INFORMATION TECH CO LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-21
AI Technical Summary
In a kernel-based virtual machine/fast emulator architecture, the read and write performance of virtual resources is limited by multi-layer transfer and CPU mode switching, multiple data copies and virtual interrupts, resulting in poor performance.
By monitoring the shared memory or virtual machine memory of the target virtual machine, and based on its supported IO data transmission protocols, it directly or indirectly reads and sends IO request data, avoiding multi-layer kernel forwarding, and adopts differentiated write logic to achieve zero copy and compatibility.
It improves the read and write performance of virtual resources, reduces the number of data copies and CPU mode switching overhead, is compatible with multiple IO data transmission protocols, and enables efficient IO processing for the coexistence of multiple protocol virtual machines on the same compute node.
Smart Images

Figure CN122431799A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a data processing method, apparatus, computer equipment, storage medium, and program product. Background Technology
[0002] In a virtualized environment that includes cloud platforms and host machines, the read / write performance of the backend storage cluster for virtual resource access plays a decisive role in the response rate of virtual resources.
[0003] In the existing kernel-based Virtual Machine / Quick Emulator (KVM / QEMU) architecture, input / output (I / O) access requests for virtual resources need to go through multiple layers, such as the Guest Operating System (Guest OS), the virtual I / O (virtio) driver, the QEMU process (user space), Linux (kernel module), and the storage driver. This process results in three performance losses: virtual resource exit and QEMU process scheduling causing central processing unit (CPU) mode switching, multiple data memory copies, and virtual interrupts caused by I / O. As a result, there is a problem of low read and write performance for virtual resources. Summary of the Invention
[0004] Therefore, it is necessary to provide a data processing method, apparatus, computer equipment, storage medium, and program product that can improve the read and write performance of virtual resources in response to the above-mentioned technical problems.
[0005] In a first aspect, this application provides a data processing method, which is applied to an agent module in a computing node, including:
[0006] If an input / output (I / O) write request is detected in the shared memory corresponding to the target virtual machine in the compute node, the first data content corresponding to the I / O write request is read from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module; and,
[0007] The IO write request and the first data content are sent to the storage cluster for storage.
[0008] The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0009] In the above embodiments, the data transmission method can be determined based on the IO data transmission protocol supported by the target virtual machine, and data can be flexibly read from the virtual machine memory or shared memory without going through multiple kernel forwarding layers, reducing the number of data copying times and CPU mode switching losses. At the same time, it is compatible with multiple IO data transmission protocols, realizing the IO processing effect of multiple protocol virtual machines coexisting on the same computing node.
[0010] In one embodiment, depending on the data transmission method between the target virtual machine and the agent module, reading the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine includes:
[0011] When the data transmission method between the target virtual machine and the proxy module is direct transmission, the interface corresponding to the target virtual machine is called to read the first data content corresponding to the IO write request from the virtual machine memory of the target virtual machine;
[0012] When the data transmission method is indirect transmission, the first data content corresponding to the IO write request is read from the shared memory; wherein, the first data content is copied from the virtual machine memory to the shared memory.
[0013] In the above embodiments, for direct access to virtual machine memory in the direct transmission method and for reading data from shared memory in the indirect transmission method, the transmission characteristics of different protocols are accurately matched. This can maximize the zero-copy advantage of the user-space virtual host (vhost-user) protocol, while also being compatible with the universal adaptability of the RADOS Block Device (RBD) protocol, taking into account both IO performance and protocol compatibility.
[0014] In one embodiment, the method further includes:
[0015] In response to the connection request from the target virtual machine, a communication connection is established with the target virtual machine;
[0016] Based on the data transmission method between the target virtual machine and the agent module, the first data content corresponding to the IO write request is read from the shared memory or the virtual machine memory of the target virtual machine, including:
[0017] The target transmission control module reads the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module.
[0018] The target transmission control module is selected from the candidate transmission control modules deployed by the proxy module based on the transmission mode identifier carried in the connection request. Different candidate transmission control modules support different IO data transmission protocols.
[0019] In the above embodiments, the target transmission control module is adaptively selected by the transmission mode identifier in the connection request. The module is only started when there is a virtual machine connection, which avoids the waste of resources when there is no business, reduces the CPU and memory usage of the computing node, and realizes independent scheduling of the dual protocol modules without interference.
[0020] In one embodiment, the method further includes:
[0021] If an IO read request is detected in the shared memory corresponding to the target virtual machine, the second data content corresponding to the IO read request is read from the storage cluster;
[0022] According to the data transmission method, the second data content is written into the shared memory or the virtual machine memory.
[0023] In the above embodiments, the data transmission method can be determined based on the IO data transmission protocol supported by the target virtual machine. The business data read in the computing cluster can be transmitted to the virtual machine memory or shared memory without going through multiple kernel forwarding layers, which reduces the number of data copying times and CPU mode switching losses. At the same time, it is compatible with multiple IO data transmission protocols, realizing the IO processing effect of multiple protocol virtual machines coexisting on the same computing node.
[0024] In one embodiment, writing the second data content into the shared memory or the virtual machine memory according to the data transmission method includes:
[0025] When the data transmission method is direct transmission, the interface corresponding to the target virtual machine is called to write the second data content into the virtual machine memory;
[0026] When the data transmission method is indirect, the second data content is written into the shared memory; wherein, the second data content in the shared memory is used for the target virtual machine to copy to the virtual machine memory.
[0027] In the above embodiments, differentiated write logic is adopted for different transmission methods. Direct transmission achieves zero copy, while indirect transmission ensures compatibility. This can improve the read and write efficiency of high-performance virtual machines while ensuring the data reading stability of general-purpose virtual machines.
[0028] In one embodiment, the method further includes:
[0029] Receive simulated I / O requests sent from the cloud;
[0030] Send the simulated I / O request to the storage cluster;
[0031] Based on the response of the storage cluster to the simulated IO request, the processing result of the simulated IO request is fed back to the cloud; wherein, the processing result is used to reflect the connection status between the proxy module and the storage cluster.
[0032] In the above embodiments, by receiving simulated IO requests and verifying the response results of the storage cluster, the cloud platform realizes the periodic detection of the connection status of the storage cluster.
[0033] Secondly, this application also provides a data processing apparatus, which is configured in an agent module in a computing node, comprising:
[0034] The acquisition module is used to read the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine in the computing node when it detects that there is an input / output IO write request in the shared memory corresponding to the target virtual machine, according to the data transmission method between the target virtual machine and the agent module.
[0035] The sending module is used to send the IO write request and the first data content to the storage cluster for storage;
[0036] The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0037] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0038] If an input / output (I / O) write request is detected in the shared memory corresponding to the target virtual machine in the compute node, the first data content corresponding to the I / O write request is read from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module; and,
[0039] The IO write request and the first data content are sent to the storage cluster for storage.
[0040] The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0042] If an input / output (I / O) write request is detected in the shared memory corresponding to the target virtual machine in the compute node, the first data content corresponding to the I / O write request is read from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module; and,
[0043] The IO write request and the first data content are sent to the storage cluster for storage.
[0044] The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0045] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0046] If an input / output (I / O) write request is detected in the shared memory corresponding to the target virtual machine in the compute node, the first data content corresponding to the I / O write request is read from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module; and,
[0047] The IO write request and the first data content are sent to the storage cluster for storage.
[0048] The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0049] The aforementioned data processing methods, apparatus, computer equipment, storage media, and program products can determine the data transmission mode based on the IO data transmission protocol supported by the target virtual machine, flexibly read data from virtual machine memory or shared memory without going through multiple kernel layers of forwarding, reduce the number of data copying times and CPU mode switching losses, and at the same time be compatible with multiple IO data transmission protocols, achieving the IO processing effect of multiple protocol virtual machines coexisting on the same computing node. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating a data processing method in one embodiment;
[0052] Figure 2 This is a flowchart illustrating a simulated I / O request processing method in one embodiment;
[0053] Figure 3 This is a timing diagram simulating an I / O request processing method in one embodiment;
[0054] Figure 4 This is a schematic diagram of the structure of a data processing system in one embodiment;
[0055] Figure 5 This is a structural block diagram of a data processing device in one embodiment;
[0056] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] The data processing method provided in this application embodiment can be applied to application scenarios that process IO requests between virtual machines and storage clusters.
[0059] This method can be executed by an agent module within a computing node, which can be a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses.
[0060] In one exemplary embodiment, such as Figure 1 The diagram illustrates a data processing method, using an example of its application to an agent module in a compute node. The method includes the following steps:
[0061] S101, if an input / output IO write request is detected in the shared memory corresponding to the target virtual machine in the compute node, according to the data transmission method between the target virtual machine and the agent module, the first data content corresponding to the IO write request is read from the shared memory or the virtual machine memory of the target virtual machine; and the IO write request and the first data content are sent to the storage cluster for storage.
[0062] Among them, the compute node is the physical host machine in the cloud platform that deploys virtual machines and runs agent modules. It can host multiple virtual machines at the same time and supports a variety of IO data transmission protocols.
[0063] The agent module integrates the Storage Performance Development Kit (SPDK) vhost-user protocol and RADOS Block Device (RBD) functionality. The target virtual machine is a Quick Emulator (QEMU) virtual machine running on the compute node, providing virtual computing resources for the business. Shared memory is the memory area used for transferring I / O data between the virtual machine and the agent module, and is divided into virtual ring queue (vring) shared memory and general-purpose shared large page memory.
[0064] An IO write request is a write instruction initiated by the virtual machine to the storage cluster, containing information such as data address, length, and storage location. The first data content is the business data to be written to the storage cluster corresponding to the IO write request. The storage cluster is an open-source unified distributed storage system, Ceph, that provides block storage services and can receive IO data through the RBD interface.
[0065] The IO data transfer protocol is the communication specification between the virtual machine and the agent module, including the Ceph RBD protocol or the vhost-user protocol. The data transfer method is determined based on the IO data transfer protocol supported by the target virtual machine. That is, the data transfer method is based on the IO data read path determined by the protocol supported by the virtual machine, which is divided into direct read and indirect read.
[0066] For example, after the agent module starts, it enables Unix domain socket (UnixSocket) listening, does not initialize business modules, and continuously monitors the shared memory status bound to the target virtual machine; it detects whether there is an IO write request identifier in the shared memory through a polling mechanism. This identifier is written by the virtual machine's virtual input / output (virtio) device protocol. The agent module can perform a memory scan periodically (every 10ms) to ensure that requests are captured without delay.
[0067] The proxy module then first obtains the protocol adaptation information of the target virtual machine, which has been synchronized to the proxy module when the virtual machine connects. If the virtual machine uses the vhost-user protocol, the proxy module directly accesses the virtual machine's memory to read the first data content. During the reading process, memory address mapping ensures data integrity, bypassing the kernel and memory copying process. If the RBD protocol is used, the proxy module reads the first data content that has already been copied by the virtual machine from shared memory. The read operation is performed by the x block device proxy (xbd_proxy) module in the proxy module, avoiding kernel mode switching.
[0068] The proxy module encapsulates the IO write request command and the first data content into an RBD format data packet that the storage cluster can recognize, and sends it directly to the storage cluster over the network. The data packet carries a data verification identifier to ensure that there is no packet loss or error during transmission.
[0069] For example, a proxy module is deployed on a computing node of a cloud platform, running two types of QEMU virtual machines simultaneously: the first virtual machine uses the vhost-user protocol, and the second uses the RBD protocol. After the proxy module detects an IO write request to the shared memory of the first virtual machine, it directly reads business data from that virtual machine's memory; upon detecting an IO write request to the shared memory of the second virtual machine, it reads business data from the shared memory; and then encapsulates the two sets of data separately before sending them to the Ceph storage cluster to complete the write operation.
[0070] In the above embodiments, the data transmission method can be determined based on the IO data transmission protocol supported by the target virtual machine, and data can be flexibly read from the virtual machine memory or shared memory without going through multiple kernel forwarding layers, reducing the number of data copying times and CPU mode switching losses. At the same time, it is compatible with multiple IO data transmission protocols, realizing the IO processing effect of multiple protocol virtual machines coexisting on the same computing node.
[0071] In some alternative implementations, the data transmission methods between the target virtual machine and the proxy module differ, and the way the proxy module reads the first data content corresponding to the IO write request also differs.
[0072] For example, when the data transmission method between the target virtual machine and the agent module is direct transmission, the interface corresponding to the target virtual machine is called to read the first data content corresponding to the IO write request from the virtual machine memory of the target virtual machine.
[0073] The direct transmission method is an IO transmission mode based on the vhost-user protocol. The proxy module can directly call the virtual machine interface to access the virtual machine memory, achieving zero-copy data transmission.
[0074] When the target virtual machine is detected to be using the vhost-user protocol, the agent module calls the virtual machine memory registration interface, which has mapped the virtual machine memory to the agent module's user space. The agent module directly accesses the physical memory area corresponding to the IO write request through the memory address and reads the first data content. The entire process does not trigger memory copying or go through QEMU process scheduling. The read operation is executed by the virtual host block device (vhost-blk) controller calling the SPDK block device application programming interface (Spdk_bdev_API).
[0075] Optionally, when the data transmission method is indirect, the first data content corresponding to the IO write request is read from the shared memory; wherein, the first data content is copied from the virtual machine memory to the shared memory.
[0076] The indirect transmission method is an IO transmission mode based on the RBD protocol. The virtual machine first copies the data to the shared memory, and then the agent module reads the data from the shared memory.
[0077] When the target virtual machine is detected to be using the RBD protocol, the virtual machine copies the first data content from its own memory to the shared memory area agreed upon with the agent module through the RADOS block device library (librbd) or the RADOS library (librados). The virtual machine then marks the data as ready in the shared memory. After scanning the status mark, the agent module reads the first data content from the specified offset address in the shared memory. The reading process is guaranteed by the shared memory lock mechanism to ensure mutual exclusion between data reading and writing, and to avoid data corruption.
[0078] For example, if target virtual machine A uses the vhost-user direct transmission method, after initiating an IO write request, the agent module directly calls the virtual machine memory interface to read the corresponding write data content; if target virtual machine B uses the RBD indirect transmission method, the corresponding write data content is first copied to shared memory, and then the agent module reads the data from shared memory. After both methods complete the data reading, the data is sent to the storage cluster.
[0079] In the above embodiments, the direct transmission method directly accesses the virtual machine memory, while the indirect transmission method reads data from shared memory. This accurately matches the transmission characteristics of different protocols, maximizing the zero-copy advantage of the vhost-user protocol, while also being compatible with the universal adaptability of the RBD protocol, thus balancing IO performance and protocol compatibility.
[0080] In some optional implementations, a connection can be established between the target virtual machine and the agent module when the target virtual machine starts. After the connection is established, the agent module starts the corresponding transmission module deployed inside the agent based on the transmission protocol supported by the target virtual machine.
[0081] Based on this, in response to the connection request of the target virtual machine, a communication connection can be established with the target virtual machine, and the first data content corresponding to the IO write request can be read from the shared memory or the virtual machine memory of the target virtual machine through the target transmission control module, according to the data transmission method between the target virtual machine and the agent module.
[0082] The connection request is a communication establishment request initiated by the target virtual machine to the agent module after startup, carrying a transmission mode identifier.
[0083] The target transmission control module is the module within the proxy module used to handle corresponding protocol I / O requests, including the xbd_proxy module and the vhost-blk controller module. The target transmission control module is selected from among the candidate transmission control modules deployed in the proxy module based on the transmission mode identifier carried in the connection request. Different candidate transmission control modules support different I / O data transmission protocols. The candidate transmission control modules are a set of transmission control modules pre-configured by the proxy module that support different protocols. The transmission mode identifier is a protocol marker carried in the connection request, used to distinguish between the RBD protocol and the vhost-user protocol.
[0084] The proxy module continuously listens on the Unix Socket port. When it receives a connection request from the target virtual machine, it immediately establishes a dual communication channel with the virtual machine using both Transmission Control Protocol (TCP) and shared memory. The Unix Socket is used to transmit management commands, and the shared memory is used to transmit I / O data. After the connection is established, the proxy module parses the transmission mode identifier in the request. The identifier can be encoded in hexadecimal, for example, 0x01 represents the RBD protocol and 0x02 represents the vhost-user protocol.
[0085] The proxy module can match the corresponding module from the candidate modules based on the transmission method identifier. For example, if the identifier is 0x01, the xbd_proxy module is selected, and if it is 0x02, the vhost-blk controller module is selected. After the module is selected, the proxy module initializes the module's memory, threads, and interface resources. When there are no connection requests, the module remains in a sleep state and does not occupy CPU and memory resources.
[0086] Subsequently, the target transmission control module reads the first data content from the virtual machine memory or shared memory according to the corresponding protocol's transmission method, and encapsulates the IO write request instruction and the first data content into an RBD format data packet recognizable by the storage cluster, which is then sent directly to the storage cluster via the network. The module runs entirely in user space, avoiding system call overhead.
[0087] In the above embodiments, the target transmission control module is adaptively selected by the transmission mode identifier in the connection request. The module is only started when there is a virtual machine connection, which avoids the waste of resources when there is no business, reduces the CPU and memory usage of the computing node, and realizes independent scheduling of the dual protocol modules without interference.
[0088] In some optional implementations, when the target virtual machine initiates an IO read request, the business data read from the storage cluster can be transferred to shared memory or virtual machine memory, depending on the data transfer method between the target virtual machine and the agent module.
[0089] Based on this, when an IO read request is detected in the shared memory corresponding to the target virtual machine, the second data content corresponding to the IO read request can be read from the storage cluster; and the second data content can be written into the shared memory or the virtual machine memory according to the data transmission method.
[0090] Among them, the IO read request is a data read instruction initiated by the target virtual machine to the storage cluster, requesting to obtain storage data from a specified location; the second data content is the business data read from the storage cluster corresponding to the IO read request.
[0091] The proxy module continuously monitors the I / O read request flags of the target virtual machine's shared memory. The flags are written by the virtual machine's virtio driver and contain information such as the data read address and length. The proxy module can detect requests by polling the vring ring, with the detection frequency matching that of I / O write requests, ensuring that read and write request processing is synchronized.
[0092] When the proxy module receives an IO read request, it encapsulates the IO read request into an RBD instruction and sends it to the storage cluster through the bdev_rbd module. After the storage cluster queries the corresponding data, it returns the second data content to the proxy module through the network. After receiving the data, the proxy module temporarily stores it in the user-space buffer to avoid kernel cache interference.
[0093] Then, depending on the transmission method of the target virtual machine, the second data content is written to the virtual machine memory or shared memory; the direct transmission method writes directly to the virtual machine memory, and the indirect transmission method writes to the shared memory. The writing process ensures data integrity through memory verification so that the virtual machine can read it from the shared memory.
[0094] In the above embodiments, the data transmission method can be determined based on the IO data transmission protocol supported by the target virtual machine. The business data read in the computing cluster can be transmitted to the virtual machine memory or shared memory without going through multiple kernel forwarding layers, which reduces the number of data copying times and CPU mode switching losses. At the same time, it is compatible with multiple IO data transmission protocols, realizing the IO processing effect of multiple protocol virtual machines coexisting on the same computing node.
[0095] In some alternative implementations, the data transmission methods between the target virtual machine and the agent module differ, and the agent module also transmits the second data content corresponding to the IO read request in different ways.
[0096] For example, when the data transmission method is direct transmission, the interface corresponding to the target virtual machine is called to write the second data content into the virtual machine memory.
[0097] The proxy module calls the virtual machine memory mapping interface of the vhost-user protocol to write the second data content directly to the physical memory address of the virtual machine. The writing process does not need to go through shared memory, and the whole process is zero copy. After the writing is completed, a data ready notification is sent to the virtual machine, and the virtual machine reads the data directly from its own memory.
[0098] Optionally, when the data transmission method is indirect, the second data content is written into shared memory; wherein, the second data content in shared memory is used for the target virtual machine to copy to the virtual machine memory.
[0099] The proxy module writes the second data content to the shared memory area agreed upon with the RBD virtual machine. During writing, it can write data in segments of a preset size (such as 4KB) to avoid memory overflow. After writing is completed, the shared memory status flag is updated. After the virtual machine scans the flag, it copies the data from the shared memory to its own memory. The copying process is performed by the librbd or librados shared library to ensure data safety.
[0100] In the above embodiments, differentiated write logic is adopted for different transmission methods. Direct transmission achieves zero copy, while indirect transmission ensures compatibility. This can improve the read and write efficiency of high-performance virtual machines while ensuring the data reading stability of general-purpose virtual machines.
[0101] In some optional implementations, the cloud platform can also periodically send simulated IO read / write requests to the agent module to determine the connection status between the agent module and the storage cluster, and to verify whether the storage cluster can read and write normally.
[0102] See Figure 2 , Figure 2 A flowchart illustrating a simulated I / O request processing method is provided, which includes the following steps:
[0103] S201 receives simulated I / O requests sent from the cloud.
[0104] The simulated I / O request is a heartbeat volume detection command sent from the cloud, used to periodically check the connectivity between the agent module and the storage cluster, and to check whether the storage cluster can read and write normally. The cloud is the management and control center of the cloud platform, responsible for monitoring the status of the storage cluster and compute nodes.
[0105] When the remote procedure call server (RPC server) of the proxy module starts, it registers a poller to periodically listen for simulated I / O requests sent by the remote procedure call client (RPC client) in the cloud. The request can be in JavaScript object notation (JSON) format, containing a heartbeat volume identifier (ID), read / write instructions, and cyclic redundancy check (CRC) values. The proxy module receives the request via Unix Socket and parses the JSON data to obtain the detection parameters.
[0106] S202 sends simulated I / O requests to the storage cluster.
[0107] Then, the proxy module converts the simulated IO request into IO instructions that the storage cluster can recognize, and sends them to the storage node corresponding to the heartbeat volume through the bdev_rbd module; during the sending process, the CRC check value is retained for subsequent data consistency verification.
[0108] S203, based on the storage cluster's response to the simulated IO request, sends the processing result of the simulated IO request back to the cloud.
[0109] The processing result reflects the connection status between the agent module and the storage cluster. The connection status is the communication status between the agent module and the storage cluster, including normal, abnormal, and disconnected.
[0110] After the storage cluster executes a simulated IO request and returns a response, the proxy module verifies the CRC value. Once it confirms that the data is normal, it encapsulates the connection status into a JSON-formatted acknowledgement (ack) packet and sends it to the cloud. If the storage cluster does not respond or the CRC verification fails, it marks the connection status as abnormal and sends the feedback to the cloud, thus enabling real-time monitoring of the storage status.
[0111] For example, the cloud sends a heartbeat volume simulation IO write request to the proxy module every 5 seconds, carrying the data CRC value; the proxy module forwards the request to the storage cluster, and the storage cluster returns the result after writing the data; after verifying that the CRC value is correct, the proxy module reports "connection error" to the cloud; if the storage cluster does not respond after a timeout, it reports "connection error".
[0112] In the above embodiments, by receiving simulated IO requests and verifying the response results of the storage cluster, the cloud platform realizes the periodic detection of the connection status of the storage cluster.
[0113] For example, see Figure 3 , Figure 3 A sequence diagram simulating an I / O request processing method is provided, including the following steps:
[0114] S1. Remote Procedure Call server initialization and poller registration.
[0115] S2. The remote procedure call client constructs a heartbeat detection request message.
[0116] For example, when initiating a write IO operation for the health monitoring business of the heartbeat volume, a unique CRC checksum is calculated and generated based on the original business data to be written to the heartbeat volume. The write IO command, target storage resource address, original business data, and the calculated write IO CRC checksum are then integrated, and the integrated content is structured and encapsulated into a unified and standardized JSON format IO request data packet.
[0117] S3. The remote procedure call client sends a heartbeat detection request to the remote procedure call server.
[0118] The request is in JSON format and contains a heartbeat detection request message.
[0119] S4. The remote procedure call server receives and parses the heartbeat detection request, and performs cyclic redundancy check on the heartbeat detection request.
[0120] The poller, which is in listening mode, successfully captured the JSON-formatted heartbeat request sent by the remote procedure call client and received the message completely. It then performed structured parsing on the JSON message, extracting the IO operation type, heartbeat volume target address, business data content, and the accompanying write IO checksum CRC value. Simultaneously, based on the parsed business data, it recalculated the data CRC value and compared it with the original CRC value carried in the message, completing the initial verification of the integrity of the requested data transmission and confirming that the requested data was transmitted without errors or packet loss.
[0121] S5. Remote procedure call server queries the corresponding interface for heartbeat detection requests.
[0122] Based on the parsed heartbeat volume IO service type, the remote procedure call server performs an internal CRC interface library search and matching operation. From its own pre-set full set of functional interfaces, it accurately queries and locates the dedicated function call interface corresponding to this heartbeat volume read / write IO service. At the same time, it verifies the interface call permissions and input parameter specifications, completes the routing matching of the request to the underlying storage interface, and determines the call entry point for subsequent storage instructions.
[0123] S6. The remote procedure call server calls the application programming interface to send read and write requests to the storage cluster.
[0124] S7. The storage cluster processes read and write requests and performs cyclic redundancy check (CRC) verification.
[0125] The storage cluster receives IO requests from the remote procedure call server, accurately locates the dedicated heartbeat volume storage resource within the cluster, and executes the IO read / write business processing. Simultaneously, based on the original data of this IO interaction, it independently recalculates the CRC checksum value and performs a full comparison and verification with the original CRC value carried in the request message. This verifies the integrity of the data throughout the entire transmission and storage writing process, confirms that the data has not been tampered with or that there are no write anomalies, and completes the closed loop of the entire business processing and verification process on the storage side.
[0126] S8. The storage cluster sends read / write request responses, i.e., IO ack, back to the remote procedure call server.
[0127] S9. Remote procedure call server encapsulates response messages.
[0128] The remote procedure call server receives the IO ack receipt returned by the storage cluster and extracts all execution result information from the receipt. For the write IO return data of this interaction, it independently recalculates the corresponding IO write CRC check value to complete the secondary closed-loop verification on the server side. Then, it integrates the IO execution status, link connectivity results, and all CRC check conclusions of this entire process and encapsulates all information into a structured JSON format ack response message.
[0129] S10. The remote procedure call server sends a response message to the remote procedure call client; the response message is in JSON format.
[0130] S11. The remote procedure call client determines the heartbeat volume detection result based on the response message.
[0131] The remote procedure call client receives the JSON-formatted ACK response message returned by the remote procedure call server, parses all the result data in the message, and completes the final result processing of this heartbeat volume full-process detection; based on the IO execution status and CRC full-link verification conclusion in the message, it determines the availability of the storage cluster service and the connectivity status of the storage link, and completes the cloud platform's health monitoring business for the backend storage cluster.
[0132] In some alternative implementations, see [link to relevant documentation]. Figure 4 , Figure 4 A schematic diagram of a data processing system is provided. The system includes a first virtual machine and a second virtual machine, which can be one or more. The first virtual machine supports the vhost-user protocol and transmits data directly to the agent module. The second virtual machine supports the Ceph RBD protocol and transmits data indirectly to the agent module.
[0133] Taking the first virtual machine as an example, the virtual machine client (Qemu-vhost-user-client) inside the first virtual machine initiates an IO request, encapsulates the IO operation, and generates a request context, which may contain information such as the type of the IO operation, the data memory address, the data length, the target storage address, the unique identifier of the request, and all scheduling metadata.
[0134] The first virtual machine and the agent module complete the link handshake and establish a connection in advance through the first communication link Unix socket on the left, start and initialize the virtual host block device controller (i.e., the vhost-blk controller), and do not transmit business data.
[0135] The Qemu-vhost-user-client distributes the generated IO context to the shared large page memory area between the first virtual machine and the agent module, and writes it into the circular request queue Vring ring within that area.
[0136] The dedicated vhost-blk controller within the proxy module continuously polls and listens to the vring ring, reads all IO request context information for this IO request from the ring queue, completes request parsing and parameter validation, and clarifies all operation parameters such as the data address and data size for this IO.
[0137] The vhost-blk controller can directly access the virtual machine memory of the first virtual machine through the first interface Spdk_Bdev_API, retrieve the first data content corresponding to the IO write request from the virtual machine memory of the first virtual machine, and transmit the IO request context information and the first data content to the first device module (i.e., the bdev_rbd module). Then, the second data content is written to the storage cluster through the network module (i.e., nal_common). Alternatively, the second data content corresponding to the IO read request retrieved by the bdev_rbd module from the storage cluster through nal_common is transmitted to the virtual machine memory of the first virtual machine.
[0138] Taking the second virtual machine as an example, the second device module (i.e., the librbd / librados module) inside the second virtual machine initiates an IO request and encapsulates the IO operation to generate a request context, which may contain information such as the type of the IO operation, the data memory address, the data length, the target storage address, the unique identifier of the request, and all scheduling metadata.
[0139] The second virtual machine and the agent module complete the link handshake and establish a connection in advance through the Unix socket of the second communication link on the right, start and initialize the block device agent module (i.e., the xbd_proxy module), and do not transmit business data.
[0140] The librbd / librados module distributes the generated request context to the shared memory area between the second virtual machine and the proxy module, writing it into the ring buffer within this area. Simultaneously, it copies the first data content corresponding to the IO write request to the page cache area within the same shared memory to complete data pre-transfer. The dedicated xbd_proxy module within the proxy module continuously polls and listens to the ring buffer, reading all IO context information for this IO request from the ring buffer, completing request parsing and parameter validation, and determining all operation parameters such as the data address and data size for this IO request.
[0141] The xbd_proxy module retrieves the first data content corresponding to the IO write request from the shared memory pagecache area, and transmits the IO context information and the first data content to the underlying network module nal_common. Then, nal_common writes the first data content to the storage cluster. Alternatively, it writes the second data content corresponding to the IO read request retrieved by nal_common from the storage cluster to the pagecache area of the shared memory between the second virtual machine and the proxy module. The librbd / librados module inside the second virtual machine reads the data from the pagecache and writes it to the virtual machine's own memory.
[0142] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0143] Based on the same inventive concept, this application also provides a data processing apparatus for implementing the data processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data processing apparatus embodiments provided below can be found in the limitations of the data processing method described above, and will not be repeated here.
[0144] In one exemplary embodiment, such as Figure 5 As shown, a data processing apparatus is provided, the apparatus being configured in an agent module within a computing node, comprising:
[0145] The acquisition module 10 is used to read the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine in the compute node when it detects that there is an input / output IO write request in the shared memory corresponding to the target virtual machine, according to the data transmission method between the target virtual machine and the agent module.
[0146] Sending module 20 is used to send the IO write request and the first data content to the storage cluster for storage;
[0147] The compute nodes support multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
[0148] In the above embodiments, the data transmission method can be determined based on the IO data transmission protocol supported by the target virtual machine, and data can be flexibly read from the virtual machine memory or shared memory without going through multiple kernel forwarding layers, reducing the number of data copying times and CPU mode switching losses. At the same time, it is compatible with multiple IO data transmission protocols, realizing the IO processing effect of multiple protocol virtual machines coexisting on the same computing node.
[0149] In one embodiment, the acquisition module 10 is specifically used for:
[0150] When the data transmission method between the target virtual machine and the agent module is direct, the corresponding interface of the target virtual machine is called to read the first data content corresponding to the IO write request from the virtual machine memory of the target virtual machine; when the data transmission method is indirect, the first data content corresponding to the IO write request is read from shared memory; wherein, the first data content is copied from the virtual machine memory to the shared memory.
[0151] In one embodiment, the device further includes a connection module for establishing a communication connection with the target virtual machine in response to a connection request from the target virtual machine;
[0152] The acquisition module 10 is specifically used to read the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module, through the target transmission control module. The target transmission control module is selected from the candidate transmission control modules deployed by the agent module based on the transmission method identifier carried in the connection request. Different candidate transmission control modules support different IO data transmission protocols.
[0153] In one embodiment, the device further includes a writing module, which, when an IO read request is detected in the shared memory corresponding to the target virtual machine, reads the second data content corresponding to the IO read request from the storage cluster; and writes the second data content into the shared memory or the virtual machine memory according to the data transmission method.
[0154] In one embodiment, the writing module is specifically used for:
[0155] When the data transmission method is direct transmission, the corresponding interface of the target virtual machine is called to write the second data content into the virtual machine memory; when the data transmission method is indirect transmission, the second data content is written into shared memory; wherein, the second data content in shared memory is used for the target virtual machine to copy to the virtual machine memory.
[0156] In one embodiment, the device further includes a testing module for:
[0157] Receive simulated I / O requests sent from the cloud; send the simulated I / O requests to the storage cluster; based on the storage cluster's response to the simulated I / O requests, send the processing results of the simulated I / O requests back to the cloud; the processing results are used to reflect the connection status between the agent module and the storage cluster.
[0158] Each module in the aforementioned data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0159] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a data processing method.
[0160] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the data processing method described in any of the above embodiments.
[0162] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the data processing method described in any of the above embodiments.
[0163] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the data processing method described in any of the above embodiments.
[0164] 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, data stored, data displayed, 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 the relevant data must comply with relevant regulations.
[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data processing method, characterized in that, The method is applied to an agent module in a compute node, and the method includes: If an input / output (I / O) write request is detected in the shared memory corresponding to the target virtual machine in the compute node, the first data content corresponding to the I / O write request is read from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module; and, The IO write request and the first data content are sent to the storage cluster for storage. The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
2. The method according to claim 1, characterized in that, Based on the data transmission method between the target virtual machine and the agent module, the first data content corresponding to the IO write request is read from the shared memory or the virtual machine memory of the target virtual machine, including: When the data transmission method between the target virtual machine and the proxy module is direct transmission, the interface corresponding to the target virtual machine is called to read the first data content corresponding to the IO write request from the virtual machine memory of the target virtual machine; When the data transmission method is indirect transmission, the first data content corresponding to the IO write request is read from the shared memory; wherein, the first data content is copied from the virtual machine memory to the shared memory.
3. The method according to claim 1, characterized in that, The method further includes: In response to the connection request from the target virtual machine, a communication connection is established with the target virtual machine; Based on the data transmission method between the target virtual machine and the agent module, the first data content corresponding to the IO write request is read from the shared memory or the virtual machine memory of the target virtual machine, including: The target transmission control module reads the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine, according to the data transmission method between the target virtual machine and the agent module. The target transmission control module is selected from the candidate transmission control modules deployed by the proxy module based on the transmission mode identifier carried in the connection request. Different candidate transmission control modules support different IO data transmission protocols.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: If an IO read request is detected in the shared memory corresponding to the target virtual machine, the second data content corresponding to the IO read request is read from the storage cluster; According to the data transmission method, the second data content is written into the shared memory or the virtual machine memory.
5. The method according to claim 4, characterized in that, According to the data transmission method, writing the second data content into the shared memory or the virtual machine memory includes: When the data transmission method is direct transmission, the interface corresponding to the target virtual machine is called to write the second data content into the virtual machine memory; When the data transmission method is indirect, the second data content is written into the shared memory; wherein, the second data content in the shared memory is used for the target virtual machine to copy to the virtual machine memory.
6. The method according to any one of claims 1-3, characterized in that, The method further includes: Receive simulated I / O requests sent from the cloud; Send the simulated I / O request to the storage cluster; Based on the response of the storage cluster to the simulated IO request, the processing result of the simulated IO request is fed back to the cloud; wherein, the processing result is used to reflect the connection status between the proxy module and the storage cluster.
7. A data processing apparatus, characterized in that, The device is configured in an agent module within a compute node, and the device includes: The acquisition module is used to read the first data content corresponding to the IO write request from the shared memory or the virtual machine memory of the target virtual machine in the computing node when it detects that there is an input / output IO write request in the shared memory corresponding to the target virtual machine, according to the data transmission method between the target virtual machine and the agent module. The sending module is used to send the IO write request and the first data content to the storage cluster for storage; The computing node supports multiple I / O data transmission protocols, and the data transmission method is determined based on the I / O data transmission protocol supported by the target virtual machine.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.