CN111193600B - Method, device and system for taking over service - Google Patents

Method, device and system for taking over service Download PDF

Info

Publication number
CN111193600B
CN111193600B CN201811355024.3A CN201811355024A CN111193600B CN 111193600 B CN111193600 B CN 111193600B CN 201811355024 A CN201811355024 A CN 201811355024A CN 111193600 B CN111193600 B CN 111193600B
Authority
CN
China
Prior art keywords
node
virtual
virtual file
configuration information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811355024.3A
Other languages
Chinese (zh)
Other versions
CN111193600A (en
Inventor
陈伟
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201811355024.3A priority Critical patent/CN111193600B/en
Publication of CN111193600A publication Critical patent/CN111193600A/en
Application granted granted Critical
Publication of CN111193600B publication Critical patent/CN111193600B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a method, a device and a system for taking over service, belonging to the field of communication. The method comprises the following steps: a first node receives a takeover request message sent by a master node when a second node fault is detected, wherein the takeover request message comprises an equipment identifier of the second node, the first node, the second node and the master node are located in the same node group, and the first node stores configuration information of virtual files broadcast by other nodes in the node group; acquiring configuration information of a first virtual file stored locally according to the equipment identifier of the second node, wherein the first virtual file is a virtual file stored in the second node; and creating a second virtual file and configuring the second virtual file according to the configuration information of the first virtual file so as to take over the service provided by the second node through the first virtual file and used for storing and/or reading data. The method and the device can improve the utilization rate of the nodes.

Description

Method, device and system for taking over service
Technical Field
The present application relates to the field of communications, and in particular, to a method, an apparatus, and a system for taking over a service.
Background
In the field of monitoring, a terminal can manage at least one camera device, and each camera device can send data obtained by shooting to a corresponding terminal. However, the storage space in the terminal is limited, and the terminal stores data to the cloud storage platform through the nodes.
The node comprises a virtual file for providing data storage and reading services, the node can store data of the terminal in the cloud storage platform through the virtual file, and the data which needs to be read by the terminal is read from the cloud storage platform through the virtual file. In order to ensure the reliability of providing the storage and/or reading service, at least one backup node may be set for each node, each virtual file in the node is also created in the backup node, and when the node fails, one backup node of the node may take over the storage and/or reading service provided by the node to the outside by using the created virtual file.
In the process of implementing the present application, the inventors found that the above manner has at least the following defects:
because the virtual file is created in the backup node, the virtual file needs to occupy a large amount of hardware resources of the backup node, so that the backup node can be used as a backup device, the device cannot be served, and the utilization of the node is low.
Disclosure of Invention
In order to improve the utilization rate of a node, the embodiments of the present application provide a method, an apparatus, and a system for taking over a service. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for taking over a service, where the method includes:
a first node receives a take-over request message sent by a main node when a second node fault is detected, wherein the take-over request message comprises an equipment identifier of the second node, the first node, the second node and the main node are located in the same node group, and the first node stores configuration information of virtual files broadcast by other nodes in the node group;
the first node acquires configuration information of a first virtual file stored locally according to the equipment identifier of the second node, wherein the first virtual file is a virtual file stored in the second node;
and the first node creates a second virtual file and configures the second virtual file according to the configuration information of the first virtual file so as to take over the service provided by the second node through the first virtual file and used for storing and/or reading data.
Optionally, the configuration information of the first virtual file at least includes a file identifier, a capacity, an address, and a port number of the first virtual file, and after configuring the second virtual file according to the configuration information of the first virtual file, the method further includes:
and the first node establishes connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file, and configures the connection to correspond to the second virtual file.
Optionally, before the receiving the takeover request message sent by the master node when the failure of the second node is detected, the method further includes:
the first node receives the device identifier of the second node and the configuration information of the first virtual file which are broadcasted to the node group by the second node when the second node creates the first virtual file, and correspondingly stores the device identifier of the second node and the configuration information of the first virtual file in the corresponding relation between the device identifier and the configuration information.
Optionally, the method further includes:
when creating a third virtual file, the first node broadcasts the device identifier of the first node and the configuration information of the third virtual file to the node group.
Optionally, a consistency algorithm is installed in each node in the node group;
the broadcasting the device identifier of the first node and the configuration information of the third virtual file to the node group includes:
the first node broadcasts the equipment identification of the first node and the configuration information of the third virtual file to the node group through the installed consistency algorithm.
In a second aspect, an embodiment of the present application provides an apparatus for taking over a service, where the apparatus includes:
a receiving module, configured to receive a take-over request message sent by a master node when a failure of a second node is detected, where the take-over request message includes an equipment identifier of the second node, the apparatus, the second node, and the master node are located in a same node group, and the apparatus stores configuration information of virtual files broadcast by other nodes in the node group;
an obtaining module, configured to obtain configuration information of a first virtual file stored locally according to the device identifier of the second node, where the first virtual file is a virtual file stored in the second node;
and the creating module is used for creating a second virtual file and configuring the second virtual file according to the configuration information of the first virtual file so as to take over the service which is provided by the second node through the first virtual file and is used for storing and/or reading data.
Optionally, the configuration information of the first virtual file at least includes a file identifier, a capacity, an address, and a port number of the first virtual file, and the apparatus further includes:
and the establishing module is used for establishing connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file and configuring the connection to correspond to the second virtual file.
Optionally, the apparatus further comprises: a storage module for storing the data of the data,
the receiving module is further configured to receive a device identifier of the second node and configuration information of the first virtual file, which are broadcasted to the node group by the second node when the first virtual file is created;
and the storage module is used for correspondingly storing the equipment identifier of the second node and the configuration information of the first virtual file in the corresponding relation between the equipment identifier and the configuration information.
Optionally, the apparatus further comprises:
a broadcasting module, configured to broadcast, to the node group, the device identifier of the apparatus and configuration information of the third virtual file when the third virtual file is created.
Optionally, a consistency algorithm is installed in each node in the node group;
the broadcast module is configured to broadcast the device identifier of the apparatus and the configuration information of the third virtual file to the node group through the installed consistency algorithm.
In a third aspect, an embodiment of the present application provides a system for taking over a service, where the system includes: the system comprises a first node, a second node and a main node, wherein the first node, the second node and the main node are positioned in the same node group, and the first node stores configuration information of virtual files broadcast by other nodes in the node group;
the master node is configured to send a takeover request message to the first node when detecting that the second node fails, where the takeover request message includes a device identifier of the second node;
the first node is configured to acquire configuration information of a locally stored first virtual file according to the device identifier of the second node, where the first virtual file is a virtual file stored in the second node, create a second virtual file, and configure the second virtual file according to the configuration information of the first virtual file, so as to take over a service provided by the second node through the first virtual file and used for storing and/or reading data.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method steps provided by the first aspect or any alternative form of the first aspect.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
since the first node locally stores the configuration information of the first virtual file included in the second node, the configuration information of the first virtual file at least includes the file identifier, the capacity, the address and the port number of the first virtual file. Thus, a takeover request message sent by the master node when the second node fault is detected is received at the first node, the takeover request message includes the equipment identifier of the second node, the configuration information of the first virtual file included in the second node which is locally stored is obtained according to the equipment identifier of the second node, the second virtual file is created, and the second virtual file is configured according to the configuration information of the first virtual file, so that the service which is provided by the second node through the first virtual file and is used for storing and/or reading data is taken over. Therefore, the first node does not need to be used as a backup node of the second node, only the service in the second node needs to be taken over when the second node fails, and the first node can also independently provide the service, so that the utilization rate of the node is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic structural diagram of a storage system according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for creating a virtual file according to an embodiment of the present application;
fig. 3 is a flowchart of a method for taking over service according to an embodiment of the present application;
fig. 4 is a flowchart of a method for establishing a connection according to an embodiment of the present application;
FIG. 5 is a flow chart of a method for storing data according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of a method for reading data according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an apparatus for taking over service according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a node according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a system for taking over service according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
Referring to fig. 1, an embodiment of the present application provides a storage system, including:
terminal 1, node 2 and cloud storage platform 3. Alternatively, the node 2 may be a server or the like.
The terminal 1 includes at least one virtual disk therein.
The node 2 includes a virtual file corresponding to a virtual disk in the terminal. Each virtual file in the node 2 has configuration information, and the configuration information of the virtual file at least includes a file identifier, a capacity, an address, and a port number of the virtual file. The address may be an Internet Protocol (IP) address or the like for interconnection between networks.
Optionally, the node 2 may include a kernel layer and a user layer, where the kernel layer includes at least one virtual kernel device, and the user layer includes at least one virtual user device, and each virtual user device corresponds to one virtual file. Each virtual core device corresponds to one virtual user device in the user layer and one virtual disk in the terminal 1. Therefore, each virtual user device also corresponds to a virtual disk on the terminal 1, and similarly, the virtual file of each virtual user device corresponds to a virtual disk on the terminal 1.
The cloud storage platform 3 includes at least one storage block unit corresponding to each virtual disk in the at least one virtual disk.
At least one connection is established between the terminal 1 and the node 2, the at least one connection being a long connection. For each virtual disk in the terminal 1, the virtual disk and the virtual file corresponding to the virtual disk jointly correspond to a connection between the terminal 1 and the node 2, and the address and the port number of the connection at the node 2 side are respectively the address and the port number included in the configuration information of the virtual file.
Optionally, for a virtual kernel device, a virtual user device, and a virtual file that correspond to the virtual disk in the node 2, the virtual kernel device, the virtual user device, and the virtual file all correspond to the connection.
Optionally, since the configuration information of the virtual file corresponding to the virtual disk in the terminal 1 includes the capacity, the terminal 1 may use the capacity as the capacity of the virtual disk and may display the capacity to the user.
In an embodiment of the present invention, the virtual disk may not be a physical disk actually existing in the terminal 1, and the actual storage space corresponding to the virtual disk is located in the cloud storage platform 3, that is, the actual storage space corresponding to the virtual disk is at least one storage block unit corresponding to the virtual disk in the cloud storage platform 3, and a sum of capacities of each storage block unit in the at least one storage block unit may be equal to a capacity included in the configuration information of the virtual file.
The cloud storage platform 3 stores a corresponding relationship between the file identifier and the unit identifier, where the corresponding relationship is used to store a corresponding relationship between the file identifier of the virtual file corresponding to the virtual disk and the unit identifier of each storage block unit corresponding to the virtual disk.
Referring to fig. 1, the cloud storage platform 3 includes a metadata cluster 31 and a storage cluster 32, where a correspondence between a file identifier and a unit identifier is stored in the metadata cluster 31, and the storage cluster 32 includes at least one storage block unit corresponding to each virtual disk.
Optionally, the storage system may include a plurality of nodes 2, and the plurality of nodes 2 may be configured to form a node group. And setting a node in the node group as a master node.
A consistency algorithm is also deployed on each node in the node group, and any node in the node group can synchronize the configuration information of each virtual file stored by the node to other nodes in the node group through the consistency algorithm. So that other nodes in the node cluster can take over the services provided by each virtual file in the node for storing and/or reading data when the node fails.
The virtual file in the node 2 is not a real virtual file, and the virtual file may be a program for intercepting a command sent by the terminal to read data or store data, and then storing the data in the cloud storage platform 3 or reading the data from the cloud storage platform 3.
In the storage system, each node 2 may create a virtual file through which a terminal is provided with a service of storing and/or reading data. Examples of creating virtual files, embodiments of storing data, examples of reading data, and examples of other nodes in a node cluster taking over service when a node fails are listed in this application as follows. The detailed implementation of each instance is as follows.
Referring to fig. 2, for any one of the nodes in the storage system, a virtual file may be created by the following procedure. Respectively as follows:
step 201: the terminal establishes a virtual disk, establishes a connection corresponding to the virtual disk between the terminal and the node, and sends a creation command to the node, wherein the creation command comprises the capacity of the virtual disk.
The user may configure the address of the node on the terminal, and the terminal sends a connection establishment request to the node according to the address of the node. The node allocates a port number to the connection to enable establishment of the connection with the terminal.
Optionally, the node may include at least one address, and the connection corresponds to an address in the node and a port number of a port on the node side.
The user can trigger the terminal to create the virtual disk and set the capacity of the virtual disk in the terminal. Therefore, the terminal can obtain the capacity of the virtual disk set by the user, create the virtual disk, establish the connection corresponding to the virtual disk between the virtual disk and the node, and send a creation command to the node through the connection, wherein the creation command comprises the capacity of the virtual disk.
The virtual disk created by the terminal is not a physical disk that actually exists on the terminal. In this embodiment, therefore, the terminal may not include a disk.
Step 202: and the node receives the creation command, creates a virtual file corresponding to the virtual disk, configures the configuration information of the virtual file and configures the virtual file to correspond to the connection.
Optionally, the configuration information of the virtual file at least includes a file identifier, a capacity, an address, and a port number of the virtual file. The capacity of the virtual file is the capacity of the virtual disk included in the create command. The address and the port number of the virtual file are respectively the address and the port number corresponding to the node side of the connection, so that the virtual file is configured to correspond to the connection.
After creating the virtual file, the terminal locally saves the address and port number of the virtual file.
The node may receive the creation command through the connection, create a virtual kernel device corresponding to the virtual disk at a kernel layer thereof, create a virtual user device and the virtual file corresponding to the virtual disk at a user layer thereof, associate the connection with the virtual kernel device, associate the virtual kernel device with the virtual user device, and associate the virtual user device with the virtual file.
Optionally, after the virtual file is created, the node may broadcast the device identifier of the node and the configuration information of the virtual file to the node group where the node is located.
Other nodes in the node group may receive the device identifier and the configuration information of the virtual file, and store the device identifier and the configuration information of the virtual file in a corresponding relationship between the device identifier and the virtual file.
Optionally, a consistency algorithm is installed in the node, and the node may broadcast the device identifier and the configuration information of the virtual file to other nodes in the node group through the consistency algorithm.
Step 203: and the node applies for at least one storage block unit corresponding to the virtual disk in the cloud storage platform according to the capacity of the virtual disk.
The cloud storage platform comprises a metadata cluster and a storage cluster, wherein the storage cluster comprises a large number of storage block units, and the capacity of each storage block unit is equal.
Alternatively, the memory block unit may be object.
The method comprises the following steps: and the node calculates the number of the storage block units corresponding to the virtual disk according to the capacity of the virtual disk and the capacity of the storage block units, and applies for the storage block units from the storage cluster of the cloud storage platform according to the number, wherein the applied storage block units are the storage block units corresponding to the virtual disk.
For example, assuming that the capacity of the virtual disk is 30G, and the capacity of each storage block unit in the storage cluster of the cloud storage platform is 5G, then the number of the storage block units corresponding to the virtual disk is 6 according to the capacity of the virtual disk 30G and the capacity of the storage block units 5G, and 6 storage block units are applied from the storage cluster of the cloud storage platform, where the 6 storage block units are the storage block units corresponding to the virtual disk.
Step 204: and the node correspondingly stores the file identifier of the virtual file and the unit identifier of each storage block unit corresponding to the virtual disk in the corresponding relation between the file identifier and the unit identifier of the cloud storage platform.
The metadata cluster of the cloud storage platform stores the corresponding relation between the file identification and the unit identification. Therefore, in this step, the node may store the file identifier of the virtual file and the unit identifier of each storage block unit corresponding to the virtual disk in the corresponding relationship between the file identifier and the unit identifier in the metadata cluster.
The steps 201 to 204 may be repeatedly executed, and a plurality of virtual disks are created on the terminal and a virtual file corresponding to each virtual disk is created on the node.
Referring to fig. 3, the present application provides a method for taking over service, in which a first node may be instructed to take over service provided by a second node when a master node in a node group detects a failure of the second node, and the first node and the second node are two different nodes in the node group. The method comprises the following steps:
step 301: the method comprises the steps that a first node receives a take-over request message sent by a main node when a second node fault is detected, the take-over request message comprises an equipment identifier of the second node, and the first node, the second node and the main node are located in the same node group.
A plurality of nodes form a node group in the storage system, and a main node in the node group can detect other nodes in the node group. When a node (for convenience of explanation, referred to as a second node) is detected to have a fault, one node (for convenience of explanation, referred to as a first node) is selected from other nodes in the node group, and a takeover request message is sent to the first node, where the takeover request message includes a device identifier of the second node.
Step 302: the first node acquires configuration information of a first virtual file stored locally according to the device identifier of the second node, wherein the first virtual file is a virtual file stored in the second node.
Optionally, the configuration information of the first virtual file at least includes a file identifier, a capacity, an address, a port number, and the like of the first virtual file.
And each node in the node group is provided with a consistency algorithm. For each node in the node group, the node broadcasts the configuration information of the virtual file and the equipment identification of the node to other nodes in the node group through the consistency algorithm when the virtual file is created.
And correspondingly storing the equipment identifier of the node and the configuration information of the virtual file in the corresponding relation between the equipment identifier and the configuration information when receiving the equipment identifier of the node and the configuration information of the virtual file for each other node in the node group.
Therefore, the first node stores the configuration information of the virtual file in the other nodes in the node group, and the first node may also store the configuration information of the virtual file in the first node.
Optionally, the virtual file on the node needs to occupy more hardware resources of the node, where the hardware resources at least include storage resources, computing resources, ports, addresses, and the like. After each node receives the configuration information of the virtual file of other nodes, the configuration information of the virtual file is only stored, and the virtual file stored by other nodes is not created according to the configuration information of the virtual file, so that the occupation of hardware resources of the nodes can be reduced.
Alternatively, the consistency algorithm may be a Zookeeper algorithm. A virtual file is a virtual file and not a real file.
In this step, the first node may obtain, according to the device identifier of the second node in the takeover request message, the configuration information of the corresponding virtual file from the correspondence between the saved device identifier and the configuration information, and use the obtained configuration information of the virtual file as the configuration information of the first virtual file.
Step 303: the first node creates a second virtual file and configures the second virtual file according to the configuration information of the first virtual file so as to take over the service provided by the second node through the first virtual file and used for storing and/or reading data.
The address, the port number, the capacity and the file identifier of the configured second virtual file are respectively the same as the address, the port number, the capacity and the file identifier included in the configuration information of the first virtual file. That is, the configured second virtual file is the same as the first virtual file.
Optionally, the first node may create, in its kernel layer, a virtual kernel device corresponding to the first virtual file, and create, in its user layer, a virtual user device corresponding to the first virtual file.
After the first node configures the created first virtual file, the first node may provide a service of storing and/or reading data for a terminal corresponding to the first virtual file in the second node through the first virtual file. When the terminal stores and/or reads data, the terminal needs to establish connection with the first node. Referring to fig. 4, the process of establishing a connection includes:
401: and the first node establishes connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file.
When the second node fails, the connection between the second node and the terminal is disconnected. When the terminal requests the second node to create the first virtual file, the address and the port number of the first virtual file are stored. Thus, when the terminal requests to establish connection, the terminal sends a connection establishment request, and the destination address and the destination port number of the connection establishment request are the address and the port number of the first virtual file.
After the first node creates the second virtual file, the address and the port number of the second virtual file are configured to be the address and the port number of the first virtual file. The connection establishment request is thus routed in the network to the first node. And the first node receives the connection establishment request and establishes connection with the terminal.
After the connection is established, the terminal may further correspond the virtual disk setting corresponding to the first virtual file to the connection.
402: the first node configures the connection to correspond to the second virtual file.
Optionally, the first node may set the address and the port number corresponding to the connection on the first node side as the address and the port number of the first virtual file, respectively, to implement configuring that the connection corresponds to the second virtual file.
Optionally, the first node further associates the virtual kernel device corresponding to the connection and the second virtual file, and associates the virtual user device corresponding to the connection and the second virtual file.
The terminal can then store or read the data. The detailed processes of storing data and reading data can be referred to the contents of the following related embodiments, which are not described in detail herein.
In the embodiment of the present application, when the second node fails, the first node stores the configuration information of the first virtual file in the second node, so that the first node can create a second virtual file that is the same as the first virtual file according to the configuration information of the first virtual file, and take over, through the second virtual file, a service that is externally provided by the first node and is used for storage and/or reading. After receiving the configuration information of the virtual file of the second node, the first node only stores the configuration information of the virtual file, and does not create the virtual file according to the configuration information of the virtual file, so that the occupation of hardware resources of the first node can be reduced, and the external provision of storage and/or reading services by the first node is not influenced. Therefore, the utilization rate of the nodes is improved in advance under the condition of ensuring the reliability of the service.
Referring to fig. 5, the storage system may be used to store data, and the process of storing data may be:
step 501: the terminal acquires data to be stored and an initial address of the data to be stored in a virtual disk included in the terminal, and sends a storage command to the node through the connection corresponding to the virtual disk, wherein the storage command includes the data to be stored and the initial address.
The user can input the data to be stored to the terminal, and can also input the initial address of the data to be stored in a virtual disk to the terminal. Or, the terminal may store the occupied space capacity in the virtual disk, and when receiving the to-be-stored data that needs to be stored in the virtual disk, may determine the start address of the to-be-stored data in the virtual disk according to the occupied space capacity.
Step 502: and the node receives a storage command sent by the terminal through the connection, wherein the storage command comprises data to be stored and the initial address of the data to be stored in the virtual disk, and determines a virtual file corresponding to the connection.
The virtual file is a virtual file corresponding to the virtual disk in the node. And the virtual file has a corresponding file identifier.
Optionally, the node receives the storage command through a virtual kernel device associated with the connection, and the virtual kernel device then inputs the storage command to the virtual user device. The node then retrieves the storage command from the virtual user equipment.
The command sent by the terminal to the node is received by the virtual kernel device of the kernel layer first, and at this time, the node does not know whether the command is a read command or a storage command. The virtual kernel layer inputs the command to the corresponding virtual user equipment. In the user layer, the node may obtain the command from the virtual user equipment, identify whether the command is a read command or a storage command, and obtain a virtual file corresponding to the virtual user equipment.
Step 503: and the node determines a storage block unit and an offset address of the data to be stored in the storage block unit according to the starting address and the virtual file.
Specifically, the node acquires at least one unit identifier corresponding to the virtual disk from the corresponding relationship between the file identifier and the unit identifier stored in the cloud storage platform according to the file identifier of the virtual file; and determining a storage block unit and an offset address of the data to be stored in the storage block unit from the storage block unit corresponding to each unit identifier according to the starting address and the capacity of the storage block unit.
Wherein, the capacity of each storage block unit in the cloud storage platform can be equal. Suppose that the starting address of the data to be stored in the virtual disk is at the position of 7G, and the capacity of each storage block unit is 5G. According to the starting address and the capacity of the storage block unit, the determined storage block unit is a second storage block unit corresponding to the first virtual disk, and the offset address of the data to be stored in the storage block unit is 2G.
Step 504: and the node stores the data to be stored in the storage block unit according to the offset address.
For example, the node may store the data to be stored in the storage block unit corresponding to the virtual disk according to the location of the 2G.
Referring to fig. 6, the above-mentioned storage system may also be used to read data, and the process of reading data may be as follows:
step 601: the terminal obtains the initial address of the data to be read in the virtual disk included in the terminal and the data volume of the data to be read, and sends a reading command to the node through the connection corresponding to the virtual disk, wherein the reading command includes the initial address and the data volume of the data to be read.
The user can directly input the initial address and the data volume of the data to be read in the virtual disk to the terminal.
Correspondingly, the terminal receives the initial address of the data to be read in the virtual disk and the data volume of the data to be read, which are input by a user, determines the connection corresponding to the virtual disk, and sends a read command to the node through the determined connection, wherein the read command comprises the initial address and the data volume of the data to be stored.
Step 602: and the node receives a reading command sent by the terminal through the connection, wherein the reading command comprises the initial address and the data volume of the data to be read in the virtual disk, and the virtual file corresponding to the connection is determined.
Alternatively, the node may receive the read command through a virtual core device associated with the connection, which then inputs the read command to the virtual user device. The node then obtains the read command from the virtual user equipment.
The command sent by the terminal to the node is received by the virtual kernel device of the kernel layer first, and at this time, the node does not know whether the command is a read command or a storage command. The virtual kernel layer inputs the command to its corresponding virtual user device. In the user layer, the node may obtain the command from the virtual user equipment, identify whether the command is a read command or a storage command, and obtain a virtual file corresponding to the virtual user equipment.
Step 603: and the node determines a storage block unit and an offset address of the data to be read in the storage block unit according to the starting address and the virtual file.
Specifically, the node acquires at least one unit identifier corresponding to the virtual disk from the corresponding relationship between the file identifier and the unit identifier stored in the cloud storage platform according to the file identifier of the virtual file; and determining a storage block unit and an offset address of the data to be read in the storage block unit from the storage block unit corresponding to each unit identifier according to the starting address and the capacity of the storage block unit.
Wherein, the capacity of each storage block unit in the cloud storage platform can be equal. Suppose that the starting address of the data to be stored in the virtual disk is at the position of 7G, and the capacity of each storage block unit is 5G. Thus, according to the starting address and the capacity of the storage block unit, the determined storage block unit is the second storage block unit corresponding to the virtual disk and the offset address of the data to be read in the storage block unit is 2G.
Step 604: and the node reads the data to be read from the storage block unit according to the offset address and the data volume of the data to be read, and sends the data to be read to the terminal.
For example, assuming 2M of data to be read, the node may read the 2M data to be read from the second storage block unit corresponding to the virtual disk according to the position of the 2G, and send the data to be read to the terminal through the connection.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, an embodiment of the present application provides an apparatus 700 for taking over a service, where the apparatus 700 includes:
a receiving module 701, configured to receive a takeover request message sent by a master node when a failure of a second node is detected, where the takeover request message includes an equipment identifier of the second node, and the apparatus, the second node, and the master node are located in a same node group, and the apparatus stores configuration information of virtual files broadcast by other nodes in the node group;
an obtaining module 702, configured to obtain, according to the device identifier of the second node, configuration information of a first virtual file stored locally, where the first virtual file is a virtual file stored in the second node;
a creating module 703 is configured to create a second virtual file and configure the second virtual file according to the configuration information of the first virtual file, so as to take over a service provided by the second node through the first virtual file and used for storing and/or reading data.
Optionally, the configuration information of the first virtual file at least includes a file identifier, a capacity, an address, and a port number of the first virtual file, and the apparatus 700 further includes:
and the establishing module is used for establishing connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file and configuring the connection to correspond to the second virtual file.
Optionally, the apparatus 700 further includes: a storage module for storing the data of the data,
the receiving module is further configured to receive a device identifier of the second node and configuration information of the first virtual file, which are broadcasted to the node group by the second node when the first virtual file is created;
and the storage module is used for correspondingly storing the equipment identifier of the second node and the configuration information of the first virtual file in the corresponding relation between the equipment identifier and the configuration information.
Optionally, the apparatus 700 further includes:
a broadcasting module, configured to broadcast, to the node group, the device identifier of the apparatus and configuration information of the third virtual file when the third virtual file is created.
Optionally, a consistency algorithm is installed in each node in the node group;
the broadcast module is configured to broadcast the device identifier of the apparatus and the configuration information of the third virtual file to the node group through the installed consistency algorithm.
In this embodiment of the present application, when the second node fails, the device stores configuration information of the first virtual file in the second node, so that the creating module may create a second virtual file that is the same as the first virtual file according to the configuration information of the first virtual file, and take over, through the second virtual file, a service that is provided externally by the first node and is used for storage and/or reading. After receiving the configuration information of the virtual file of the second node, the device only stores the configuration information of the virtual file and does not create the virtual file according to the configuration information of the virtual file, so that the occupation of hardware resources of the device can be reduced, and the external provision of storage and/or reading services by the device is not influenced. Therefore, the utilization rate of the nodes is improved in advance under the condition of ensuring the reliability of the service.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 8 is a block diagram illustrating a structure of a node 800 according to an exemplary embodiment of the present invention. The node 800 may be a server or a computer, etc. The computer may be a desktop computer or a notebook computer, etc.
In general, node 800 includes: a processor 801 and a memory 802.
The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 can also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 802 is used to store at least one instruction for execution by processor 801 to implement a method of taking over services provided by method embodiments herein.
In some embodiments, the node 800 may further include: a peripheral interface 803 and at least one peripheral. The processor 801, memory 802, and peripheral interface 803 may be connected by buses or signal lines. Various peripheral devices may be connected to peripheral interface 803 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a touch screen display 805, a camera 806, an audio circuit 807, a positioning component 808, and a power supply 809.
The peripheral interface 803 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral interface 803 may be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 804 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 804 converts an electrical signal into an electromagnetic signal to be transmitted, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 804 may communicate with other nodes via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 804 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 805 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 805 is a touch display, the display 805 also has the ability to capture touch signals on or above the surface of the display 805. The touch signal may be input to the processor 801 as a control signal for processing. At this point, the display 805 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, display 805 may be one, providing the front panel of node 800; in other embodiments, the number of the display screens 805 may be at least two, and the at least two display screens are respectively arranged on different surfaces of the node 800 or are in a folding design; in still other embodiments, display 805 may be a flexible display, disposed on a curved surface or on a folded surface of node 800. Even further, the display 805 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 805 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 806 is used to capture images or video. Optionally, camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the node and the rear camera is disposed on the back of the node. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 801 for processing or inputting the electric signals to the radio frequency circuit 804 to realize voice communication. For stereo acquisition or noise reduction purposes, the microphones may be multiple and disposed at different locations of the node 800. The microphone may also be an array microphone or an omni-directional acquisition microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 807 may also include a headphone jack.
The Location component 808 is operable to locate the current geographic Location of the node 800 for navigation or LBS (Location Based Service). The Positioning component 808 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
A power supply 809 is used to power the various components in the node 800. The power source 809 may be ac, dc, disposable or rechargeable. When the power supply 809 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, node 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: acceleration sensor 811, gyro sensor 812, pressure sensor 813, fingerprint sensor 814, optical sensor 815 and proximity sensor 816.
The acceleration sensor 811 may detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the node 800. For example, the acceleration sensor 811 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 801 may control the touch screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 812 may detect a body direction and a rotation angle of the node 800, and the gyro sensor 812 may acquire a 3D motion of the user on the node 800 in cooperation with the acceleration sensor 811. From the data collected by the gyro sensor 812, the processor 801 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization while shooting, game control, and inertial navigation.
Pressure sensors 813 may be disposed on the side frames of node 800 and/or underneath touch screen display 805. When the pressure sensor 813 is arranged on the side frame of the node 800, the holding signal of the user to the node 800 can be detected, and the processor 801 performs left-right hand identification or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed at a lower layer of the touch display screen 805, the processor 801 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 805. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 814 is used for collecting a fingerprint of the user, and the processor 801 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations including unlocking a screen, viewing encrypted information, downloading software, paying for and changing settings, etc. Fingerprint sensor 814 may be disposed on the front, back, or side of node 800. When a physical key or vendor Logo is provided on node 800, fingerprint sensor 814 may be integrated with the physical key or vendor Logo.
The optical sensor 815 is used to collect ambient light intensity. In one embodiment, the processor 801 may control the display brightness of the touch screen 805 based on the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 805 is increased; when the ambient light intensity is low, the display brightness of the touch display 805 is turned down. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815.
A proximity sensor 816, also known as a distance sensor, is typically disposed on the front panel of the node 800. The proximity sensor 816 is used to capture the distance between the user and the front of the node 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front surface of the node 800 gradually decreases, the processor 801 controls the touch display 805 to switch from the bright screen state to the dark screen state; when the proximity sensor 816 detects that the distance between the user and the front surface of the node 800 becomes gradually larger, the processor 801 controls the touch display 805 to switch from the screen-on state to the screen-on state.
Those skilled in the art will appreciate that the structure illustrated in fig. 8 does not constitute a limitation of node 800, and may include more or fewer components than illustrated, or may combine certain components, or may employ a different arrangement of components.
Referring to fig. 9, an embodiment of the present application provides a system 900 for taking over a service, where the system 900 includes: the virtual file allocation method comprises a first node 901, a second node 902 and a master node 903, wherein the first node 901, the second node 902 and the master node 903 are located in the same node group, and the first node 901 stores configuration information of virtual files broadcast by other nodes in the node group;
the master node 903 is configured to send a takeover request message to the first node 901 when detecting that the second node 902 fails, where the takeover request message includes an apparatus identifier of the second node 902;
the first node 901 is configured to obtain configuration information of a first virtual file stored locally according to the device identifier of the second node 902, where the first virtual file is a virtual file stored in the second node 902, create a second virtual file, and configure the second virtual file according to the configuration information of the first virtual file, so as to take over a service provided by the second node 902 through the first virtual file and used for storing and/or reading data.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A method of taking over a service, the method comprising:
a first node receives a take-over request message sent by a main node when a second node fault is detected, wherein the take-over request message comprises an equipment identifier of the second node, the first node, the second node and the main node are located in the same node group, and the first node stores configuration information of virtual files broadcast by other nodes in the node group;
the first node acquires configuration information of a first virtual file stored locally according to the equipment identifier of the second node, wherein the first virtual file is a virtual file stored in the second node;
the first node creates a second virtual file and configures the second virtual file according to the configuration information of the first virtual file;
the first node associates the connection between the first node and the terminal with the virtual kernel device corresponding to the second virtual file, and associates the connection with the virtual user device corresponding to the second virtual file;
the first node receives a storage command sent by a terminal through a virtual kernel device associated with the connection, so that the virtual kernel device inputs the storage command to a virtual user device, the storage command is obtained from the virtual user device, the storage command comprises data to be stored and a start address of the data to be stored in a virtual disk, a storage block unit in the virtual disk and an offset address of the data to be stored in the storage block unit are determined according to the start address and the second virtual file, and the data to be stored is stored in the storage block unit according to the offset address; and/or the presence of a gas in the gas,
the first node receives a reading command sent by a terminal through a virtual kernel device associated with the connection, so that the virtual kernel device inputs the reading command to a virtual user device, the reading command is obtained from the virtual user device, the reading command comprises a starting address and a data volume of data to be read in the virtual disk, a storage block unit in the virtual disk and an offset address of the data to be read in the storage block unit are determined according to the starting address and the second virtual file, and the data to be read is read from the storage block unit according to the offset address and the data volume.
2. The method of claim 1, wherein the configuration information of the first virtual file at least comprises a file identifier, a capacity, an address, and a port number of the first virtual file, and further comprising, after configuring the second virtual file according to the configuration information of the first virtual file:
and the first node establishes connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file, and configures the connection to correspond to the second virtual file.
3. The method of claim 1, wherein the receiving the takeover request message sent by the master node upon detecting the failure of the second node further comprises:
the first node receives the device identifier of the second node and the configuration information of the first virtual file which are broadcasted to the node group by the second node when the second node creates the first virtual file, and correspondingly stores the device identifier of the second node and the configuration information of the first virtual file in the corresponding relation between the device identifier and the configuration information.
4. A method according to any one of claims 1 to 3, wherein the method further comprises:
when creating a third virtual file, the first node broadcasts the device identifier of the first node and the configuration information of the third virtual file to the node group.
5. The method of claim 4, wherein a consistency algorithm is installed in each node in the cluster of nodes;
the broadcasting the device identifier of the first node and the configuration information of the third virtual file to the node group includes:
the first node broadcasts the device identification of the first node and the configuration information of the third virtual file to the node group through the installed consistency algorithm.
6. An apparatus for taking over a service, the apparatus comprising:
a receiving module, configured to receive a takeover request message sent by a master node when a failure of a second node is detected, where the takeover request message includes an equipment identifier of the second node, and the apparatus, the second node, and the master node are located in a same node group, and the apparatus stores configuration information of virtual files broadcast by other nodes in the node group;
an obtaining module, configured to obtain configuration information of a first virtual file stored locally according to the device identifier of the second node, where the first virtual file is a virtual file stored in the second node;
the creating module is used for creating a second virtual file and configuring the second virtual file according to the configuration information of the first virtual file;
the device is further configured to associate a connection with a virtual kernel device corresponding to the second virtual file, and associate the connection with a virtual user device corresponding to the second virtual file, where the connection is a connection between the device and a terminal; receiving a storage command sent by a terminal through virtual kernel equipment associated with the connection, enabling the virtual kernel equipment to input the storage command into virtual user equipment, acquiring the storage command from the virtual user equipment, determining a storage block unit in the virtual disk and an offset address of the data to be stored in the storage block unit according to the start address and the second virtual file, and storing the data to be stored in the storage block unit according to the offset address; and/or the presence of a gas in the atmosphere,
the device is further configured to receive, by the virtual kernel device associated with the connection, a read command sent by the terminal, so that the virtual kernel device inputs the read command to the virtual user device, and obtain the read command from the virtual user device, where the read command includes a start address and a data amount of data to be read in the virtual disk, determine, according to the start address and the second virtual file, a storage block unit in the virtual disk and an offset address of the data to be read in the storage block unit, and read the data to be read from the storage block unit according to the offset address and the data amount.
7. The apparatus of claim 6, wherein the configuration information of the first virtual file comprises at least a file identification, a capacity, an address, and a port number of the first virtual file, the apparatus further comprising:
and the establishing module is used for establishing connection between terminals corresponding to the first virtual file according to the address and the port number of the first virtual file and configuring the connection to correspond to the second virtual file.
8. The apparatus of claim 6, wherein the apparatus further comprises: a storage module for storing the data of the data,
the receiving module is further configured to receive a device identifier of the second node and configuration information of the first virtual file, which are broadcasted to the node group by the second node when the first virtual file is created;
and the storage module is used for correspondingly storing the equipment identifier of the second node and the configuration information of the first virtual file in the corresponding relation between the equipment identifier and the configuration information.
9. The apparatus of any of claims 6 to 8, further comprising:
a broadcasting module, configured to broadcast, to the node group, the device identifier of the apparatus and configuration information of the third virtual file when the third virtual file is created.
10. The apparatus of claim 9, wherein a consistency algorithm is installed in each node in the cluster of nodes;
the broadcast module is configured to broadcast, to the node group, the device identifier of the apparatus and the configuration information of the third virtual file through the installed consistency algorithm.
11. A system for taking over a service, the system comprising: the system comprises a first node, a second node and a main node, wherein the first node, the second node and the main node are positioned in the same node group, and the first node stores configuration information of virtual files broadcast by other nodes in the node group;
the master node is configured to send a takeover request message to the first node when detecting that the second node fails, where the takeover request message includes a device identifier of the second node;
the first node is configured to acquire configuration information of a locally stored first virtual file according to the device identifier of the second node, where the first virtual file is a virtual file stored in the second node, create a second virtual file, and configure the second virtual file according to the configuration information of the first virtual file, so as to take over a service provided by the second node through the first virtual file and used for storing and/or reading data;
the first node is further configured to associate a connection between the first node and a terminal and a virtual kernel device corresponding to the second virtual file, and associate the connection and a virtual user device corresponding to the second virtual file;
the first node is further configured to receive, by the virtual kernel device associated with the connection, a storage command sent by a terminal, so that the virtual kernel device inputs the storage command to a virtual user device, acquire the storage command from the virtual user device, where the storage command includes data to be stored and a start address of the data to be stored in a virtual disk, determine, according to the start address and the second virtual file, a storage block unit in the virtual disk and an offset address of the data to be stored in the storage block unit, and store the data to be stored in the storage block unit according to the offset address; and/or the presence of a gas in the gas,
the first node is further configured to receive, by the virtual kernel device associated with the connection, a read command sent by the terminal, so that the virtual kernel device inputs the read command to the virtual user device, and obtains the read command from the virtual user device, where the read command includes a start address and a data amount of data to be read in the virtual disk, determine, according to the start address and the second virtual file, a storage block unit in the virtual disk and an offset address of the data to be read in the storage block unit, and read the data to be read from the storage block unit according to the offset address and the data amount.
CN201811355024.3A 2018-11-14 2018-11-14 Method, device and system for taking over service Active CN111193600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811355024.3A CN111193600B (en) 2018-11-14 2018-11-14 Method, device and system for taking over service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811355024.3A CN111193600B (en) 2018-11-14 2018-11-14 Method, device and system for taking over service

Publications (2)

Publication Number Publication Date
CN111193600A CN111193600A (en) 2020-05-22
CN111193600B true CN111193600B (en) 2023-04-07

Family

ID=70707073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811355024.3A Active CN111193600B (en) 2018-11-14 2018-11-14 Method, device and system for taking over service

Country Status (1)

Country Link
CN (1) CN111193600B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103814352A (en) * 2012-12-31 2014-05-21 华为技术有限公司 Virtual equipment reconstruction method and apparatus
CN108664523A (en) * 2017-03-31 2018-10-16 华为技术有限公司 A kind of virtual disk files format conversion method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4448719B2 (en) * 2004-03-19 2010-04-14 株式会社日立製作所 Storage system
JP4339763B2 (en) * 2004-09-07 2009-10-07 株式会社日立製作所 Failover method and computer system
CN103019889A (en) * 2012-12-21 2013-04-03 曙光信息产业(北京)有限公司 Distributed file system and failure processing method thereof
JP6132980B2 (en) * 2013-06-19 2017-05-24 株式会社日立製作所 Decentralized distributed computing system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103814352A (en) * 2012-12-31 2014-05-21 华为技术有限公司 Virtual equipment reconstruction method and apparatus
CN108664523A (en) * 2017-03-31 2018-10-16 华为技术有限公司 A kind of virtual disk files format conversion method and device

Also Published As

Publication number Publication date
CN111193600A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN111225042B (en) Data transmission method and device, computer equipment and storage medium
CN110308956B (en) Application interface display method and device and mobile terminal
CN110659127A (en) Method, device and system for processing task
CN111355774B (en) Service communication method, device and system based on P2P
CN110288689B (en) Method and device for rendering electronic map
CN111190748A (en) Data sharing method, device, equipment and storage medium
CN111327928A (en) Song playing method, device and system and computer storage medium
CN111159604A (en) Picture resource loading method and device
CN111897465B (en) Popup display method, device, equipment and storage medium
CN110636144A (en) Data downloading method and device
CN110704324A (en) Application debugging method and device and storage medium
CN113076051A (en) Slave control terminal synchronization method, device, terminal and storage medium
CN109783176B (en) Page switching method and device
CN111866140A (en) Fusion management apparatus, management system, service calling method, and medium
CN110839174A (en) Image processing method and device, computer equipment and storage medium
CN111813322A (en) Method, device and equipment for creating storage pool and storage medium
CN111324293B (en) Storage system, data storage method, data reading method and device
CN110086814B (en) Data acquisition method and device and storage medium
CN111881423A (en) Method, device and system for limiting function use authorization
CN109413190B (en) File acquisition method and device, electronic equipment and storage medium
CN111008083A (en) Page communication method and device, electronic equipment and storage medium
CN112181915A (en) Method, device, terminal and storage medium for executing service
CN113282243B (en) Method and device for storing object file
CN111193600B (en) Method, device and system for taking over service
CN112260845B (en) Method and device for accelerating data transmission

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant