WO2020133995A1 - Copy deployment method, cloud server, and storage medium - Google Patents

Copy deployment method, cloud server, and storage medium Download PDF

Info

Publication number
WO2020133995A1
WO2020133995A1 PCT/CN2019/093789 CN2019093789W WO2020133995A1 WO 2020133995 A1 WO2020133995 A1 WO 2020133995A1 CN 2019093789 W CN2019093789 W CN 2019093789W WO 2020133995 A1 WO2020133995 A1 WO 2020133995A1
Authority
WO
WIPO (PCT)
Prior art keywords
copy
copies
online
node
fluctuation range
Prior art date
Application number
PCT/CN2019/093789
Other languages
French (fr)
Chinese (zh)
Inventor
何琼
Original Assignee
深圳市网心科技有限公司
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 深圳市网心科技有限公司 filed Critical 深圳市网心科技有限公司
Publication of WO2020133995A1 publication Critical patent/WO2020133995A1/en

Links

Images

Classifications

    • 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

Definitions

  • the present invention relates to the field of communication technology, and in particular, to a copy deployment method, cloud server, and storage medium.
  • Cloud storage is a new concept that extends and develops from the concept of cloud computing. Through cluster applications, grid technology, or distributed file system functions, a large number of different types of storage devices in the network are gathered together through application software to work together. , A system that provides data storage and business access functions together.
  • the main purpose of the present invention is to provide a copy deployment method, a cloud server and a storage medium, aiming to solve the technical problem that the copy is lost due to node instability or the disk is damaged, resulting in inconvenience to user access.
  • the present invention provides a copy deployment method, including:
  • the copy is redeployed, wherein the current online copy number of the redeployed copy meets the fluctuation range of the copy number.
  • redeploying the copy includes:
  • the current number of online copies of the added copy is the maximum value of the fluctuation range of the number of copies.
  • redeploying the copy includes:
  • the current number of online copies of the deleted copy is the maximum value of the fluctuation range of the number of copies.
  • the method before the monitoring of the first node event of the target node where the copy is deployed, the method further includes:
  • the method before the monitoring of the first node event of the target node where the copy is deployed, the method further includes:
  • the method further includes:
  • the present invention further provides a cloud server, the cloud server includes a memory and a processor, the memory stores a copy deployment program that can run on the processor, and the copy deployment program is When the processor executes, the copy deployment method is implemented.
  • the cloud server is a node that constitutes a content distribution network or a blockchain network.
  • the present invention further provides a copy deployment system, the copy deployment system includes:
  • the monitoring unit is used to monitor the first node event of the target node where the copy is deployed
  • a first determining unit configured to determine whether the first node event affects the current number of online copies of the copy
  • An updating unit configured to update the current online copy number of the replica according to the first node event if the first node event affects the current online copy number of the replica
  • the second judgment unit is used to judge whether the updated current online copy quantity meets the preset fluctuation range of the copy quantity
  • a deployment unit configured to redeploy the copy if the updated current online copy number does not meet the preset fluctuation range of the copy number, wherein the current online copy number of the copy after redeployment satisfies the copy number Fluctuation range.
  • the present invention further provides a computer-readable storage medium on which a copy deployment program is stored, and the copy deployment program may be executed by one or more processors to implement the Copy deployment method.
  • the present invention further provides a computer program product, including computer instructions, which, when run on a computer, enable the computer to execute the copy deployment method.
  • the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the current number of online copies of the copy, if the first node event affects the copy
  • the current number of online copies according to the first node event, update the number of current online copies of the copy; further, it can also be determined whether the updated current online copy number meets the preset copy number fluctuation range; if updated After the current number of online copies does not meet the preset fluctuation range of the number of copies, the copy is redeployed, wherein the number of current online copies of the redeployed copy meets the fluctuation range of the number of copies.
  • the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
  • FIG. 1 is a schematic flowchart of a copy deployment method disclosed in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an internal structure of a cloud server disclosed in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of functional modules of a copy deployment system disclosed in an embodiment of the present invention.
  • first and second in the present invention are for descriptive purposes only, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features.
  • features defined as “first” and “second” may include at least one of the features, either explicitly or implicitly.
  • the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary skilled in the art to achieve, when the combination of technical solutions contradicts each other or cannot be achieved, it should be considered that the combination of such technical solutions does not exist , Nor within the scope of protection required by the present invention.
  • the invention provides a copy deployment method, which can ensure the accuracy of the current online copy number, and at the same time, keep the current online copy number of the redeployed copy within a certain range, which is convenient for users to access.
  • the cloud server may refer to a computer system that can provide services to other devices (such as clients) in the network. If a personal computer can provide a file transfer protocol (File Transfer Protocol, FTP for short) service, it can also be called a cloud server.
  • FTP File Transfer Protocol
  • cloud servers refer to certain high-performance computers that can provide services externally through the network. Compared with ordinary personal computers, they require higher stability, security, and performance. Therefore, CPU, chipset, memory, disk system, network and other hardware are different from ordinary personal computers.
  • the cloud server is used to provide services (such as data transmission services) to clients.
  • the cloud server may include, but is not limited to, a PC (Personal Computer), a smart phone, a tablet computer, a palmtop computer, a portable computer, an intelligent router, a network storage device, and the like.
  • the target node may be various clients, wherein the client is a device that can automatically perform numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes but is not limited to microprocessing Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • the client includes but is not limited to any electronic product that can interact with the user through keyboard, mouse, remote control, touchpad or voice control device, such as personal computer, tablet computer, smart phone, personal digital Assistant (Personal Digital Assistant, PDA), interactive network TV (Internet Protocol, IPTV), smart wearable devices, etc.
  • FIG. 1 is a schematic flowchart of a copy deployment method disclosed in an embodiment of the present invention. As shown in Figure 1, the method includes:
  • the cloud server monitors the first node event of the target node where the copy is deployed.
  • the cloud server after the cloud server receives the copy deployment task, the cloud server needs to copy the original into multiple copies, and then deploy the multiple copies to the target node, where the original is the original data, and the copy passes the original data Copies of multiple copies of data.
  • the cloud server can manage node online and offline information, trigger node online and offline events, manage node-replication relationships, trigger node add replica events and trigger node delete replica events, receive replica deployment tasks and deliver them to deployment nodes.
  • the cloud server needs to monitor the first node event of the target node where the copy is deployed
  • the first node event may include but is not limited to a node going online event, a node adding copy event, a node deleting copy event, a copy invalid event, and a node moving copy event.
  • the method further includes:
  • the cloud server may obtain multiple regions to be deployed carried by the copy deployment task and the total number of copies, and further, may obtain the The number of population, according to the number of population of each of the areas, calculate the proportion of the population of the plurality of areas, and then determine the proportion of the population of the plurality of areas as the distribution ratio of the copies of the plurality of areas; further, Calculate the number of replicas to be deployed in each of the regions according to the total number of replicas and the replica allocation ratio; finally, for each of the regions, obtain the currently online nodes from the multiple nodes included in the region, Then, a node whose storage space is greater than a preset storage space threshold is selected from the currently online nodes as the target node, and then the copy can be deployed on the target node in the area according to the number of copies. Each described area operates similarly until all replicas are deployed to all target nodes.
  • the frequency of data access is generally higher. Assigning copies according to the proportion of the population in the area can satisfy the requirements of local users for data access as much as possible, making data access The speed is faster and the user experience is more.
  • the method further includes:
  • the copy deployment task carries the copy allocation ratio and the total number of copies for multiple regions
  • the cloud server may directly calculate each of the copies according to the total number of copies and the copy allocation ratio.
  • the number of replicas to be deployed in the area Further, for each of the areas, the currently online nodes are obtained from the multiple nodes included in the area, and then the resource utilization rate selected from the currently online nodes is lower than the preset
  • the node with the resource usage threshold is determined as the target node, and then the copy can be deployed on the target node in the area according to the number of copies.
  • Each described area operates similarly until all replicas are deployed to all target nodes.
  • the target nodes selected in this way are all nodes with light load, low resource usage, and can have extra resources to deploy copies. At the same time, it also makes subsequent data access faster.
  • step S102 The cloud server determines whether the first node event affects the current number of online copies of the copy. If so, step S103 is executed. If not, the process ends.
  • some of the first node events listed above may affect the current number of online copies of the replicas, such as a node add replica event, a node delete replica event, and a copy invalid event, and some will not affect all
  • the current online copy number of the copy such as the node move copy event.
  • the current number of online copies refers to the number of copies that can be accessed by users deployed on the target node currently online.
  • the cloud server updates the current number of online copies of the copy according to the first node event.
  • the cloud server determines that the first node event affects the current online copy number of the copy, it indicates that the current online copy number of the copy has changed, and the cloud server needs to determine according to the first node event The number of the copies affected by the first node event, and in turn, the current online copy number of the copies is updated.
  • the first node event is a node delete copy event
  • the number of copies deleted by the node delete copy event is A
  • the number of currently stored copies is B
  • the cloud server needs to update the current number of online copies of the copy
  • the current number of online copies will be changed from B copies to (BA) copies.
  • step S104 The cloud server determines whether the updated current number of online copies meets the preset fluctuation range of the number of copies. If not, step S105 is executed, and if so, the process ends.
  • the number of replicas if the number of replicas is too large, it will cause the waste of node storage resources and network bandwidth, and increase the burden on the system and the network; if the number of replicas is too small, the availability and access speed of data cannot be guaranteed, which is likely to cause hot spots. In order to ensure higher service reliability of the system, the number of copies needs to be appropriately controlled.
  • the delete/patch operation is the operation of deleting a copy/adding a copy.
  • a copy quantity fluctuation range may be preset, wherein the copy quantity fluctuation range is obtained in advance according to the probability of an online target node, and the copy quantity fluctuation range includes a maximum value and a minimum value, the maximum The value is the maximum number of copies allowed by the system, and the minimum value is the minimum number of copies allowed by the system.
  • the cloud server may determine whether the updated current online copy quantity meets the preset copy quantity fluctuation range, if the updated current online copy quantity does not satisfy the preset copy quantity
  • the fluctuation range indicates that there are too many or too few online copies, which has affected the normal operation of the entire system.
  • the cloud server redeploys the copy.
  • the cloud server needs to redeploy the copy. Wherein, the current number of online copies of the redeployed copy meets the fluctuation range of the number of copies.
  • redeploying the copies includes:
  • the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
  • the updated current number of online copies is less than the minimum value of the preset copy number fluctuation range, it means that the current number of copies is too small, which has affected the access of the copies.
  • the copy is added, that is, a certain number of copies are added, so that the number of added copies is within the fluctuation range of the number of copies.
  • the number of copies that can be directly added to the copy after being added is the maximum value of the fluctuation range of the number of copies. If the number of added copies is small, it is likely that the number of copies will fluctuate within a short period of time, and adding the copy to the maximum value of the number of copies of the fluctuation range, which is beneficial after adding copies, in a shorter During the time, it will not cause the current online copy quantity of the copy to be lower than the minimum value of the fluctuation range of the copy quantity, and it is possible to maintain the current online copy quantity of the copy within the fluctuation range of the copy quantity for a long time.
  • redeploying the copies includes:
  • the updated number of current online copies is greater than the maximum value of the preset copy number fluctuation range, it indicates that the current number of copies is too large.
  • the copies need to be deleted The operation is to delete a certain number of copies so that the number of deleted copies is within the fluctuation range of the number of copies.
  • the copy can be directly deleted to the current online copy number of the deleted copy is the maximum value of the fluctuation range of the copy number. If the number of deleted copies increases, it is likely that there will be fluctuations in the number of copies within a short period of time, and deleting the copies to the maximum value of the fluctuation range of the number of copies will facilitate the deletion of copies after a short period of time. During the time, it will not cause the current online copy quantity of the copy to be lower than the minimum value of the fluctuation range of the copy quantity, and it is possible to maintain the current online copy quantity of the copy within the fluctuation range of the copy quantity for a long time.
  • step S103 the method further includes:
  • a node event acquisition request may be actively sent to the target node, and after receiving the node event acquisition request, the target node may acquire a preset period (such as one day ), and return all second node events to the cloud server.
  • the cloud server can The second node event counts the current number of online copies of the copy; further, it can be determined whether the updated current online copy number is consistent with the counted current online copy number, if the updated current online copy number is The consistent number of current online copies indicates that the deviation of the number of current online copies after the update is relatively small, and the data is more reliable. You can further determine whether the updated number of online copies meets the preset fluctuation range of the number of copies.
  • the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the number of current online copies of the copy, if the first The node event affects the current online copy number of the replica, and the current online copy number of the replica is updated according to the first node event; further, it can also be determined whether the updated current online copy quantity meets the preset copy Number fluctuation range; if the updated current online copy number does not meet the preset copy number fluctuation range, redeploy the copy, wherein the redeployed copy of the current online copy number meets the copy number fluctuation range.
  • the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
  • FIG. 2 is a schematic diagram of an internal structure of a cloud server disclosed in an embodiment of the present invention.
  • the cloud server 1 may include a memory 11, a processor 12, and a bus 13.
  • the cloud server 1 may refer to a computer system that can provide services to other devices (such as clients) in the network. If a personal computer can provide a file transfer protocol (File Transfer Protocol, FTP for short) service, it can also be called a cloud server.
  • FTP File Transfer Protocol
  • cloud servers refer to certain high-performance computers that can provide services externally through the network. Compared with ordinary personal computers, they require higher stability, security, and performance. Therefore, CPU, chipset, memory, disk system, network and other hardware are different from ordinary personal computers.
  • the server is used to provide services (such as data transmission services) to clients.
  • the cloud server may include, but is not limited to, a PC (Personal Computer), a smart phone, a tablet computer, a palmtop computer, a portable computer, an intelligent router, a network storage device, and the like.
  • the cloud server 1 may be a node constituting a content distribution network or a blockchain network.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like.
  • the storage 11 may be an internal storage unit of the cloud server 1 in some embodiments, such as a hard disk of the cloud server 1.
  • the storage 11 may also be an external storage device of the cloud server 1, such as a plug-in hard disk equipped on the cloud server 1, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc.
  • the memory 11 may also include both the internal storage unit of the cloud server 1 and the external storage device.
  • the memory 11 can be used not only to store application software installed on the cloud server 1 and various types of data, such as code of a copy deployment program, but also to temporarily store data that has been or will be output.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip for running the program code or processing stored in the memory 11 Data, such as executing copy deployment procedures, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip for running the program code or processing stored in the memory 11 Data, such as executing copy deployment procedures, etc.
  • the bus 13 may be a peripheral component interconnection (peripheral component interconnection, PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus, or the like.
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only a thick line is used in FIG. 2, but it does not mean that there is only one bus or one type of bus.
  • the server may further include a network interface, and the network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish between the cloud server 1 and other servers Communication connection.
  • the cloud server 1 may further include a user interface.
  • the user interface may include a display and an input unit such as a keyboard.
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, or the like.
  • the display may also be appropriately called a display screen or a display unit, for displaying information processed in the cloud server 1 and for displaying a visual user interface.
  • FIG. 2 only shows the cloud server 1 having components 11 to 13 and a copy deployment program. Those skilled in the art can understand that the structure shown in FIG. 2 does not constitute a limitation on the cloud server 1, and may include a comparison diagram. Fewer or more components, or some combination of components, or different component arrangements.
  • the memory 11 in the cloud server 1 stores multiple instructions to implement a copy deployment method, and the processor 12 can execute the multiple instructions to implement:
  • the copy is redeployed, wherein the current online copy number of the redeployed copy meets the fluctuation range of the copy number.
  • redeploying the copies includes:
  • the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
  • redeploying the copies includes:
  • the processor 12 may execute the multiple instructions to implement:
  • the processor 12 may execute the multiple instructions to implement:
  • the processor 12 may execute the plurality of instructions to implement:
  • the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the number of current online copies of the copy, if the first The node event affects the current online copy number of the copy, and the current online copy number of the copy is updated according to the first node event; further, it can also be determined whether the updated current online copy number satisfies the preset copy Number fluctuation range; if the updated current online copy number does not meet the preset copy number fluctuation range, redeploy the copy, wherein the redeployed copy of the current online copy number meets the copy number fluctuation range.
  • the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
  • FIG. 3 is a schematic diagram of functional modules of a copy deployment system disclosed in an embodiment of the present invention.
  • the replica deployment system described in FIG. 3 is used to perform some or all of the steps in the replica deployment method described in FIG. 1.
  • the unit referred to in the present invention refers to a series of computer program segments that can be executed by a processor and can complete a fixed function, and are stored in a memory. In this embodiment, the functions of each unit will be described in detail in subsequent embodiments.
  • the copy deployment system depicted in Figure 3 includes:
  • the monitoring unit 301 is configured to monitor the first node event of the target node where the copy is deployed;
  • the first determining unit 302 is configured to determine whether the first node event affects the current number of online copies of the copy
  • the updating unit 303 is configured to, if the first node event affects the current online copy number of the copy, update the current online copy number of the copy according to the first node event;
  • the second judging unit 304 is used to judge whether the updated current online copy quantity meets the preset copy quantity fluctuation range
  • the deployment unit 305 is configured to redeploy the copy if the updated current online copy number does not meet the preset fluctuation range of the copy number, wherein the current online copy number of the copy after redeployment satisfies the copy Quantity fluctuation range.
  • the method of redeploying the copy is specifically:
  • the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
  • the method of redeploying the copy is specifically:
  • replica deployment system described in FIG. 3 may further include:
  • a determining unit configured to determine a plurality of regions to be deployed before receiving the copy deployment task before the monitoring unit 301 monitors the first node event of the target node where the copy is deployed;
  • the determining unit is also used to determine a copy allocation ratio of a plurality of the areas according to the population of each of the areas;
  • a calculation unit configured to calculate the number of copies to be deployed in each of the regions according to the total number of copies and the copy allocation ratio
  • the determining unit is further configured to determine, for each of the areas, a target node where the area is currently online and whose storage space is greater than a preset storage space threshold;
  • the deployment unit 305 is further configured to deploy the copy on the target node in the area according to the number of copies.
  • replica deployment system described in FIG. 3 may further include:
  • An obtaining unit configured to obtain, before the monitoring unit 301 monitors the first node event of the target node where the copy is deployed, after receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
  • the calculation unit is further configured to calculate the number of copies to be deployed in each of the regions according to the total number of copies and the copy allocation ratio;
  • the determining unit is further configured to determine, for each of the regions, a node whose resource usage rate is lower than a preset resource usage rate threshold as a target node from a plurality of nodes currently online;
  • the deployment unit 305 is further configured to deploy the copy on the target node in the area according to the number of copies.
  • replica deployment system described in FIG. 3 may further include:
  • a sending unit configured to send a node event acquisition request to the target node
  • a receiving unit configured to receive a second node event returned by the target node in response to the node event acquisition request
  • a statistical unit configured to count the current number of online copies of the replica based on the second node event
  • the third judging unit is used to judge whether the updated current online copy quantity is consistent with the counted current online copy quantity
  • the second judgment unit 304 is specifically configured to judge whether the updated current online copy quantity meets the preset fluctuation range of the copy quantity if the updated current online copy quantity is consistent with the counted current online copy quantity.
  • the first node event of the target node where the replica is deployed can be monitored; further, it is determined whether the first node event affects the current number of online replicas of the replica, if the first A node event affects the number of current online copies of the replica, and according to the first node event, the current online copy number of the replica is updated; further, it can also be determined whether the updated current online copy number meets the preset Fluctuation range of the number of copies; if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploy the copy, wherein the number of current online copies of the redeployed copy after redeployment meets the number of copies Fluctuation range.
  • the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
  • the above integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may store a computer program, and when the computer program is executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, etc.
  • the computer-readable storage medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only Memory) ), Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals and software distribution media, etc.
  • the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in jurisdictions.
  • computer-readable storage media The medium does not include electrical carrier signals and telecommunication signals.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmit to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • wired such as coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless such as infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, Solid State Disk (SSD)), or the like.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be 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.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
  • sequence numbers of the above embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
  • the terms “including”, “comprising”, or any other variants thereof are intended to cover non-exclusive inclusions, so that a process, device, article, or method that includes a series of elements includes not only those elements, but also those that are not explicitly listed The other elements listed may also include elements inherent to such processes, devices, objects, or methods. Without more restrictions, the element defined by the sentence "include one" does not exclude that there are other identical elements in the process, device, article or method that includes the element.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed is a copy deployment method, comprising: monitoring a first node event of a target node having a deployed copy; determining whether the first node event affects a current online copy quantity of the copy; if so, updating the current online copy quantity of the copy according to the first node event; determining whether the updated current online copy quantity is within a pre-determined copy quantity fluctuation range; and if not, performing redeployment of the copy, wherein the current online copy quantity of the copy after the redeployment is within the copy quantity fluctuation range. Further disclosed are a cloud server and a storage medium. The present invention ensures accuracy of the current online copy quantity, and maintains the current online copy quantity of the copy to be within a specific range after redeployment, thereby facilitating user access.

Description

副本部署方法、云服务器及存储介质Copy deployment method, cloud server and storage medium
本申请要求于2018年12月26日提交中国专利局,申请号为201811603472.0、发明名称为“副本部署方法、云服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the Chinese Patent Office on December 26, 2018 with the application number 201811603472.0 and the invention titled "Copy Deployment Method, Cloud Server and Storage Media", the entire contents of which are incorporated herein by reference Applying.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种副本部署方法、云服务器及存储介质。The present invention relates to the field of communication technology, and in particular, to a copy deployment method, cloud server, and storage medium.
背景技术Background technique
云存储是在云计算概念上延伸和发展出来的一个新概念,通过集群应用、网格技术或分布式文件系统等功能,将网络中大量各种不同类型的存储设备通过应用软件集合起来协同工作,共同对外提供数据存储和业务访问功能的系统。Cloud storage is a new concept that extends and develops from the concept of cloud computing. Through cluster applications, grid technology, or distributed file system functions, a large number of different types of storage devices in the network are gathered together through application software to work together. , A system that provides data storage and business access functions together.
在云存储系统中存储了大量数据及其副本,且数据规模仍在迅速增加,这使得数据副本管理模块是云存储系统中必不可少的组件。目前,在云存储系统中,由于节点不稳定或者磁盘受损,导致副本丢失,这给用户的访问带来很大不便。A large amount of data and its copies are stored in the cloud storage system, and the data scale is still increasing rapidly, which makes the data copy management module an indispensable component in the cloud storage system. At present, in cloud storage systems, due to node instability or disk damage, the copy is lost, which brings great inconvenience to users' access.
发明内容Summary of the invention
本发明的主要目的在于提供一种副本部署方法、云服务器及存储介质,旨在解决由于节点不稳定或者磁盘受损,导致副本丢失,给用户访问带来不便的技术问题。The main purpose of the present invention is to provide a copy deployment method, a cloud server and a storage medium, aiming to solve the technical problem that the copy is lost due to node instability or the disk is damaged, resulting in inconvenience to user access.
为实现上述目的,本发明提供一种副本部署方法,包括:To achieve the above objective, the present invention provides a copy deployment method, including:
监听部署有副本的目标节点的第一节点事件;Monitor the first node event of the target node where the copy is deployed;
判断所述第一节点事件是否影响所述副本的当前在线副本数量;Determine whether the first node event affects the current number of online copies of the copy;
若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;If the first node event affects the current online copy number of the copy, update the current online copy number of the copy according to the first node event;
判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;Determine whether the updated current online copy quantity meets the preset copy quantity fluctuation range;
若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。If the updated current online copy number does not satisfy the preset fluctuation range of the copy number, the copy is redeployed, wherein the current online copy number of the redeployed copy meets the fluctuation range of the copy number.
作为一种可选的实施方式,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:As an optional implementation manner, if the updated current online copy number does not meet the preset copy number fluctuation range, redeploying the copy includes:
若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,对所述副本进行添加操作。If the updated current online copy quantity is less than the minimum value of the preset copy quantity fluctuation range, add the copy operation.
作为一种可选的实施方式,添加后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。As an optional implementation manner, the current number of online copies of the added copy is the maximum value of the fluctuation range of the number of copies.
作为一种可选的实施方式,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:As an optional implementation manner, if the updated current online copy number does not meet the preset copy number fluctuation range, redeploying the copy includes:
若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,对所述副本进行删除操作。If the updated current online copy number is greater than the maximum value of the preset copy number fluctuation range, delete the copy.
作为一种可选的实施方式,删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。As an optional implementation manner, the current number of online copies of the deleted copy is the maximum value of the fluctuation range of the number of copies.
作为一种可选的实施方式,所述监听部署有副本的目标节点的第一节点事件之前,所述方法还包括:As an optional implementation, before the monitoring of the first node event of the target node where the copy is deployed, the method further includes:
在接收到副本部署任务之后,确定待部署的多个区域;After receiving the copy deployment task, determine the multiple areas to be deployed;
根据每个所述区域的人口数量,确定多个所述区域的副本分配比例;According to the population of each of the areas, determine the distribution ratio of multiple copies of the areas;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
针对每个所述区域,确定所述区域当前在线且存储空间大于预设存储空间阈值的目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the areas, determine a target node where the area is currently online and whose storage space is greater than a preset storage space threshold, and deploy the copy on the target node of the area according to the number of copies.
作为一种可选的实施方式,所述监听部署有副本的目标节点的第一节点事件之前,所述方法还包括:As an optional implementation, before the monitoring of the first node event of the target node where the copy is deployed, the method further includes:
在接收到副本部署任务之后,获取所述副本部署任务携带的针对多个区域的副本分配比例;After receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副 本数量;Calculate the number of copies to be deployed in each of the areas based on the total number of copies and the distribution ratio of the copies;
针对每个所述区域,从当前在线的多个节点中,将资源使用率低于预设资源使用率阈值的节点确定为目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the regions, from multiple nodes currently online, determine the node whose resource usage rate is lower than the preset resource usage threshold as the target node, and deploy on the target node of the region according to the number of copies The copy.
作为一种可选的实施方式,所述根据所述节点事件,更新所述副本的当前在线副本数量之后,所述方法还包括:As an optional implementation manner, after updating the current online copy number of the copy according to the node event, the method further includes:
向所述目标节点发送节点事件获取请求;Send a node event acquisition request to the target node;
接收所述目标节点针对所述节点事件获取请求返回的第二节点事件;Receiving a second node event returned by the target node in response to the node event acquisition request;
根据所述第二节点事件,统计所述副本的当前在线副本数量;According to the second node event, count the current number of online copies of the copy;
判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致;Determine whether the updated number of current online copies is consistent with the counted current number of online copies;
若更新后的当前在线副本数量与统计的当前在线副本数量一致,执行所述的判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。If the updated current online copy number is consistent with the counted current online copy number, execute the judgment to determine whether the updated current online copy number meets the preset copy number fluctuation range.
为实现上述目的,本发明进一步提供一种云服务器,所述云服务器包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的副本部署程序,所述副本部署程序被所述处理器执行时实现所述的副本部署方法。To achieve the above object, the present invention further provides a cloud server, the cloud server includes a memory and a processor, the memory stores a copy deployment program that can run on the processor, and the copy deployment program is When the processor executes, the copy deployment method is implemented.
可选地,所述云服务器为组成内容分发网络或者区块链网络的节点。Optionally, the cloud server is a node that constitutes a content distribution network or a blockchain network.
为实现上述目的,本发明进一步提供一种副本部署系统,所述副本部署系统包括:To achieve the above object, the present invention further provides a copy deployment system, the copy deployment system includes:
监听单元,用于监听部署有副本的目标节点的第一节点事件;The monitoring unit is used to monitor the first node event of the target node where the copy is deployed;
第一判断单元,用于判断所述第一节点事件是否影响所述副本的当前在线副本数量;A first determining unit, configured to determine whether the first node event affects the current number of online copies of the copy;
更新单元,用于若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;An updating unit, configured to update the current online copy number of the replica according to the first node event if the first node event affects the current online copy number of the replica;
第二判断单元,用于判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;The second judgment unit is used to judge whether the updated current online copy quantity meets the preset fluctuation range of the copy quantity;
部署单元,用于若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。A deployment unit, configured to redeploy the copy if the updated current online copy number does not meet the preset fluctuation range of the copy number, wherein the current online copy number of the copy after redeployment satisfies the copy number Fluctuation range.
为实现上述目的,本发明进一步提供一种计算机可读存储介质,所述计算机可读存储介质上存储有副本部署程序,所述副本部署程序可被一个或者 多个处理器执行,以实现所述的副本部署方法。To achieve the above object, the present invention further provides a computer-readable storage medium on which a copy deployment program is stored, and the copy deployment program may be executed by one or more processors to implement the Copy deployment method.
为实现上述目的,本发明进一步提供一种计算机程序产品,包括计算机指令,当其在计算机上运行时,使得计算机可以执行所述的副本部署方法。In order to achieve the above object, the present invention further provides a computer program product, including computer instructions, which, when run on a computer, enable the computer to execute the copy deployment method.
本发明所实现的有益效果:The beneficial effects achieved by the present invention:
本发明中,可以监听部署有副本的目标节点的第一节点事件;进一步地,判断所述第一节点事件是否影响所述副本的当前在线副本数量,若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;更进一步地,还可以判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。可见,本发明中,云服务器可以主动监听目标节点上发生的第一节点事件,当所述第一节点事件影响所述副本的当前在线副本数量时,更新所述当前在线副本数量,这有利于确保实时更新当前在线副本数量,确保当前在线副本数量的准确性,之后,进一步判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,如果不满足,则对所述副本进行重新部署,从而有利于及时地根据当前在线副本数量的情况来对所述副本进行重新部署,使得重新部署后的所述副本的当前在线副本数量保持在一定范围,便于用户访问。In the present invention, the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the current number of online copies of the copy, if the first node event affects the copy The current number of online copies, according to the first node event, update the number of current online copies of the copy; further, it can also be determined whether the updated current online copy number meets the preset copy number fluctuation range; if updated After the current number of online copies does not meet the preset fluctuation range of the number of copies, the copy is redeployed, wherein the number of current online copies of the redeployed copy meets the fluctuation range of the number of copies. It can be seen that in the present invention, the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
附图说明BRIEF DESCRIPTION
图1为本发明一实施例公开的一种副本部署方法的流程示意图;1 is a schematic flowchart of a copy deployment method disclosed in an embodiment of the present invention;
图2为本发明一实施例公开的一种云服务器的内部结构示意图;2 is a schematic diagram of an internal structure of a cloud server disclosed in an embodiment of the present invention;
图3为本发明一实施例公开的一种副本部署系统的功能模块示意图。3 is a schematic diagram of functional modules of a copy deployment system disclosed in an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都 属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the protection scope of the present invention.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms “first” and “second” in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequential order. It should be understood that the data so used can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than what is illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, processes, methods, systems, products or devices that contain a series of steps or units are not necessarily limited to those clearly listed Those steps or units, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or equipment.
需要说明的是,在本发明中涉及“第一”“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。It should be noted that the descriptions related to “first” and “second” in the present invention are for descriptive purposes only, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features. Thus, features defined as "first" and "second" may include at least one of the features, either explicitly or implicitly. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary skilled in the art to achieve, when the combination of technical solutions contradicts each other or cannot be achieved, it should be considered that the combination of such technical solutions does not exist , Nor within the scope of protection required by the present invention.
本发明提供一种副本部署方法,可以确保当前在线副本数量的准确性,同时,使得重新部署后的所述副本的当前在线副本数量保持在一定范围,便于用户访问。The invention provides a copy deployment method, which can ensure the accuracy of the current online copy number, and at the same time, keep the current online copy number of the redeployed copy within a certain range, which is convenient for users to access.
其中,所述云服务器可以是指能对网络中其它设备(如客户端)提供服务的计算机系统。如果一个个人电脑能够对外提供文件传输协议(File Transfer Protocol,简称FTP)服务,也可以叫云服务器。从狭义范围上讲,云服务器专指某些高性能计算机,能通过网络,对外提供服务,其相对于普通的个人电脑来说,稳定性、安全性、性能等方面都要求更高,因此在CPU、芯片组、内存、磁盘系统、网络等硬件和普通的个人电脑有所不同。所述云服务器用于向客户端提供服务(例如数据传输服务)。所述云服务器可以包括但不限于PC(Personal Computer,个人电脑)、智能手机、平板电脑、掌上电脑、便携计算机、智能路由器、网络存储设备等。The cloud server may refer to a computer system that can provide services to other devices (such as clients) in the network. If a personal computer can provide a file transfer protocol (File Transfer Protocol, FTP for short) service, it can also be called a cloud server. In a narrow sense, cloud servers refer to certain high-performance computers that can provide services externally through the network. Compared with ordinary personal computers, they require higher stability, security, and performance. Therefore, CPU, chipset, memory, disk system, network and other hardware are different from ordinary personal computers. The cloud server is used to provide services (such as data transmission services) to clients. The cloud server may include, but is not limited to, a PC (Personal Computer), a smart phone, a tablet computer, a palmtop computer, a portable computer, an intelligent router, a network storage device, and the like.
其中,所述目标节点可以为各种客户端,其中,客户端是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit, ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。所述客户端包括但不限于任何一种可与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备等。Wherein, the target node may be various clients, wherein the client is a device that can automatically perform numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes but is not limited to microprocessing Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc. The client includes but is not limited to any electronic product that can interact with the user through keyboard, mouse, remote control, touchpad or voice control device, such as personal computer, tablet computer, smart phone, personal digital Assistant (Personal Digital Assistant, PDA), interactive network TV (Internet Protocol, IPTV), smart wearable devices, etc.
参照图1,图1为本发明一实施例公开的一种副本部署方法的流程示意图。如图1所示,该方法包括:Referring to FIG. 1, FIG. 1 is a schematic flowchart of a copy deployment method disclosed in an embodiment of the present invention. As shown in Figure 1, the method includes:
S101、云服务器监听部署有副本的目标节点的第一节点事件。S101. The cloud server monitors the first node event of the target node where the copy is deployed.
通常,为了提高单个数据的备份份数,提高冗余度以实现数据的可靠性,需要将原始数据进行备份。Generally, in order to increase the number of backup copies of a single data and increase the redundancy to achieve data reliability, the original data needs to be backed up.
本发明实施例中,当云服务器接收到副本部署任务之后,云服务器需要将正本复制成多份副本,进而将多份副本部署至目标节点中,其中,正本即原始数据,副本即通过原始数据复制的多份副本数据。In the embodiment of the present invention, after the cloud server receives the copy deployment task, the cloud server needs to copy the original into multiple copies, and then deploy the multiple copies to the target node, where the original is the original data, and the copy passes the original data Copies of multiple copies of data.
其中,云服务器可以管理节点上下线信息,触发节点上下线事件,管理节点-副本关系,触发节点增加副本事件和触发节点删除副本事件,接收副本部署任务并下发至部署节点。Among them, the cloud server can manage node online and offline information, trigger node online and offline events, manage node-replication relationships, trigger node add replica events and trigger node delete replica events, receive replica deployment tasks and deliver them to deployment nodes.
本发明实施例中,由于目标节点存在不稳定的因素,在目标节点下线或者磁盘失效时,可能会导致副本丢失,给用户访问副本带来不便。当目标节点上部署有副本后,为了避免副本大概率地丢失,同时,维持在线副本数量在一定的范围,确保用户能够随时访问副本,云服务器需要监听部署有副本的目标节点的第一节点事件,其中,所述第一节点事件可以包括但不限于节点上下线事件、节点添加副本事件、节点删除副本事件、副本无效事件以及节点移动副本事件。In the embodiment of the present invention, due to the unstable factors of the target node, when the target node goes offline or the disk fails, the copy may be lost, which may cause inconvenience for the user to access the copy. When a copy is deployed on the target node, in order to avoid a large probability of loss of the copy, and at the same time, maintain the number of online copies within a certain range to ensure that users can access the copy at any time, the cloud server needs to monitor the first node event of the target node where the copy is deployed Wherein, the first node event may include but is not limited to a node going online event, a node adding copy event, a node deleting copy event, a copy invalid event, and a node moving copy event.
作为一种可选的实施方式,步骤S101之前,所述方法还包括:As an optional implementation, before step S101, the method further includes:
在接收到副本部署任务之后,确定待部署的多个区域;After receiving the copy deployment task, determine the multiple areas to be deployed;
根据每个所述区域的人口数量,确定多个所述区域的副本分配比例;According to the population of each of the areas, determine the distribution ratio of multiple copies of the areas;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
针对每个所述区域,确定所述区域当前在线且存储空间大于预设存储空间阈值的目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the areas, determine a target node where the area is currently online and whose storage space is greater than a preset storage space threshold, and deploy the copy on the target node of the area according to the number of copies.
在该可选的实施方式中,云服务器在接收到副本部署任务后,可以获取所述副本部署任务携带的待部署的多个区域以及副本总数量,进一步地,可以获取每个所述区域的人口数量,根据每个所述区域的人口数量,计算多个所述区域的人口比例,进而将多个所述区域的人口比例确定为多个所述区域的副本分配比例;更进一步地,可以根据副本总数量以及所述副本分配比例,计算出每个所述区域待部署的副本数量;最后,针对每个所述区域,从所述区域包括的多个节点中,获取当前在线的节点,再从当前在线的节点中挑选出存储空间大于预设存储空间阈值的节点作为目标节点,之后,即可依据所述副本数量在所述区域的目标节点上部署所述副本。每个所述区域都类似操作,直至将所有的副本部署都部署至所有的目标节点上。In this optional embodiment, after receiving the copy deployment task, the cloud server may obtain multiple regions to be deployed carried by the copy deployment task and the total number of copies, and further, may obtain the The number of population, according to the number of population of each of the areas, calculate the proportion of the population of the plurality of areas, and then determine the proportion of the population of the plurality of areas as the distribution ratio of the copies of the plurality of areas; further, Calculate the number of replicas to be deployed in each of the regions according to the total number of replicas and the replica allocation ratio; finally, for each of the regions, obtain the currently online nodes from the multiple nodes included in the region, Then, a node whose storage space is greater than a preset storage space threshold is selected from the currently online nodes as the target node, and then the copy can be deployed on the target node in the area according to the number of copies. Each described area operates similarly until all replicas are deployed to all target nodes.
在该可选的实施例中,由于人口多的区域,通常对数据访问的频率更高,根据区域的人口比例来分配副本,可以尽可能得满足当地用户对数据访问的要求,使得数据访问的速度更快,用户体验更加。In this alternative embodiment, due to areas with large populations, the frequency of data access is generally higher. Assigning copies according to the proportion of the population in the area can satisfy the requirements of local users for data access as much as possible, making data access The speed is faster and the user experience is more.
作为一种可选的实施方式,步骤S101之前,所述方法还包括:As an optional implementation, before step S101, the method further includes:
在接收到副本部署任务之后,获取所述副本部署任务携带的针对多个区域的副本分配比例;After receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
针对每个所述区域,从当前在线的多个节点中,将资源使用率低于预设资源使用率阈值的节点确定为目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the regions, from multiple nodes currently online, determine the node whose resource usage rate is lower than the preset resource usage threshold as the target node, and deploy on the target node of the region according to the number of copies The copy.
在该可选的实施方式中,所述副本部署任务中携带有针对多个区域的副本分配比例以及副本总数量,云服务器可以直接根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量,进一步地,针对每个所述区域,从所述区域包括的多个节点中,获取当前在线的节点,再从当前在线的节点中挑选出资源使用率低于预设资源使用率阈值的节点确定为目标节点,之后,即可依据所述副本数量在所述区域的目标节点上部署所述副本。 每个所述区域都类似操作,直至将所有的副本部署都部署至所有的目标节点上。In this optional embodiment, the copy deployment task carries the copy allocation ratio and the total number of copies for multiple regions, and the cloud server may directly calculate each of the copies according to the total number of copies and the copy allocation ratio. The number of replicas to be deployed in the area. Further, for each of the areas, the currently online nodes are obtained from the multiple nodes included in the area, and then the resource utilization rate selected from the currently online nodes is lower than the preset The node with the resource usage threshold is determined as the target node, and then the copy can be deployed on the target node in the area according to the number of copies. Each described area operates similarly until all replicas are deployed to all target nodes.
通过这种方式挑选的目标节点都是负载较轻的节点,资源使用率较低,能够有多余的资源来部署副本,同时,也使得后续数据访问的速度较快。The target nodes selected in this way are all nodes with light load, low resource usage, and can have extra resources to deploy copies. At the same time, it also makes subsequent data access faster.
S102、云服务器判断所述第一节点事件是否影响所述副本的当前在线副本数量,若是,执行步骤S103,若否,结束本流程。S102. The cloud server determines whether the first node event affects the current number of online copies of the copy. If so, step S103 is executed. If not, the process ends.
本发明实施例中,上述列举的所述第一节点事件,有的会影响所述副本的当前在线副本数量,比如节点添加副本事件、节点删除副本事件、副本无效事件,有的不会影响所述副本的当前在线副本数量,比如节点移动副本事件。其中,当前在线副本数量即当前在线的目标节点上部署的能够供用户访问的副本的数量。In the embodiment of the present invention, some of the first node events listed above may affect the current number of online copies of the replicas, such as a node add replica event, a node delete replica event, and a copy invalid event, and some will not affect all The current online copy number of the copy, such as the node move copy event. The current number of online copies refers to the number of copies that can be accessed by users deployed on the target node currently online.
S103、云服务器根据所述第一节点事件,更新所述副本的当前在线副本数量。S103. The cloud server updates the current number of online copies of the copy according to the first node event.
本发明实施例中,如果云服务器判断所述第一节点事件影响所述副本的当前在线副本数量,表明所述副本的当前在线副本数量发生变更,云服务器需要根据所述第一节点事件,确定所述第一节点事件影响的所述副本的数量,进而来更新所述副本的当前在线副本数量。比如:所述第一节点事件为节点删除副本事件,所述节点删除副本事件删除的副本数量为A份,当前存储的副本数量为B份,则云服务器需要更新所述副本的当前在线副本数量,即将当前在线副本数量从B份变更为(B-A)份。In the embodiment of the present invention, if the cloud server determines that the first node event affects the current online copy number of the copy, it indicates that the current online copy number of the copy has changed, and the cloud server needs to determine according to the first node event The number of the copies affected by the first node event, and in turn, the current online copy number of the copies is updated. For example: the first node event is a node delete copy event, the number of copies deleted by the node delete copy event is A, and the number of currently stored copies is B, then the cloud server needs to update the current number of online copies of the copy , The current number of online copies will be changed from B copies to (BA) copies.
S104、云服务器判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,若否,执行步骤S105,若是,结束本流程。S104. The cloud server determines whether the updated current number of online copies meets the preset fluctuation range of the number of copies. If not, step S105 is executed, and if so, the process ends.
通常,如果副本数量过多会造成节点存储资源和网络带宽的浪费,加重系统和网络负担;如果副本数量过少,则数据的可用性和访问速度得不到保证,容易造成热点问题。为了保障系统更高的服务可靠性,需要适当控制副本数量。Generally, if the number of replicas is too large, it will cause the waste of node storage resources and network bandwidth, and increase the burden on the system and the network; if the number of replicas is too small, the availability and access speed of data cannot be guaranteed, which is likely to cause hot spots. In order to ensure higher service reliability of the system, the number of copies needs to be appropriately controlled.
由于节点的不稳定性或者网络情况,可能会导致节点上报信息丢失或者延时,这会频繁地触发大量删片/补片操作,导致副本数量频繁波动。这种情况,不仅使得后端面临事件处理压力大的问题,而且,频繁的删片/补片操作导致资源消耗在大量无用功操作上。其中,删片/补片操作即删除副本/添加副 本的操作。Due to the instability of the node or the network situation, the information reported by the node may be lost or delayed, which frequently triggers a large number of deletion/patch operations, resulting in frequent fluctuations in the number of copies. This situation not only makes the backend face the problem of high pressure for event processing, but also, frequent delete/patch operations cause resources to be consumed in a large number of wasteful operations. Among them, the delete/patch operation is the operation of deleting a copy/adding a copy.
本发明实施例中,可以预先设定一个副本数量波动范围,其中,该副本数量波动范围是预先根据在线的目标节点的概率来得到的,该副本数量波动范围包括最大值和最小值,该最大值为系统允许的副本的最大数量,该最小值为系统允许的副本的最小数量。无论目标节点发生什么时间,如果当前在线副本数量在该副本数量波动范围内,就不会触发频繁的删片/补片操作,同时,可以减轻后端处理事件的压力,也不会影响到副本的访问,确保系统的正常运行。In the embodiment of the present invention, a copy quantity fluctuation range may be preset, wherein the copy quantity fluctuation range is obtained in advance according to the probability of an online target node, and the copy quantity fluctuation range includes a maximum value and a minimum value, the maximum The value is the maximum number of copies allowed by the system, and the minimum value is the minimum number of copies allowed by the system. No matter what time the target node occurs, if the current number of online copies is within the fluctuation range of the number of copies, frequent delete/patch operations will not be triggered, and at the same time, the pressure of back-end processing events will be reduced, and the copies will not be affected. Access to ensure the normal operation of the system.
本发明实施例中,在更新当前在线副本数量后,云服务器可以判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,如果更新后的当前在线副本数量不满足预设的副本数量波动范围,表明当前在线副本数量过多或者过少,已经影响到整个系统的正常运行了。In the embodiment of the present invention, after updating the current online copy quantity, the cloud server may determine whether the updated current online copy quantity meets the preset copy quantity fluctuation range, if the updated current online copy quantity does not satisfy the preset copy quantity The fluctuation range indicates that there are too many or too few online copies, which has affected the normal operation of the entire system.
S105、云服务器对所述副本进行重新部署。S105. The cloud server redeploys the copy.
本发明实施例中,若更新后的当前在线副本数量不满足预设的副本数量波动范围,云服务器需要对所述副本进行重新部署。其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。In the embodiment of the present invention, if the updated current online copy quantity does not meet the preset copy quantity fluctuation range, the cloud server needs to redeploy the copy. Wherein, the current number of online copies of the redeployed copy meets the fluctuation range of the number of copies.
可选的,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:Optionally, if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploying the copies includes:
若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,对所述副本进行添加操作,其中,添加后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。If the updated current online copy number is less than the minimum value of the preset fluctuation range of the copy number, the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
在该可选的实施方式中,若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,表明当前的副本的数量过少,已经影响到副本的访问了,因此,需要对所述副本进行添加操作,即添加一定数量的副本,使得添加后的副本的数量在所述副本数量波动范围内。In this optional embodiment, if the updated current number of online copies is less than the minimum value of the preset copy number fluctuation range, it means that the current number of copies is too small, which has affected the access of the copies. The copy is added, that is, a certain number of copies are added, so that the number of added copies is within the fluctuation range of the number of copies.
优选的,可以直接添加副本至添加后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。如果添加的副本的数量少了,很可能在短时间内又会出现副本数量的波动,而将副本添加至所述副本数量波动范围的最大值,这有利于在添加副本后,在较短的时间内,不会导致所述副本的当前在线副本数量低于所述副本数量波动范围的最小值,能够较长时间的维持 所述副本的当前在线副本数量在所述副本数量波动范围内。Preferably, the number of copies that can be directly added to the copy after being added is the maximum value of the fluctuation range of the number of copies. If the number of added copies is small, it is likely that the number of copies will fluctuate within a short period of time, and adding the copy to the maximum value of the number of copies of the fluctuation range, which is beneficial after adding copies, in a shorter During the time, it will not cause the current online copy quantity of the copy to be lower than the minimum value of the fluctuation range of the copy quantity, and it is possible to maintain the current online copy quantity of the copy within the fluctuation range of the copy quantity for a long time.
可选的,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:Optionally, if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploying the copies includes:
若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,对所述副本进行删除操作,其中,删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。If the updated current online copy quantity is greater than the maximum value of the preset copy quantity fluctuation range, delete the copy operation, wherein the current online copy quantity of the deleted copy is the largest copy quantity fluctuation range value.
在该可选的实施方式中,若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,表明当前的副本的数量过多,为了避免资源浪费,需要对所述副本进行删除操作,即删除一定数量的副本,使得删除后的副本的数量在所述副本数量波动范围内。In this optional embodiment, if the updated number of current online copies is greater than the maximum value of the preset copy number fluctuation range, it indicates that the current number of copies is too large. In order to avoid waste of resources, the copies need to be deleted The operation is to delete a certain number of copies so that the number of deleted copies is within the fluctuation range of the number of copies.
优选的,可以直接删除副本至删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。如果删除的副本的数量多了,很可能在短时间内又会出现副本数量的波动,而将副本删除至所述副本数量波动范围的最大值,这有利于在删除副本后,在较短的时间内,不会导致所述副本的当前在线副本数量低于所述副本数量波动范围的最小值,能够较长时间的维持所述副本的当前在线副本数量在所述副本数量波动范围内。Preferably, the copy can be directly deleted to the current online copy number of the deleted copy is the maximum value of the fluctuation range of the copy number. If the number of deleted copies increases, it is likely that there will be fluctuations in the number of copies within a short period of time, and deleting the copies to the maximum value of the fluctuation range of the number of copies will facilitate the deletion of copies after a short period of time. During the time, it will not cause the current online copy quantity of the copy to be lower than the minimum value of the fluctuation range of the copy quantity, and it is possible to maintain the current online copy quantity of the copy within the fluctuation range of the copy quantity for a long time.
作为一种可选的实施方式,步骤S103之后,所述方法还包括:As an optional implementation manner, after step S103, the method further includes:
向所述目标节点发送节点事件获取请求;Send a node event acquisition request to the target node;
接收所述目标节点针对所述节点事件获取请求返回的第二节点事件;Receiving a second node event returned by the target node in response to the node event acquisition request;
根据所述第二节点事件,统计所述副本的当前在线副本数量;According to the second node event, count the current number of online copies of the copy;
判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致;Determine whether the updated number of current online copies is consistent with the counted current number of online copies;
若更新后的当前在线副本数量与统计的当前在线副本数量一致,执行所述的判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。If the updated current online copy number is consistent with the counted current online copy number, execute the judgment to determine whether the updated current online copy number meets the preset copy number fluctuation range.
在该可选的实施方式中,由于网络情况可能会导致事件的丢失,缓存的所述副本的当前在线副本数量可能会存在偏差,而这种偏差会导致后续删片/补片操作的失误,至此,需要控制偏差的大小,进行偏差校准。In this optional embodiment, due to network conditions that may result in the loss of events, there may be deviations in the current number of online copies of the cached copies, and such deviations may cause errors in subsequent deletion/patching operations, At this point, it is necessary to control the magnitude of the deviation and perform deviation calibration.
具体的,在更新所述副本的当前在线副本数量之后,可以主动向所述目标节点发送节点事件获取请求,所述目标节点接收到所述节点事件获取请求之后,可以获取预设周期(比如一天)内发生的所有第二节点事件,并将所有第二节点事件返回给所述云服务器,云服务器接收到所述目标节点针对所 述节点事件获取请求返回的第二节点事件之后,就可以根据所述第二节点事件,统计所述副本的当前在线副本数量;进一步地,可以判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致,如果更新后的当前在线副本数量与统计的当前在线副本数量一致,表明当前更新后的当前在线副本数量的偏差较小,数据比较真实可靠,则可以进一步地判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。Specifically, after updating the current number of online copies of the replica, a node event acquisition request may be actively sent to the target node, and after receiving the node event acquisition request, the target node may acquire a preset period (such as one day ), and return all second node events to the cloud server. After receiving the second node event returned by the target node for the node event acquisition request, the cloud server can The second node event counts the current number of online copies of the copy; further, it can be determined whether the updated current online copy number is consistent with the counted current online copy number, if the updated current online copy number is The consistent number of current online copies indicates that the deviation of the number of current online copies after the update is relatively small, and the data is more reliable. You can further determine whether the updated number of online copies meets the preset fluctuation range of the number of copies.
在图1所描述的方法流程中,可以监听部署有副本的目标节点的第一节点事件;进一步地,判断所述第一节点事件是否影响所述副本的当前在线副本数量,若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;更进一步地,还可以判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。可见,本发明中,云服务器可以主动监听目标节点上发生的第一节点事件,当所述第一节点事件影响所述副本的当前在线副本数量时,更新所述当前在线副本数量,这有利于确保实时更新当前在线副本数量,确保当前在线副本数量的准确性,之后,进一步判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,如果不满足,则对所述副本进行重新部署,从而有利于及时地根据当前在线副本数量的情况来对所述副本进行重新部署,使得重新部署后的所述副本的当前在线副本数量保持在一定范围,便于用户访问。In the method flow described in FIG. 1, the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the number of current online copies of the copy, if the first The node event affects the current online copy number of the replica, and the current online copy number of the replica is updated according to the first node event; further, it can also be determined whether the updated current online copy quantity meets the preset copy Number fluctuation range; if the updated current online copy number does not meet the preset copy number fluctuation range, redeploy the copy, wherein the redeployed copy of the current online copy number meets the copy number fluctuation range. It can be seen that in the present invention, the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
参照图2,图2为本发明一实施例公开的一种云服务器的内部结构示意图,如图2所示,所述云服务器1可以包括存储器11、处理器12和总线13。2, FIG. 2 is a schematic diagram of an internal structure of a cloud server disclosed in an embodiment of the present invention. As shown in FIG. 2, the cloud server 1 may include a memory 11, a processor 12, and a bus 13.
在本实施例中,所述云服务器1可以是指能对网络中其它设备(如客户端)提供服务的计算机系统。如果一个个人电脑能够对外提供文件传输协议(File Transfer Protocol,简称FTP)服务,也可以叫云服务器。从狭义范围上讲,云服务器专指某些高性能计算机,能通过网络,对外提供服务,其相对于普通的个人电脑来说,稳定性、安全性、性能等方面都要求更高,因此在CPU、芯片组、内存、磁盘系统、网络等硬件和普通的个人电脑有所不同。 所述服务器用于向客户端提供服务(例如数据传输服务)。所述云服务器可以包括但不限于PC(Personal Computer,个人电脑)、智能手机、平板电脑、掌上电脑、便携计算机、智能路由器、网络存储设备等。In this embodiment, the cloud server 1 may refer to a computer system that can provide services to other devices (such as clients) in the network. If a personal computer can provide a file transfer protocol (File Transfer Protocol, FTP for short) service, it can also be called a cloud server. In a narrow sense, cloud servers refer to certain high-performance computers that can provide services externally through the network. Compared with ordinary personal computers, they require higher stability, security, and performance. Therefore, CPU, chipset, memory, disk system, network and other hardware are different from ordinary personal computers. The server is used to provide services (such as data transmission services) to clients. The cloud server may include, but is not limited to, a PC (Personal Computer), a smart phone, a tablet computer, a palmtop computer, a portable computer, an intelligent router, a network storage device, and the like.
该云服务器1可以是组成内容分发网络或者区块链网络的节点。The cloud server 1 may be a node constituting a content distribution network or a blockchain network.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是云服务器1的内部存储单元,例如该云服务器1的硬盘。存储器11在另一些实施例中也可以是云服务器1的外部存储设备,例如云服务器1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括云服务器1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于云服务器1的应用软件及各类数据,例如副本部署程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, and the like. The storage 11 may be an internal storage unit of the cloud server 1 in some embodiments, such as a hard disk of the cloud server 1. In other embodiments, the storage 11 may also be an external storage device of the cloud server 1, such as a plug-in hard disk equipped on the cloud server 1, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc. Further, the memory 11 may also include both the internal storage unit of the cloud server 1 and the external storage device. The memory 11 can be used not only to store application software installed on the cloud server 1 and various types of data, such as code of a copy deployment program, but also to temporarily store data that has been or will be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行副本部署程序等。In some embodiments, the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip for running the program code or processing stored in the memory 11 Data, such as executing copy deployment procedures, etc.
该总线13可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。进一步地,服务器还可以包括网络接口,网络接口可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该云服务器1与其他服务器之间建立通信连接。The bus 13 may be a peripheral component interconnection (peripheral component interconnection, PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus, or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only a thick line is used in FIG. 2, but it does not mean that there is only one bus or one type of bus. Further, the server may further include a network interface, and the network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish between the cloud server 1 and other servers Communication connection.
可选地,该云服务器1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在云服务器1中处理的信息以及用于显示可视化的用 户界面。Optionally, the cloud server 1 may further include a user interface. The user interface may include a display and an input unit such as a keyboard. The optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, or the like. Among them, the display may also be appropriately called a display screen or a display unit, for displaying information processed in the cloud server 1 and for displaying a visual user interface.
图2仅示出了具有组件11至13以及副本部署程序的云服务器1,本领域技术人员可以理解的是,图2示出的结构并不构成对云服务器1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 2 only shows the cloud server 1 having components 11 to 13 and a copy deployment program. Those skilled in the art can understand that the structure shown in FIG. 2 does not constitute a limitation on the cloud server 1, and may include a comparison diagram. Fewer or more components, or some combination of components, or different component arrangements.
结合图1,所述云服务器1中的所述存储器11存储多个指令以实现一种副本部署方法,所述处理器12可执行所述多个指令从而实现:With reference to FIG. 1, the memory 11 in the cloud server 1 stores multiple instructions to implement a copy deployment method, and the processor 12 can execute the multiple instructions to implement:
监听部署有副本的目标节点的第一节点事件;Monitor the first node event of the target node where the copy is deployed;
判断所述第一节点事件是否影响所述副本的当前在线副本数量;Determine whether the first node event affects the current number of online copies of the copy;
若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;If the first node event affects the current online copy number of the copy, update the current online copy number of the copy according to the first node event;
判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;Determine whether the updated current online copy quantity meets the preset copy quantity fluctuation range;
若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。If the updated current online copy number does not satisfy the preset fluctuation range of the copy number, the copy is redeployed, wherein the current online copy number of the redeployed copy meets the fluctuation range of the copy number.
在一种可选的实施方式中,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:In an optional implementation manner, if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploying the copies includes:
若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,对所述副本进行添加操作,其中,添加后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。If the updated current online copy number is less than the minimum value of the preset fluctuation range of the copy number, the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
在一种可选的实施方式中,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:In an optional implementation manner, if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploying the copies includes:
若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,对所述副本进行删除操作,其中,删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。If the updated current online copy quantity is greater than the maximum value of the preset copy quantity fluctuation range, delete the copy operation, wherein the current online copy quantity of the deleted copy is the largest copy quantity fluctuation range value.
在一种可选的实施方式中,所述监听部署有副本的目标节点的第一节点事件之前,所述处理器12可执行所述多个指令从而实现:In an optional implementation manner, before monitoring the first node event of the target node where the copy is deployed, the processor 12 may execute the multiple instructions to implement:
在接收到副本部署任务之后,确定待部署的多个区域;After receiving the copy deployment task, determine the multiple areas to be deployed;
根据每个所述区域的人口数量,确定多个所述区域的副本分配比例;According to the population of each of the areas, determine the distribution ratio of multiple copies of the areas;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副 本数量;Calculate the number of copies to be deployed in each of the areas based on the total number of copies and the distribution ratio of the copies;
针对每个所述区域,确定所述区域当前在线且存储空间大于预设存储空间阈值的目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the areas, determine a target node where the area is currently online and whose storage space is greater than a preset storage space threshold, and deploy the copy on the target node of the area according to the number of copies.
在一种可选的实施方式中,所述监听部署有副本的目标节点的第一节点事件之前,所述处理器12可执行所述多个指令从而实现:In an optional implementation manner, before monitoring the first node event of the target node where the copy is deployed, the processor 12 may execute the multiple instructions to implement:
在接收到副本部署任务之后,获取所述副本部署任务携带的针对多个区域的副本分配比例;After receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
针对每个所述区域,从当前在线的多个节点中,将资源使用率低于预设资源使用率阈值的节点确定为目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the regions, from multiple nodes currently online, determine the node whose resource usage rate is lower than the preset resource usage threshold as the target node, and deploy on the target node of the region according to the number of copies The copy.
在一种可选的实施方式中,所述根据所述节点事件,更新所述副本的当前在线副本数量之后,所述处理器12可执行所述多个指令从而实现:In an optional implementation manner, after updating the current online copy number of the copy according to the node event, the processor 12 may execute the plurality of instructions to implement:
向所述目标节点发送节点事件获取请求;Send a node event acquisition request to the target node;
接收所述目标节点针对所述节点事件获取请求返回的第二节点事件;Receiving a second node event returned by the target node in response to the node event acquisition request;
根据所述第二节点事件,统计所述副本的当前在线副本数量;According to the second node event, count the current number of online copies of the copy;
判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致;Determine whether the updated number of current online copies is consistent with the counted current number of online copies;
若更新后的当前在线副本数量与统计的当前在线副本数量一致,执行所述的判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。If the updated current online copy number is consistent with the counted current online copy number, execute the judgment to determine whether the updated current online copy number meets the preset copy number fluctuation range.
具体地,所述处理器12对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for a specific implementation method of the foregoing instruction by the processor 12, reference may be made to the description of related steps in the embodiment corresponding to FIG. 1, and details are not described herein again.
在图2所描述的云服务器中,可以监听部署有副本的目标节点的第一节点事件;进一步地,判断所述第一节点事件是否影响所述副本的当前在线副本数量,若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;更进一步地,还可以判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量 波动范围。可见,本发明中,云服务器可以主动监听目标节点上发生的第一节点事件,当所述第一节点事件影响所述副本的当前在线副本数量时,更新所述当前在线副本数量,这有利于确保实时更新当前在线副本数量,确保当前在线副本数量的准确性,之后,进一步判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,如果不满足,则对所述副本进行重新部署,从而有利于及时地根据当前在线副本数量的情况来对所述副本进行重新部署,使得重新部署后的所述副本的当前在线副本数量保持在一定范围,便于用户访问。In the cloud server described in FIG. 2, the first node event of the target node where the copy is deployed can be monitored; further, it is determined whether the first node event affects the number of current online copies of the copy, if the first The node event affects the current online copy number of the copy, and the current online copy number of the copy is updated according to the first node event; further, it can also be determined whether the updated current online copy number satisfies the preset copy Number fluctuation range; if the updated current online copy number does not meet the preset copy number fluctuation range, redeploy the copy, wherein the redeployed copy of the current online copy number meets the copy number fluctuation range. It can be seen that in the present invention, the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
参照图3,图3为本发明一实施例公开的一种副本部署系统的功能模块示意图。其中,图3描述的副本部署系统用于执行图1所描述的副本部署方法中的部分或全部步骤,具体可以参考图1中的相关描述,在此不再赘述。本发明所称的单元是指一种能够被处理器所执行并且能够完成固定功能的一系列计算机程序段,其存储在存储器中。在本实施例中,关于各单元的功能将在后续的实施例中详述。Referring to FIG. 3, FIG. 3 is a schematic diagram of functional modules of a copy deployment system disclosed in an embodiment of the present invention. The replica deployment system described in FIG. 3 is used to perform some or all of the steps in the replica deployment method described in FIG. 1. For details, reference may be made to the related description in FIG. 1, and details are not described herein again. The unit referred to in the present invention refers to a series of computer program segments that can be executed by a processor and can complete a fixed function, and are stored in a memory. In this embodiment, the functions of each unit will be described in detail in subsequent embodiments.
图3描述的副本部署系统包括:The copy deployment system depicted in Figure 3 includes:
监听单元301,用于监听部署有副本的目标节点的第一节点事件;The monitoring unit 301 is configured to monitor the first node event of the target node where the copy is deployed;
第一判断单元302,用于判断所述第一节点事件是否影响所述副本的当前在线副本数量;The first determining unit 302 is configured to determine whether the first node event affects the current number of online copies of the copy;
更新单元303,用于若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;The updating unit 303 is configured to, if the first node event affects the current online copy number of the copy, update the current online copy number of the copy according to the first node event;
第二判断单元304,用于判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;The second judging unit 304 is used to judge whether the updated current online copy quantity meets the preset copy quantity fluctuation range;
部署单元305,用于若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。The deployment unit 305 is configured to redeploy the copy if the updated current online copy number does not meet the preset fluctuation range of the copy number, wherein the current online copy number of the copy after redeployment satisfies the copy Quantity fluctuation range.
可选的,所述部署单元305若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署的方式具体为:Optionally, if the updated current online copy number of the deployment unit 305 does not meet the preset fluctuation range of the copy number, the method of redeploying the copy is specifically:
若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,对所述副本进行添加操作,其中,添加后的所述副本的当前在线副本数量为 所述副本数量波动范围的最大值。If the updated current online copy number is less than the minimum value of the preset fluctuation range of the copy number, the copy is added, wherein the current online copy number of the added copy is the maximum fluctuation range of the copy number value.
可选的,所述部署单元305若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署的方式具体为:Optionally, if the updated current online copy number of the deployment unit 305 does not meet the preset fluctuation range of the copy number, the method of redeploying the copy is specifically:
若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,对所述副本进行删除操作,其中,删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。If the updated current online copy quantity is greater than the maximum value of the preset copy quantity fluctuation range, delete the copy operation, wherein the current online copy quantity of the deleted copy is the largest copy quantity fluctuation range value.
可选的,图3描述的副本部署系统还可以包括:Optionally, the replica deployment system described in FIG. 3 may further include:
确定单元,用于在所述监听单元301监听部署有副本的目标节点的第一节点事件之前,在接收到副本部署任务之后,确定待部署的多个区域;A determining unit, configured to determine a plurality of regions to be deployed before receiving the copy deployment task before the monitoring unit 301 monitors the first node event of the target node where the copy is deployed;
所述确定单元,还用于根据每个所述区域的人口数量,确定多个所述区域的副本分配比例;The determining unit is also used to determine a copy allocation ratio of a plurality of the areas according to the population of each of the areas;
计算单元,用于根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;A calculation unit, configured to calculate the number of copies to be deployed in each of the regions according to the total number of copies and the copy allocation ratio;
所述确定单元,还用于针对每个所述区域,确定所述区域当前在线且存储空间大于预设存储空间阈值的目标节点;The determining unit is further configured to determine, for each of the areas, a target node where the area is currently online and whose storage space is greater than a preset storage space threshold;
所述部署单元305,还用于依据所述副本数量在所述区域的目标节点上部署所述副本。The deployment unit 305 is further configured to deploy the copy on the target node in the area according to the number of copies.
可选的,图3描述的副本部署系统还可以包括:Optionally, the replica deployment system described in FIG. 3 may further include:
获取单元,用于在所述监听单元301监听部署有副本的目标节点的第一节点事件之前,在接收到副本部署任务之后,获取所述副本部署任务携带的针对多个区域的副本分配比例;An obtaining unit, configured to obtain, before the monitoring unit 301 monitors the first node event of the target node where the copy is deployed, after receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
所述计算单元,还用于根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;The calculation unit is further configured to calculate the number of copies to be deployed in each of the regions according to the total number of copies and the copy allocation ratio;
所述确定单元,还用于针对每个所述区域,从当前在线的多个节点中,将资源使用率低于预设资源使用率阈值的节点确定为目标节点;The determining unit is further configured to determine, for each of the regions, a node whose resource usage rate is lower than a preset resource usage rate threshold as a target node from a plurality of nodes currently online;
所述部署单元305,还用于依据所述副本数量在所述区域的目标节点上部署所述副本。The deployment unit 305 is further configured to deploy the copy on the target node in the area according to the number of copies.
可选的,图3描述的副本部署系统还可以包括:Optionally, the replica deployment system described in FIG. 3 may further include:
发送单元,用于向所述目标节点发送节点事件获取请求;A sending unit, configured to send a node event acquisition request to the target node;
接收单元,用于接收所述目标节点针对所述节点事件获取请求返回的第 二节点事件;A receiving unit, configured to receive a second node event returned by the target node in response to the node event acquisition request;
统计单元,用于根据所述第二节点事件,统计所述副本的当前在线副本数量;A statistical unit, configured to count the current number of online copies of the replica based on the second node event;
第三判断单元,用于判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致;The third judging unit is used to judge whether the updated current online copy quantity is consistent with the counted current online copy quantity;
所述第二判断单元304,具体用于若更新后的当前在线副本数量与统计的当前在线副本数量一致,判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。The second judgment unit 304 is specifically configured to judge whether the updated current online copy quantity meets the preset fluctuation range of the copy quantity if the updated current online copy quantity is consistent with the counted current online copy quantity.
在图3所描述的副本部署系统中,可以监听部署有副本的目标节点的第一节点事件;进一步地,判断所述第一节点事件是否影响所述副本的当前在线副本数量,若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;更进一步地,还可以判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。可见,本发明中,云服务器可以主动监听目标节点上发生的第一节点事件,当所述第一节点事件影响所述副本的当前在线副本数量时,更新所述当前在线副本数量,这有利于确保实时更新当前在线副本数量,确保当前在线副本数量的准确性,之后,进一步判断更新后的当前在线副本数量是否满足预设的副本数量波动范围,如果不满足,则对所述副本进行重新部署,从而有利于及时地根据当前在线副本数量的情况来对所述副本进行重新部署,使得重新部署后的所述副本的当前在线副本数量保持在一定范围,便于用户访问。In the replica deployment system described in FIG. 3, the first node event of the target node where the replica is deployed can be monitored; further, it is determined whether the first node event affects the current number of online replicas of the replica, if the first A node event affects the number of current online copies of the replica, and according to the first node event, the current online copy number of the replica is updated; further, it can also be determined whether the updated current online copy number meets the preset Fluctuation range of the number of copies; if the updated current number of online copies does not meet the preset fluctuation range of the number of copies, redeploy the copy, wherein the number of current online copies of the redeployed copy after redeployment meets the number of copies Fluctuation range. It can be seen that in the present invention, the cloud server can actively monitor the first node event occurring on the target node, and when the first node event affects the current online copy number of the copy, update the current online copy number, which is beneficial to Ensure that the current number of online copies is updated in real time to ensure the accuracy of the current number of online copies. After that, it is further determined whether the updated number of current online copies meets the preset fluctuation range of the number of copies, and if not, redeploys the copies Therefore, it is beneficial to timely redeploy the copies according to the current number of online copies, so that the number of the current online copies of the redeployed copies remains within a certain range, which is convenient for users to access.
上述以软件功能模块的形式实现的集成的单元,可以存储在一个计算机可读存储介质中。其中,该计算机可读存储介质可以存储计算机程序,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、 随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。The above integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The computer-readable storage medium may store a computer program, and when the computer program is executed by the processor, the steps of the foregoing method embodiments may be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, etc. The computer-readable storage medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only Memory) ), Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in jurisdictions. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media The medium does not include electrical carrier signals and telecommunication signals.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmit to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, Solid State Disk (SSD)), or the like.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of the description, the specific working processes of the system, device and unit described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be 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.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software function unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
需要说明的是,上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the sequence numbers of the above embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising", or any other variants thereof are intended to cover non-exclusive inclusions, so that a process, device, article, or method that includes a series of elements includes not only those elements, but also those that are not explicitly listed The other elements listed may also include elements inherent to such processes, devices, objects, or methods. Without more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, device, article or method that includes the element.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by the description and drawings of the present invention, or directly or indirectly used in other related technical fields The same reason is included in the patent protection scope of the present invention.

Claims (10)

  1. 一种副本部署方法,其特征在于,所述方法包括:A copy deployment method, characterized in that the method includes:
    监听部署有副本的目标节点的第一节点事件;Monitor the first node event of the target node where the copy is deployed;
    判断所述第一节点事件是否影响所述副本的当前在线副本数量;Determine whether the first node event affects the current number of online copies of the copy;
    若所述第一节点事件影响所述副本的当前在线副本数量,根据所述第一节点事件,更新所述副本的当前在线副本数量;If the first node event affects the current online copy number of the copy, update the current online copy number of the copy according to the first node event;
    判断更新后的当前在线副本数量是否满足预设的副本数量波动范围;Determine whether the updated current online copy quantity meets the preset copy quantity fluctuation range;
    若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署,其中,重新部署后的所述副本的当前在线副本数量满足所述副本数量波动范围。If the updated current online copy number does not satisfy the preset fluctuation range of the copy number, the copy is redeployed, wherein the current online copy number of the redeployed copy meets the fluctuation range of the copy number.
  2. 如权利要求1所述的方法,其特征在于,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:The method according to claim 1, wherein, if the updated current number of online copies does not satisfy the preset fluctuation range of the number of copies, redeploying the copies includes:
    若更新后的当前在线副本数量小于预设的副本数量波动范围的最小值,对所述副本进行添加操作。If the updated current online copy quantity is less than the minimum value of the preset copy quantity fluctuation range, add the copy operation.
  3. 如权利要求2所述的方法,其特征在于,添加后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。The method according to claim 2, wherein the current number of online copies of the added copy is the maximum value of the fluctuation range of the number of copies.
  4. 如权利要求1所述的方法,其特征在于,所述若更新后的当前在线副本数量不满足预设的副本数量波动范围,对所述副本进行重新部署包括:The method according to claim 1, wherein, if the updated current number of online copies does not satisfy the preset fluctuation range of the number of copies, redeploying the copies includes:
    若更新后的当前在线副本数量大于预设的副本数量波动范围的最大值,对所述副本进行删除操作。If the updated current online copy number is greater than the maximum value of the preset copy number fluctuation range, delete the copy.
  5. 如权利要求4所述的方法,其特征在于,删除后的所述副本的当前在线副本数量为所述副本数量波动范围的最大值。The method according to claim 4, wherein the current number of online copies of the deleted copy is the maximum value of the fluctuation range of the number of copies.
  6. 如权利要求1至5中任一项所述的方法,其特征在于,所述监听部署有副本的目标节点的第一节点事件之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein before the monitoring the first node event of the target node where the copy is deployed, the method further comprises:
    在接收到副本部署任务之后,确定待部署的多个区域;After receiving the copy deployment task, determine the multiple areas to be deployed;
    根据每个所述区域的人口数量,确定多个所述区域的副本分配比例;According to the population of each of the areas, determine the distribution ratio of multiple copies of the areas;
    根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
    针对每个所述区域,确定所述区域当前在线且存储空间大于预设存储空间阈值的目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the areas, determine a target node where the area is currently online and whose storage space is greater than a preset storage space threshold, and deploy the copy on the target node of the area according to the number of copies.
  7. 如权利要求1至5中任一项所述的方法,其特征在于,所述监听部署有副本的目标节点的第一节点事件之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein before the monitoring the first node event of the target node where the copy is deployed, the method further comprises:
    在接收到副本部署任务之后,获取所述副本部署任务携带的针对多个区域的副本分配比例;After receiving the copy deployment task, obtain the copy allocation ratio for multiple regions carried by the copy deployment task;
    根据副本总数量以及所述副本分配比例,计算每个所述区域待部署的副本数量;Calculate the number of copies to be deployed in each of the areas according to the total number of copies and the copy allocation ratio;
    针对每个所述区域,从当前在线的多个节点中,将资源使用率低于预设资源使用率阈值的节点确定为目标节点,并依据所述副本数量在所述区域的目标节点上部署所述副本。For each of the regions, from multiple nodes currently online, determine the node whose resource usage rate is lower than the preset resource usage threshold as the target node, and deploy on the target node of the region according to the number of copies The copy.
  8. 如权利要求1至5中任一项所述的方法,其特征在于,所述根据所述节点事件,更新所述副本的当前在线副本数量之后,所述方法还包括:The method according to any one of claims 1 to 5, wherein after updating the current online copy number of the copy according to the node event, the method further comprises:
    向所述目标节点发送节点事件获取请求;Send a node event acquisition request to the target node;
    接收所述目标节点针对所述节点事件获取请求返回的第二节点事件;Receiving a second node event returned by the target node in response to the node event acquisition request;
    根据所述第二节点事件,统计所述副本的当前在线副本数量;According to the second node event, count the current number of online copies of the copy;
    判断更新后的当前在线副本数量与统计的当前在线副本数量是否一致;Determine whether the updated number of current online copies is consistent with the counted current number of online copies;
    若更新后的当前在线副本数量与统计的当前在线副本数量一致,执行所述的判断更新后的当前在线副本数量是否满足预设的副本数量波动范围。If the updated current online copy number is consistent with the counted current online copy number, execute the judgment to determine whether the updated current online copy number meets the preset copy number fluctuation range.
  9. 一种云服务器,其特征在于,所述云服务器包括存储器和处理器,所述存储器上存储有可由所述处理器执行的副本部署程序,所述副本部署程序被所述处理器执行时实现如权利要求1至8任一项所述的副本部署方法。A cloud server, characterized in that the cloud server includes a memory and a processor, and a copy deployment program executable by the processor is stored on the memory, and the copy deployment program is implemented when the processor executes The copy deployment method according to any one of claims 1 to 8.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有副本部署程序,所述副本部署程序可被一个或者多个处理器执行,以实现如权利要求1至6中任一项所述的副本部署方法。A computer-readable storage medium, characterized in that a copy deployment program is stored on the computer-readable storage medium, and the copy deployment program can be executed by one or more processors to implement claims 1 to 6 The copy deployment method described in any one of the above.
PCT/CN2019/093789 2018-12-26 2019-06-28 Copy deployment method, cloud server, and storage medium WO2020133995A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811603472.0 2018-12-26
CN201811603472.0A CN109753243A (en) 2018-12-26 2018-12-26 Copy dispositions method, Cloud Server and storage medium

Publications (1)

Publication Number Publication Date
WO2020133995A1 true WO2020133995A1 (en) 2020-07-02

Family

ID=66403181

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/093789 WO2020133995A1 (en) 2018-12-26 2019-06-28 Copy deployment method, cloud server, and storage medium

Country Status (2)

Country Link
CN (1) CN109753243A (en)
WO (1) WO2020133995A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112272354A (en) * 2020-10-23 2021-01-26 北京指掌易科技有限公司 Cloud mobile phone equipment distribution method and device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753243A (en) * 2018-12-26 2019-05-14 深圳市网心科技有限公司 Copy dispositions method, Cloud Server and storage medium
CN110188006B (en) * 2019-06-03 2022-04-29 深圳市网心科技有限公司 Data maintenance method, device and equipment
CN110188007B (en) * 2019-06-05 2022-02-15 深圳市迅雷网络技术有限公司 Distributed data repair method, device, network node and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050154697A1 (en) * 2004-01-14 2005-07-14 International Business Machines Corporation Adjusting a number of database replicas based on a defined threshold value
CN103997512A (en) * 2014-04-14 2014-08-20 南京邮电大学 Data duplicate quantity determination method for cloud storage system
CN104735107A (en) * 2013-12-20 2015-06-24 中国移动通信集团公司 Recovery method and device for data copies in distributed storage system
CN107943510A (en) * 2017-11-23 2018-04-20 郑州云海信息技术有限公司 Distributed memory system upgrade method, system, device and readable storage medium storing program for executing
CN109753243A (en) * 2018-12-26 2019-05-14 深圳市网心科技有限公司 Copy dispositions method, Cloud Server and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237512B (en) * 2007-01-31 2010-09-15 三洋电机株式会社 Content processing apparatus
CN103034739A (en) * 2012-12-29 2013-04-10 天津南大通用数据技术有限公司 Distributed memory system and updating and querying method thereof
CN103618690B (en) * 2013-10-14 2016-06-08 南京邮电大学 Improving one's methods of route agreement is sprayed-waited to a kind of appearance in slow net
CN103780693B (en) * 2014-01-21 2017-07-28 北京科技大学 The best copy server selection method and system of a kind of utilization User collaborative sensing
CN103984507A (en) * 2014-05-15 2014-08-13 浪潮电子信息产业股份有限公司 Storage configuration and optimizing strategy for bioinformatics high-performance computing platform
CN105426427A (en) * 2015-11-04 2016-03-23 国家计算机网络与信息安全管理中心 MPP database cluster replica realization method based on RAID 0 storage

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050154697A1 (en) * 2004-01-14 2005-07-14 International Business Machines Corporation Adjusting a number of database replicas based on a defined threshold value
CN104735107A (en) * 2013-12-20 2015-06-24 中国移动通信集团公司 Recovery method and device for data copies in distributed storage system
CN103997512A (en) * 2014-04-14 2014-08-20 南京邮电大学 Data duplicate quantity determination method for cloud storage system
CN107943510A (en) * 2017-11-23 2018-04-20 郑州云海信息技术有限公司 Distributed memory system upgrade method, system, device and readable storage medium storing program for executing
CN109753243A (en) * 2018-12-26 2019-05-14 深圳市网心科技有限公司 Copy dispositions method, Cloud Server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112272354A (en) * 2020-10-23 2021-01-26 北京指掌易科技有限公司 Cloud mobile phone equipment distribution method and device
CN112272354B (en) * 2020-10-23 2023-05-30 北京指掌易科技有限公司 Cloud mobile phone equipment distribution method and device

Also Published As

Publication number Publication date
CN109753243A (en) 2019-05-14

Similar Documents

Publication Publication Date Title
WO2020133995A1 (en) Copy deployment method, cloud server, and storage medium
US11165667B2 (en) Dynamic scaling of storage volumes for storage client file systems
US9684450B2 (en) Profile-based lifecycle management for data storage servers
CN109947668B (en) Method and device for storing data
US10657108B2 (en) Parallel I/O read processing for use in clustered file systems having cache storage
US9614926B2 (en) Parallel I/O write processing for use in clustered file systems having cache storage
CA2961229C (en) Asynchronous processing of mapping information
CN112650576A (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN109600430A (en) A kind of data managing method, system and electronic equipment and storage medium
WO2023093127A1 (en) Method and apparatus for monitoring a cluster, and electronic device
WO2022142665A1 (en) Database cluster-based data processing method and apparatus, and electronic device
US10754368B1 (en) Method and system for load balancing backup resources
CN109428926B (en) Method and device for scheduling task nodes
US10019182B2 (en) Management system and management method of computer system
CN112671892B (en) Data transmission method, device, electronic equipment and medium
CN113553074B (en) Applet distribution control method, device, electronic equipment and storage medium
CN113779412B (en) Message touch method, node and system based on blockchain network
CN114117280A (en) Page static resource using method and device, terminal equipment and storage medium
US10542087B1 (en) System and method for managing storage tier migration
CN113051244A (en) Data access method and device, and data acquisition method and device
CN107707620B (en) Method and device for processing IO (input/output) request
CN111431764A (en) Node determination method, device, system and medium
US11687269B2 (en) Determining data copy resources
JP7317998B2 (en) Systems and methods for monitoring network devices
CN107231423B (en) File distribution method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19903443

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 03/11/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19903443

Country of ref document: EP

Kind code of ref document: A1