Data migration method based on distributed lock and related device
By introducing oscillation protection time into distributed locks and controlling data migration operations, the problems of server load instability and migration delay in traditional data migration solutions are solved, and more stable server load and lower migration delay are achieved.
Patent Information
- Application Number
- CN202310627399.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-05-30
Smart Images

Figure CN119065583A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data migration method based on a distributed lock and related devices. Background Art
[0002] With the development of game technology, cloud services have become a general trend for game projects. In a cloud-native environment, there are two factors that promote the need to reduce the number of data migrations during expansion or contraction. The first factor is that due to the characteristics of the cloud-native environment, the expansion or contraction of services is automatically based on factors such as resource utilization. Expansion or contraction may occur at any time, so each expansion or contraction should minimize the impact on the server and the experience of game players. The second factor is that services are usually implemented in a stateful form, and the cost of loading and writing back service data is high. Frequent migration will cause server load fluctuations. Therefore, in order to achieve seamless expansion or contraction, the number of service data migrations should be minimized.
[0003] In traditional data migration solutions, when a service is expanded or reduced in capacity, the service-using device usually receives new routing information and migrates the service data from the original service node to the service node corresponding to the new routing information based on the new routing information. In other words, as long as the service-using device receives new routing information, the traditional migration solution will perform the migration operation of the service data, which can easily cause the service data to be repeatedly migrated between multiple service nodes, resulting in unstable server load and greatly increasing the delay of service migration. Summary of the invention
[0004] The embodiments of the present application provide a data migration method and related devices based on distributed locks, which can reduce the number of data migrations of service data between service nodes, not only improving the stability of server load, but also reducing the delay of service migration.
[0005] In the first aspect, an embodiment of the present application provides a data migration method based on a distributed lock. The method includes: a first service node obtains an access request sent by a service-using device, and obtains first lock information based on the access request. Among them, the access request is used to request access to service data, and the first lock information includes a first oscillation protection time, and the first oscillation protection time is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. When the current running time of the first service node is not less than the first oscillation protection time, the first service node receives the service data sent by the storage service node. The first service node sends an access response message corresponding to the access request to the service-using device, and the access response message includes service data, and the access response message is used to instruct the service-using device to perform an access operation on the service data.
[0006] In the second aspect, an embodiment of the present application provides another data migration method based on a distributed lock. In this method, a storage service node receives a data migration request sent by a first service node, and the data migration request is sent by the first service node when the current running time is not less than the first oscillation protection time in the first lock information. The first oscillation protection time is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. The storage service node migrates the service data from the second service node to the first service node based on the data migration request. The storage service node sends a data response message corresponding to the data migration request to the first service node, and the data response message includes service data.
[0007] In the third aspect, an embodiment of the present application provides another data migration method based on distributed locks. In this method, a service-using device obtains a node list and a first event from a cluster management device, the node list includes at least two service nodes, the first event is used to indicate that the first service node needs to perform an expansion processing operation or a reduction processing operation, and the at least two service nodes include the first service node. The service-using device sends an access request to the first service node based on the first event, and the access request is used to request access to service data. The service-using device receives an access response message sent by the first service node corresponding to the access request, and the access response message includes service data. The service-using device performs an access operation on the service data based on the access response message.
[0008] In a fourth aspect, an embodiment of the present application provides a first service node. The first service node includes an acquisition unit and a sending unit. Exemplarily, the first service node also includes a processing unit. Among them, the acquisition unit is used to obtain an access request sent by a service-using device, and the access request is used to request access to service data. The acquisition unit is used to obtain first lock information based on the access request, and the first lock information includes a first oscillation protection time, and the first oscillation protection time is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. The acquisition unit is used to receive the service data sent by the storage service node when the current running time is not less than the first oscillation protection time. The sending unit is used to send an access response message corresponding to the access request to the service-using device, and the access response message includes service data, and the access response message is used to instruct the service-using device to perform an access operation on the service data.
[0009] In some optional implementations, the sending unit is further configured to send a data migration request to the storage service node before receiving the service data sent by the storage service node, the data migration request being used to instruct the storage service node to migrate the service data from the second service node to the first service node. The acquiring unit is configured to receive a data response message sent by the storage service node corresponding to the data migration request, the data response message including the service data.
[0010] In some other optional implementations, the sending unit is further configured to, before acquiring the first lock information based on the access request, after acquiring the access request, when the first lock information is not stored in the local database of the first service node, send a first message to the storage service node, the first message being used to instruct the storage service node to send the first lock information to the first service node. The acquiring unit is configured to receive the first lock information sent by the storage service node.
[0011] In some other optional implementations, the first lock information also includes a node identifier of the second service node; and the processing unit is configured to forward the access request to the second service node corresponding to the node identifier when the current running time is less than the first shock protection time.
[0012] In some other optional implementations, the sending unit is further configured to send a service capacity expansion request or a service capacity reduction request to the cluster management device before obtaining the access request sent by the service usage device.
[0013] In a fifth aspect, an embodiment of the present application provides a storage service node. The storage service node includes a receiving module, a processing module and a sending module. Among them, the receiving module is used to receive a data migration request sent by the first service node, and the data migration request is sent by the first service node when the current running time is not less than the first oscillation protection time in the first lock information. The first oscillation protection time is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. The processing module is used to migrate the service data from the second service node to the first service node based on the data migration request. The sending module is used to send a data response message corresponding to the data migration request to the first service node, and the data response message includes service data.
[0014] In some optional implementations, the processing module is further used to compare the current running time with the first expiration time in the first lock information before migrating the service data from the second service node to the first service node based on the data migration request, when the current running time is not less than the first shock protection time, the first expiration time is used to indicate the longest effective time of the distributed lock when the second service node accesses the service data, and the first expiration time is greater than the first shock protection time. The processing module is used to migrate the service data from the second service node to the first service node based on the data migration request when the current running time is less than the first expiration time.
[0015] In other optional embodiments, the processing module is also used to: when the current running time is not less than the first expiration time, update the first lock information based on the second lock information; the second lock information includes the node identifier of the first service node, a second oscillation protection time and a second expiration time, the second oscillation protection time is used to indicate the effective protection time of the distributed lock when the first service node holds the second lock information and the first service node accesses the service data, and the second expiration time is used to indicate the longest effective time of the distributed lock when the first service node accesses the service data.
[0016] In a sixth aspect, an embodiment of the present application provides a service usage device. The service usage device includes a receiving unit, a sending unit, and a processing unit. Among them, the receiving unit is used to obtain a node list and a first event from a cluster management device, the node list includes at least two service nodes, the first event is used to indicate that the first service node needs to perform an expansion processing operation or a reduction processing operation, and the at least two service nodes include the first service node. The sending unit is used to send an access request to the first service node based on the first event, the access request is used to request access to service data, and the receiving unit is used to receive an access response message sent by the first service node corresponding to the access request, and the access response message includes service data. The processing unit is used to perform an access operation on the service data based on the access response message.
[0017] In other optional embodiments, the processing unit is also used to: before sending an access request to the first service node based on the first event, process the node identifier, node list and routing rules of the first service node based on a preset routing model, calculate the node address corresponding to the first event, and the node address is the address of the first service node to determine the first service node.
[0018] The seventh aspect of the embodiment of the present application provides a data migration device, including: a memory, an input / output (I / O) interface and a memory. The memory is used to store program instructions. The processor is used to execute the program instructions in the memory to execute the method corresponding to the implementation method of the first aspect above; or, execute the method corresponding to the implementation method of the second aspect above; or execute the method corresponding to the implementation method of the third aspect above.
[0019] An eighth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method corresponding to the implementation method of the first aspect above; or, execute the method corresponding to the implementation method of the second aspect above; or, execute the method corresponding to the implementation method of the third aspect above.
[0020] A ninth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer or a processor, enables the computer or the processor to execute the method corresponding to the implementation method of the first aspect; or, to execute the method corresponding to the implementation method of the second aspect; or, to execute the method corresponding to the implementation method of the third aspect.
[0021] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0022] In an embodiment of the present application, after obtaining the access request sent by the service user device, the first service node obtains the first lock information based on the access request. The first lock information mentioned includes the first oscillation protection time. The first oscillation protection time can be used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. The first service node compares the current running time with the first oscillation protection time, and then receives the service data sent by the storage service node when the current running time is not less than the first oscillation protection time. Then the first service node sends an access response message corresponding to the access request to the service user device, and the access response message includes the service data. The access response message mentioned can indicate that the service user device performs an access operation on the service data. In the above manner, the first oscillation protection time is added to the first lock information. The first service node only needs to determine that the current running time is not less than the first oscillation protection time. It can be clear that the distributed lock under the current running time should be held by the first service node. At this time, the service data fed back by the storage service node can be used to respond to the service user device. That is to say, in the embodiment of the present application, there is no need to directly perform data migration processing when new routing information is received. Instead, the new service node (i.e., the first service node) needs to further interact with the storage service node to complete the data migration operation when it determines that the current running time is not less than the first shock protection time. This reduces the number of data migrations of service data between service nodes, which not only improves the stability of the server load, but also reduces the delay of service migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A schematic diagram of the system architecture provided by an embodiment of the present application is shown;
[0025] Figure 2 A flow chart of a data migration method based on a distributed lock provided in an embodiment of the present application is shown;
[0026] Figure 3 A schematic diagram of a process flow when a first service node processes an access request in an embodiment of the present application is shown;
[0027] Figure 4 The overall process diagram of the method for data migration based on distributed locks provided in an embodiment of the present application is shown;
[0028] Figure 5 A schematic diagram of the process of a storage service node processing a data migration request in an embodiment of the present application is shown;
[0029] Figure 6 A schematic diagram of the structure of a first service node provided in an embodiment of the present application is shown;
[0030] Figure 7 A schematic diagram of the structure of a storage service node provided in an embodiment of the present application is shown;
[0031] Figure 8 A schematic diagram showing the structure of a service usage device provided in an embodiment of the present application is shown;
[0032] Fig. 9 A schematic diagram of the hardware structure of a data migration device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] The embodiments of the present application provide a data migration method and related devices based on distributed locks, which can reduce the number of data migrations of service data between service nodes, not only improving the stability of server load, but also reducing the delay of service migration.
[0034] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0036] The terms "first", "second", "third", "fourth", etc. (if any) 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 implementation of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. 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.
[0037] In traditional data migration solutions, as long as the service-using device receives new routing information, the service data migration operation will be executed, which can easily cause the service data to be repeatedly migrated between multiple service nodes, resulting in unstable server load and greatly increasing the delay of service migration.
[0038] In order to solve the technical problems mentioned above, the embodiments of the present application provide a data migration method based on a distributed lock, which does not require repeated data migration between service nodes, not only reduces the frequency of data migration, but also improves the stability of server load and reduces the delay of service migration. Exemplarily, the data migration method based on a distributed lock can be applied to virtual game scenarios, business transmission scenarios, or other data migration scenarios, which are not limited in the embodiments of the present application.
[0039] For example, the data migration method based on distributed locks provided in this application can be applied to Figure 1 The system architecture shown in FIG. Figure 1 As shown, the system architecture includes at least a service usage device, a cluster management device, a storage service node, and at least two service nodes. The at least two service nodes may include service node 1 to service node N, N≥2, and N is an integer.
[0040] When the first service node (e.g., service node 1) generates a service expansion request or a service reduction request, it can send the corresponding service expansion request or service reduction request to the cluster management device. After receiving the service expansion request or the service reduction request, the cluster management device updates the corresponding node list. After the service user device obtains the node list from the cluster management device, it calculates the node address of the first service node corresponding to the service expansion request or the service reduction request, and then sends an access request to the first service node corresponding to the node address.
[0041] After receiving the access request, the first service node obtains the first lock information based on the access request. The first lock information mentioned includes the first oscillation protection time, which can be used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. The first service node compares the current running time with the first oscillation protection time, and then sends a data migration request to the storage service node when the current running time is not less than the first oscillation protection time, so as to facilitate reading the corresponding service data.
[0042] It should be noted that the first service node and the second service node mentioned above can be any two different service nodes among the at least two service nodes. For example, the first service node can be service node 1, the second service node can be service node 2, etc., which is not limited in the specific embodiments of the present application. Each service node mentioned may include but is not limited to terminal devices, servers, etc. The storage service nodes described may also include but are not limited to background servers or other data storage devices, etc. The cluster management devices described may include but are not limited to terminal devices, servers or other management devices, etc., which are not limited in the specific embodiments of the present application.
[0043] In addition, the terminal devices mentioned above may include but are not limited to smart phones, desktop computers, laptops, tablet computers, smart speakers, vehicle-mounted devices, smart watches, wearable smart devices, intelligent voice interaction devices, smart home appliances, aircraft, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (context delivery networks, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc., which are not specifically limited in this application. In addition, the terminal devices and servers mentioned above can be directly or indirectly connected by wired communication or wireless communication, which are not specifically limited in this application.
[0044] The data migration method based on distributed locks mentioned above can also be applied in fields such as cloud technology. The described cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data calculation, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0045] The cloud computing mentioned is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an Infrastructure as a Service (IaaS) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. 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. SaaS can also be deployed directly 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.
[0046] The following is an introduction to the distributed lock-based data migration method provided in an embodiment of the present application in conjunction with the accompanying drawings. Figure 2 A flow chart of a data migration method based on a distributed lock provided in an embodiment of the present application is shown. Figure 2 As shown, the data migration method may include the following steps:
[0047] 201. A service using device obtains a node list and a first event from a cluster management device, where the node list includes at least two service nodes, the first event is used to indicate that a first service node needs to perform a capacity expansion processing operation or a capacity reduction processing operation, and the at least two service nodes include the first service node.
[0048] In this example, when it is necessary to expand the capacity of the service, the service node can send a service expansion request to the cluster management device. Alternatively, when it is necessary to shrink the capacity of the service, the service node can send a service shrinkage request to the cluster management device. After obtaining the service expansion request or the service shrinkage request, the cluster management device can generate a corresponding first event based on the service expansion request or the service shrinkage request. The first event can indicate that the corresponding service node needs to perform an expansion processing operation or a shrinkage processing operation. Exemplarily, the first event mentioned may include an expansion event or a shrinkage event.
[0049] After generating the first event, the cluster management device also updates the stored node list based on the first event. Through the node list, it is possible to know which service nodes support service expansion processing and service reduction processing. For example, taking the first service node as service node 1, if service node 1 sends a service expansion request to the cluster management device, the cluster management device can add the node information of service node 1 in the first event to the node list after generating the corresponding first event. It should be noted that the node list includes at least two service nodes. The at least two service nodes described include a first service node and a second service node.
[0050] In some examples, before executing the subsequent step 202, the service-using device may also process the node identifier, the node list, and the routing rule of the first service node based on the preset routing model to calculate the node address corresponding to the first event. The node address described is the address of the first service node. The first service node can be accurately located from the N service nodes through the node address.
[0051] 202. The service-using device sends an access request to the first service node based on the first event, where the access request is used to access service data.
[0052] In this example, when requesting service data, the service-using device can request the node list and the first event from the cluster management device through messages or the like. After receiving the node list and the first event fed back by the cluster management device, the service-using device can send an access request to the first service node based on the first event. It should be noted that the access request described is used to request access to service data. The access request mentioned may include, but is not limited to, a remote procedure call (RPC) request, etc., which is not limited in the embodiments of the present application.
[0053] Exemplarily, the service data mentioned may include, but is not limited to, game service data in a virtual game scene, business service data in a business transmission scene, etc., and is not limited in the embodiments of the present application.
[0054] 203. The first service node obtains first lock information based on the access request, where the first lock information includes a first oscillation protection time, where the first oscillation protection time is used to indicate an effective protection time of the distributed lock when the second service node accesses service data when the second service node holds the first lock information.
[0055] In this example, the distributed lock is understood as a method for synchronizing access to shared resources in a distributed system. When sharing resources, the distributed lock plays the role of mutually exclusive access, so that the service data always remains consistent when migrating to different service nodes.
[0056] Since the traditional lock information only includes the node information of the service node to which the distributed lock currently belongs, and the expiration time of the distributed lock. According to the traditional lock information, data migration is performed. Within the expiration time of the distributed lock, as long as the new routing information is received, the lock information attribution processing is directly completed between the service nodes, so as to complete the migration operation of the service data. However, the traditional solution is prone to repeated migration, resulting in unstable server load and greatly increasing the delay of service migration. Therefore, in the embodiment of the present application, the shock protection time is added to the lock information by adding a new field in the lock information. Through the shock protection time, it is possible to clearly determine the effective protection time of the distributed lock when the service node holds the lock information and the service node accesses the service data. In other words, through the shock protection time, it can be ensured that the distributed lock will not be occupied by other service nodes within the shock protection time, thereby ensuring that the service data within the shock protection time will not be migrated to other service nodes, but only when the current running time is not less than the shock protection time, the data migration operation is completed, which can reduce the number of migrations of the service data and enhance the stability of the server load. It is worth noting that the shock protection time of the distributed lock is less than the expiration time of the distributed lock.
[0057] Based on this, after obtaining the access request, the first service node can obtain the first lock information based on the access request. The first lock information mentioned includes a first oscillation protection time. Exemplarily, the first lock information also includes a first expiration time and a node identifier of the second service node. Among them, the first oscillation protection time is less than the first expiration time. The first oscillation protection time mentioned can indicate the effective protection time of the distributed lock when the second service node holds the first lock information and the second service node accesses the service data. The first expiration time can indicate the longest effective time of the distributed lock when the second service node accesses the service data.
[0058] Exemplarily, the first service node can save the association between the service identifier and the lock information. The service identifier is used to identify the specific service data that needs to be accessed. Regarding the way in which the first service node obtains the first lock information, the first service node can first query whether the local database has cached the first lock information based on the service identifier in the access request and the association between the service identifier and the lock information. If the first lock information is cached in the local database of the first service node, the first service node executes the subsequent step 204. On the contrary, if the first service node does not cache the first lock information in the local database after querying, the storage service node can be requested to inform the first lock information. As an illustrative description, the first service node can send a first message to the storage service node when the first lock information is not stored in the local database of the first service node, so as to instruct the storage service node to send the first lock information to the first service node through the first message. In this way, the first service node receives the first lock information sent by the storage service node, and can obtain the first lock information when the distributed lock currently belongs to the second service node.
[0059] 204. When the current running time of the first service node is not less than the first shock protection time, the first service node receives service data sent by the storage service node.
[0060] In this example, after obtaining the first lock information, the first service node demaps the first oscillation protection time in the first lock information to obtain the specific first oscillation protection time. Subsequently, the first service node compares the relationship between the current running time and the first oscillation protection time, and then decides whether to perform the data migration operation based on the comparison result. Exemplarily, when the first service node determines that the current running time is not less than the first oscillation protection time, it receives the service data sent by the storage service node. For example, if the current running time is 20 minutes and the first oscillation protection time is 15 minutes, it can be seen by comparison that 20 minutes>15 minutes. At this time, the first service node can receive the service data sent by the storage service node.
[0061] Exemplarily, when the first service node determines that the current running time is less than the first shock protection time, it can be explained that the distributed lock will not be occupied by other service nodes during the first shock protection time, and no data migration operation is required at this time. Therefore, when the current running time is less than the first shock protection time, the first service node can also forward the access request to the second service node, and then the second service node will feedback the corresponding service data to the service-using device. It should be noted that the process of the second service node feeding back service data to the service-using device can also be understood by referring to the contents described in steps 202 to 205 of this application, and will not be repeated here.
[0062] Figure 3 FIG. 2 shows a schematic diagram of the process when the first service node processes an access request. Figure 3 As shown, the first service node receives the access request and queries whether the first lock information is stored in the local database.
[0063] When the first service node determines that the first lock information is stored in the local database, it further determines whether the current running time is less than the first shock protection time in the first lock information. Conversely, when the first service node determines that the first lock information is not stored in the local database, it obtains the first lock information from the storage service node, and further determines whether the current running time is less than the first shock protection time in the first lock information.
[0064] When the first service node determines that the current running time is not less than the first oscillation protection time in the first lock information, the first service node processes the access request. How to process the access request can be understood by referring to the contents described in steps 204 to 205, which will not be described here. Conversely, when the first service node determines that the current running time is less than the first oscillation protection time in the first lock information, it forwards the access request to the second service node corresponding to the node identifier in the first lock information, and the second service node continues to process the access request. It should be noted that how the second service node processes the access request can be understood by referring to the contents described in steps 204 to 205. Figure 3 You can understand it by referring to the flowchart diagram, which will not be described here.
[0065] 205. The first service node sends an access response message corresponding to the access request to the service-using device, where the access response message includes service data.
[0066] In this example, after receiving the service data sent by the storage service node, the first service node can map the service data to an access response message, and then feed back an access response message corresponding to the access request to the service user device. In this way, the service data is sent to the service user device by means of the access response message.
[0067] 206. The service-using device performs an access operation on the service data based on the access response message.
[0068] In this example, after receiving the access response message, the service-using device demaps the access response message, thereby extracting the service data carried in the access response message. In this way, the service-using device can perform access operations on the service data to facilitate access to the corresponding service. For example, the services mentioned in this application may include but are not limited to game services, business services, etc., and are not specifically limited. For example, game services may include but are not limited to game gift package services, game lobby services, game mall services, game team services, etc., which are not limited in the embodiments of this application.
[0069] The following will describe the data migration process provided by the embodiment of the present application in an overall manner from the perspective of interaction between devices and nodes. Figure 4 The overall process diagram of the method for data migration based on distributed locks provided in the embodiment of the present application is shown. Figure 4 As shown, the overall process diagram includes at least the following steps:
[0070] 401. A service using device obtains a node list and a first event from a cluster management device, where the node list includes at least two service nodes, the first event is used to indicate that a first service node needs to perform a capacity expansion processing operation or a capacity reduction processing operation, and the at least two service nodes include the first service node.
[0071] 402. The service-using device sends an access request to the first service node based on the first event, where the access request is used to access service data.
[0072] 403. The first service node obtains first lock information based on the access request, where the first lock information includes a first oscillation protection time, where the first oscillation protection time is used to indicate an effective protection time of the distributed lock when the second service node accesses service data when the second service node holds the first lock information.
[0073] It should be noted that steps 401 to 403 in the embodiment of the present application can be specifically referred to in the aforementioned Figure 2 The contents described in step 201 to step 203 in the above description can be understood and will not be repeated here.
[0074] 404. When the current running time of the first service node is not less than the first shock protection time, the first service node sends a data migration request to the storage service node.
[0075] In this example, when it is determined that the current running time is not less than the first shock protection time, the first service node may send a data migration request to the storage service node during the process of receiving the service data sent by the storage service node. The data migration request instructs the storage service node to migrate the service data from the second service node to the first service node.
[0076] 405. The storage service node migrates the service data from the second service node to the first service node based on the data migration request.
[0077] In this example, after receiving the data migration request sent by the first service node, the storage service node learns that data migration processing needs to be performed on the service data. Based on this, the storage service node migrates the service data from the second service node to the first service node according to the data migration request.
[0078] In some examples, before performing a data migration operation on the service data, the storage service node may further determine the relationship between the current running time and the first expiration time in the first lock information when it is determined that the current running time is not less than the first shock protection time. Subsequently, when the storage service node determines that the current running time is less than the first expiration time, it migrates the service data from the second service node to the first service node based on the data migration request. Exemplarily, the storage service node may notify the second service node to write back and release the service data through a message or the like, and then after the second service node successfully writes back and releases the service data, the first lock information will be updated, and then the updated lock information (i.e., the second lock information) will be completely allocated to the first service node, so that the first service node loads the service data based on the second lock information, thereby completing the migration process of the service data.
[0079] It should be noted that the first shock protection time, first lock information, and first expiration time mentioned here can be specifically referred to in the previous Figure 2 The contents described in step 202 in the above description can be understood and will not be described in detail here.
[0080] In addition, when the storage service node determines that the current running time is not less than the first expiration time, it means that the distributed lock has exceeded the longest validity period, and the second service node cannot continue to occupy the distributed lock exclusively. Therefore, when the current running time is not less than the first expiration time, the storage service node can update the first lock information based on the second lock information.
[0081] The second lock information mentioned above includes the node identifier of the first service node, the second shock protection time and the second expiration time. Among them, the second shock protection time mentioned is used to indicate the effective protection time of the distributed lock when the first service node accesses the service data when the first service node holds the second lock information. The second expiration time is used to indicate the longest effective time of the distributed lock when the first service node accesses the service data. As a schematic description, in the process of updating the first lock information, the storage service node can specifically update the node identifier of the second service node to the node identifier of the first service node; similarly, the storage service node updates the first shock protection time to the second shock protection time, and updates the first expiration time to the second update time.
[0082] Figure 5 The figure shows a schematic diagram of the process when the storage service node processes a data migration request. Figure 5 As shown, the storage service node receives the data migration request and determines whether the current running time is less than the first shock protection time in the first lock information.
[0083] When the storage service node determines that the current running time is less than the first shock protection time in the first lock information, the first lock information is directly allocated to the second service node. Conversely, when the storage service node determines that the current running time is not less than the first shock protection time, the storage service node further determines whether the current running time is less than the first expiration time in the first lock information.
[0084] When the storage service node determines that the current running time is less than the first expiration time, it notifies the second service node to write back and release the service data, and then after the second service node successfully writes back and releases the service data, it allocates the updated second lock information to the first service node, so that the first service node loads the service data based on the second lock information, thereby completing the migration of the service data. Conversely, when the storage service node determines that the current running time is not less than the first expiration time, it directly allocates the second lock information to the first service node.
[0085] 406. The storage service node sends a data response message corresponding to the data migration request to the first service node, where the data response message includes service data.
[0086] In this example, after the storage service node migrates the service data from the second service node to the first service node, it completes the data migration operation on the service data. At this time, the storage service node sends a data response message corresponding to the data migration request to the first service node, and then informs the first service node of the corresponding service data through the data response message. After receiving the data response message, the first service node extracts the service data carried in the data response message by demapping the data response message.
[0087] 407. The first service node sends an access response message corresponding to the access request to the service-using device, where the access response message includes the service data, and the access response message is used to instruct the service-using device to perform an access operation on the service data.
[0088] 408. The service-using device performs an access operation on the service data based on the access response message.
[0089] It should be noted that steps 408 to 409 in the embodiment of the present application can be specifically referred to in the aforementioned Figure 2 The contents described in step 205 to step 206 in the above description can be understood and will not be repeated here.
[0090] In an embodiment of the present application, the first oscillation protection time is added to the first lock information. The first service node only needs to determine that the current running time is not less than the first oscillation protection time to be able to clearly determine that the distributed lock under the current running time should be held by the first service node. At this time, the service data fed back by the storage service node can be used to respond to the service usage device. In other words, in an embodiment of the present application, when receiving new routing information, it is not necessary to directly perform data migration processing, but it is necessary for the new service node (i.e., the first service node) to further interact with the storage service node to complete the data migration operation when the current running time is determined to be not less than the first oscillation protection time, thereby reducing the number of data migrations of service data between service nodes, which not only improves the stability of the server load, but also reduces the delay of service migration.
[0091] The above mainly introduces the scheme provided by the embodiment of the present application from the perspective of the method. It can be understood that in order to realize the above functions, the hardware structure and / or software module corresponding to the execution of each function are included. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0092] The embodiment of the present application can divide the functional modules of the device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0093] The first service node in the embodiment of the present application is described in detail below. Figure 6 FIG. 1 is a schematic diagram of an embodiment of the first service node provided in the embodiment of the present application. Figure 6 As shown, the first service node may include an acquiring unit 601 and a sending unit 602. Exemplarily, the first service node further includes a processing unit 603.
[0094] The acquisition unit 601 is used to acquire the access request sent by the service using device, and the access request is used to request access to the service data. Figure 2 Step 202 in or Figure 4 The contents described in step 402 in FIG. 4 can be understood for reference only and will not be described in detail here.
[0095] The acquisition unit 601 is used to acquire the first lock information based on the access request, and the first lock information includes a first oscillation protection time, which is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information. Figure 2 Step 203 in or Figure 4 The contents described in step 403 in FIG. 4 can be understood for reference only and will not be described in detail here.
[0096] The acquisition unit 601 is configured to receive service data sent by the storage service node when the current running time is not less than the first shock protection time. Figure 2 Step 203 in or Figure 4 The contents described in step 406 in FIG. 4 can be understood for reference only and will not be described in detail here.
[0097] The sending unit 602 is used to send an access response message corresponding to the access request to the service user device, the access response message includes service data, and the access response message is used to instruct the service user device to perform an access operation on the service data. Figure 2 Step 204 or Figure 4 The contents described in step 407 in FIG. 4 can be understood for reference only and will not be described in detail here.
[0098] In some optional implementations, the sending unit 602 is further configured to send a data migration request to the storage service node before receiving the service data sent by the storage service node, the data migration request being used to instruct the storage service node to migrate the service data from the second service node to the first service node. The acquiring unit 601 is configured to receive a data response message corresponding to the data migration request sent by the storage service node, the data response message including the service data.
[0099] In some other optional implementations, the sending unit 602 is further used to send a first message to the storage service node before acquiring the first lock information based on the access request, after acquiring the access request, when the first lock information is not stored in the local database of the first service node, and the first message is used to instruct the storage service node to send the first lock information to the first service node. The acquiring unit 601 is used to receive the first lock information sent by the storage service node.
[0100] In some other optional implementations, the first lock information also includes a node identifier of the second service node; the processing unit 603 is used to forward the access request to the second service node corresponding to the node identifier when the current running time is less than the first shock protection time.
[0101] In some other optional implementations, the sending unit 602 is further configured to send a service capacity expansion request or a service capacity reduction request to the cluster management device before obtaining the access request sent by the service usage device.
[0102] Above Figure 6 The first service node is mainly described from the perspective of the functional module. The storage service node in the embodiment of the present application will be described in detail from the perspective of the functional module below. Figure 7 Schematic diagram of an embodiment of a storage service node provided in an embodiment of the present application. Figure 7 As shown, the storage service node includes a receiving module 701, a processing module 702 and a sending module 703.
[0103] Among them, the receiving module 701 is used to receive a data migration request sent by the first service node. The data migration request is sent by the first service node when the current running time is not less than the first oscillation protection time in the first lock information. The first oscillation protection time is used to indicate the effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information.
[0104] The processing module 702 is configured to migrate service data from the second service node to the first service node based on the data migration request.
[0105] The sending module 703 is configured to send a data response message corresponding to the data migration request to the first service node, where the data response message includes service data.
[0106] In some optional implementations, the processing module 702 is further used to compare the current running time with the first expiration time in the first lock information before migrating the service data from the second service node to the first service node based on the data migration request, when the current running time is not less than the first shock protection time, the first expiration time is used to indicate the longest effective time of the distributed lock when the second service node accesses the service data, and the first expiration time is greater than the first shock protection time. The processing module 702 is used to migrate the service data from the second service node to the first service node based on the data migration request when the current running time is less than the first expiration time.
[0107] In some other optional implementations, the processing module 702 is also used to: when the current running time is not less than the first expiration time, update the first lock information based on the second lock information. The second lock information includes the node identifier of the first service node, the second oscillation protection time and the second expiration time, the second oscillation protection time is used to indicate the effective protection time of the distributed lock when the first service node accesses the service data when the first service node holds the second lock information, and the second expiration time is used to indicate the maximum effective time of the distributed lock when the first service node accesses the service data.
[0108] Above Figure 6 , Figure 7 The first service node and the storage service node are mainly described from the perspective of the functional modules. The service usage device in the embodiment of the present application will be described in detail from the perspective of the functional modules below. Figure 8 This is a schematic diagram of an embodiment of a service use device provided in an embodiment of the present application. Figure 8 As shown, the service using device includes a receiving unit 801 , a sending unit 802 and a processing unit 803 .
[0109] Among them, the receiving unit 801 is used to obtain a node list and a first event from the cluster management device, the node list includes at least two service nodes, the first event is used to indicate that the first service node needs to perform a capacity expansion processing operation or a capacity reduction processing operation, and the at least two service nodes include the first service node.
[0110] A sending unit 802 is configured to send an access request to a first service node based on a first event, where the access request is used to request access to service data.
[0111] The receiving unit 801 is configured to receive an access response message corresponding to an access request and sent by a first service node, where the access response message includes service data.
[0112] The processing unit 803 is configured to perform an access operation on the service data based on the access response message.
[0113] In other optional embodiments, the processing unit 803 is also used to: before sending an access request to the first service node based on the first event, process the node identifier, node list and routing rules of the first service node based on a preset routing model, calculate the node address corresponding to the first event, and the node address is the address of the first service node to determine the first service node.
[0114] The data migration device in the embodiment of the present application is described above from the perspective of modular functional entities, and the data migration device in the embodiment of the present application is described below from the perspective of hardware processing. Fig. 9 90 is a schematic diagram of the structure of the data migration device provided in the embodiment of the present application. The data migration device may have relatively large differences due to different configurations or performances. The data migration device may include at least one processor 901, a communication line 907, a memory 903 and at least one communication interface 904.
[0115] Processor 901 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0116] Communications link 907 may include a pathway for transmitting information between the above-mentioned components.
[0117] The communication interface 904 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0118] The memory 903 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, and the memory may exist independently and be connected to the processor via a communication line 907. The memory may also be integrated with the processor.
[0119] The memory 903 is used to store computer execution instructions for executing the solution of the present application, and the execution is controlled by the processor 901. The processor 901 is used to execute the computer execution instructions stored in the memory 903, thereby realizing the data migration method based on distributed locks provided in the above embodiment of the present application.
[0120] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0121] In a specific implementation, as an embodiment, the data migration device may include multiple processors, such as Fig. 9 901 and processor 902 in the embodiment. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0122] In a specific implementation, as an embodiment, the data migration device may further include an output device 905 and an input device 906. The output device 905 communicates with the processor 901 and may display information in a variety of ways. The input device 906 communicates with the processor 901 and may receive input from a target object in a variety of ways. For example, the input device 906 may be a mouse, a touch screen device, or a sensor device.
[0123] The data migration device mentioned above can be a general device or a special device. In a specific implementation, the data migration device can be a server, a terminal, etc. or a Fig. 9 The embodiment of the present application does not limit the type of the data migration device.
[0124] Need to explain, Fig. 9 The processor 901 in the data migration device can execute the following by calling the computer execution instructions stored in the memory 903: Figures 2 to 5 The method in the corresponding method embodiment.
[0125] Specifically, Figure 6 The processing unit 603 in Figure 7 The processing module 702 and Figure 8 The function / implementation process of the processing unit 803 in Fig. 9 The processor 901 in the embodiment calls the computer execution instructions stored in the memory 903 to implement. Figure 6 The acquiring unit 601 and the sending unit 602, Figure 7 The receiving module 701, the sending module 703, and Figure 8 The functions / implementation processes of the receiving unit 801 and the sending unit 802 can be Fig. 9 It is implemented by the communication interface 904 in.
[0126] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the data migration methods based on distributed locks recorded in the above method embodiments.
[0127] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any distributed lock-based data migration method recorded in the above method embodiments.
[0128] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0130] 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.
[0131] 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.
[0132] 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-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0134] The above embodiments may be implemented in whole or in part through software, hardware, firmware or any combination thereof. When implemented by software, they may be implemented in whole or in part in the form of a computer program product.
[0135] The computer program product includes one or more computer instructions. When loading and executing the computer execution instruction on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instruction can be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server, a data center, etc. that includes one or more available media integration. Available media can be magnetic media, (for example, floppy disk, hard disk, tape), optical media (for example, DVD), or semiconductor media (such as SSD)) and the like.
[0136] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data migration method based on distributed locks, characterized in that: Applied to a first service node, the method includes: Obtaining an access request sent by a service-using device, where the access request is used to request access to service data; Acquire first lock information based on the access request, where the first lock information includes a first oscillation protection time, where the first oscillation protection time is used to indicate an effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information; When the current running time is not less than the first shock protection time, receiving service data sent by the storage service node; An access response message corresponding to the access request is sent to the service-using device, wherein the access response message includes the service data and is used to instruct the service-using device to perform an access operation on the service data.
2. The method according to claim 1, characterized in that Before receiving the service data sent by the storage service node, the method further includes: Sending a data migration request to the storage service node, wherein the data migration request is used to instruct the storage service node to migrate the service data from the second service node to the first service node; Receive service data sent by the storage service node, including: Receive a data response message corresponding to the data migration request and sent by the storage service node, wherein the data response message includes the service data.
3. The method according to any one of claims 1 to 2, characterized in that Before acquiring the first lock information based on the access request, the method further includes: After obtaining the access request, when the first lock information is not stored in the local database of the first service node, sending a first message to the storage service node, where the first message is used to instruct the storage service node to send the first lock information to the first service node; The acquiring the first lock information based on the access request includes: Receive first lock information sent by the storage service node.
4. The method according to any one of claims 1 to 2, characterized in that The first lock information further includes a node identifier of the second service node, and the method further includes: When the current running time is less than the first shock protection time, the access request is forwarded to the second service node corresponding to the node identifier.
5. A data migration method based on distributed locks, characterized in that: Applied to a storage service node, the method includes: Receive a data migration request sent by a first service node, where the data migration request is sent by the first service node when the current running time is not less than a first oscillation protection time in the first lock information, where the first oscillation protection time is used to indicate an effective protection time of the distributed lock when the second service node accesses the service data when the second service node holds the first lock information; Migrating the service data from the second service node to the first service node based on the data migration request; A data response message corresponding to the data migration request is sent to the first service node, where the data response message includes the service data.
6. The method according to claim 5, characterized in that Before migrating the service data from the second service node to the first service node based on the data migration request, the method further includes: When the current running time is not less than the first shock protection time, compare the current running time with a first expiration time in the first lock information, where the first expiration time is used to indicate the longest valid time of the distributed lock when the second service node accesses the service data, and the first expiration time is greater than the first shock protection time; Migrating the service data from the second service node to the first service node based on the data migration request includes: When the current running time is less than the first expiration time, the service data is migrated from the second service node to the first service node based on the data migration request.
7. The method according to claim 6, characterized in that The method further comprises: When the current running time is not less than the first expiration time, the first lock information is updated based on the second lock information, the second lock information includes the node identifier of the first service node, the second oscillation protection time and the second expiration time, the second oscillation protection time is used to indicate the effective protection time of the distributed lock when the first service node accesses the service data when the first service node holds the second lock information, and the second expiration time is used to indicate the longest effective time of the distributed lock when the first service node accesses the service data.
8. A data migration method based on distributed locks, characterized in that: Applied to a service-using device, the method comprises: Acquire a node list and a first event from a cluster management device, wherein the node list includes at least two service nodes, the first event is used to indicate that a first service node needs to perform a capacity expansion processing operation or a capacity reduction processing operation, and the at least two service nodes include the first service node; sending an access request to the first service node based on the first event, where the access request is used to request access to service data; receiving an access response message corresponding to the access request and sent by the first service node, wherein the access response message includes the service data; An access operation is performed on the service data based on the access response message.
9. The method according to claim 8, characterized in that Before sending the access request to the first service node based on the first event, the method further includes: The node identifier of the first service node, the node list and the routing rule of the first service node are processed based on a preset routing model, and a node address corresponding to the first event is calculated, where the node address is the address of the first service node, to determine the first service node.
10. A first service node, characterized in that: include: an acquisition unit, configured to acquire an access request sent by a service-using device, wherein the access request is used to request access to service data; The acquiring unit is configured to acquire first lock information based on the access request, where the first lock information includes a first oscillation protection time, where the first oscillation protection time is used to indicate an effective protection time of a distributed lock when the second service node accesses the service data when the second service node holds the first lock information; The acquiring unit is configured to receive service data sent by the storage service node when the current running time is not less than the first shock protection time; A sending unit is used to send an access response message corresponding to the access request to the service-using device, wherein the access response message includes the service data and is used to instruct the service-using device to perform an access operation on the service data.
11. A storage service node, characterized in that: include: A receiving module, configured to receive a data migration request sent by a first service node, wherein the data migration request is sent by the first service node when the current running time is not less than a first oscillation protection time in the first lock information, wherein the first oscillation protection time is used to indicate an effective protection time of a distributed lock when the second service node accesses the service data when the second service node holds the first lock information; a processing module, configured to migrate the service data from the second service node to the first service node based on the data migration request; A sending module is used to send a data response message corresponding to the data migration request to the first service node, where the data response message includes the service data.
12. A service using device, characterized in that: include: A receiving unit, configured to obtain a node list and a first event from a cluster management device, wherein the node list includes at least two service nodes, the first event is used to indicate that a first service node needs to perform a capacity expansion processing operation or a capacity reduction processing operation, and the at least two service nodes include the first service node; a sending unit, configured to send an access request to the first service node based on the first event, wherein the access request is used to request access to service data; The receiving unit is configured to receive an access response message corresponding to the access request and sent by the first service node, wherein the access response message includes the service data; A processing unit is used to perform an access operation on the service data based on the access response message.
13. A data migration device, characterized in that: include: An input / output interface, a processor and a memory, wherein program instructions are stored in the memory; The processor is used to execute program instructions stored in the memory to perform the method according to any one of claims 1 to 9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 9.
15. A computer program product, characterized in that The computer program product comprises instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Access control method and device
CN104486328A
Shared resource access method and device and computer readable storage medium
CN109753540A
Data migration method, readable storage medium and computing equipment
CN111198845A
Distributed lock management method and device
CN113076187A
Method and device for extending distributed consistency service
WO2017041650A1
