Data processing method, corresponding device and cloud system

By introducing servers into nodes of cloud system to process memory data or target node data, the problems of cloud service storage service delay and low performance are solved, and fast response and high-performance data processing are achieved.

CN119645991APending Publication Date: 2025-03-18HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311201646.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In cloud service applications, storage services have problems such as extended access delay and limited TPS/QPS, resulting in extended response time of application instances and affecting cloud service performance.

Method used

By introducing a server into the nodes of the cloud system, the servers in the node can process the data in memory or the memory data of the target node, directly complete data processing tasks within the node, and reduce access to the database or cluster cache.

Benefits of technology

It improves the response speed of nodes, reduces response delay, reduces IO overhead, and realizes consistent synchronization of distributed data, improving the performance of cloud systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645991A_ABST
    Figure CN119645991A_ABST
Patent Text Reader

Abstract

The cloud system comprises a plurality of nodes, each node comprises a server and at least one application instance, the application instance in the same node communicates with the server, the servers of different nodes communicate with each other, and the server of each node is used for managing the memory of the node. And processing the data in the memories of the different nodes through communication with the servers of the different nodes. And the server side in the node receives the data processing task sent by the application instance in the node, and then the server side processes data associated with the data processing task. Therefore, the node in the cloud system can process the data processing task through the server without accessing a database or cluster cache, so that the response speed of the node can be improved, and the response time delay is reduced. In addition, data processing tasks are basically processed at the node, other nodes do not need to be frequently accessed, and IO overhead can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud service technology, and in particular to a data processing method, corresponding device and cloud system. Background Art

[0002] In cloud service applications, the state data of application instances is stored in some persistent storage services, such as structured query language database (SQL DB) or non-structured query language database (NO-SQL DB), so as to achieve the scaling and migration of application instances.

[0003] However, these storage services generally have problems such as long access latency and limited transactions per second (TPS) / queries per second (QPS). In addition, a database instance generally needs to process data read and write requests from a large number of different cloud service instances, which can easily lead to bottlenecks and affect the response time of application instances, thereby affecting the performance of cloud services. Summary of the invention

[0004] The present application provides a data processing method for reducing response delay and improving the performance of a cloud system. The present application also provides a corresponding device, a cloud system, a computer-readable storage medium, and a computer program product.

[0005] A first aspect of the present application provides a method for data processing, which is applied to a cloud system, wherein the cloud system includes multiple nodes, wherein each node includes a server and at least one application instance; the method includes: a first server receives a data processing task, the data processing task is issued by a first application instance, the first server is a server in a first node, the first application instance is an application instance in the first node, and the first node is any one of the multiple nodes; the first server processes data associated with the data processing task by processing data in the memory of the first node or / and processing data in the memory of a target node, the target node being at least one node associated with the data processing task among the multiple nodes except the first node.

[0006] In this application, the nodes in the cloud system can be physical machines or virtual machines (VM). The application instance can be a function, which can be configured with an interface for communicating with the server and an interface for processing data processing tasks, and these interfaces can be in the form of a software development kit (SDK). The server can be a functional module that can receive data processing tasks issued by the application instance, process the corresponding tasks, and can also communicate with the server of other nodes.

[0007] In the present application, the data processing task may be generated by the node in response to a request from a terminal device, or may be generated by the node in response to a request from other nodes in the cloud system, or may be generated by the node itself according to internal configuration.

[0008] In the solution provided by the first aspect above, the nodes in the cloud system can process data processing tasks through the server in the node, without accessing the database or cluster cache, which can improve the response speed of the node and reduce the response delay. In addition, data processing tasks will basically be completed in this node, without the need to frequently access other nodes, which can reduce input / output (IO) overhead. In addition, the servers of different nodes can communicate with each other and achieve consistent synchronization of distributed data. Moreover, this solution does not require the introduction of distributed cluster cache, and does not require tenants to rent or purchase cache services additionally.

[0009] In one possible implementation, each node also includes at least one client, at least one client is included in at least one application instance, or at least one client corresponds to at least one application instance; at least one application instance in the same node communicates with the server through at least one client.

[0010] In this possible implementation, the client may be a functional module including a communication interface with the server and other interfaces, and the client may include various types of SDKs for scheduling different types of data processing tasks to the server. The client may be included in the application instance or may be independent of the application instance. The relationship between the client and the application instance may be one-to-one (i.e., one client corresponds to one application instance), one-to-many (i.e., one client corresponds to multiple application instances), or many-to-many, but the number of clients is less than the number of application instances, such as 2 clients correspond to 4 application instances. In the present application, the efficiency of internal communication between nodes can be improved by communicating between the client and the server.

[0011] In one possible implementation, when the data processing task is a data writing task, the data writing task includes the key and value of the first data of the key-value structure; the above steps: the first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: the first server writes the value of the first data as the master into the memory, and the memory is the memory shared by multiple application instances in the first node.

[0012] In this possible implementation, data in a key-value (KV) structure refers to data whose value can be queried by a key. When writing data, the value written locally to the memory can be called the primary copy. In this application, writing values ​​to the memory shared by multiple application instances can enable different application instances to share data from other application instances. There is no need to store the same data repeatedly, which can reduce memory waste and improve memory utilization.

[0013] In one possible implementation, the method also includes: the first server determines a node for storing metadata of the first data based on a hash value of a key in the first data, the metadata of the first data is used to describe the node where the primary copy of the value of the first data is located, and different ranges of hash values ​​are associated with different nodes.

[0014] In this possible implementation, the master copy of the metadata may include information such as the key of the data, the size of the data, and the location of the data (the node where it is located). In the present application, the metadata and the value of the data may be stored separately, and each node may be associated with a hash value in a different range, for example: Node 1 may store metadata for data with a hash value range from hash1 to hash100, Node 2 may store metadata for data with a hash value range from hash101 to hash200, ... Then, if the hash value calculated based on the key in the data is within hash1 to hash100, the metadata of the data is stored in Node 1, and if the hash value calculated based on the key in the data is within hash100 to hash200, the metadata of the data is stored in Node 2. The solution provided in the present application can realize distributed storage of metadata.

[0015] In one possible implementation, the method also includes: if the hash value of the key in the first data indicates that the associated node is the first node, the first server generates a master copy of the metadata of the first data, and stores the master copy of the metadata of the first data in the memory of the first node.

[0016] In this possible implementation, if the hash value of the key in the first data falls within the hash value range corresponding to the first node, the master copy of the metadata of the first data is stored in the memory, and local storage does not need to generate IO overhead.

[0017] In one possible implementation, the method also includes: if the hash value of the key in the first data indicates that the associated node is the second node, the first server sends a first indication message to the server of the second node, and the first indication message is used to instruct the server of the second node to generate and store a master copy of the metadata of the first data.

[0018] In this possible implementation, if the hash value of the key in the first data falls within the hash value range corresponding to the second node, the first server needs to send a first indication message to the server of the second node, in which the key of the first data and the size of the first data can be notified to the server of the second node, and the second node will generate a master copy containing the key of the first data, the size of the first data, and the metadata of the node where the master copy of the first data is located based on the first indication message and the source of the first indication message. In the present application, the node where data is written can instruct other nodes to generate and store the metadata of the written data, thereby improving the coordination between nodes.

[0019] In a possible implementation, the method further includes: the first server obtains a copy of the metadata of the first data from the server of the second node, and stores the copy of the metadata of the first data in the memory of the first node.

[0020] In this possible implementation, the copy of the metadata of the first data (local copy) may include the key of the first data. In the present application, a copy of the metadata of the first data is obtained in advance, and when the first data needs to be queried in the first node, the metadata of the first data can be directly queried locally without accessing the second node, thereby reducing the frequency of access to other nodes and further reducing IO overhead.

[0021] In one possible implementation, when the data processing task is a data reading task, the data reading task includes the key of the second data of the key-value structure; the above steps: the first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: the first server determines whether the second data is stored in the first node based on the key of the second data; if the second data is stored in the first node, the first server reads the value of the second data from the memory of the first node.

[0022] In this possible implementation, if the second data is stored in the local node, the second data is directly read from the memory of the local node, that is, no IO overhead is generated, and the second data can be quickly read.

[0023] In one possible implementation, the method also includes: if the second data is not stored in the first node, the first server queries the master copy of the metadata of the second data based on the hash value of the key of the second data, and the master copy of the metadata of the second data describes the node where the master copy of the value of the second data is located; if the metadata of the second data indicates that the master copy of the value of the second data is stored in a third node, the first server reads the value of the second data from the memory of the third node, and the third node is the target node.

[0024] In this possible implementation, if the second data is not stored in the first node, it is necessary to first find the node where the master copy of the metadata of the second data is located, so as to obtain the third node where the master copy of the value of the second data is stored, and then read the value of the second data from the memory of the third node. In this way, data sharing between different nodes can be achieved.

[0025] In one possible implementation, the method also includes: the first server stores a copy of the value of the second data and a copy of the metadata of the second data in the memory of the first node, and the copy of the value and the copy of the metadata are used when there is a reading task for the second data in the first node again.

[0026] In this possible implementation, after reading the second data, the first server can store a copy of the metadata of the second data and a copy of the value of the second data in the local memory. In this way, when there is a reading task for the second data in the first node again, it can be read directly from the local memory, which improves the speed of the next reading of the second data and reduces the IO overhead. In this way, multiple nodes can also read the second data concurrently, solving the problem of high load on a certain node and slow reading caused by hot data.

[0027] In one possible implementation, the method also includes: the first server updates the master copy of the metadata of the second data, the master copy of the metadata of the second data describes the node where the value of the second data is located, and the node where the value of the second data is located includes the node where the master copy of the value of the second data is located and the node where the copy is located.

[0028] In this possible implementation, after pulling a copy of the value of the second data, the first server can instruct the server of the second node to update the master copy of the metadata of the second data. The process of updating the master copy can be that the server of the second node receives the update instruction from the first server and adds the information of the first node to the master copy of the metadata of the second data, indicating that a copy of the value of the second data is stored on the first node. In this way, when a modification task or deletion task for the second data occurs later, global consistency processing can be performed.

[0029] In one possible implementation, when the data processing task is a data modification task, the data modification task includes a key and an updated value in the third data of the key-value structure; the above steps: the first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: the first server invalidates the copy of the value of the third data according to the key of the third data, and modifies the master copy of the value of the third data to the updated value.

[0030] In this possible implementation, when modifying data, the copy of the value of the third data in the cloud system needs to be invalidated, and the master copy of the value of the third data needs to be modified to the updated value. In this way, different values ​​of the third data on different nodes can be avoided, and the probability of feedback errors can be reduced.

[0031] In a possible implementation, the above steps: the first server invalidates the copy of the third data according to the key of the third data, and modifies the master copy of the value of the third data to the updated value, including: the first server queries the master copy of the metadata of the third data according to the hash value of the key of the third data to determine the node where the master copy and the copy of the value of the third data are located; wherein the master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the copy is located; if the master copy or the copy of the value of the third data is stored in the first node, the first server deletes the copy of the value of the third data in the memory of the first node, or modifies the master copy of the value of the third data to the updated value; if the master copy or the copy of the value of the third data is not stored in the first node, the first server sends a second indication message to the node where the master copy of the value of the third data is located, and sends a third indication message to the node where the copy is located, the second indication message is used to indicate that the master copy of the value of the third data is modified to the updated value, and the third indication message is used to indicate that the copy of the value of the third data is deleted, and the node where the master copy and the copy of the value of the third data are located is the target node.

[0032] In this possible implementation, the first server can find the master copy of the metadata of the third data through the hash value of the key of the third data, and determine the nodes where the master copy and the copy of the value of the third data are located based on the master copy of the metadata. If the master copy is stored on the first node, the value of the master copy of the third data is modified to the updated value. If the copy of the value of the third data is stored on the first node, the copy of the value is deleted. If the first node does not store the master copy of the value of the third data or the master copy of the value of the third data, the nodes where the corresponding master copy and the copy are located are instructed to perform corresponding update and deletion processing. In this way, any node can perform the task of modifying data on this node or other nodes, which improves the convenience of data modification.

[0033] In a possible implementation, the method further includes: the first server updates a master copy of the metadata of the third data, and the master copy of the metadata of the third data is updated to a node where an updated value of the third data is located.

[0034] In this possible implementation, after the value of the third data is modified, the master copy of the metadata of the third data needs to delete the information of the node storing the copy. If the size of the updated value is significantly different from the value before modification, the size of the data needs to be modified.

[0035] In one possible implementation, when the data processing task is a data deletion task, the data deletion task includes the key of the fourth data of the key-value structure; the above steps: the first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: the first server deletes the master and the copy of the value of the fourth data according to the key of the fourth data, and deletes the master and the copy of the metadata of the fourth data.

[0036] In this possible implementation, when deleting data, you only need to determine the nodes where the master and replica of the fourth data value are located based on the key of the fourth data, and then delete the master and replica of the value as well as the master and replica of the metadata, so as to achieve global consistent deletion.

[0037] In a possible implementation, the above steps: the first server deletes the master and the copy of the fourth data value according to the key of the fourth data, and deletes the master and the copy of the metadata of the fourth data, including: the first server queries the master of the metadata of the fourth data according to the hash value of the key of the fourth data to determine the node where the master and the copy of the fourth data value are located; wherein the master of the metadata of the fourth data is used to describe the node where the master of the fourth data value is located, and the node where the copy is located; if the master or the copy of the fourth data value is stored in the first node, the first server deletes the master or the copy of the fourth data value in the memory of the first node, and the master or the copy of the metadata of the fourth data. copy; if the master copy or the copy of the fourth data value is not stored in the first node, the first server sends a deletion instruction to the node where the master copy or the copy of the fourth data value is located, and the deletion instruction is used to instruct the node where the master copy or the copy of the fourth data value is located to delete the master copy or the copy of the fourth data value, and delete the master copy or the copy of the metadata of the fourth data, and the node where the master copy or the copy of the fourth data value is located is the target node; if the master copy of the metadata of the fourth data is not stored in the node where the master copy or the copy of the fourth data value is located, the first server sends fourth indication information to the node where the master copy of the metadata of the fourth data is located, and the fourth indication information is used to instruct to delete the master copy of the metadata of the fourth data.

[0038] In this possible implementation, the first server may query the master copy of the metadata of the fourth data according to the hash value of the key of the fourth data, thereby determining the nodes where the master copy and the copy of the value of the fourth data are located, and then deleting them.

[0039] The second aspect of the present application provides a server for executing the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a module or unit for executing the method in the first aspect or any possible implementation of the first aspect, such as a receiving unit and a processing unit.

[0040] The third aspect of the present application provides a computer device, including a transceiver, a processor and a memory, wherein the transceiver and the processor are coupled to the memory, and the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the cloud device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0041] In a fourth aspect, the present application provides a computer device cluster, comprising at least one computer device, each computer device comprising a processor and a memory; the processor of the at least one computer device is used to execute instructions stored in the memory of the at least one computer device, so that the computer device cluster executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0042] In a fifth aspect, the present application provides a chip system, which includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected through lines; the interface circuits are used to receive signals from a memory of a computer device and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0043] The sixth aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0044] The seventh aspect of the present application provides a computer device program product, which includes a computer device program code. When the computer device program code is executed on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0045] The eighth aspect of the present application provides a cloud system, comprising: multiple nodes, each of which includes a server and at least one application instance; the application instance in the same node communicates with the server, and the servers of different nodes communicate with each other. The server of each node is used to manage the memory of the node, and process the data in the memory of different nodes by communicating with the servers of different nodes.

[0046] The server in each node is used to receive data processing tasks issued by the application instance of this node, and processes the data associated with the data processing tasks by processing the data in the memory of this node and / or processing the data in the memory of the target node. The target node is at least one node associated with the data processing task among multiple nodes other than this node.

[0047] In one possible implementation, each node also includes at least one client, at least one client is included in at least one application instance, or at least one client corresponds to at least one application instance; at least one application instance in the same node communicates with the server through at least one client.

[0048] In one possible implementation, when the data processing task is a data writing task, the data writing task includes the key and value of the first data of the key-value structure; the value in the first data is written as the master into the memory of this node, and the memory is the memory shared by multiple application instances in this node.

[0049] In one possible implementation, the hash value of the key in the first data indicates a node for storing metadata of the first data, and the metadata of the first data is used to describe the node where the master copy of the value of the first data is located, and hash values ​​in different ranges are associated with different nodes; if the hash value of the key in the first data indicates that the associated node is the first node, the master copy of the metadata of the first data is stored in the memory of the first node, and the first node is the current node; if the hash value of the key in the first data indicates that the associated node is the second node, the master copy of the metadata of the first data is stored in the memory of the second node, and the second node is any one of the multiple nodes except the first node.

[0050] In a possible implementation, when the master copy of the metadata of the first data is stored in the memory of the second node, the copy of the metadata of the first data is stored in the memory of the first node.

[0051] In one possible implementation, when the data processing task is a data reading task, the data reading task includes the key of the second data of the key-value structure; the key of the second data is used to determine whether the second data is stored in the first node, and the first node is the current node; if the second data is stored in the first node, the value of the second data is read from the memory of the first node; if the second data is not stored in the first node, and the metadata of the second data indicates that the master copy of the value of the second data is stored in the third node, then the value of the second data is read from the memory of the third node, and the master copy of the metadata of the second data describes the node where the master copy of the value of the second data is located; the third node is the target node.

[0052] In one possible implementation, a copy of the value of the second data and a copy of the metadata of the second data are stored in the memory of the first node, and the copy of the value and the copy of the metadata are used when there is a reading task for the second data in the first node again; correspondingly, the metadata of the second data is also used to describe the node where the copy of the value of the second data is located.

[0053] In one possible implementation, when the data processing task is a data modification task, the data modification task includes a key and an updated value in the third data of the key-value structure; the data modification task and the key of the third data are used to invalidate a copy of the value of the third data, and to modify the master copy of the value of the third data to the updated value.

[0054] In one possible implementation, the hash value of the key of the third data is used to indicate the node where the master copy of the metadata of the third data is located, and the master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the copy is located; if the master copy or the copy of the value of the third data is stored in the first node, the server of the first node is used to delete the copy of the value of the third data from the memory of the first node, or modify the value of the third data to an updated value, and the first node is the current node; if the master copy or the copy of the value of the third data is not stored in the first node, the server of the first node instructs the node where the master copy of the value of the third data is located to modify the value of the third data to an updated value, and instructs the node where the copy of the value of the third data is located to delete the copy of the value of the third data, and the node where the master copy and the copy of the value of the third data are located is the target node; correspondingly, the master copy of the metadata of the third data is updated to the node where the updated value of the third data is located.

[0055] In one possible implementation, when the data processing task is a data deletion task, the data deletion task includes the key of the fourth data of the key-value structure; the data deletion task and the key of the fourth data are used to delete the master and copy of the value of the fourth data, and to delete the master and copy of the metadata of the fourth data.

[0056] In a possible implementation, the hash value of the key of the fourth data is used to indicate the node where the master copy of the metadata of the fourth data is located, and the master copy of the metadata of the fourth data is used to describe the node where the master copy of the value of the fourth data is located, and the node where the copy is located; if the master copy or the copy of the value of the fourth data is stored in the first node, the server of the first node is used to delete the master copy or the copy of the value of the fourth data from the memory of the first node, and delete the master copy or the copy of the metadata of the fourth data; if the master copy or the copy of the value of the fourth data is not stored in the first node, the server of the first node is used to instruct the node where the master copy or the copy of the value of the fourth data is located to delete the master copy or the copy of the value of the fourth data, and delete the master copy or the copy of the metadata of the fourth data, and the node where the master copy or the copy of the value of the fourth data is located is the target node; if the master copy of the metadata of the fourth data is not stored in the node where the master copy or the copy of the value of the fourth data is located, the service of the first node is used to instruct the node where the master copy of the metadata of the fourth data is located to delete the master copy of the metadata of the fourth data.

[0057] The technical effects of the above second to eighth aspects, and any possible implementation method of the eighth aspect, can be understood by referring to the technical effects of the first aspect and any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1A It is a schematic diagram of the architecture of the cloud system provided by the embodiment of the present application;

[0059] Figure 1B is another schematic diagram of the architecture of the cloud system provided in an embodiment of the present application;

[0060] Figure 1C is another schematic diagram of the architecture of the cloud system provided in an embodiment of the present application;

[0061] Figure 1D is another schematic diagram of the architecture of the cloud system provided in an embodiment of the present application;

[0062] Figure 2 is a schematic diagram of a structure of a node provided in an embodiment of the present application;

[0063] Figure 3 is another structural schematic diagram of a node provided in an embodiment of the present application;

[0064] Figure 4 It is a schematic diagram of an embodiment of a data processing method provided in an embodiment of the present application;

[0065] Figure 5 is a schematic diagram of another embodiment of the data processing method provided in an embodiment of the present application;

[0066] Figure 6is a schematic diagram of another embodiment of the data processing method provided in an embodiment of the present application;

[0067] Figure 7 is a schematic diagram of another embodiment of the data processing method provided in an embodiment of the present application;

[0068] Figure 8 It is a structural diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0070] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0071] The embodiment of the present application provides a data processing method for reducing response delay and improving the performance of a cloud system. The present application also provides a corresponding device, a cloud system, a computer-readable storage medium, and a computer program product, etc. The following are detailed descriptions.

[0072] The method of the present application can be applied to a cloud system, which is sometimes referred to as a cloud computing system, a cloud service system, a cloud storage system, etc., and is often referred to as a "cloud".

[0073] The resources in the "cloud" appear to users to be infinitely expandable, and can be accessed at any time, used on demand, expanded at any time, and paid for on a per-use basis.

[0074] As a cloud basic capability provider, a cloud resource pool platform will be established, also referred to as a cloud platform, generally referred to as infrastructure as a service (IaaS), and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud resource pool mainly includes: devices (virtualized machines, including operating systems), storage devices, and network devices.

[0075] According to the logical function division, the platform as a service (PaaS) layer can be deployed on the IaaS layer, and the software as a service (SaaS) layer can be deployed on the PaaS layer, or SaaS can be directly deployed on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0076] The deployment model of the above services on the cloud can also be understood as serverless. The so-called serverless does not mean that there is no need to rely on servers and other resources, but that developers no longer have to worry too much about server issues and can focus more on product code. At the same time, computing resources also begin to appear as services rather than as the concept of servers.

[0077] The current serverless platform still uses the solution of caching data in the database when processing data, and a distributed cache service cluster is also configured to increase the speed of data reading. The corresponding values ​​(value, V) of the hot key (key, K) are cached in the distributed cache service cluster, thereby speeding up the access speed to these hot keys. However, there is still an access bottleneck for the cache storing hot keys, and reading data from the distributed cache service cluster is the same as reading data from the database. There is network input / output (IO) overhead, slow reading speed, and large response delay. Based on this, an embodiment of the present application provides a cloud system, and the architecture of the cloud system can be referred to. Figure 1A To understand.

[0078] like Figure 1A As shown, the cloud system includes multiple nodes. Figure 1AThree nodes are exemplarily illustrated, namely node 1, node 2 and node 3, wherein each node includes a server and at least one application instance, the application instance in the same node communicates with the server, and the servers of different nodes communicate with each other. The server of each node is used to manage the memory of the node and process the data in the memory of different nodes by communicating with the servers of different nodes.

[0079] In the embodiment of the present application, the node can be a physical machine or a virtual machine (VM). The application instance can be a function, which can be configured with an interface for communicating with the server and an interface for processing data processing tasks, and these interfaces can be in the form of a software development kit (SDK). The server can be a functional module that can receive data processing tasks issued by the application instance, process the corresponding tasks, and can also communicate with the server of other nodes.

[0080] In an embodiment of the present application, each server can receive a data processing task sent by an application instance in this node, and process data associated with the data processing task by managing the memory of this node or processing data in the memory of a target node. The data processing task includes a data writing task, a data reading task, a data modification task, or a data deletion task. The target node is at least one node among multiple nodes other than this node that is associated with the data processing task.

[0081] In the embodiment of the present application, the nodes in the cloud system can process data processing tasks through the server in the node, without accessing the database or cluster cache, which can improve the response speed of the node and reduce the response delay. In addition, the data processing tasks will basically be processed in this node, without frequent access to other nodes, which can reduce input / output (IO) overhead. In addition, the servers of different nodes can communicate with each other and can also achieve consistent synchronization of distributed data. Moreover, this solution does not need to introduce distributed cluster cache, and does not require tenants to rent or purchase cache services additionally.

[0082] The above-mentioned ability to provide an interface for communication with the server can also be achieved by configuring a client in the node. For cloud systems configured with a client, please refer to Figure 1B To understand, such as Figure 1B As shown, each node also includes at least one client, at least one client is included in at least one application instance, or at least one client corresponds to at least one application instance; at least one application instance in the same node communicates with the server through at least one client.

[0083] In an embodiment of the present application, the client may be a functional module including a communication interface with the server and other interfaces, and the client may include various types of SDKs for scheduling different types of data processing tasks to the server. The client may be included in an application instance or may be independent of the application instance. The relationship between the client and the application instance may be one-to-one (i.e., one client corresponds to one application instance), one-to-many (i.e., one client corresponds to multiple application instances), or many-to-many, but the number of clients is less than the number of application instances, such as 2 clients correspond to 4 application instances. In the present application, the efficiency of internal communication between nodes can be improved by communicating between the client and the server.

[0084] In the embodiment of the present application, the data processing task can be generated by the node in response to a request from a terminal device, or it can be generated by the node in response to a request from other nodes in the cloud system, or it can be generated by the node itself according to internal configuration.

[0085] For example, the data processing task is generated by the node in response to the request from the terminal device. The architecture of this scenario can be found in Figure 1C To understand, such as Figure 1C As shown, the cloud system provided in the embodiment of the present application includes a cloud and multiple terminal devices, and the cloud can communicate with multiple terminal devices through a network. Among them, the cloud can be software or services of the cloud platform, or it can be software or services deployed on nodes in the network such as edge nodes. The cloud can run on an independent physical machine or on virtualized resources. Applications can be run on terminal devices, and users interact with the cloud by using applications on terminal devices. The applications can be search engines, smart voice assistants, intelligent social networking and other question-and-answer, or dialogue applications, or other applications involving operations such as data writing, data reading, data modification or data deletion.

[0086] The terminal device can send a data processing request to the cloud, and the cloud can generate a data processing task based on the data processing request, process the data related to the data processing task, and return the data processing result to the terminal device. The terminal device can also display the corresponding data processing result.

[0087] Figure 1C The cloud node in the cloud system can be a working node or a scheduling node in the cloud system. After the scheduling node receives a data processing request from the terminal device, the scheduling node can execute the corresponding data processing process. The scheduling node can also assign the data processing request to one or more working nodes in the cloud system, and one or more working nodes will execute the corresponding data processing process.

[0088] The function of the scheduling node can be implemented by software or hardware.

[0089] As an example of a software functional unit, the scheduling node may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computer device), a virtual machine, and a container. Furthermore, the above computing instance may be one or more. For example, the scheduling node 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 in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.

[0090] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in one region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0091] As an example of a hardware functional unit, the scheduling node may include at least one computer device, such as a server, etc. Alternatively, the scheduling node may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0092] The multiple computer devices included in the scheduling node can be distributed in the same area or in different areas. The multiple computer devices included in the scheduling node can be distributed in the same AZ or in different AZs. Similarly, the multiple computer devices included in the scheduling node can be distributed in the same VPC or in multiple VPCs. The multiple computer devices can be any combination of computer devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0093] A working node can be a physical machine, or a computing instance such as a virtual machine (VM) or a container. A working node can include one or more central processing units (CPU) and graphics processing units (GPU), etc. A working node can also be a CPU or a GPU.

[0094] Terminal equipment, also known as user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a device that includes wireless communication functions (providing voice / data connectivity to users), for example, a handheld device with wireless connection function. At present, some examples of terminal equipment are: mobile phones, tablet computers, laptops, PDAs, laptops, wireless routers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in the Internet of Vehicles, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes. For example, the wireless terminal in the Internet of Vehicles can be a vehicle-mounted device, a whole vehicle device, a vehicle-mounted module, a vehicle, etc. The wireless terminal in industrial control can be a robot, etc. For example, the wireless terminal in unmanned driving can be a drone. The terminal device can be a device running an Android system, an IOS system, a Windows system, or other systems. Applications that need to render application scenes to obtain two-dimensional images, such as game applications, lock screen applications, or map applications, can be run in the terminal device.

[0095] Above Figure 1C The cloud end can be located in the cloud system. The architecture of the cloud system can be found in Figure 1D The cloud system includes the cloud platform and basic resources. The cloud platform includes the cloud platform manager. The scheduling nodes introduced above can be Figure 1D The basic resources may include multiple servers, each of which may be a working node, or each server may include multiple working nodes.

[0096] exist Figure 1DThe working node in the system may be a computer device card or a virtual machine (VM). The computer device card may be at least one of a central processing unit (CPU), a graphics processing unit (GPU) and a neural network processing unit (NPU).

[0097] The cloud platform manager will maintain or regularly collect information about each work node in the basic resources, such as the resource usage on each work node (resource usage rate or resource idle rate), etc. This information can be used as auxiliary decision-making information when allocating query requests.

[0098] The cloud platform manager can receive data processing requests from terminal devices, and then the cloud platform manager can execute the corresponding data processing process. The cloud platform manager can also assign the data processing request to one or more working nodes in the cloud system, and the corresponding data processing process will be executed by one or more working nodes.

[0099] After the working node completes data processing, the cloud platform manager can return the data processing results to the terminal device.

[0100] Figure 2 A possible logical structure diagram of a node in a cloud system provided by an embodiment of the present application. Figure 2 As shown, the node 20 provided in the embodiment of the present application includes: a processor 201, a communication interface 202, a memory 203 and a bus 204. The processor 201, the communication interface 202 and the memory 203 are interconnected via the bus 204. In the embodiment of the present application, the processor 201 is used to control and manage the actions of the node 20, for example, the processor 201 is used to process data associated with a data processing task. The communication interface 202 is used to support the node 20 to communicate, for example: the communication interface 202 can perform the steps of receiving a data processing request and sending a data processing result. The memory 203 is used to store the program code and data of the node 20.

[0101] Among them, the processor 201 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 204 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0102] In the embodiment of the present application, the structure of the node can also be referred to Figure 3 To understand, such as Figure 3 As shown, the node may include software and hardware, the hardware may include a processor 301, a memory 302 and a network card 303, and the software may include a server 310 and a client 320. The server 310 includes a remote procedure call protocol (RPC) communication module 3101, a message processing module 3102, a metadata management module 3103, a data management module 3104 and a memory management module 3105.

[0103] The RPC communication module 3101 can schedule the network card 303 to complete the communication with the server in other nodes; the message processing module 3102 can trigger the metadata management module 3103, the data management module 3104 or the RPC communication module 3101 to perform corresponding operations according to the type of the message. The message processing module 3102, the metadata management module 3103, and the data management module 3104 can all run based on the processor 301. The metadata management module 3103 can manage metadata, which is used to describe the key of the data, the size of the data, the storage location of the data, etc. The data management module 3104 is used to manage data and can perform write, read, modify or delete operations on the data. The memory management module 3105 can schedule the memory 201. The data management module 3104 can manage the data in the memory through the memory management module 3105, or write data to the memory.

[0104] The client may include an RPC communication module 3201, a message processing module 3202, and an SDK interface module 3203. The RPC communication module 3201 may schedule the network card 303 to receive messages from other nodes or terminal devices. The message processing module 3202 may convert the received message into a data processing task and send it to the server through the SDK interface module 3203.

[0105] The client represents an instance connected to the server. After the client is created, it can establish a connection with the server through the Init interface, then write data through the Set interface, read data through the Get interface, modify data through the Mod interface / Set interface, and delete data through the Del interface.

[0106] The data in this application can be understood as data in a key-value (KV) structure, and the value of KV data can be queried through the key.

[0107] The following describes the data processing method provided in the embodiment of the present application. In the embodiment of the present application, the data processing method involves data writing, data reading, data modification and data deletion, which are introduced below respectively.

[0108] 1. Data writing: that is, the data processing task is the data writing task;

[0109] like Figure 4 As shown, the data writing process involves a first node and a second node, the first node can also be described as node 1, and the second node can also be described as node 2. The server in the first node can be called a first server, and the server in the second node can be called a second server. Application instance A in the first node can be called a first application instance.

[0110] In the first node, the data processing process for the data writing task triggered by the application instance A may include:

[0111] 401. The first server receives a data writing task sent by the application instance A through the corresponding client, where the data writing task includes a key and a value of the first data.

[0112] The client sends a data writing task to the server, which can be implemented through a Set interface, which can include the key (K) and value (V) of the first data to be written, such as Figure 4 It is represented as Set(K, V).

[0113] 402. The first server writes the value of the first data into the memory as the master copy.

[0114] In the embodiment of the present application, the value involves the primary copy of the value and the local copy of the value. The primary copy of the value refers to the value written into the memory when the node performs the data writing task, and the local copy of the value refers to the data obtained by copying the primary copy of the value from other nodes. The data of the primary copy of the value and the local copy of the value are the same.

[0115] The memory of the present application can be understood as the memory shared by multiple application instances in the first node. This allows different application instances to share data of other application instances, and does not require repeated storage of the same data, which can reduce the waste of memory and improve memory utilization.

[0116] 403. The first server determines the node for storing metadata of the first data according to the hash value of the key in the first data. The metadata of the first data is used to describe the node where the primary copy of the value of the first data is located. Hash values ​​in different ranges are associated with different nodes.

[0117] In the present application, metadata and data values ​​can be stored separately, and each node can be associated with a different range of hash values. For example, node 1 can store metadata for data with hash values ​​ranging from hash1 to hash100, and node 2 can store metadata for data with hash values ​​ranging from hash101 to hash200, etc. Then, if the hash value calculated based on the key in the data is within hash1 to hash100, the metadata of the data is stored in node 1, and if the hash value calculated based on the key in the data is within hash100 to hash200, the metadata of the data is stored in node 2. In this way, distributed storage of metadata can be achieved.

[0118] The first server may perform hash calculation on the key to obtain a hash value, and then determine the node where the primary copy of the metadata of the first data should be stored based on the hash value and the range of hash values ​​associated with each node.

[0119] In this application, metadata can also be divided into a master copy and a copy. The master copy of metadata may include information such as the key of the data, the size of the data, and the location of the data (the node where the data is located). The copy of metadata may include the key of the data. The copy of metadata usually does not need to include information such as the size of the data and the location of the data.

[0120] 404. If the hash value of the key in the first data indicates that the associated node is the first node, the first server generates a master copy of the metadata of the first data and stores the master copy of the metadata of the first data into the memory of the first node.

[0121] If the hash value of the key in the first data falls within the hash value range corresponding to the first node, the master copy of the metadata of the first data is stored in the memory, and local storage does not need to generate IO overhead.

[0122] 405. If the hash value of the key in the first data indicates that the associated node is the second node, the first server sends a first indication message to the server of the second node, and the first indication message is used to instruct the server of the second node to generate and store a master copy of the metadata of the first data.

[0123] If the hash value of the key in the first data falls within the hash value range corresponding to the second node, the first server needs to send a first indication message to the server of the second node, in which the key of the first data and the size of the first data can be notified to the server of the second node. The second node will generate a master copy containing the key of the first data, the size of the first data, and the metadata of the node where the master copy of the first data is located based on the first indication message and the source of the first indication message. In the present application, the node where data is written can instruct other nodes to generate and store the metadata of the written data, thereby improving the coordination between nodes.

[0124] 406. The second server generates a master copy of the metadata of the first data according to the first indication information.

[0125] 407. The first server obtains a copy of the metadata of the first data from the second server, and stores the copy of the metadata of the first data in the memory of the first node.

[0126] In the present application, a copy of the metadata of the first data is obtained in advance, so that when the first data needs to be queried in the first node, the metadata of the first data can be queried directly locally without accessing the second node, thereby reducing the frequency of access to other nodes and further reducing IO overhead.

[0127] 2. Data reading: that is, the data processing task is the data reading task;

[0128] like Figure 5 As shown, the data reading process involves a first node, a second node, and a third node. The first node can also be described as node 1, the second node can also be described as node 2, and the second node can also be described as node 3. The server in the first node can be called a first server, the server in the second node can be called a second server, and the server in the third node can be called a third server. Application instance A in the first node can be called a first application instance.

[0129] In the first node, the data processing process for the data reading task triggered by the application instance A may include:

[0130] 501. The first server receives a data reading task sent by the application instance A through the corresponding client, where the data reading task includes a key of the second data.

[0131] The client sends a data reading task to the server, which can be implemented through a Get interface. The Get interface can contain the key of the second data to be read, such as Figure 5 It is represented as Get(K) in .

[0132] 502. The first server determines whether the second data is stored in the first node according to the key of the second data.

[0133] The first server can search locally for a master copy or a copy of the metadata of the second data according to the key of the second data. If found locally, it means that the second data is stored locally, and the value of the second data can be directly read locally.

[0134] 503. If the second data is stored in the first node, the first server reads the value of the second data from the memory of the first node.

[0135] If the second data is stored in the local node, the second data is directly read from the memory of the local node, that is, no IO overhead is generated, and the second data can be quickly read.

[0136] 504. If the second data is not stored in the first node, the first server queries the master copy of the metadata of the second data according to the hash value of the key of the second data.

[0137] If the master copy of the metadata of the second data is on the second node, the first server may send a query request to the second server to query the master copy of the second metadata.

[0138] The master copy of the metadata of the second data describes the node where the master copy of the value of the second data is located; for example, the master copy of the value of the second data is stored in the third node. If the master copy of the value of the second data is stored in the third node, the third node is the target node.

[0139] 505. If the metadata of the second data indicates that the primary copy of the value of the second data is stored in the third node, the first server reads the value of the second data from the memory of the third node.

[0140] The first server may send a data request to the third server of the third node, and obtain the value of the second data from the third node.

[0141] 506. The first server stores a copy of the value of the second data and a copy of the metadata of the second data in the memory of the first node. The copy of the value and the copy of the metadata are used when there is a read task for the second data in the first node again.

[0142] After reading the second data, the first server can store a copy of the metadata of the second data and a copy of the value of the second data in the local memory. In this way, when there is a reading task for the second data in the first node again, it can be read directly from the local memory, which improves the speed of reading the second data next time and reduces IO overhead. In this way, multiple nodes can also concurrently read the second data, solving the problem of high load on a certain node and slow reading caused by hot data.

[0143] 507. The first server updates the master copy of the metadata of the second data, the master copy of the metadata of the second data describes the node where the value of the second data is located, and the node where the value of the second data is located includes the node where the master copy of the value of the second data is located and the node where the copy is located.

[0144] After pulling a copy of the value of the second data, the first server can instruct the server of the second node to update the master copy of the metadata of the second data. The process of updating the master copy can be that the server of the second node receives the update instruction from the first server and adds the information of the first node to the master copy of the metadata of the second data, indicating that a copy of the value of the second data is stored on the first node. In this way, when a modification task or deletion task for the second data occurs later, global consistency processing can be performed.

[0145] It should be noted that Figure 5 This is just an example of a situation where the value of the second data is stored in the third node. In fact, the value of the second data may also be stored in the second node or other nodes. Except that the value of the second data is stored locally in the first node, the acquisition process when it is stored in other nodes can be understood by referring to the acquisition process from the third node.

[0146] 3. Data modification, that is, data processing tasks are data modification tasks;

[0147] like Figure 6 As shown, the data modification process involves the first node, the second node, the third node and the fourth node. The first node can also be described as node 1, the second node can also be described as node 2, the third node can also be described as node 3, and the fourth node can also be described as node 4. The server in the first node can be called the first server, the server in the second node can be called the second server, the server in the third node can be called the third server, and the server in the fourth node can be called the third server. Application instance A in the first node can be called the first application instance.

[0148] In the first node, the data processing process for the data modification task triggered by the application instance A may include:

[0149] 601. The first server receives a data modification task sent by the application instance A through the corresponding client, where the data modification task includes a key and an updated value of the third data.

[0150] The client sends a data modification task to the server, which can be implemented through the Mod interface / Set interface. Figure 6 Taking the Set interface implementation as an example, the key and update value of the third data to be modified can be included in the Set interface, such as Figure 6 It is represented as Set(K, V2).

[0151] 602. The first server queries the master copy of the metadata of the third data according to the hash value of the key of the third data. If the master copy of the value of the third data is stored in the first node and the copy is stored in the third node, execute steps 603 to 605. If the master copy is stored in the fourth node and the copy is stored in the third node, execute steps 604, 605, 606 and 607.

[0152] The master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the copy is located.

[0153] Figure 6 In the example, the master copy of the metadata of the third data is stored in the second node, and the nodes where the master copy and the copy of the value of the third data are located are obtained from the second node. If the master copy of the metadata of the third data is in the first node, the nodes where the master copy and the copy of the value of the third data are located can be directly determined locally.

[0154] 603. If the master copy of the value of the third data is stored in the first node, the first server modifies the master copy of the value of the third data to an updated value.

[0155] If the original value of the third data is V1, the value of the third data is modified to V2.

[0156] 604. If the copy of the value of the third data is on the third node, the first server sends third indication information to the third node, where the third indication information is used to instruct the third node to invalidate the copy of the value of the third data.

[0157] If a copy of the value of the third data is at the third node, then the third node is the target node.

[0158] 605. The third node invalidates the copy of the value of the third data according to the third indication information, or deletes the copy of the value of the third data.

[0159] 606. If the primary copy of the value of the third data is stored in the fourth node, the first server sends the second indication information to the fourth node.

[0160] The second indication information is used to indicate that the value of the third data is modified to an updated value. If the primary copy of the value of the third data is stored in the fourth node, the fourth node is also the target node.

[0161] 607. The fourth node modifies the value of the third data to an updated value according to the second indication information.

[0162] 608. The first server sends an update instruction to the second server to instruct the second node to update the master copy of the metadata of the third data.

[0163] 609. The second server updates the master copy of the metadata of the third data according to the update instruction.

[0164] After the value of the third data is modified, the master copy of the metadata of the third data needs to delete the information of the node storing the copy. If the size of the updated value is significantly different from the value before modification, the size of the data needs to be modified.

[0165] In the embodiment of the present application, the first server can find the master copy of the metadata of the third data through the hash value of the key of the third data, and determine the nodes where the master copy and the copy of the value of the third data are located based on the master copy of the metadata. If the master copy is stored on the first node, the value of the master copy of the third data is modified to an updated value. If the copy of the value of the third data is stored on the first node, the copy of the value is deleted. If the first node does not store the master copy of the value of the third data or the master copy of the value of the third data, the corresponding nodes where the master copy and the copy are located are instructed to perform corresponding update and deletion processing. In this way, any node can execute the task of modifying data on this node or other nodes, which improves the convenience of data modification.

[0166] It should be noted that Figure 6 It is just an example that the primary copy of the third data value is stored locally and the copy is stored on the third node, or the primary copy is stored on the fourth node and the copy is stored on the third node. In fact, the primary copy of the third data value may also be stored on other nodes, or there may be more copies. Regardless of how many copies of the third data value are stored on different nodes, you can refer to the processing flow of the copy on the third node to understand it.

[0167] 4. Data deletion, that is, the data processing task is a data deletion task;

[0168] like Figure 7As shown, the data deletion process involves a first node, a second node, a third node, and a fourth node. The first node can also be described as node 1, the second node can also be described as node 2, the third node can also be described as node 3, and the fourth node can also be described as node 4. The server in the first node can be called a first server, the server in the second node can be called a second server, the server in the third node can be called a third server, and the server in the fourth node can be called a third server. Application instance A in the first node can be called a first application instance.

[0169] In the first node, the data processing process for the data deletion task triggered by the application instance A may include:

[0170] 701. The first server receives a data deletion task sent by the application instance A through the corresponding client, where the data deletion task includes a key of the fourth data.

[0171] The client sends a data deletion task to the server, which can be implemented through the Del interface. The Del interface can contain the key of the fourth data to be modified, such as Figure 7 It is represented as Del(K).

[0172] 702. The first server queries the master copy of the metadata of the fourth data according to the hash value of the key of the fourth data. If the master copy of the value of the fourth data is stored in the first node and the copy is stored in the third node, execute steps 703 to 705. If the master copy is stored in the fourth node and the copy is stored in the third node, execute steps 704, 705, 706 and 707.

[0173] The master copy of the metadata of the fourth data is used to describe the node where the master copy of the value of the fourth data is located, and the node where the copy is located.

[0174] Figure 7 In the example, the master copy of the metadata of the fourth data is stored in the second node, and the nodes where the master copy and the copy of the value of the fourth data are located are obtained from the second node. If the master copy of the metadata of the fourth data is in the first node, the nodes where the master copy and the copy of the value of the fourth data are located can be directly obtained locally.

[0175] 703. If the master copy of the value of the fourth data is stored in the first node, the first server deletes the master copy of the value of the fourth data and the copy of the metadata of the fourth data from the memory of the first node.

[0176] 704. If the copy of the value of the fourth data is on the third node, the first server sends a deletion instruction to the third node, where the deletion instruction is used to instruct the third node to delete the copy of the value of the fourth data.

[0177] If a copy of the value of the fourth data is on the third node, the third node is the target node.

[0178] 705. The third node deletes the copy of the value of the fourth data and the copy of the metadata of the fourth data according to the deletion instruction.

[0179] 706. If the master copy of the value of the fourth data is stored in the fourth node, the first server sends a deletion instruction to the fourth node.

[0180] If the primary copy of the value of the fourth data is stored in the fourth node, the fourth node is also the target node.

[0181] 707. The fourth node deletes the master copy of the value of the fourth data and the copy of the metadata of the fourth data according to the deletion instruction.

[0182] 708. The first server sends a deletion instruction to the second server to instruct the second node to delete the master copy of the metadata of the fourth data.

[0183] 709. The second server deletes the master copy of the metadata of the fourth data according to the deletion instruction.

[0184] In an embodiment of the present application, when deleting data, it is only necessary to determine the nodes where the master and replica of the value of the fourth data are located based on the key of the fourth data, and then delete the master and replica of the value as well as the master and replica of the metadata, thereby achieving global consistency deletion.

[0185] It should be noted that Figure 7 This is just an example of a situation where the primary copy of the value of the fourth data is stored locally and the copy is stored on the third node, or the primary copy is stored on the fourth node and the copy is stored on the third node. In fact, the primary copy of the value of the fourth data may also be stored on other nodes, or there may be more copies. Regardless of how many copies of the value of the fourth data are stored on different nodes, you can refer to the deletion process of the copy on the third node for understanding.

[0186] The cloud system and the data processing method are introduced above. The server 80 provided in the embodiment of the present application is introduced below with reference to the accompanying drawings.

[0187] like Figure 8 As shown, the server 80 provided in the embodiment of the present application is applied to a node of a cloud system, and the node also includes at least one application instance. The server 80 includes:

[0188] The receiving unit 801 is used to receive a data processing task, where the data processing task is issued by a first application instance, the first server is a server in a first node, the first application instance is an application instance in a first node, and the first node is any one of multiple nodes.

[0189] The processing unit 802 is used to process data associated with the data processing task by processing data in the memory of the first node or / and processing data in the memory of the target node. The target node is at least one node associated with the data processing task among multiple nodes except the first node.

[0190] Optionally, each node further includes at least one client, the at least one client is included in at least one application instance, or the at least one client corresponds to at least one application instance; at least one application instance in the same node communicates with the server through the at least one client.

[0191] Optionally, the processing unit 802 is used to write the value of the first data as a master into the memory when the data processing task is a data writing task, and the memory is a memory shared by multiple application instances in the first node. The data writing task includes the key and value of the first data in the key-value structure.

[0192] Optionally, the processing unit 802 is further used to determine a node for storing metadata of the first data based on a hash value of a key in the first data, where the metadata of the first data is used to describe the node where the primary copy of the value of the first data is located, and different ranges of hash values ​​are associated with different nodes.

[0193] Optionally, the processing unit 802 is further used to generate a master copy of the metadata of the first data if the hash value of the key in the first data indicates that the associated node is the first node, and store the master copy of the metadata of the first data into the memory of the first node.

[0194] Optionally, processing unit 802 is also used to send first indication information to the server of the second node if the hash value of the key in the first data indicates that the associated node is the second node, and the first indication information is used to instruct the server of the second node to generate and store a master copy of the metadata of the first data.

[0195] Optionally, the processing unit 802 is further configured to obtain a copy of the metadata of the first data from the server of the second node, and store the copy of the metadata of the first data in the memory of the first node.

[0196] Optionally, the processing unit 802 is used to determine whether the second data is stored in the first node based on the key of the second data when the data processing task is a data reading task; if the second data is stored in the first node, the value of the second data is read from the memory of the first node, and the data reading task includes the key of the second data in the key-value structure.

[0197] Optionally, processing unit 802 is also used to query the master copy of the metadata of the second data according to the hash value of the key of the second data if the second data is not stored in the first node, and the master copy of the metadata of the second data describes the node where the master copy of the value of the second data is located; if the metadata of the second data indicates that the master copy of the value of the second data is stored in a third node, then read the value of the second data from the memory of the third node, and the third node is the target node.

[0198] Optionally, the processing unit 802 is further configured to store a copy of the value of the second data and a copy of the metadata of the second data in the memory of the first node, and the copy of the value and the copy of the metadata are used when there is a read task for the second data in the first node again. Correspondingly, the metadata of the second data is also used to describe the node where the copy of the value of the second data is located.

[0199] Optionally, processing unit 802 is also used to update the master copy of the metadata of the second data, where the master copy of the metadata of the second data describes the nodes where the values ​​of the second data are located, and the nodes where the values ​​of the second data are located include the nodes where the master copy of the value of the second data is located and the nodes where the copies are located.

[0200] Optionally, the processing unit 802 is used to invalidate the copy of the value of the third data according to the key of the third data, and modify the master copy of the value of the third data to an updated value when the data processing task is a data modification task, and the data modification task includes the key and updated value in the third data of the key-value structure.

[0201] Optionally, processing unit 802 is used to query the master copy of the metadata of the third data according to the hash value of the key of the third data to determine the nodes where the master copy and the copy of the value of the third data are located; wherein the master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the copy is located; if the master copy or the copy of the value of the third data is stored in the first node, then the copy of the value of the third data in the memory of the first node is deleted, or the master copy of the value of the third data is modified to an updated value.

[0202] Sending unit 803 is used to send second indication information to the node where the master copy of the third data value is located, and send third indication information to the node where the copy is located, if the master copy or the copy of the third data value is not stored in the first node. The second indication information is used to indicate that the master copy of the third data value is modified to an updated value, and the third indication information is used to indicate that the copy of the third data value is deleted. The nodes where the master copy and the copy of the third data value are located are target nodes.

[0203] Optionally, the processing unit 802 is further configured to update a master copy of the metadata of the third data, where the master copy of the metadata of the third data is updated to a node where an updated value of the third data is located.

[0204] Optionally, the processing unit 802 is used to delete the master and the copy of the value of the fourth data and the master and the copy of the metadata of the fourth data according to the key of the fourth data when the data processing task is a data deletion task, and the data deletion task includes the key of the fourth data in the key-value structure.

[0205] Optionally, processing unit 802 is used to query the master copy of the metadata of the fourth data according to the hash value of the key of the fourth data to determine the nodes where the master copy and the copy of the value of the fourth data are located; wherein the master copy of the metadata of the fourth data is used to describe the node where the master copy of the value of the fourth data is located, and the node where the copy is located; if the master copy or the copy of the value of the fourth data is stored in the first node, the first server deletes the master copy or the copy of the value of the fourth data in the memory of the first node, and the master copy or the copy of the metadata of the fourth data.

[0206] The sending unit 803 is also used to send a deletion indication to the node where the master copy or the copy of the fourth data value is located, if the master copy or the copy of the fourth data value is not stored in the first node, and the deletion indication is used to instruct the node where the master copy or the copy of the fourth data value is located to delete the master copy or the copy of the fourth data value, and to delete the master copy or the copy of the metadata of the fourth data, and the node where the master copy or the copy of the fourth data value is located is the target node; if the master copy of the metadata of the fourth data is not stored in the node where the master copy or the copy of the fourth data value is located, fourth indication information is sent to the node where the master copy of the metadata of the fourth data is located, and the fourth indication information is used to instruct the deletion of the master copy of the metadata of the fourth data.

[0207] In the embodiment of the present application, the operations performed by each unit in the server 80 are the same as those described above. Figures 4 to 7 The description in the illustrated embodiment is similar and will not be repeated here.

[0208] In another embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores computer-executable instructions. When a processor of a computer device executes the computer-executable instructions, the computer device executes the above Figures 4 to 7 The steps performed by the first server in .

[0209] In another embodiment of the present application, a computer program product is also provided. The computer program product includes a computer program code. When the computer program code is executed on a computer, the computer device executes the above Figures 4 to 7 The steps performed by the first server in .

[0210] In another embodiment of the present application, a chip system is also provided, which includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the interface circuit is used to receive a signal from a memory of a computer device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the computer device executes the above-mentioned Figures 4 to 7 In a possible design, the chip system may also include a memory, which is used to store program instructions and data necessary for the control device. The chip system may be composed of a chip or may include a chip and other discrete devices.

[0211] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0213] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.

[0214] When the integrated unit is implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

Claims

1. A cloud system, characterized in that: It includes multiple nodes, each of which includes a server and at least one application instance; the application instance in the same node communicates with the server, and the servers of different nodes communicate with each other. The server of each node is used to manage the memory of the node and process the data in the memory of different nodes by communicating with the servers of different nodes; The server in each node is used to receive data processing tasks issued by the application instance of this node, and processes the data associated with the data processing task by processing the data in the memory of this node or / and processing the data in the memory of the target node. The target node is at least one node among the multiple nodes associated with the data processing task except the current node.

2. The cloud system according to claim 1, characterized in that: Each of the nodes further includes at least one client, and the at least one client is included in the at least one application instance, or the at least one client corresponds to the at least one application instance; The at least one application instance in the same node communicates with the server through the at least one client.

3. The cloud system according to claim 1 or 2, characterized in that: When the data processing task is a data writing task, the data writing task includes a key and a value of first data of a key-value structure; The value in the first data is written as a master into the memory of the local node, and the memory is a memory shared by multiple application instances in the local node.

4. The cloud system according to claim 3, characterized in that: The hash value of the key in the first data indicates a node for storing metadata of the first data, where the metadata of the first data is used to describe the node where the primary copy of the value of the first data is located, and different ranges of hash values ​​are associated with different nodes; If the hash value of the key in the first data indicates that the associated node is the first node, the master copy of the metadata of the first data is stored in the memory of the first node, and the first node is the current node; If the hash value of the key in the first data indicates that the associated node is a second node, the master copy of the metadata of the first data is stored in the memory of the second node, and the second node is any one of the multiple nodes except the first node.

5. The cloud system according to claim 4, characterized in that: When the master copy of the metadata of the first data is stored in the memory of the second node, the copy of the metadata of the first data is stored in the memory of the first node.

6. The cloud system according to claim 1 or 2, characterized in that: When the data processing task is a data reading task, the data reading task includes a key of the second data of the key-value structure; The key of the second data is used to determine whether the second data is stored in the first node, and the first node is the current node; If the second data is stored in the first node, the value of the second data is read from the memory of the first node; If the second data is not stored in the first node, and the metadata of the second data indicates that the primary copy of the value of the second data is stored in the third node, the value of the second data is read from the memory of the third node, and the primary copy of the metadata of the second data describes the node where the primary copy of the value of the second data is located; The third node is the target node.

7. The cloud system according to claim 6, characterized in that: A copy of the value of the second data and a copy of the metadata of the second data are stored in the memory of the first node, and the copy of the value and the copy of the metadata are used when there is a read task for the second data in the first node again; Correspondingly, the metadata of the second data is also used to describe the node where the copy of the value of the second data is located.

8. The cloud system according to claim 1 or 2, characterized in that: When the data processing task is a data modification task, the data modification task includes a key and an updated value in the third data of the key-value structure; The data modification task and the key of the third data are used to invalidate the copy of the value of the third data and to modify the master copy of the value of the third data to the updated value.

9. The cloud system according to claim 8, characterized in that: The hash value of the key of the third data is used to indicate the node where the master copy of the metadata of the third data is located, and the master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the copy is located; If the master or the copy of the value of the third data is stored in the first node, the server of the first node is used to delete the copy of the value of the third data from the memory of the first node, or modify the value of the third data to the updated value, and the first node is the current node; If the master copy or the copy of the value of the third data is not stored in the first node, the server of the first node instructs the node where the master copy of the value of the third data is located to modify the value of the third data to the updated value, and instructs the node where the copy of the value of the third data is located to delete the copy of the value of the third data, and the node where the master copy and the copy of the value of the third data are located are the target nodes; Correspondingly, the master copy of the metadata of the third data is updated to the node where the updated value of the third data is located.

10. The cloud system according to claim 1 or 2, characterized in that: When the data processing task is a data deletion task, the data deletion task includes a key of fourth data of a key-value structure; The data deletion task and the key of the fourth data are used to delete the master and the copy of the value of the fourth data, and to delete the master and the copy of the metadata of the fourth data.

11. The cloud system according to claim 10, characterized in that: The hash value of the key of the fourth data is used to indicate the node where the master copy of the metadata of the fourth data is located, and the master copy of the metadata of the fourth data is used to describe the node where the master copy of the value of the fourth data is located, and the node where the copy is located; If the master copy or the copy of the value of the fourth data is stored in the first node, the server of the first node is used to delete the master copy or the copy of the value of the fourth data from the memory of the first node, and delete the master copy or the copy of the metadata of the fourth data; If the master copy or the copy of the value of the fourth data is not stored in the first node, the server of the first node is used to instruct the node where the master copy or the copy of the value of the fourth data is located to delete the master copy or the copy of the value of the fourth data, and to delete the master copy or the copy of the metadata of the fourth data, and the node where the master copy or the copy of the value of the fourth data is located is the target node; If the master copy of the metadata of the fourth data is not stored in the node where the master copy or copy of the value of the fourth data is located, the service of the first node is used to instruct the node where the master copy of the metadata of the fourth data is located to delete the master copy of the metadata of the fourth data.

12. A method for data processing, characterized in that: The method is applied to a cloud system, wherein the cloud system includes a plurality of nodes, wherein each node includes a server and at least one application instance; the method includes: The first server receives a data processing task, where the data processing task is issued by a first application instance, the first server is a server in a first node, the first application instance is an application instance in the first node, and the first node is any one of the multiple nodes; The first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, and the target node is at least one node among the multiple nodes associated with the data processing task except the first node.

13. The method according to claim 12, characterized in that When the data processing task is a data writing task, the data writing task includes a key and a value of first data of a key-value structure; The first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: The first server writes the value of the first data as a master into a memory, and the memory is a memory shared by multiple application instances in the first node.

14. The method according to claim 13, characterized in that The method further comprises: The first server determines a node for storing metadata of the first data based on a hash value of a key in the first data, where the metadata of the first data is used to describe the node where the primary copy of the value of the first data is located, and hash values ​​in different ranges are associated with different nodes.

15. The method according to claim 14, characterized in that The method further comprises: If the hash value of the key in the first data indicates that the associated node is the first node, the first server generates a master copy of the metadata of the first data, and stores the master copy of the metadata of the first data in the memory of the first node; If the hash value of the key in the first data indicates that the associated node is a second node, the first server sends a first indication message to the server of the second node, and the first indication message is used to instruct the server of the second node to generate and store a master copy of the metadata of the first data.

16. The method according to claim 15, characterized in that The method further comprises: The first server obtains a copy of the metadata of the first data from the server of the second node, and stores the copy of the metadata of the first data in the memory of the first node.

17. The method according to claim 12, characterized in that When the data processing task is a data reading task, the data reading task includes a key of the second data of the key-value structure; The first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: The first server determines, according to a key of the second data, whether the second data is stored in the first node; If the second data is stored in the first node, the first server reads the value of the second data from the memory of the first node; If the second data is not stored in the first node, the first server queries the master copy of the metadata of the second data according to the hash value of the key of the second data, where the master copy of the metadata of the second data describes the node where the master copy of the value of the second data is located; If the metadata of the second data indicates that the primary copy of the value of the second data is stored in the third node, the first server reads the value of the second data from the memory of the third node, and the third node is the target node.

18. The method according to claim 17, characterized in that The method further comprises: The first server stores a copy of the value of the second data and a copy of the metadata of the second data in the memory of the first node, and the copy of the value and the copy of the metadata are used when there is a read task for the second data in the first node again; Correspondingly, the metadata of the second data is also used to describe the node where the copy of the value of the second data is located.

19. The method according to claim 12, characterized in that When the data processing task is a data modification task, the data modification task includes a key and an updated value in the third data of the key-value structure; The first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: The first server invalidates the copy of the value of the third data according to the key of the third data, and modifies the master copy of the value of the third data to the updated value.

20. The method according to claim 19, characterized in that The first server invalidates the copy of the third data according to the key of the third data, and modifies the master copy of the value of the third data to the updated value, including: The first server queries the master copy of the metadata of the third data according to the hash value of the key of the third data to determine the nodes where the master copy and the replica of the value of the third data are located; wherein the master copy of the metadata of the third data is used to describe the node where the master copy of the value of the third data is located, and the node where the replica is located; If the master or the copy of the value of the third data is stored in the first node, the first server deletes the copy of the value of the third data in the memory of the first node, or modifies the master of the value of the third data to the updated value; If the master copy or the copy of the value of the third data is not stored in the first node, the first server sends second indication information to the node where the master copy of the value of the third data is located, and sends third indication information to the node where the copy is located, the second indication information is used to indicate that the master copy of the value of the third data is modified to the updated value, and the third indication information is used to indicate that the copy of the value of the third data is deleted, and the node where the master copy and the copy of the value of the third data are located is the target node; Correspondingly, the master copy of the metadata of the third data is updated to the node where the updated value of the third data is located.

21. The method according to claim 12, characterized in that When the data processing task is a data deletion task, the data deletion task includes a key of fourth data of a key-value structure; The first server processes the data associated with the data processing task by processing the data in the memory of the first node or / and processing the data in the memory of the target node, including: The first server deletes the master and the copy of the value of the fourth data according to the key of the fourth data, and deletes the master and the copy of the metadata of the fourth data.

22. The method according to claim 21, characterized in that The first server deletes the master and the copy of the value of the fourth data according to the key of the fourth data, and deletes the master and the copy of the metadata of the fourth data, including: The first server queries the master copy of the metadata of the fourth data according to the hash value of the key of the fourth data to determine the nodes where the master copy and the replica of the value of the fourth data are located; wherein the master copy of the metadata of the fourth data is used to describe the node where the master copy of the value of the fourth data is located, and the node where the replica is located; If the master copy or the copy of the value of the fourth data is stored in the first node, the first server deletes the master copy or the copy of the value of the fourth data in the memory of the first node, and the master copy or the copy of the metadata of the fourth data; If the master copy or the copy of the value of the fourth data is not stored in the first node, the first server sends a deletion instruction to the node where the master copy or the copy of the value of the fourth data is located, and the deletion instruction is used to instruct the node where the master copy or the copy of the value of the fourth data is located to delete the master copy or the copy of the value of the fourth data, and delete the master copy or the copy of the metadata of the fourth data, and the node where the master copy or the copy of the value of the fourth data is located is the target node; If the master copy of the metadata of the fourth data is not stored in the node where the master copy or copy of the value of the fourth data is located, the first server sends a fourth indication message to the node where the master copy of the metadata of the fourth data is located, and the fourth indication message is used to indicate the deletion of the master copy of the metadata of the fourth data.

23. A computer device cluster, characterized in that: comprising at least one computer device, each computer device comprising a processor and a memory; The processor of the at least one computer device is configured to execute instructions stored in the memory of the at least one computer device, so that the computer device cluster executes the method according to any one of claims 12 to 22.

24. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computer device cluster, the computer device cluster performs the method according to any one of claims 12 to 22.

25. A computer program product comprising instructions, characterized in that When the instructions are executed by a computer device cluster, the computer device cluster executes the method according to any one of claims 12 to 22.

Citation Information

Cited By

  • Shared aquaculture digital twin system and construction method thereof

    CN120181689A