A method of reading and writing data and related apparatus
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2026-08-11
AI Technical Summary
但在租户的业务部署的位置不断变化的情况下,或者在网络质量变化的情况下,租户访问数据的时延也会出现波动
Smart Images

Figure CN122554466A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing, and more specifically, to a method for reading and writing data, a cloud management platform, a cluster of computing devices, a computer program product, and a computer-readable storage medium. Background Technology
[0002] Currently, tenants can utilize cloud vendors' storage services to store and read / write data. In object storage systems, a bucket can store at least one object, and each bucket is deployed within a compute device cluster. In file storage systems, a folder can store at least one file, and each folder is deployed within a compute device cluster. Each compute device cluster includes at least one compute node, and each compute node includes storage resources. Because tenants can access data in buckets over a network, the physical distance between the tenant and the compute device cluster to which the bucket / folder belongs may not be fixed. When the physical distance between the tenant and the compute device cluster is short, the latency required for data access is low; conversely, when the physical distance is far, the latency is high. To improve the tenant experience, cloud vendors can allocate frequently accessed data to compute device clusters closer to the tenant and less frequently accessed data to clusters farther away. However, as tenants' business deployment locations change or network quality fluctuates, the latency for tenants accessing data can also fluctuate. Furthermore, data inconsistency can easily arise when multiple users simultaneously modify and / or read data from the same storage bucket / folder.
[0003] Therefore, how to shorten the latency for tenants to access data and ensure data consistency has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method for reading and writing data, a cloud management platform, a computing device cluster, a computer program product, and a computer-readable storage medium, which can shorten the latency for tenants to access data and ensure data consistency.
[0005] Firstly, a method for reading and writing data is provided. This method is applied to a cloud management platform for managing infrastructure providing cloud services, including a first computing node and a second computing node. The method includes: the cloud management platform receiving a first write request from a first user device, the first write request requesting the writing of first data into a target data block, the metadata of the target data block being stored in a second computing node, and the distance between the region to which the second computing node belongs and the first user device being greater than the distance between the region to which the first computing node belongs and the first user device; the cloud management platform responding to the first write request by notifying the first computing node to store the first data and notifying the first computing node to send a first response message to the first user device, the first response message indicating that the first data was successfully written; the cloud management platform notifying the first computing node to send a first indication message to the second computing node, the first indication message indicating the updating of first metadata, the first metadata including metadata corresponding to the first data; the cloud management platform notifying the first computing node to set a write lock on the first data in the first computing node; the cloud management platform receiving a second response message from the second computing node, the second response message indicating that the first metadata was successfully updated; and the cloud management platform, after receiving the second response message, notifying the first computing node to remove the write lock on the first data in the first computing node.
[0006] In this embodiment, when a user writes data, even if the object to which the data belongs is stored on a computing node in a region far from the user's device, the first computing node closer to the user's device can receive and process the write request without the computing node storing the object to which the data belongs needing to receive and process the write request. Furthermore, the first computing node can send a write success response to the user's device immediately after storing the data, without waiting for a write success response from the computing node storing the object to which the data belongs before sending the write success response, thus enabling fast data writing. Simultaneously, after the first computing node sends a write success response to the user, the cloud management platform can notify the first computing node to request the second computing node storing the metadata of the object to which the data belongs to update the first metadata. During the process of the second computing node updating the first metadata, a write lock is set for the first data in the first computing node until the first metadata in the second computing node is successfully updated. Because a write lock is set for the first data in the first computing node, the first computing node will not process read requests until the write lock is released, thereby ensuring data consistency for the user when accessing data.
[0007] In conjunction with the first aspect, in some implementations, the first computing node belongs to the first computing device cluster in the first region, and the first computing device cluster is used to provide the first storage service. The second computing node belongs to the second computing device cluster in the second region, and the second computing device cluster is used to provide the second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
[0008] In this embodiment, the first computing node and the second computing node are used to provide different storage services. Since the data read / write speed of the storage service provided by the first computing node is greater than that of the storage service provided by the second computing node, the latency for tenants to access data can be further reduced.
[0009] In conjunction with the first aspect, in some implementations, the method further includes: before notifying the first computing node to release the write lock on the first data in the first computing node, the cloud management platform receives a first read request from the first user device, the first read request being used to request the acquisition of the first data; after notifying the first computing node to release the write lock on the first data in the first computing node, the cloud management platform responds to the first read request by notifying the first computing node to send the first data to the first user device.
[0010] In this embodiment of the application, the first computing node will not process the request to read the first data before the write lock is released for the first data, so that the data can be read after the second computing node has updated the first metadata, thereby avoiding the problem of inconsistent data reading.
[0011] In conjunction with the first aspect, in some implementations, the cloud management platform responds to the first read request by notifying the first computing node to set a read lock for the first data in the first computing node; the cloud management platform receives the first data from the first computing node; the cloud management platform sends the first data to the first user equipment; and the cloud management platform notifies the first computing node to cancel the read lock for the first data in the first computing node.
[0012] In this embodiment of the application, a write lock is set for the first data during the reading of the first data by the first computing node, which can avoid the problem of inconsistent data reading caused by modification of the first data during the reading of the first data.
[0013] In conjunction with the first aspect, in some implementations, the method further includes: the cloud management platform obtaining the resource utilization rate of the first computing node and / or the resource utilization rate of the computing device cluster to which the first computing node belongs; when the resource utilization rate of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization rate of the computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, the cloud management platform notifies the first computing node to send a first data set to the third computing node, and notifies the first computing node to delete the first data set after sending it, wherein the first data set includes some or all of the data stored in the first computing node, the first computing node belongs to a first computing device cluster in a first region, the first computing device cluster is used to provide a first storage service, the third computing node belongs to a third computing device cluster in the first region, the third computing device cluster is used to provide a second storage service, and the data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
[0014] In this embodiment of the application, when the resource utilization rate in the first computing node or the first computing device cluster is high, some or all of the data in the first computing node is transferred to the third computing device cluster, thereby saving storage space in the first computing node.
[0015] In conjunction with the first aspect, in some implementations, the method further includes: the cloud management platform receiving a second indication message from the second computing node, the second indication message being used to indicate that the first data has become invalid; the cloud management platform responding to the second indication message by notifying the first computing node to delete the first data in the first computing node, and notifying the first computing node to send a third response message to the second computing node after deleting the first data, the third response message being used to indicate that the first data in the first computing node has become invalid.
[0016] In this embodiment of the application, when the first computing node has stored the first data and the metadata corresponding to the first data stored in the second computing node has been updated, the first computing node deletes the first data in the first computing node according to the instruction and sends response information to the second computing node, thereby facilitating the maintenance of data consistency.
[0017] In conjunction with the first aspect, in some implementations, the method further includes: the cloud management platform receiving a second read request from the first user device, the second read request being used to request the reading of second data in the target data block; when the second data is stored in the first computing node, the cloud management platform notifying the first computing node to send the second data to the first user device; or, when the second data is not stored in the first computing node, the cloud management platform notifying the first computing node to obtain the second data from the computing node in the third region based on the second metadata, the second metadata including the metadata corresponding to the second data, the second metadata being used to indicate that the second data is stored in the computing node in the third region.
[0018] In this embodiment, when a user reads data, a first computing node located close to the user's device can receive the read request. If the data is stored in the first computing node, it is sent directly to the user's device. If the data is not stored in the first computing node, the data is retrieved from a computing node in the region where the data is located, based on the metadata corresponding to the data, and then sent to the user's device.
[0019] In conjunction with the first aspect, in some implementations, the cloud management platform notifies the first computing node to send a third read request to the second computing node. The third read request is used to request the acquisition of second metadata, which is stored in the second computing node. The cloud management platform receives a fourth response from the second computing node, which includes the second metadata. The cloud management platform notifies the first computing node to obtain the second data from the fourth or fifth computing node based on the second metadata. The fourth and fifth computing nodes belong to a third region. The fourth computing node is used to provide the first storage service, and the fifth computing node is used to provide the second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
[0020] In this embodiment, the cloud management platform obtains the second metadata from the computing node that stores the second metadata, and notifies the first computing node to obtain the second data from the computing node in the area that stores the second data according to the instructions of the second metadata.
[0021] In conjunction with the first aspect, in some implementations, the cloud management platform notifies the first computing node to send a fourth read request to the fourth computing node, the fourth read request being used to request the acquisition of second data; the cloud management platform receives a fifth response from the fourth computing node, the fifth response including the second data, or the fifth response indicating that the fourth computing node does not store the second data; when the fifth response indicating that the fourth computing node does not store the second data, the method further includes: the cloud management platform notifying the first computing node to send a fifth read request to the fifth computing node, the fifth read request being used to request the acquisition of second data; and the cloud management platform receiving a sixth response from the fifth computing node, the sixth response including the second data.
[0022] In this embodiment of the application, after the first computing node determines the region where the second data is located, it first sends a read request to the fourth computing node in that region that provides the first storage service. If the fourth computing node does not store the data, it then sends a read request to the fifth computing node that provides the second storage service.
[0023] Secondly, a cloud management platform is provided. This cloud management platform manages the infrastructure providing cloud services. The infrastructure includes a first computing node and a second computing node. The cloud management platform includes: a receiving module, used to receive a first write request from a first user device, the first write request requesting the writing of first data into a target data block, the metadata of the target data block being stored in the second computing node, and the distance between the region to which the second computing node belongs and the first user device being greater than the distance between the region to which the first computing node belongs and the first user device; a sending module, used in response to the first write request to notify the first computing node to store the first data and to send a first response message to the first user device, the first response message indicating that the first data was successfully written; the sending module is also used to notify the first computing node to send a first indication message to the second computing node, the first indication message indicating the updating of first metadata, the first metadata including metadata corresponding to the first data; the sending module is also used to notify the first computing node to set a write lock for the first data in the first computing node; the receiving module is also used to receive a second response message from the second computing node, the second response message indicating that the first metadata was successfully updated; the sending module is also used to, after receiving the second response message, to notify the first computing node to cancel the write lock for the first data in the first computing node.
[0024] In conjunction with the second aspect, in some implementations, the first computing node belongs to the first computing device cluster in the first region, and the first computing device cluster is used to provide the first storage service. The second computing node belongs to the second computing device cluster in the second region, and the second computing device cluster is used to provide the second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
[0025] In conjunction with the second aspect, in some implementations, the receiving module is further configured to receive a first read request from the first user equipment before notifying the first computing node to release the write lock on the first data in the first computing node, the first read request being used to request the acquisition of the first data; the sending module is further configured to, in response to the first read request, notify the first computing node to send the first data to the first user equipment after notifying the first computing node to release the write lock on the first data in the first computing node.
[0026] In conjunction with the second aspect, in some implementations, the sending module is specifically used to respond to the first read request and notify the first computing node to set a read lock for the first data in the first computing node; the receiving module is also used to receive the first data from the first computing node; the sending module is also used to send the first data to the first user equipment; the sending module is also used to notify the first computing node to cancel the read lock for the first data in the first computing node.
[0027] In conjunction with the second aspect, in some implementations, the cloud management platform further includes a processing module. This processing module is used to obtain the resource utilization rate of the first computing node and / or the resource utilization rate of the computing device cluster to which the first computing node belongs. The sending module is further used to: when the resource utilization rate of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization rate of the computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, notify the first computing node to send a first data set to the third computing node, and notify the first computing node to delete the first data set after sending it. The first data set includes some or all of the data stored in the first computing node. Wherein, the first computing node belongs to a first computing device cluster in a first region, and the first computing device cluster is used to provide a first storage service; the third computing node belongs to a third computing device cluster in the first region, and the third computing device cluster is used to provide a second storage service; the data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
[0028] In conjunction with the second aspect, in some implementations, the receiving module is further configured to receive a second indication message from the second computing node, the second indication message being used to indicate that the first data has expired; the sending module is further configured to respond to the second indication message, notify the first computing node to delete the first data in the first computing node, and notify the first computing node to send a third response message to the second computing node after deleting the first data, the third response message being used to indicate that the first data in the first computing node has expired.
[0029] In conjunction with the second aspect, in some implementations, the receiving module is further configured to receive a second read request from the first user equipment, the second read request being used to request the reading of second data in the target data block; when the second data is stored in the first computing node, the sending module is further configured to notify the first computing node to send the second data to the first user equipment; or, when the second data is not stored in the first computing node, the sending module is further configured to notify the first computing node to obtain the second data from the computing node in the third region according to the second metadata, the second metadata including the metadata corresponding to the second data, the second metadata being used to indicate that the second data is stored in the computing node in the third region.
[0030] In conjunction with the second aspect, in some implementations, the sending module is specifically used to notify the first computing node to send a third read request to the second computing node. The third read request is used to request the acquisition of the second metadata, which is stored in the second computing node. The receiving module is also used to receive a fourth response information from the second computing node, which includes the second metadata. The sending module is also used to notify the first computing node to obtain the second data from the fourth or fifth computing node based on the second metadata. The fourth and fifth computing nodes belong to a third region. The fourth computing node is used to provide the first storage service, and the fifth computing node is used to provide the second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
[0031] In conjunction with the second aspect, in some implementations, the sending module is specifically used to notify the first computing node to send a fourth read request to the fourth computing node, the fourth read request being used to request the acquisition of the second data; the receiving module is also used to receive a fifth response information from the fourth computing node, the fifth response information including the second data, or the fifth response information indicating that the fourth computing node does not store the second data; when the fifth response information indicates that the fourth computing node does not store the second data: the sending module is also used to notify the first computing node to send a fifth read request to the fifth computing node, the fifth read request being used to request the acquisition of the second data; the receiving module is also used to receive a sixth response information from the fifth computing node, the sixth response information including the second data.
[0032] It should be understood that the technical effects achieved by the second aspect or some implementations of the second aspect are similar to those achieved by the first aspect or some implementations of the first aspect, and will not be elaborated here.
[0033] Thirdly, this application provides a computing device cluster, including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the method in the first aspect or any possible implementation of the first aspect.
[0034] Fourthly, this application provides a computer program product containing instructions that, when executed by a cluster of computer devices, cause the cluster of computer devices to perform the method described in the first aspect or any possible implementation thereof.
[0035] Fifthly, this application provides a computer-readable storage medium including computer program instructions that, when executed by a cluster of computing devices, perform the method described in the first aspect or any possible implementation thereof.
[0036] In a sixth aspect, a chip system is provided, the chip system including logic circuitry for coupling with an input / output interface, through which data is transmitted to perform the method described in the first aspect or any possible implementation thereof. Attached Figure Description
[0037] Figure 1 This is a schematic structural diagram of a cloud scenario according to an embodiment of this application.
[0038] Figure 2 This is a schematic structural diagram of a cloud scenario according to an embodiment of this application.
[0039] Figure 3 This is a schematic flowchart of a method for reading and writing data according to an embodiment of this application.
[0040] Figure 4 This is a schematic flowchart of a method for reading and writing data according to an embodiment of this application.
[0041] Figure 5 This is a schematic flowchart of a method for reading and writing data according to an embodiment of this application.
[0042] Figure 6 This is a schematic structural diagram of a cloud management platform according to an embodiment of this application.
[0043] Figure 7This is a schematic structural diagram of a computing device according to an embodiment of the present application.
[0044] Figure 8 This is a schematic structural diagram of a computing device according to an embodiment of this application.
[0045] Figure 9 This is a schematic structural diagram of a computing device cluster according to an embodiment of this application.
[0046] Figure 10 This is a schematic diagram illustrating the connection between computing devices 800A and 800B via a network according to an embodiment of this application. Detailed Implementation
[0047] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0048] This application will present various aspects, embodiments, or features relating to a system comprising multiple devices, components, modules, etc. It should be understood and appreciated that individual systems may include additional devices, components, modules, etc., and / or may not include all the devices, components, modules, etc. discussed in conjunction with the accompanying drawings. Furthermore, combinations of these approaches are also possible.
[0049] Furthermore, in the embodiments of this application, the words "exemplary," "for example," etc., are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" in the embodiments of this application should not be construed as being better or more advantageous than other embodiments or design schemes. Specifically, the use of the term "exemplary" is intended to present the concept in a concrete manner.
[0050] The business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0051] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0052] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0053] The method in this embodiment can be applied to various computing nodes that belong to the infrastructure managed by the cloud management platform and are used to provide cloud services. Specifically, the cloud management platform manages the infrastructure that provides cloud services, which includes at least one cloud data center. Each cloud data center includes at least one computing node, such as a container, virtual machine, server, or computing device. Each computing node includes cloud service resources to provide corresponding cloud services to tenants.
[0054] Figure 1 This is a schematic diagram of a cloud service scenario used in this application, such as... Figure 1 As shown, this cloud scenario may include: a cloud management platform 110, the Internet 120, and a client 130. For example... Figure 1 As shown, the cloud management platform 110 is used to manage the infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each containing multiple servers, and each server containing cloud service resources to provide corresponding cloud services to tenants. For example, a cloud service resource could be a cloud database.
[0055] The cloud management platform 110 can be located in a cloud data center. The cloud management platform 110 provides an access interface (such as a user interface or application program interface, API). Tenants can use client 130 to remotely access the access interface to register a cloud account and password on the cloud management platform 110 and log in. After successful authentication of the cloud account and password, the tenant can further select and purchase compute nodes (such as containers, virtual machines, servers, computing devices, etc.) with specific specifications (such as processors, memory, and disks) on the cloud management platform 110. After successful purchase, the cloud management platform 110 provides a remote login account and password for the purchased compute node. The tenant can remotely log in to the compute node through client 130 and install and run the tenant's applications on the compute node. Therefore, tenants can create, manage, log in to, and operate compute nodes in the cloud data center through the cloud management platform 110. The compute node can also be called a cloud server (Elastic Compute Service, ECS) or elastic instance (different cloud service providers may use different names).
[0056] It should be understood that cloud service tenants can be individuals, businesses, schools, hospitals, government agencies, etc.
[0057] The cloud management platform 110 includes, but is not limited to, a user console, compute management services, network management services, storage management services, authentication services, and image management services. The user console provides an interface or API for interaction with tenants. The compute management services manage servers running virtual machines and containers, as well as bare metal servers. The network management services manage network services (such as gateways and firewalls). The storage management services manage storage services (such as data bucket services). The authentication services manage tenant account passwords. The image management services manage virtual machine images. Tenants can log in to the cloud management platform 110 via client 130 and the internet 120 to manage their rented cloud services.
[0058] Cloud servers are one of the most popular forms of computing resource services today, especially in the era of cloud computing, where they are widely used to host websites, applications, databases, and various other applications. When using cloud servers, it is sometimes necessary to configure multiple Internet Protocol (IP) addresses to extend the services offered by applications. For example, building a cluster of web servers, providing services with different network characteristics, or having different clients access the internet all require configuring multiple IP addresses on the cloud server.
[0059] Figure 2 This is a schematic structural diagram of the cloud scenario 200 provided in the embodiments of this application. Figure 2The cloud scenario 200 includes a cloud management platform 210. This cloud management platform 210 and... Figure 1 Similar to the cloud management platform 110. The cloud management platform 210 manages the infrastructure providing cloud services, which includes multiple computing device clusters, at least two of which belong to different regions. For example, the multiple computing device clusters include computing device clusters 221, 222, 231, 232, 241, and 242. Computing device clusters 221 and 222 belong to region 220, computing device clusters 231 and 232 belong to region 230, and computing device clusters 241 and 242 belong to region 240. Each computing device cluster includes at least one computing node, such as a container, virtual machine, server, or computing device. For example, computing device cluster 221 includes computing nodes 2211 and / or 2212, and computing device cluster 222 includes computing nodes 2221 and / or 2222. Computing device cluster 231 includes computing nodes 2311 and / or 2312, and computing device cluster 232 includes computing nodes 2321 and / or 2322. Computing device cluster 241 includes computing nodes 2411 and / or 2412, and computing device cluster 242 includes computing nodes 2421 and / or 2422. A tenant can apply for and use resources in these multiple computing device clusters through cloud management platform 210. This tenant is a public cloud tenant who has registered a public cloud account and purchased public cloud resources. Each computing node managed by cloud management platform 210 is used to execute the methods provided in the embodiments of this application, such as... Figures 3 to 5 The method in the middle.
[0060] For example, the physical distance between computing nodes belonging to the same region is less than the physical distance between computing nodes belonging to different regions. The physical distance between computing nodes belonging to the same computing device cluster is less than the physical distance between computing nodes belonging to different computing device clusters.
[0061] In some embodiments, multiple computing nodes in a computing device cluster are directly connected or connected via a network, such as a wide area network or a local area network.
[0062] In some embodiments, each computing node in the computing device cluster includes storage resources, i.e., each computing node is used to store data. The computing device cluster is used to provide a first storage service or a second storage service. The data read / write speed of the first storage service is greater than that of the second storage service. For example, computing device clusters 221, 231, and 241 are used to provide the first storage service, and computing device clusters 222, 232, and 242 are used to provide the second storage service. In other words, tenants can store data in the computing device cluster managed by the cloud management platform 210, and can also access the data stored in the computing device cluster, such as performing read and / or write operations on the data.
[0063] For example, the first storage service is a global cache service. The second storage service is an object storage service or a file storage service. The object storage service uses buckets to store objects. The object storage service supports accessing objects in the buckets via the Hypertext Transfer Protocol (HTTP). The file storage service stores data through a file storage system.
[0064] In some embodiments, tenant data is stored via a file storage system and / or an object storage system. When data is stored via a file storage system, the tenant data is stored in at least one folder, which is located within one or more computing device clusters. Each folder within the at least one folder includes at least one file, and each file includes at least one piece of data. When data is stored via an object storage system, the tenant data is stored in at least one bucket, which is located within one or more computing device clusters. Each bucket within the at least one bucket includes at least one object, and each object includes at least one piece of data.
[0065] In some embodiments, when a tenant writes data to a tenant's folder or bucket, if the tenant's folder or bucket is stored on a compute node that is far away from the tenant's device, the tenant's device can send a write request to a compute node that is closer to the tenant's device. The compute node can complete the write operation through synchronous or asynchronous writing.
[0066] For example, suppose a tenant's folder or bucket is stored on compute node 2311 in compute device cluster 231, and the physical distance between the tenant's device and compute node 2211 in compute device cluster 221 is less than the physical distance between the tenant's device and compute node 2311. When a tenant writes data to its folder or bucket, the tenant's device sends a write request to compute node 1211 through cloud management platform 210. In synchronous write mode, compute node 2211 stores the data written by the tenant and sends the data to compute node 2311. For example, compute node 2211 first stores the data written by the tenant, and then sends the data to compute node 2311 after the write is complete. Alternatively, compute node 2211 sends the data written by the tenant to compute node 2311 while storing the data. Compute node 2311 stores the data written by the tenant and sends a write success response message to cloud management platform 210 or compute node 2211. After receiving the write success response message, cloud management platform 210 sends a write success response message to the tenant's device, thus completing the write operation. In the asynchronous write method, compute node 2211 stores the data written by the tenant, sends a write success response to the tenant's device through cloud management platform 210, and sends the tenant's written data to compute node 2311. Compute node 2311 stores the data written by the tenant and sends a write success response to either cloud management platform 210 or compute node 2211, thereby completing the write operation.
[0067] For example, computing nodes in different computing device clusters can directly transmit information, such as computing node 2211 and computing node 2311. Alternatively, computing nodes in different computing device clusters can transmit information through a cloud management platform, such as computing node 2211 transmitting information to computing node 2311 through cloud management platform 210. In other words, computing node 2211 sending information to computing node 2311 includes: computing node 2211 sending information directly to computing node 2311; or computing node 2211 sending information to the cloud management platform, and the cloud management platform receiving the information and then sending information to computing node 2311.
[0068] For example, in synchronous writing, the tenant's device receives the write success message only after writing data to the compute node 2311, resulting in a long write operation time. In asynchronous writing, the tenant's device receives the write success message before writing data to the compute node 2311, which can easily lead to data inconsistency during reading. Therefore, this application provides a method for reading and writing data that can shorten the latency required for tenants to access data and ensure data consistency.
[0069] Figure 3 This is a schematic flowchart illustrating the method for reading and writing data provided in the embodiments of this application. Figure 3 The methods described are applied to cloud management platforms, for example... Figure 1 or Figure 2 The cloud management platform in the system manages the infrastructure that provides cloud services, including a first compute node and a second compute node. The first compute node and the second compute node are, for example,... Figure 2 Two different computing nodes in the process. Figure 3 The method includes the following steps.
[0070] 301, Send the first write request to the cloud management platform.
[0071] The first user equipment sends a first write request to the cloud management platform, meaning the cloud management platform receives the first write request from the first user equipment. This first write request is used to request the writing of first data into a target data block. The metadata of the target data block is stored in a second computing node, and the distance between the region to which the second computing node belongs and the first user equipment is greater than the distance between the region to which the first computing node belongs and the first user equipment.
[0072] In some embodiments, the first tenant has at least one user device, which includes the first user device. The first tenant is a public cloud tenant that has registered a public cloud account and purchased public cloud resources.
[0073] In some embodiments, a first computing node belongs to a first computing device cluster in a first region, which provides a first storage service. A second computing node belongs to a second computing device cluster in a second region, which provides a second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
[0074] For example, the computing nodes in the first region and the computing nodes in the second region are provided by the same cloud vendor, that is, the computing nodes in the first region and the computing nodes in the second region belong to the infrastructure managed by the same cloud management platform.
[0075] For example, the first computing node is Figure 2 Computing node 2211 in the first computing device cluster is Figure 2 The computing device cluster 221 in the first area is Figure 2 Region 220 in the middle. The second computation node is Figure 2 The computing node 2321 in the second computing device cluster is Figure 2 The computing device cluster 232 in the second area is Figure 2 Region 230 in the middle.
[0076] For example, the first storage service is a global cache service, and the second storage service is an object storage service.
[0077] For example, the distance between the second region to which the second computing node belongs and the first user device is determined based on the physical distance between each computing node in the second region and the first user device. For instance, the distance between the second region and the first user device is the minimum or average of the distances between each computing node in the second region and the first user device. Similarly, the distance between the first region to which the first computing node belongs and the first user device is determined based on the physical distance between each computing node in the first region and the first user device. For instance, the distance between the first region and the first user device is the minimum or average of the distances between each computing node in the first region and the first user device.
[0078] In some embodiments, the target data block includes at least one object in an object storage system, and the first data is data to be written to the at least one object. Alternatively, the target data block includes at least one file in a file storage system, and the first data is data to be written to the at least one file.
[0079] For example, when the target data block includes at least one object, the metadata of the target data block includes at least one of the following: file identification information, file type, file access permissions, file size, file last modification time, object storage location, etc. When the target data block includes at least one file, the metadata of the target data block includes at least one of the following: file identification information, directory identification information, file and directory hierarchy, file size, file creation time, file last modification time, file access permissions, file storage location, etc.
[0080] In some embodiments, the second computing node stores the metadata of the first data in the form of key-value pairs. The key corresponding to the metadata of the target data block is the identifier information of the target data block, and the value corresponding to the metadata of the target data block is the metadata of the target data block.
[0081] For example, the bucket or folder to which the target data block belongs is stored in a second or sixth compute node, and the sixth compute node belongs to the same compute device cluster as the second compute node. In other words, the target data block belongs to the compute device cluster to which the second compute node belongs, and the metadata of the target data block is managed by the second compute node.
[0082] For example, the sixth computing node is Figure 2 The computation node is 2322.
[0083] For example, the first computing node may store the target data block, or the first computing node may not store the target data block; this application embodiment is not limited in this respect.
[0084] 302, Notify the first computing node to store the first data and send the first response information to the first user equipment.
[0085] Upon receiving the first write request, the cloud management platform sends a third instruction to the first computing node. This third instruction instructs the first computing node to store the first data and send a first response to the first user equipment. Alternatively, upon receiving the first write request, the cloud management platform forwards the first write request to the first computing node to notify it to store the first data and send a first response to the first user equipment.
[0086] In some embodiments, the third instruction information includes the first data.
[0087] In some embodiments, the first user equipment directly sends the first write request to the first computing node, that is, the first computing node directly receives the first write request from the first user equipment without the need for the cloud management platform to forward it.
[0088] 303, store the first data.
[0089] After receiving the first write request or the third instruction information, the first computing node stores the first data in response to the first write request or the third instruction information.
[0090] In some embodiments, when the first computing node stores the first data, it also stores the correspondence between the first data and the object to which the first data belongs.
[0091] For example, the first computing node stores the first data in the form of key-value pairs. Here, the key corresponding to the first data is the identifier information of the target data block, and the value corresponding to the first data is the first data itself.
[0092] In some embodiments, after storing the first data, the first computing node or the seventh computing node stores the first metadata. The seventh computing node and the first computing node belong to the same computing device cluster. The first metadata includes metadata corresponding to the first data. For example, the first metadata includes at least one of the following: the size of the first data, the storage location of the first data, the last modification time of the first data, etc.
[0093] For example, the seventh computing node is Figure 2 The computation node is 2212.
[0094] For example, the first metadata includes the metadata corresponding to the first data, which may be either the metadata corresponding to the first data or the metadata of the target data block after the first data is written. Specifically, when the first metadata is the metadata corresponding to the first data, if the target data block only includes the first data, then the first metadata is the metadata of the target data block after the first data is written; if the target data block includes the first data and other data besides the first data, then the first metadata is a portion of the metadata of the target data block after the first data is written.
[0095] For example, the first computing node or the seventh computing node stores the first metadata in the form of key-value pairs. Here, the key corresponding to the first metadata is the identifier information of the target data block, and the value corresponding to the first metadata is the first metadata itself.
[0096] 304, send the first response information to the first user equipment.
[0097] The first computing node sends a first response message to the first user equipment, meaning the first user equipment receives the first response message from the first computing node. This first response message indicates that the first data was successfully written. In other words, the first computing node can send a successful write message to the first user equipment immediately after storing the first data, thereby reducing the latency of writing data.
[0098] For example, the first computing node sending information to the first user equipment includes: the first computing node sending information directly to the first user equipment; or, the first computing node sending information to the cloud management platform, and the cloud management platform receiving the information and then sending the information to the first user equipment.
[0099] 305, Notify the first computing node to send the first instruction information to the second computing node.
[0100] Following step 303, the cloud management platform sends a fourth instruction message to the first computing node. This fourth instruction message instructs the first computing node to send the first instruction message to the second computing node.
[0101] For example, steps 304 and 305 can be performed simultaneously. Alternatively, step 304 can be performed after step 305. Alternatively, step 305 can be performed after step 304.
[0102] In some embodiments, after step 303, the first computing node directly executes step 306. In other words, step 305 is an optional step and may not be executed.
[0103] 306, Send the first instruction information to the second computing node.
[0104] The first computing node sends a first indication message to the second computing node, that is, the second computing node receives the first indication message from the first computing node. This first indication message is used to indicate the updating of the first metadata.
[0105] In some embodiments, steps 304 and 306 may be executed simultaneously. Alternatively, step 306 may be executed after step 304. Alternatively, step 306 may be triggered by step 304. Alternatively, step 306 may be executed before step 304.
[0106] In some embodiments, the first indication information includes first metadata.
[0107] In some embodiments, the first computing node sending information to the second computing node includes: the first computing node sending information directly to the second computing node; or, the first computing node sending information to the cloud management platform, and the cloud management platform receiving the information and then sending the information to the second computing node.
[0108] 307, Update first metadata.
[0109] After receiving the first instruction information, the second computing node updates the first metadata according to the first instruction information. After updating the first metadata, the second computing node executes step 310.
[0110] For example, when the first metadata is the metadata corresponding to the first data, the second computing node adds the first metadata to the metadata of the already stored target data block. When the first metadata is the metadata of the target data block after the first data has been written, the second computing node replaces the metadata of the already stored target data block with the first metadata.
[0111] 308, Notify the first compute node to set a write lock for the first data.
[0112] After step 305, or before or after step 306, the cloud management platform sends a fifth instruction message to the first computing node. This fifth instruction message instructs the first computing node to set a write lock on the first data in the first computing node.
[0113] In some embodiments, the first computing node executes step 309 before or after executing step 306. In other words, step 308 is an optional step and may not be executed.
[0114] 309, Set a write lock for the first data.
[0115] The first computing node sets a write lock on the first data within the first computing node. This write lock allows only a first thread or a first process to access the data in a first storage location, which is where the first data is stored within the first computing node. Accessing the data in the first storage location includes writing or reading data from the first storage location. The first thread or the first process executes step 306 and waits to receive a second response message or a sixth indication message. In other words, because the first computing node sets a write lock on the first data within the first computing node, the first data in the first computing node cannot be modified or read before receiving the second response message or the sixth indication message, thus ensuring data consistency.
[0116] In some embodiments, setting a write lock on first data in the first compute node includes: setting a write lock on data related to the first data in the first compute node. The data related to the first data includes at least one of the following: first data, first metadata, key-value pairs to which the first data belongs, and a target data block.
[0117] For example, when a target data block is stored in a first compute node, the first compute node sets a write lock on the target data block in the first compute node.
[0118] 310. Send the second response information to the cloud management platform.
[0119] The second compute node sends a second response message to the cloud management platform, meaning the cloud management platform receives the second response message from the second compute node. This second response message indicates that the first metadata update was successful.
[0120] In some embodiments, the second computing node directly sends the second response information to the first computing node, that is, the first computing node receives the second response information from the second computing node.
[0121] 311, Notify the first compute node to release the write lock for the first data.
[0122] Following step 310, the cloud management platform sends a sixth instruction message to the first compute node. This sixth instruction message instructs the first compute node to release the write lock on the first data within the first compute node. Alternatively, following step 310, the cloud management platform sends a second response message to the first compute node.
[0123] In some embodiments, after the first computing node receives the second response information from the second computing node, the first computing node directly executes step 312. In other words, step 311 is an optional step and may not be executed.
[0124] 312, cancel the write lock for the first data.
[0125] After receiving the second response information or the sixth indication information, the first computing node releases the write lock on the first data in the first computing node. In other words, after receiving the second response information or the sixth indication information, the first data in the first computing node can be modified or read.
[0126] In some embodiments, before the write lock on the first data in the first compute node is released, or before the cloud management platform notifies the first compute node to release the write lock on the first data, the cloud management platform receives a first read request from the first user equipment. In response to the first read request, the cloud management platform notifies the first compute node to send the first data to the first user equipment. For example, in response to the first read request, the cloud management platform sends a first read request or a seventh indication message to the first compute node. The first read request is used to request the acquisition of the first data. The seventh indication message is used to instruct the first compute node to send the first data to the first user equipment. Because the first data is write-locked, the first compute node cannot read the first data; that is, the first compute node cannot process the first read request or cannot send the first data according to the instruction of the seventh indication message. After the write lock on the first data in the first compute node is released, the first compute node can read the first data; that is, the first compute node can process the first read request or can send the first data according to the instruction of the seventh indication message, for example, the first compute node reads the first data and sends it to the first user equipment.
[0127] In some embodiments, after releasing the write lock on the first data in the first compute node, the cloud management platform receives a first read request from the first user equipment. In response to this first read request, the cloud management platform instructs the first compute node to send the first data to the first user equipment. For example, in response to the first read request, the cloud management platform sends either the first read request or a seventh indication message to the first compute node. Since the first data is not write-locked, the first compute node can process the first read request, or it can send the first data according to the instructions in the seventh indication message; that is, the first compute node reads the first data and sends it to the first user equipment.
[0128] For example, the first user equipment directly sends the first read request to the first computing node, that is, the first computing node directly receives the first read request from the first user equipment without the need for the cloud management platform to forward it.
[0129] For example, the first computing node sending the first data to the first user equipment includes: the first computing node directly sending the first data to the first user equipment; or, the first computing node sending the first data to the cloud management platform, and the cloud management platform receiving the first data and then sending the first data to the first user equipment.
[0130] For example, when the first computing node reads the first data, the first computing node sets a read lock on the first data in the first computing node. The first computing node reads the first data and sends it to the cloud management platform or the first user device. After reading the first data or before or after sending the first data to the cloud management platform or the first user device, the first computing node releases the read lock on the first data in the first computing node. This read lock is used to allow at least one thread or process to read data in a first storage location, and to prohibit any thread from modifying the data in the first storage location. The first storage location is the storage location of the first data in the first computing node. In other words, when the first computing node reads the first data, the first data cannot be modified, thereby ensuring data consistency.
[0131] For example, after the cloud management platform receives the first read request, it notifies the first computing node to set a read lock on the first data in the first computing node in response to the first read request. For example, the cloud management platform sends the first read request or an eighth indication message to the first computing node. The eighth indication message is used to instruct the first computing node to set a read lock on the first data. In response to the first read request or the eighth indication message, the first computing node sets a read lock on the first data when reading the first data.
[0132] For example, after the cloud management platform receives the first data from the first computing node, or before or after the cloud management platform sends the first data to the first user equipment, the cloud management platform notifies the first computing node to release the read lock on the first data. For instance, the cloud management platform sends a ninth instruction message to the first computing node. This ninth instruction message instructs the first computing node to release the read lock on the first data. In response to this ninth instruction message, the first computing node releases the read lock on the first data.
[0133] Optionally, when the resource utilization of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization in the first computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, the first computing node sends a first data set to the third computing node. This first data set includes some or all of the data stored in the first computing node. For example, the first data set includes first data. After sending the first data set to the third computing node, the first computing node deletes the first data set from its own records.
[0134] For example, the cloud management platform obtains the resource utilization rate of the first computing node and / or the resource utilization rate of the first computing device cluster to which the first computing node belongs. When the resource utilization rate of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization rate of the first computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, the cloud management platform sends a tenth instruction message to the first computing node. The tenth instruction message is used to instruct the first computing node to send a first data set to a third computing node. The tenth instruction message is also used to instruct the first computing node to delete the first data set after sending it.
[0135] For example, the third computing node and the first computing node belong to different computing device clusters within the same region. That is, the third computing node belongs to a third computing device cluster in the first region, which is used to provide the second storage service.
[0136] For example, the first computing node is Figure 2 Computing node 2211 in the first computing device cluster is Figure 2 The computing device cluster 221 in the first area is Figure 2 Region 220 in the middle. The third computation node is Figure 2 The computing node 2221 in the cluster is the third computing device cluster. Figure 2 The computing device cluster 222 in the middle.
[0137] For example, the access frequency of data in the first data set is lower than the access frequency threshold. The access frequency of data is the ratio of the number of times data is accessed within a unit time period to the length of the unit time period. This application embodiment does not limit the specific values of the access frequency threshold and the length of the unit time period.
[0138] Optionally, when the target data block is stored in the second computing node, the first computing node can also send first data to the second computing node, and the second computing node receives and stores the first data. When the target data block is stored in the sixth computing node, the first computing node can also send first data to the sixth computing node, and the sixth computing node receives and stores the first data.
[0139] For example, the first computing node directly sends the first data to the second computing node and / or the sixth computing node. Alternatively, the first computing node sends the first data to the cloud management platform, and the cloud management platform, after receiving the first data, sends the first data to the second computing node and / or the sixth computing node.
[0140] exist Figure 3In this method, when a user writes data, even if the object to which the data belongs is stored on a computing node in a region far from the user's device, the first computing node closer to the user's device can receive and process the write request without the computing node storing the object to which the data belongs needing to receive and process the write request. Furthermore, the first computing node can send a write success response to the user device immediately after storing the data, without waiting for a write success response from the computing node storing the object to which the data belongs, thus enabling fast data writing. Simultaneously, after the first computing node sends a write success response to the user, the cloud management platform can notify the first computing node to request the second computing node storing the metadata of the object to which the data belongs to update the first metadata. During the process of the second computing node updating the first metadata, a write lock is set on the first data in the first computing node until the first metadata in the second computing node is successfully updated. Because a write lock is set on the first data in the first computing node, the first computing node will not process read requests until the write lock is released, thereby ensuring data consistency for users when accessing data.
[0141] In some embodiments, Figure 3 In this method, one user equipment performs write and / or read operations on data in the target data block. When two user equipments are both performing write operations on data at the same location in the target data block, further steps can be executed after step 312. Figure 4 The method in the middle.
[0142] Figure 4 This is a schematic flowchart illustrating the method for reading and writing data provided in the embodiments of this application. Figure 4 The methods described can be applied to cloud management platforms, for example... Figure 1 or Figure 2 The cloud management platform in the context of cloud services manages the infrastructure that provides these services, including a first compute node, a second compute node, and an eighth compute node. The first, second, and eighth compute nodes are, for example,... Figure 2 The three different computing nodes. See the first and second computing nodes for details. Figure 3 The description in the text. Figure 4 The method includes the following steps.
[0143] 401, Send the eleventh instruction message to the second computing node.
[0144] The eighth computing node sends an eleventh instruction message to the second computing node, meaning the second computing node receives the eleventh instruction message from the eighth computing node. This eleventh instruction message is used to instruct the updating of the third metadata. The third metadata includes metadata corresponding to the third data. For example, the third metadata includes at least one of the following: the size of the third data, the storage location of the third data, and the last modification time of the third data. The third data belongs to the target data block, and the third data and the first data are located in the same position within the target data block.
[0145] Optionally, before step 401, the first computing node and the second computing node execute... Figure 3 The method described in the text. In other words, the first computing node stores the first data, or the first computing node stores both the first data and the first metadata. The second computing node stores the first metadata.
[0146] Optionally, before step 401, the cloud management platform receives a second write request from the second user equipment, i.e., the second user equipment sends a second write request to the cloud management platform. This second write request is used to request the writing of third data into the target data block. The second user equipment and... Figure 3 The first user equipment belongs to a different device within the same tenant. The distance between the second user equipment and the region to which the eighth compute node belongs is less than the distance between the region to which the second compute node belongs and the second user equipment. The specific implementation is similar to step 301. In response to the second write request, the cloud management platform notifies the eighth compute node to store the third data and notifies the eighth compute node to send a seventh response message to the second user equipment. This seventh response message is used to indicate that the third data was successfully written. The specific implementation is similar to step 302. The eighth compute node stores the third data, and the specific implementation is similar to step 303. The eighth compute node sends a seventh response message to the first user equipment, and the specific implementation is similar to step 304. The cloud management platform notifies the eighth compute node to send an eleventh indication message to the second compute node, and the specific implementation is similar to step 305.
[0147] In some embodiments, the eighth computing node sending the eleventh indication information to the second computing node includes: the eighth computing node directly sending the eleventh indication information to the second computing node; or, the eighth computing node sending the eleventh indication information to the cloud management platform, and the cloud management platform receiving the eleventh indication information and then sending the eleventh indication information to the second computing node.
[0148] In some embodiments, the eighth computing node belongs to a fourth computing device cluster within a third region, which provides the first storage service. This third region differs from the first and second regions. See also: first region, second region, and first storage service. Figure 3 The description in the text.
[0149] For example, the computing nodes in the first region, the second region, and the third region are provided by the same cloud vendor, meaning that the computing nodes in the first region, the second region, and the third region belong to the infrastructure managed by the same cloud management platform.
[0150] For example, the eighth computing node is Figure 2 Compute node 2411, the eighth computing device cluster is Figure 2 The computing device cluster 241 in the third area is Figure 2 Region 240 in the middle.
[0151] For example, the distance between the third region to which the eighth computing node belongs and the second user equipment is determined based on the physical distance between each computing node in the third region and the second user equipment. For instance, the distance between the third region and the second user equipment is the minimum or average of the distances between each computing node in the third region and the second user equipment. Similarly, the distance between the second region to which the second computing node belongs and the second user equipment is determined based on the physical distance between each computing node in the second region and the second user equipment. For instance, the distance between the second region and the second user equipment is the minimum or average of the distances between each computing node in the second region and the second user equipment.
[0152] For example, the eighth computing node may store the target data block, or the eighth computing node may not store the target data block; this application embodiment is not limited in this respect.
[0153] For example, the eighth computing node also stores the correspondence between the third data and the target data block.
[0154] For example, the eighth computing node stores the third data in the form of key-value pairs. The key corresponding to the third data is the identifier information of the target data block, and the value corresponding to the third data is the third data itself.
[0155] In some embodiments, after storing the third data, the eighth or ninth compute node stores the third metadata. The eighth and ninth compute nodes belong to the same compute device cluster. For example, the ninth compute node is... Figure 2 The computation node is 2412.
[0156] For example, the third metadata includes the metadata corresponding to the third data, which may be either the metadata corresponding to the third data or the metadata of the target data block after the third data is written. Specifically, when the third metadata is the metadata corresponding to the third data, if the target data block only includes the first data, then the third metadata is the metadata of the target data block after the third data is written; if the target data block includes the first data and other data besides the first data, then the third metadata is a portion of the metadata of the target data block after the third data is written.
[0157] For example, the eighth or ninth computing node stores the third metadata in the form of key-value pairs. Here, the key corresponding to the third metadata is the identifier information of the target data block, and the value corresponding to the third metadata is the third metadata itself.
[0158] Optionally, the eighth computing node performs step 401 before or after sending the seventh response information, or at the same time as sending the seventh response information.
[0159] In some embodiments, the eleventh indication information includes third metadata.
[0160] 402, Set a write lock for the third data.
[0161] Before or after executing step 401, the eighth compute node sets a write lock on the third data within the eighth compute node. The specific implementation is similar to step 309 and will not be elaborated here. The function of this write lock is... Figure 3 The write lock function is similar to that in [the context of the previous sentence].
[0162] In some embodiments, before step 402, the cloud management platform notifies the eighth computing node to set a write lock for the third data, and the specific implementation is similar to step 308.
[0163] 403, update third-party metadata.
[0164] After receiving the eleventh instruction information, the second computing node updates the third metadata according to the eleventh instruction information.
[0165] For example, when the third metadata is the metadata corresponding to the third data, the second computing node replaces the stored first metadata with the third metadata. When the third metadata is the metadata of the target data block after the third data is written, the second computing node replaces the stored metadata of the target data block with the third metadata.
[0166] For example, the execution order of steps 402 and 403 is not limited in the embodiments of this application. For example, step 402 may be executed before or after step 403, or steps 402 and 403 may be executed simultaneously.
[0167] In some embodiments, the eleventh indication information further includes a first version number, which indicates the number of times the metadata of the target data block has been modified. For example, the first version number is 0. After receiving the eleventh indication information, the second computing node determines whether the first version number and the second version number are the same based on the first version number and the second version number already stored in the second computing node. The second version number indicates the number of times the metadata of the target data block has been modified in the second computing node. After the metadata of the target data block stored in the second computing node is modified, the second version number is incremented by 1. When the first version number and the second version number are the same, the second computing node does not need to update the metadata of the target data block. When the first version number and the second version number are different, the second computing node updates the third metadata according to the eleventh indication information.
[0168] 404, send a second instruction message to the cloud management platform.
[0169] After receiving the eleventh instruction message, before or after executing step 403, the second computing node sends a second instruction message to the cloud management platform; that is, the cloud management platform receives the second instruction message from the second computing node. This second instruction message indicates that the first data has expired. Alternatively, this second instruction message indicates that both the first data and the first metadata have expired.
[0170] 405, notify the first computing node to delete the first data, and send the third response information to the second computing node.
[0171] In response to the second instruction message, the cloud management platform sends a twelfth instruction message to the first computing node. This twelfth instruction message instructs the first computing node to delete the first data in its memory and then sends a third response message to the second computing node. Alternatively, in response to the second instruction message, the cloud management platform forwards the second instruction message to the first computing node to notify it to delete the first data and then sends a third response message to the second computing node.
[0172] In some embodiments, the second computing node directly sends the second instruction information to the first computing node, that is, the first computing node directly receives the second instruction information from the second computing node without the need for the cloud management platform to forward it.
[0173] 406, delete the first data.
[0174] After receiving the twelfth instruction message or the second instruction message, the first computing node deletes the first data in the first computing node in response to the twelfth instruction message or the second instruction message.
[0175] When the first computing node stores the first data and the first metadata, in response to the twelfth instruction information or the second instruction information, the first computing node deletes the first data and the first metadata from the first computing node. In other words, the twelfth instruction information is also used to instruct the first computing node to delete the first metadata from the first computing node.
[0176] When the first metadata is stored in the seventh compute node, the first compute node sends a thirteenth indication message to the seventh compute node. This thirteenth indication message indicates that the first metadata has expired. Upon receiving the thirteenth indication message, the seventh compute node, in response, deletes the first metadata from its storage.
[0177] 407, Send the third response information to the second computing node.
[0178] After executing step 406, the first computing node sends a third response message to the second computing node, that is, the second computing node receives the third response message from the first computing node. This third response message indicates that the first data has expired. Alternatively, the third response message indicates that both the first data and the first metadata have expired.
[0179] For example, the first computing node sending information to the second computing node includes: the first computing node sending information directly to the second computing node; or, the first computing node sending information to the cloud management platform, and the cloud management platform receiving the information and then sending the information to the second computing node.
[0180] When the first metadata is stored in the seventh compute node, before or after step 306, the first compute node receives an eighth response message from the seventh compute node. This eighth response message indicates that the first metadata has expired.
[0181] For example, the seventh computing node sending information to the first computing node includes: the seventh computing node sending information directly to the first computing node; or, the seventh computing node sending information to the cloud management platform, and the cloud management platform receiving the information and then sending the information to the first computing node.
[0182] 408, send the ninth response message to the cloud management platform.
[0183] After updating the third metadata, and / or after receiving the third response information, the second compute node sends a ninth response information to the cloud management platform, i.e., the cloud management platform receives the ninth response information from the second compute node. This ninth response information is used to indicate that the third metadata update was successful.
[0184] In some embodiments, the second computing node directly sends the ninth response information to the eighth computing node, that is, the eighth computing node receives the ninth response information from the second computing node.
[0185] 409. Notify the eighth compute node to cancel the write lock for the third data. The specific implementation is similar to step 311, and will not be described in detail here.
[0186] 410, remove the write lock for the third data. The specific implementation is similar to step 312, and will not be repeated here.
[0187] exist Figure 3 In the method, after the first user equipment writes the first data to the first computing node and the first metadata has been updated in the second computing node, if the second user equipment writes the third data to the eighth computing node and the third data is in the same position as the first data in the target data block, the second computing node also needs to instruct the first computing node to delete the first data when updating the third metadata, so as to ensure data consistency.
[0188] In some embodiments, the user equipment reads data from the target data block in the following manner: Figure 5 As shown. Figure 5 This is a schematic flowchart illustrating the method for reading and writing data provided in the embodiments of this application. Figure 5 The methods described can be applied to cloud management platforms, for example... Figure 1 or Figure 2 The cloud management platform is used to manage the infrastructure providing cloud services, which includes a first compute node and a second compute node. See [link to details about the first and second compute nodes]. Figure 3 The description in the text. Figure 5 The method includes the following steps.
[0189] 501, a second read request is sent to the cloud management platform.
[0190] The first user equipment sends a second read request to the cloud management platform, meaning the cloud management platform receives the second read request from the first user equipment. This second read request is used to request second data from the target data block. (See also: First user equipment, target data block) Figure 3 The description in the text.
[0191] Optionally, if the second data is stored in the first computing node, the cloud management platform executes step 502. If the second data is not stored in the first computing node, the cloud management platform executes step 503.
[0192] 502, instructs the first computing node to send the second data to the first user equipment.
[0193] When the second data is stored in the first computing node, the cloud management platform sends a fourteenth instruction message or a second read request to the first computing node. This fourteenth instruction message instructs the first computing node to send the second data to the first user equipment.
[0194] For example, the first computing node stores the second data in the form of key-value pairs. Here, the key corresponding to the second data is the identifier information of the target data block, and the value corresponding to the second data is the second data itself.
[0195] In some embodiments, the first computing node directly receives the second read request from the first user device without the need for forwarding by the cloud management platform.
[0196] For example, in response to the fourteenth instruction message or the second read request, the first computing node performs step 508.
[0197] 503, notifies the first compute node to obtain the second data from the compute nodes in the third region based on the second metadata.
[0198] If the second data is not stored in the first computing node, the cloud management platform sends a fifteenth instruction message or a second read request to the first computing node. This fifteenth instruction message instructs the first computing node to obtain the second data from the computing node in the third region based on the second metadata. This second metadata includes metadata corresponding to the second data and also indicates that the second data is stored in the computing node in the third region.
[0199] In some embodiments, the fifteenth instruction information is also used to instruct the first computing node to send a third read request to the second computing node to obtain the second metadata.
[0200] In some embodiments, in response to the fifteenth instruction message or the second read request, the first computing node performs step 504.
[0201] 504, a third read request is sent to the second compute node.
[0202] The first compute node sends a third read request to the second compute node, meaning the second compute node receives a third read request from the first compute node. This third read request is used to request the second metadata. The second compute node stores the second metadata.
[0203] For example, the second metadata includes at least one of the following: the size of the second data, the storage location of the second data, the last modification time of the second data, etc.
[0204] In some embodiments, the second metadata includes metadata corresponding to the second data, which may be either the second metadata being the metadata corresponding to the second data, or the second metadata being the metadata of the target data block after the second data is written. Specifically, when the second metadata is the metadata corresponding to the second data, if the target data block only includes the second data, then the second metadata is the metadata of the target data block after the second data is written; if the target data block includes the second data and other data besides the second data, then the second metadata is a portion of the metadata of the target data block after the second data is written.
[0205] For example, the second computing node stores the second metadata in the form of key-value pairs. The key corresponding to the second metadata is the identifier information of the target data block, and the value corresponding to the second metadata is the second metadata itself.
[0206] 505, send the fourth response message to the cloud management platform.
[0207] In response to the third read request, the second compute node sends a fourth response message to the cloud management platform, meaning the cloud management platform receives the fourth response message from the second compute node. This fourth response message includes the second metadata. Based on the fourth response message, the cloud management platform determines that the second data is stored in a compute node in a third region. This third region is different from the first and second regions.
[0208] In some embodiments, the second computing node directly sends the fourth response information to the first computing node. In other words, step 505 is an optional step and can be omitted.
[0209] 506, Notify the first computing node to obtain the second data from the fourth or fifth computing node based on the second metadata.
[0210] After receiving the fourth response information, the cloud management platform sends a sixteenth instruction message or a fourth response message to the first computing node. This sixteenth instruction message instructs the first computing node to obtain the second data from the fourth or fifth computing node. The fourth and fifth computing nodes belong to the third region.
[0211] In some embodiments, the fourth computing node is used to provide a first storage service, which is described in [reference needed]. Figure 3 The description in the text. For example, the third region is... Figure 2 In region 240, the fourth compute node is compute node 2411 in compute node cluster 241. The fifth compute node is used to provide a second storage service, which is described in [reference needed]. Figure 3 The description in the text. For example, the third region is... Figure 2 In region 240, the fifth compute node is compute node 2421 in compute node cluster 242.
[0212] In some embodiments, in response to the sixteenth instruction message or the fourth response message, the first computing node executes step 507. In other words, step 506 is an optional step and may not be executed.
[0213] 507, obtained the second data.
[0214] In some embodiments, the sixteenth indication information is used to instruct the first computing node to send a fourth read request to the fourth computing node, the fourth read request being used to request the acquisition of second data. In response to the sixteenth indication information or the fourth response information, the first computing node sends the fourth read request to the fourth computing node. In response to the fourth read request, the fourth computing node sends a fifth response information to the cloud management platform. When the second data is stored in the fourth computing node, the fifth response information includes the second data. When the second data is not stored in the fourth computing node, the fifth response information is used to indicate that the second data is not stored in the fourth computing node. Exemplarily, after receiving the fifth response information, the cloud management platform sends the fifth response information to the first computing node. Alternatively, the fourth computing node directly sends the fifth response information to the first computing node.
[0215] For example, when the fifth response information includes the second data, the first computing node performs step 508 after receiving the fifth response information.
[0216] For example, when the fifth response information indicates that the second data is not stored in the fourth computing node, the cloud management platform sends a seventeenth indication information or a fifth response information to the first computing node. The seventeenth indication information instructs the first computing node to send a fifth read request to the fifth computing node. This fifth read request requests the acquisition of the second data. In response to the seventeenth indication information or the fifth response information, the first computing node sends a fifth read request to the fifth computing node. In response to the fifth read request, the fifth computing node sends a sixth response information to the cloud management platform. This sixth response information includes the second data. For example, after receiving the sixth response information, the cloud management platform sends the sixth response information to the first computing node. Alternatively, the fifth computing node directly sends the sixth response information to the first computing node.
[0217] For example, after receiving the sixth response information, the first computing node executes step 508.
[0218] 508, Send the second data to the first user equipment.
[0219] In some embodiments, after obtaining the second data, the first computing node sends the second data to the first user equipment. For example, the first computing node sends the second data directly to the first user equipment. Alternatively, the first computing node sends the second data to a cloud management platform, and the cloud management platform receives the second data and then sends it to the first user equipment.
[0220] In some embodiments, after obtaining the second data, the cloud management platform sends the second data to the first user device. In other words, step 508 is an optional step and can be omitted.
[0221] exist Figure 5 In this method, when a user reads data, even if the object to which the data belongs is stored on a computing node in a region far from the user's device, a first computing node closer to the user's device can receive and process the read request without the computing node storing the object to which the data belongs needing to receive and process the read request. When the first computing node stores the data, it can directly send the data to the user, thereby shortening the latency required to read the data. When the first computing node does not store the data, it can obtain the metadata corresponding to the data from the computing node storing the metadata of the data, thereby determining the region where the data is located, and then obtaining the data from the computing node in that region. When the first computing node obtains the data from the computing node in the region where the data is located, it can first access the computing node providing the first storage service; if it does not obtain the data, it will then access the computing node providing the second storage service. Since the data read / write speed of the first storage service is greater than that of the second storage service, the latency of obtaining the data from the computing node providing the first storage service is shorter.
[0222] Optionally, during execution Figures 3 to 5 Prior to the method described above, the cloud management platform receives first configuration information from the first tenant. This first configuration information is used to configure the use of the first storage service and the second storage service. (See [link to first storage service and second storage service] for details.) Figure 3 The description in [the document / reference] is as follows. This cloud management platform is, for example, [the platform / service]. Figure 1 or Figure 2 The cloud management platform in China.
[0223] Optionally, during execution Figures 3 to 5Prior to the method described above, the cloud management platform received second configuration information from the first tenant, which was used to configure the use of regionless storage services. When using buckets or folders within this regionless storage service to store data, tenants can access the data in a bucket or folder without explicitly specifying the computing device cluster to which it belongs. In other words, with regionless storage services, tenants do not need to be aware of the actual storage location of the bucket or folder.
[0224] Optionally, the method in this embodiment can be applied to application scenarios with a large number of read operations and a small number of write operations. The method in this embodiment can also be applied to application scenarios with a small number of concurrent write operations from multiple user devices. For example, the method in this embodiment can be applied to the training process of an artificial intelligence (AI) model.
[0225] Figure 6 This is a schematic structural diagram of the cloud management platform provided in the embodiments of this application. Figure 6 The cloud management platform 600 includes a receiving module 610 and a sending module 620. Figure 6 The cloud management platform 600 is used for execution Figures 3 to 5 The methods executed by the cloud management platform in the middle.
[0226] The cloud management platform 600 is used for execution. Figure 3 When the cloud management platform executes the method, the receiving module 610 is used to: receive a first write request; and receive a second response information. The sending module 620 is used to: notify the first computing node to store the first data and send the first response information to the first user equipment; notify the first computing node to send the first indication information to the second computing node; notify the first computing node to set a write lock for the first data; and notify the first computing node to cancel the write lock for the first data. The sending module 620 is used to execute... Figure 3 Steps 302, 305, 308, and 311 in the process.
[0227] The cloud management platform 600 is used for execution. Figure 4 When the cloud management platform executes the method, the receiving module 610 is used to: receive second instruction information; and receive ninth response information. The sending module 620 is used to: notify the first computing node to delete the first data and send a third response information to the second computing node; and notify the eighth computing node to cancel the write lock for the third data. The sending module 620 is used to execute... Figure 4 Steps 405 and 409 in the process.
[0228] The cloud management platform 600 is used for execution. Figure 5When the cloud management platform executes the method, the receiving module 610 is used to: receive a second write request; and receive a fourth response information. The sending module 620 is used to: notify the first computing node to send second data to the first user equipment; notify the first computing node to obtain second data from the computing nodes in the third region according to the second metadata; and notify the first computing node to obtain second data from the fourth or fifth computing node according to the second metadata. The sending module 620 is used to execute... Figure 5 Steps 502, 503, and 506 in the process.
[0229] Figure 7 This is a schematic structural diagram of the computing device provided in the embodiments of this application. Figure 7 The computing device 700 includes a transceiver module 710 and a processing module 720. Figure 7 The computing device 700 in the middle is used to perform Figures 3 to 5 The methods executed by the first to eighth computing nodes in the process.
[0230] The computing device 700 is used for execution Figure 3 When the first computing node executes the method, the transceiver module 710 is used to receive notifications from the cloud management platform; send first response information to the first user equipment; and send first instruction information to the second computing node. The transceiver module 710 is used to execute... Figure 3 Steps 304 and 306 in the above steps. Processing module 720 is used for: storing first data; setting a write lock for the first data; and removing the write lock for the first data. Processing module 720 is used for executing... Figure 3 Steps 303, 309, and 312 in the text.
[0231] The computing device 700 is used for execution Figure 3 When the second computing node executes the method, the transceiver module 710 is used to: receive first indication information; and send second response information to the cloud management platform. The transceiver module 710 is used to execute... Figure 3 Step 310. Processing module 720 is used to update the first metadata. Processing module 720 is used to perform... Figure 3 Step 307 in the process.
[0232] The computing device 700 is used for execution Figure 4 When the first computing node executes the method, the transceiver module 710 is used to: receive notifications from the cloud management platform; and send third response information to the second computing node. The transceiver module 710 is used to execute... Figure 3 Step 407. Processing module 720 is used to delete the first data. Processing module 720 is used to execute step 406.
[0233] The computing device 700 is used for execution Figure 4When the second computing node executes the method, the transceiver module 710 is used to: receive the eleventh instruction information; send the second instruction information to the cloud management platform; receive the third response information; and send the ninth response information to the cloud management platform. The transceiver module 710 is used to execute... Figure 4 Steps 404 and 408 are described. Processing module 720 is used to update third-party metadata. Processing module 720 is used to execute step 403.
[0234] The computing device 700 is used for execution Figure 4 When the method is executed by the eighth computing node, the transceiver module 710 is used to: send the eleventh instruction information to the second computing node; and receive notifications from the cloud management platform. The transceiver module 710 is used to execute... Figure 3 Step 401. Processing module 720 is used to set a write lock for the third data; and to remove the write lock for the third data. Processing module 720 is used to execute steps 402 and 410.
[0235] The computing device 700 is used for execution Figure 5 When the first computing node executes the method, the transceiver module 710 is used to: receive notifications from the cloud management platform; and send second data to the first user device. The transceiver module 710 is used to execute... Figure 5 Step 508 in the process.
[0236] In some embodiments, when the computing device 700 is used to perform Figure 5 When the first computing node executes the method, the transceiver module 710 is used to: send a third read request to the second computing node. The transceiver module 710 is used to execute... Figure 5 Step 504. Processing module 507 is used to obtain the second data and execute... Figure 5 Step 507 in the process.
[0237] The computing device 700 is used for execution Figure 5 When the second computing node executes the method, the transceiver module 710 is used to: receive a third read request; and send a fourth response message to the cloud management platform. The transceiver module 710 is used to execute... Figure 5 Step 505 in the process.
[0238] Figure 6 , Figure 7 The receiving module 610, transmitting module 620, transceiver module 710, and processing module 720 can all be implemented in software or in hardware. For example, the implementation of transceiver module 710 will be described below. Similarly, the implementation methods of receiving module 610, transmitting module 620, and processing module 720 can refer to the implementation method of transceiver module 710.
[0239] As an example of a software functional unit, the transceiver module 710 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, the transceiver module 710 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0240] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0241] As an example of a hardware functional unit, the transceiver module 710 may include at least one computing device, such as a server. Alternatively, the transceiver module 710 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0242] The transceiver module 710 includes multiple computing devices that can be distributed in the same region or in different regions. Similarly, the transceiver module 710 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the transceiver module 710 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0243] Therefore, the modules of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0244] It should be noted that the above embodiments of the device, when executing the above methods, are only illustrative examples of the division of functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. For example, the transceiver module 710 can be used to execute any step in the above methods, and the processing module 720 can be used to execute any step in the above methods. The steps implemented by the transceiver module 710 and the processing module 720 can be specified as needed, and the above devices can achieve all functions by implementing different steps in the above methods through the transceiver module 710 and the processing module 720 respectively.
[0245] Furthermore, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments above, which will not be repeated here.
[0246] The method provided in this application can be executed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as processing units, memory, and memory control units; the functions and structure of this hardware will be described in detail later. The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software. Optionally, the computer system can be a handheld device such as a smartphone, or a terminal device such as a personal computer; this application does not particularly limit this, as long as the method provided in this application can be used. The executing entity of the method provided in this application can be a computing device, or a functional module within the computing device capable of calling and executing programs.
[0247] Figure 8 This is a schematic structural block diagram of a computing device 800 provided in an embodiment of this application. The computing device 800 may be a server, a computer, or other device with computing capabilities. Figure 8 The computing device 800 shown includes at least one processor 810 and a memory 820.
[0248] It should be understood that this application does not limit the number of processors and memories in the computing device 800.
[0249] The processor 810 executes instructions in the memory 820, causing the computing device 800 to implement the method provided in this application. Alternatively, the processor 810 executes instructions in the memory 820, causing the computing device 800 to implement the various functional modules provided in this application, thereby implementing the method provided in this application.
[0250] Optionally, the computing device 800 also includes a communication interface 830. The communication interface 830 uses a transceiver module, such as, but not limited to, a network interface card or a transceiver, to enable communication between the computing device 800 and other devices or communication networks.
[0251] Optionally, the computing device 800 also includes a system bus 840, wherein the processor 810, memory 820, and communication interface 830 are respectively connected to the system bus 840. The processor 810 can access the memory 820 through the system bus 840; for example, the processor 810 can perform data read / write or code execution in the memory 820 through the system bus 840. The system bus 840 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 840 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0252] In one possible implementation, the processor 810 primarily functions to interpret the instructions (or code) of a computer program and process data within the computer software. The instructions of the computer program and the data within the computer software can be stored in the memory 820 or the cache of the processor 810.
[0253] Optionally, the processor 810 may be an integrated circuit chip with signal processing capabilities. By way of example and not limitation, the processor 810 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Among these, a general-purpose processor is a microprocessor, etc. For example, the processor 810 may be a central processing unit (CPU).
[0254] The memory 820 provides runtime space for processes in the computing device 800. For example, the memory 820 stores the computer program (specifically, the program code) used to generate the process. After the computer program is run by the processor to generate a process, the processor allocates corresponding storage space for the process in the memory 820. Furthermore, the aforementioned storage space further includes text segments, initialized data segments, bit initialized data segments, stack segments, heap segments, etc. The memory 820 stores data generated during the process's execution, such as intermediate data or process data, in the aforementioned process-specific storage space.
[0255] Optionally, the memory, also known as RAM, is used to temporarily store the data processed by the processor 810, as well as data exchanged with external storage devices such as hard disks. As long as the computer is running, the processor 810 will load the data required for processing into RAM for computation, and then transfer the result back out after the computation is complete.
[0256] By way of example and not limitation, memory 820 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile storage medium may be, for example, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus DRAM (DRDRAM). It should be noted that the memory 820 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0257] The structures of the computing device 800 listed above are merely illustrative and are not limited thereto. The computing device 800 in this application includes various hardware components in existing computer systems. For example, the computing device 800 also includes other memories besides the memory 820, such as disk storage. Those skilled in the art should understand that the computing device 800 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the computing device 800 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the computing device 800 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 8All the devices shown.
[0258] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a desktop computer, a laptop computer, or a smartphone, or other terminal device.
[0259] like Figure 9 As shown, the computing device cluster includes at least one computing device 800. The memory 820 of one or more computing devices 800 in the computing device cluster may store the same instructions for performing the methods described above.
[0260] In some possible implementations, the memory 820 of one or more computing devices 800 in the computing device cluster may also each store a portion of the instructions for executing the above-described method. In other words, a combination of one or more computing devices 800 can jointly execute the instructions of the above-described method.
[0261] It should be noted that the memories 820 in different computing devices 800 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the aforementioned device. That is, the instructions stored in the memories 820 of different computing devices 800 can implement the functions of one or more modules within the aforementioned device.
[0262] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 10 One possible implementation is shown. For example... Figure 10 As shown, the two computing devices 800A and 800B are connected via a network. Specifically, they are connected to the network through the communication interfaces in each computing device.
[0263] It should be understood that Figure 10 The functions of the computing device 800A shown can also be performed by multiple computing devices 800. Similarly, the functions of the computing device 800B can also be performed by multiple computing devices 800.
[0264] In this embodiment, a computer program product containing instructions is also provided. The computer program product may be a software or program product containing instructions capable of running on a computing device cluster or stored on any available medium. When run by the computing device cluster, it causes the computing device cluster to perform the methods provided above, or causes the computing device cluster to implement the functions of the apparatus provided above.
[0265] In this embodiment, a computer-readable storage medium is also provided. This computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method described above.
[0266] This application also provides a system for reading and writing data. This data reading and writing system includes the aforementioned first computing node and second computing node. Alternatively, the data reading and writing system includes the aforementioned first user equipment, first computing node, and second computing node. Alternatively, the data reading and writing system includes the aforementioned first computing node, second computing node, and eighth computing node. Alternatively, the data reading and writing system includes the aforementioned first computing node, second computing node, fourth computing node, and fifth computing node. Alternatively, the data reading and writing system includes the aforementioned cloud management platform, first computing node, and second computing node. Alternatively, the data reading and writing system includes the aforementioned cloud management platform, first user equipment, first computing node, and second computing node. Alternatively, the data reading and writing system includes the aforementioned cloud management platform, first computing node, second computing node, and eighth computing node. Alternatively, the data reading and writing system includes the aforementioned cloud management platform, first computing node, second computing node, fourth computing node, and fifth computing node.
[0267] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0268] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0269] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0270] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0271] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0272] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0273] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of reading and writing data, characterized by, The method is applied to a cloud management platform, which manages infrastructure providing cloud services. The infrastructure includes a first computing node and a second computing node. The method includes: The cloud management platform receives a first write request from a first user device. The first write request is used to request the writing of first data into a target data block. The metadata of the target data block is stored in a second computing node. The distance between the region to which the second computing node belongs and the first user device is greater than the distance between the region to which the first computing node belongs and the first user device. In response to the first write request, the cloud management platform notifies the first computing node to store the first data and notifies the first computing node to send a first response message to the first user device. The first response message is used to indicate that the first data was successfully written. The cloud management platform notifies the first computing node to send a first instruction information to the second computing node. The first instruction information is used to instruct the updating of the first metadata, which includes the metadata corresponding to the first data. The cloud management platform notifies the first computing node to set a write lock for the first data in the first computing node; The cloud management platform receives a second response information from the second computing node, the second response information being used to indicate that the first metadata update was successful; After receiving the second response information, the cloud management platform notifies the first computing node to cancel the write lock on the first data in the first computing node.
2. The method of claim 1, wherein, The first computing node belongs to a first computing device cluster in a first region, and the first computing device cluster is used to provide a first storage service. The second computing node belongs to a second computing device cluster in a second region, and the second computing device cluster is used to provide a second storage service. The data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
3. The method according to claim 1 or 2, characterized in that, The method further includes: Before notifying the first computing node to release the write lock for the first data in the first computing node, the cloud management platform receives a first read request from the first user device, the first read request being used to request the acquisition of the first data; After notifying the first computing node to release the write lock on the first data in the first computing node, the cloud management platform responds to the first read request by notifying the first computing node to send the first data to the first user equipment.
4. The method of claim 3, wherein, In response to the first read request, the cloud management platform notifies the first computing node to send the first data to the first user equipment, including: In response to the first read request, the cloud management platform notifies the first computing node to set a read lock for the first data in the first computing node. The cloud management platform receives the first data from the first computing node; The cloud management platform sends the first data to the first user device; The cloud management platform notifies the first computing node to cancel the read lock on the first data in the first computing node.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The cloud management platform obtains the resource utilization rate of the first computing node and / or the resource utilization rate of the computing device cluster to which the first computing node belongs; When the resource utilization rate of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization rate in the computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, the cloud management platform notifies the first computing node to send a first data set to the third computing node, and notifies the first computing node to delete the first data set after sending the first data set, wherein the first data set includes some or all of the data stored in the first computing node. Wherein, the first computing node belongs to the first computing device cluster in the first region, and the first computing device cluster is used to provide the first storage service; the third computing node belongs to the third computing device cluster in the first region, and the third computing device cluster is used to provide the second storage service; the data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The cloud management platform receives a second indication information from the second computing node, the second indication information being used to indicate that the first data has failed; In response to the second instruction information, the cloud management platform notifies the first computing node to delete the first data in the first computing node, and notifies the first computing node to send a third response information to the second computing node after deleting the first data. The third response information is used to indicate that the first data in the first computing node has become invalid.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: The cloud management platform receives a second read request from the first user device, the second read request being used to request the reading of second data in the target data block; When the second data is stored in the first computing node, the cloud management platform notifies the first computing node to send the second data to the first user equipment; or... When the second data is not stored in the first computing node, the cloud management platform notifies the first computing node to obtain the second data from the computing node in the third region based on the second metadata. The second metadata includes the metadata corresponding to the second data and is used to indicate that the second data is stored in the computing node in the third region.
8. The method according to claim 7, characterized in that, The cloud management platform notifies the first computing node to obtain the second data from the computing nodes in the third region based on the second metadata, including: The cloud management platform notifies the first computing node to send a third read request to the second computing node. The third read request is used to request the second metadata, which is stored in the second computing node. The cloud management platform receives a fourth response message from the second computing node, the fourth response message including the second metadata; The cloud management platform notifies the first computing node to obtain the second data from the fourth or fifth computing node based on the second metadata. The fourth and fifth computing nodes belong to the third region. The fourth computing node is used to provide the first storage service, and the fifth computing node is used to provide the second storage service. The data read / write speed of the first storage service is greater than that of the second storage service.
9. The method according to claim 8, characterized in that, The cloud management platform notifies the first computing node to obtain the second data from the fourth or fifth computing node based on the second metadata, including: The cloud management platform notifies the first computing node to send a fourth read request to the fourth computing node, the fourth read request being used to request the second data; The cloud management platform receives a fifth response message from the fourth computing node, the fifth response message including the second data, or the fifth response message indicating that the second data is not stored in the fourth computing node; When the fifth response information indicates that the second data is not stored in the fourth computing node, the method further includes: The cloud management platform notifies the first computing node to send a fifth read request to the fifth computing node, the fifth read request being used to request the second data; The cloud management platform receives a sixth response message from the fifth computing node, the sixth response message including the second data.
10. A cloud management platform, characterized in that, The cloud management platform is used to manage the infrastructure providing cloud services, the infrastructure including a first computing node and a second computing node, and the cloud management platform includes: The receiving module is used to receive a first write request from a first user device. The first write request is used to request the writing of first data into a target data block. The metadata of the target data block is stored in a second computing node. The distance between the region to which the second computing node belongs and the first user device is greater than the distance between the region to which the first computing node belongs and the first user device. The sending module is configured to respond to the first write request by notifying the first computing node to store the first data and by notifying the first computing node to send a first response message to the first user equipment, wherein the first response message is used to indicate that the first data was successfully written. The sending module is further configured to notify the first computing node to send first indication information to the second computing node. The first indication information is used to indicate the updating of first metadata, and the first metadata includes metadata corresponding to the first data. The sending module is also used to notify the first computing node to set a write lock for the first data in the first computing node; The receiving module is further configured to receive second response information from the second computing node, the second response information being used to indicate that the first metadata update was successful; The sending module is further configured to, after receiving the second response information, notify the first computing node to cancel the write lock on the first data in the first computing node.
11. The cloud management platform according to claim 10, characterized in that, The first computing node belongs to a first computing device cluster in a first region, and the first computing device cluster is used to provide a first storage service. The second computing node belongs to a second computing device cluster in a second region, and the second computing device cluster is used to provide a second storage service. The data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
12. The cloud management platform according to claim 10 or 11, characterized in that, The receiving module is further configured to receive a first read request from the first user equipment before notifying the first computing node to release the write lock on the first data in the first computing node, wherein the first read request is used to request to obtain the first data; The sending module is further configured to, in response to the first read request, notify the first computing node to send the first data to the first user equipment after notifying the first computing node to release the write lock on the first data in the first computing node.
13. The cloud management platform according to claim 12, characterized in that, The sending module is specifically used to respond to the first read request and notify the first computing node to set a read lock for the first data in the first computing node; The receiving module is further configured to receive the first data from the first computing node; The sending module is further configured to send the first data to the first user equipment; The sending module is further configured to notify the first computing node to cancel the read lock on the first data in the first computing node.
14. The cloud management platform according to any one of claims 10 to 13, characterized in that, The cloud management platform also includes a processing module, which is used to obtain the resource utilization rate of the first computing node and / or the resource utilization rate of the computing device cluster to which the first computing node belongs. The sending module is further configured to: when the resource utilization rate of the first computing node is greater than or equal to a first preset threshold, and / or when the resource utilization rate in the computing device cluster to which the first computing node belongs is greater than or equal to a second preset threshold, notify the first computing node to send a first data set to the third computing node, and notify the first computing node to delete the first data set after sending the first data set, wherein the first data set includes part or all of the data stored in the first computing node. Wherein, the first computing node belongs to the first computing device cluster in the first region, and the first computing device cluster is used to provide the first storage service; the third computing node belongs to the third computing device cluster in the first region, and the third computing device cluster is used to provide the second storage service; the data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
15. The cloud management platform according to any one of claims 10 to 14, characterized in that, The receiving module is further configured to receive second indication information from the second computing node, the second indication information being used to indicate that the first data has failed; The sending module is further configured to respond to the second indication information, notify the first computing node to delete the first data in the first computing node, and notify the first computing node to send a third response information to the second computing node after deleting the first data, the third response information being used to indicate that the first data in the first computing node has expired.
16. The cloud management platform according to any one of claims 10 to 15, characterized in that, The receiving module is further configured to receive a second read request from the first user equipment, the second read request being used to request the reading of second data in the target data block; When the second data is stored in the first computing node, the sending module is further configured to notify the first computing node to send the second data to the first user equipment; or, When the second data is not stored in the first computing node, the sending module is further configured to notify the first computing node to obtain the second data from the computing node in the third region according to the second metadata, wherein the second metadata includes metadata corresponding to the second data, and the second metadata is used to indicate that the second data is stored in the computing node in the third region.
17. The cloud management platform according to claim 16, characterized in that, The sending module is specifically used to notify the first computing node to send a third read request to the second computing node. The third read request is used to request to obtain the second metadata, which is stored in the second computing node. The receiving module is further configured to receive fourth response information from the second computing node, the fourth response information including the second metadata; The sending module is further configured to notify the first computing node to obtain the second data from the fourth computing node or the fifth computing node based on the second metadata, wherein the fourth computing node and the fifth computing node belong to the third region, the fourth computing node is configured to provide a first storage service, the fifth computing node is configured to provide a second storage service, and the data read / write speed of the first storage service is greater than the data read / write speed of the second storage service.
18. The cloud management platform according to claim 17, characterized in that, The sending module is specifically used to notify the first computing node to send a fourth read request to the fourth computing node, the fourth read request being used to request to obtain the second data; The receiving module is further configured to receive a fifth response information from the fourth computing node, the fifth response information including the second data, or the fifth response information used to indicate that the second data is not stored in the fourth computing node; When the fifth response information is used to indicate that the second data is not stored in the fourth computing node: The sending module is further configured to notify the first computing node to send a fifth read request to the fifth computing node, the fifth read request being used to request the acquisition of the second data; The receiving module is further configured to receive a sixth response information from the fifth computing node, the sixth response information including the second data.
19. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 9.
20. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster causes the computing device cluster to perform the method as described in any one of claims 1 to 9.
21. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a cluster of computing devices, perform the method as described in any one of claims 1 to 9.