A database access method, device, electronic device and computer readable medium

By managing database instance specifications and resource utilization on the public cloud, creating primary and backup instances and dividing non-oversold and oversold areas, the problem of database services being unavailable due to oversold resources is solved, and the performance and user experience of database services are improved.

CN113918282BActive Publication Date: 2025-03-18XIAN TONGXING HENGYAO INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111175524.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-03-18
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

When the entire physical machine resource is oversold on the public cloud, the user resource usage may exceed the physical machine limit, resulting in unavailability of the database service and reducing the user experience.

Method used

By receiving database access requests, determine the database instance specifications, select the target physical machine, and create the primary and secondary instances on the physical machine. The main instance does not oversold storage, while the backup instances oversold storage according to resource utilization and oversold ratios, and divide non-oversold and oversold areas to improve database service performance.

Benefits of technology

Through the distinction between primary and secondary instances and resource management, the problem of user resource usage exceeding the physical machine limit is avoided, and the performance and user experience of database services are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113918282B_ABST
    Figure CN113918282B_ABST
Patent Text Reader

Abstract

The present application discloses a database access method, device, electronic device and computer-readable medium, and relates to the field of computer technology. The method includes: receiving a database access request, determining the corresponding database instance specifications; determining the target physical machine according to the database instance specifications, and then creating a main instance on the target physical machine based on the database instance specifications; calling the database resource pool, and then determining the corresponding resource utilization rate, and determining the oversold ratio based on the resource utilization rate, so as to create a backup instance on the target physical machine based on the oversold ratio; generating domain names corresponding to the main instance and the backup instance and returning them, so that users can access the database based on the domain name. The main instance does not perform storage overselling, and only the backup instance performs storage overselling. The main instance and the backup instance are determined based on the database instance specifications and resource utilization, respectively, and the non-oversold and oversold areas are divided to improve the performance of the database service and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a database access method, device, electronic device and computer-readable medium. Background Art

[0002] Currently, on public clouds, cloud database services are provided based on physical machines through container virtualization. The general overselling solution is to oversell the resources of the entire physical machine. If the entire physical machine is oversold, user resource usage will exceed the physical machine limit, resulting in database service unavailability and reduced user experience.

[0003] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art:

[0004] When the entire physical machine resources are oversold, user resource usage may exceed the physical machine limit, causing database services to become unavailable and reducing user experience. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a database access method, device, electronic device and computer-readable medium, which can solve the existing problem that when the entire physical machine resources are oversold, user resource usage exceeds the physical machine limit, thereby causing database services to be unavailable and reducing user experience.

[0006] To achieve the above object, according to one aspect of an embodiment of the present application, a database access method is provided, including:

[0007] Receive database access requests and determine the corresponding database instance specifications;

[0008] Determine the target physical machine based on the database instance specifications, and then create a master instance on the target physical machine based on the database instance specifications;

[0009] Call the database resource pool to determine the corresponding resource utilization rate, determine the oversold ratio based on the resource utilization rate, and create a standby instance on the target physical machine based on the oversold ratio;

[0010] Generates and returns the domain names corresponding to the primary and standby instances so that users can access the database based on the domain names.

[0011] Optionally, determine the target physical machine, including:

[0012] Determine the available space specifications corresponding to each available physical machine;

[0013] Compare the database instance specifications with the available space specifications to determine the specification differences;

[0014] An available physical machine corresponding to a specification difference smaller than a preset threshold is determined as a target physical machine.

[0015] Optionally, create a master instance on the target physical machine based on the database instance specifications, including:

[0016] Determine the non-oversold area and oversold area of ​​the target physical machine;

[0017] In a non-oversold region, create a master instance based on the database instance specifications.

[0018] Optionally, a standby instance is created on the target physical machine based on the oversold ratio, including:

[0019] In the oversold area, a backup instance is created on the target physical machine based on the oversold ratio.

[0020] Optionally, determining a non-oversold region and an oversold region of the target physical machine includes:

[0021] Determine the resource allocation ratio based on the oversold ratio;

[0022] The target physical machine is divided into a non-oversold area and an oversold area based on the resource allocation ratio.

[0023] Optionally, before determining the oversold ratio, the method further comprises:

[0024] Update resource usage in real time.

[0025] In addition, the present application also provides a database access device, including:

[0026] A receiving unit is configured to receive a database access request and determine a corresponding database instance specification;

[0027] The master instance creation unit is configured to determine a target physical machine according to the database instance specification, and then create a master instance on the target physical machine based on the database instance specification;

[0028] The standby instance creation unit is configured to call the database resource pool, determine the corresponding resource usage rate, determine the oversold ratio based on the resource usage rate, and create the standby instance on the target physical machine based on the oversold ratio;

[0029] The access unit is configured to generate domain names corresponding to the primary instance and the backup instance and return them so that users can access the database based on the domain names.

[0030] Optionally, the master instance creation unit is further configured to:

[0031] Determine the available space specifications corresponding to each available physical machine;

[0032] Compare the database instance specifications with the available space specifications to determine the specification differences;

[0033] An available physical machine corresponding to a specification difference smaller than a preset threshold is determined as a target physical machine.

[0034] Optionally, the master instance creation unit is further configured to:

[0035] Determine the non-oversold area and oversold area of ​​the target physical machine;

[0036] In a non-oversold region, create a master instance based on the database instance specifications.

[0037] Optionally, the standby instance creation unit is further configured to:

[0038] In the oversold area, a backup instance is created on the target physical machine based on the oversold ratio.

[0039] Optionally, the master instance creation unit is further configured to:

[0040] Determine the resource allocation ratio based on the oversold ratio;

[0041] The target physical machine is divided into a non-oversold area and an oversold area based on the resource allocation ratio.

[0042] Optionally, the standby instance creation unit is further configured to:

[0043] Update resource usage in real time.

[0044] In addition, the present application also provides a database access electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the database access method as described above.

[0045] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the database access method as described above is implemented.

[0046] One embodiment of the above invention has the following advantages or beneficial effects: the present application determines the corresponding database instance specifications by receiving a database access request; determines the target physical machine according to the database instance specifications, and then creates a primary instance on the target physical machine based on the database instance specifications; calls the database resource pool to determine the corresponding resource utilization rate, and determines the oversold ratio based on the resource utilization rate to create a backup instance on the target physical machine based on the oversold ratio; generates and returns domain names corresponding to the primary instance and the backup instance for users to access the database based on the domain name. The primary instance does not perform storage overselling, and only the backup instance performs storage overselling. The primary instance and the backup instance are determined based on the database instance specifications and resource utilization rate, respectively, and the non-oversold and oversold areas are divided to improve the performance of the database service and improve the user experience.

[0047] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.

[0049] Figure 1 is a schematic diagram of the main process of the database access method according to the first embodiment of the present application;

[0050] Figure 2 is a schematic diagram of the main process of the database access method according to the second embodiment of the present application;

[0051] Figure 3 is a schematic diagram of an application scenario of a database access method according to a third embodiment of the present application;

[0052] Figure 4 is a schematic diagram of main units of a database access device according to an embodiment of the present application;

[0053] Figure 5 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0054] Figure 6 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0055] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0056] Figure 1 is a schematic diagram of the main process of the database access method according to the first embodiment of the present application, such as Figure 1 As shown, the database access methods include:

[0057] Step S101, receiving a database access request and determining the corresponding database instance specification.

[0058] In this embodiment, the execution subject of the database access method (for example, it can be a server) can receive the data access request through a wired connection or a wireless connection. After receiving the data access request, the execution subject can issue a database instance creation request, wherein the database instance creation request can include the database instance specification to be created. The database instance specification can be, for example, CPU: 8C, memory: 32GB, storage space: 2TB. The embodiment of this application does not limit the specific content of the database instance specification.

[0059] Step S102: determine the target physical machine according to the database instance specifications, and then create a master instance on the target physical machine based on the database instance specifications.

[0060] Specifically, a master instance is created on the target physical machine based on the database instance specifications, including:

[0061] Determine the non-oversold and oversold regions of the target physical machine; in the non-oversold region, create a master instance based on the database instance specifications.

[0062] The target physical machine is the physical machine on which the database instance corresponding to the data access request is created.

[0063] Specifically, the execution entity can determine the risk coefficient that the cloud database resource provider can bear, and then can divide the non-oversold area and the oversold area of ​​the target physical machine into proportions based on the risk coefficient. Specifically, the execution entity can determine the regional division ratio based on the correspondence between the preset risk coefficient and the regional division ratio and the determined risk coefficient that can be borne. For example, the risk coefficient is 2, and the corresponding regional division ratio is 5:1, where the non-oversold area accounts for 5 / 6 and the oversold area accounts for 1 / 6. The execution entity can divide the target physical machine into regions according to the regional division ratio, which is divided before creating the database instance corresponding to the data access request. It can be understood that the larger the proportion of the oversold area, the higher the risk coefficient. Specifically, the division of the regional proportions can be determined according to the actual situation. The above examples in the embodiments of the present application are only examples, and the embodiments of the present application do not make specific limitations on this.

[0064] The execution entity can create a master instance based on the database instance specifications on the target physical machine that has been divided into non-oversold areas and oversold areas.

[0065] As another implementation of the embodiment of the present application, determining the non-oversold area and the oversold area of ​​the target physical machine may also include:

[0066] According to the oversold ratio, determine the resource allocation ratio; divide the target physical machine into non-oversold areas and oversold areas based on the resource allocation ratio. For example, the oversold ratio is 100%, which means that one storage space is sold in two. For example, 1TB of storage space is sold as 2T. The corresponding resource allocation ratio can be 2:1, that is, the space ratio between the non-oversold area and the oversold area is 2:1. Of course, the embodiment of the present application does not limit the specific correspondence between the oversold ratio and the resource allocation ratio, and can be determined according to the specific circumstances of the cloud resource provider.

[0067] Step S103, calling the database resource pool to determine the corresponding resource utilization rate, and based on the resource utilization rate, determining the oversold ratio, so as to create a standby instance on the target physical machine based on the oversold ratio.

[0068] Specifically, a standby instance is created on the target physical machine based on the oversold ratio, including:

[0069] In the oversold area, a backup instance is created on the target physical machine based on the oversold ratio.

[0070] The execution entity can create a standby instance in the oversold area of ​​the target physical machine based on the same database instance specifications as the primary instance, and set the attribute of the standby instance to the oversold ratio (for example, oversold 100%, the embodiment of the present application does not specifically limit the value of the oversold ratio).

[0071] Specifically, before determining the oversold ratio, the method further includes:

[0072] Update resource usage in real time.

[0073] In the embodiment of the present application, the main instance is not oversold for storage, only the backup instance is oversold. Users can read and write the cloud database normally. The storage space of the backup instance cannot store new data. You only need to create a new backup instance on other idle physical machines and replace the old backup instance. There is no business impact on users.

[0074] In the embodiment of the present application, as an overall example, when there are two physical machines that are both target physical machines, it is assumed that the specifications of the two physical machines A and B (both target physical machines) are CPU: 64C, memory: 256GB, and storage space: 8TB. ​​Scenario: It is necessary to create a cloud database with specifications of 8C / 32GB / 2TB based on these two physical machines. The execution entity can divide the target physical machine: 64C / 256GB / 8TB into two parts based on the determined resource allocation ratio, one part of the resources R1: 48C / 192GB / 6TB is not oversold, and the other part of the resources R2: 16C / 64GB / 2TB will become: 16C / 64GB / 4TB after the storage space is oversold at a ratio of 100%. Next, the execution entity starts to create cloud database instances with specifications: 8C / 32GB / 2TB. On physical machine A, 3 master instances can be created in the R1 part, and 2 standby instances can be created in the R2 part. Similarly, on physical machine B, based on the goal of maximizing benefits, 2 standby instances can be created in the R2 part, and an adjustment can be made to the R1 part to create 2 master instances and 1 standby instance. In this way, a total of 10 master and standby instances are created for physical machines A and B. This is the case when all available space on the target physical machine is fully utilized. Although the CPU and memory are not fully utilized, 2 more master and standby instances are created while ensuring user experience, which can bring additional cloud revenue.

[0075] Step S104: Generate domain names corresponding to the primary instance and the backup instance and return them so that users can access the database based on the domain names.

[0076] This embodiment determines the corresponding database instance specifications by receiving a database access request; determines the target physical machine according to the database instance specifications, and then creates a primary instance on the target physical machine based on the database instance specifications; calls the database resource pool to determine the corresponding resource utilization rate, and determines the oversold ratio based on the resource utilization rate to create a backup instance on the target physical machine based on the oversold ratio; generates and returns domain names corresponding to the primary instance and the backup instance for users to access the database based on the domain name. The primary instance does not perform storage overselling, and only the backup instance performs storage overselling. The primary instance and the backup instance are determined based on the database instance specifications and resource utilization, respectively, and the non-oversold and oversold areas are divided to improve the performance of the database service and improve the user experience. .

[0077] Figure 2 is a schematic diagram of the main flow of the database access method according to the second embodiment of the present application. Figure 2 As shown, the database access methods include:

[0078] Step S201, receiving a database access request and determining the corresponding database instance specification.

[0079] The principle of step S201 is similar to that of step S101 and will not be described in detail here.

[0080] Step S202, determining the available space specification corresponding to each available physical machine.

[0081] The execution subject may first determine the specifications of the remaining available space on each available physical machine. For example, the specifications of the remaining available space on each available physical machine may be: CPU: 8C, memory: 32GB, storage space: 2TB; CPU: 6C, memory: 32GB, storage space: 2TB; CPU: 12C, memory: 32GB, storage space: 2TB, etc.

[0082] Step S203: compare the database instance specifications with the available space specifications to determine the specification differences.

[0083] Compare the database instance specifications CPU: 8C, memory: 32GB, storage space: 2TB with the available space specifications CPU: 8C, memory: 32GB, storage space: 2TB; CPU: 6C, memory: 32GB, storage space: 2TB; CPU: 12C, memory: 32GB, storage space: 2TB to determine the specification differences: CPU difference 0C, CPU difference 2C, CPU difference 4C respectively.

[0084] Step S204: determine the available physical machine corresponding to the specification difference smaller than the preset threshold as the target physical machine.

[0085] After determining the specification difference, the execution subject can determine the physical machine corresponding to the available space specification with a specification difference less than a preset threshold or the available space specification corresponding to the smallest specification difference as the target physical machine. For example, the physical machine corresponding to the available space specification of CPU: 8C, memory: 32GB, and storage space: 2TB can be determined as the target physical machine. Then, the execution subject can create a database instance corresponding to the database access request (for example, with specifications of CPU: 8C, memory: 32GB, and storage space: 2TB) on the target physical machine.

[0086] The embodiment of the present application determines the physical machine corresponding to the remaining available space specification closest to the database instance specification to be created as the target physical machine for creating the database instance specification, thereby making greater use of physical machine space resources and reserving sufficient physical machine space to prepare for creating larger database service specifications for enterprise-level customers. This can maximize the cluster sales rate and reduce the single-core cost of the cloud database while meeting customer needs.

[0087] Step S205: Create a master instance on the target physical machine based on the database instance specifications.

[0088] Step S206 , calling the database resource pool to determine the corresponding resource usage rate, and determining the oversold ratio based on the resource usage rate, so as to create a standby instance on the target physical machine based on the oversold ratio.

[0089] Step S207: Generate domain names corresponding to the primary instance and the backup instance and return them so that the user can access the database based on the domain names.

[0090] The principles of steps S205 to S207 are similar to those of steps S102 to S104 and will not be described in detail here.

[0091] Figure 3 Schematic diagram of an application scenario of the database access method according to the third embodiment of the present application. The database access method of the embodiment of the present application can be applied to the scenario where the cloud database storage in the physical machine is oversold. Figure 3As shown, the server 302 receives the database access request 301 and determines the corresponding database instance specification 303. The server 302 determines the target physical machine 304 according to the database instance specification 303, and then creates the primary instance A in the non-oversold area on the target physical machine 304 based on the database instance specification 303. The server 302 calls the database resource pool 305, and then determines the corresponding resource utilization rate 306, and determines the oversold ratio 307 based on the resource utilization rate 306, so as to create the backup instance a in the oversold area on the target physical machine 304 based on the oversold ratio 307. The server 302 generates the domain name 308 corresponding to the primary instance A and the backup instance a and returns it, so that the user 309 can access the database instance A or a based on the domain name 308 (when A fails, the execution subject can switch to a for user access, and the user is unaware of the switching process).

[0092] This application determines the corresponding database instance specifications by receiving a database access request; determines the target physical machine according to the database instance specifications, and then creates a primary instance on the target physical machine based on the database instance specifications; calls the database resource pool to determine the corresponding resource utilization rate, and determines the oversold ratio based on the resource utilization rate to create a backup instance on the target physical machine based on the oversold ratio; generates and returns the domain names corresponding to the primary instance and the backup instance for users to access the database based on the domain name. The primary instance does not perform storage overselling, and only the backup instance performs storage overselling. The primary instance and the backup instance are determined based on the database instance specifications and resource utilization rate, respectively, and the non-oversold and oversold areas are divided to improve the performance of the database service and improve the user experience.

[0093] Figure 4 Schematic diagram of the main units of the database access device according to the embodiment of the present application. Figure 4 As shown, the database access device includes a receiving unit 401 , a primary instance creation unit 402 , a backup instance creation unit 403 and an access unit 404 .

[0094] The receiving unit 401 is configured to receive a database access request and determine a corresponding database instance specification;

[0095] The master instance creation unit 402 is configured to determine a target physical machine according to the database instance specification, and then create a master instance on the target physical machine based on the database instance specification;

[0096] The standby instance creation unit 403 is configured to call the database resource pool, determine the corresponding resource usage rate, determine the oversold ratio based on the resource usage rate, and create the standby instance on the target physical machine based on the oversold ratio;

[0097] The access unit 404 is configured to generate domain names corresponding to the primary instance and the backup instance and return them so that the user can access the database based on the domain name.

[0098] In some embodiments, the master instance creation unit 402 is further configured to: determine the available space specifications corresponding to each available physical machine; compare the database instance specifications with each available space specification to determine the specification difference; and determine the available physical machine corresponding to the specification difference less than a preset threshold as the target physical machine.

[0099] In some embodiments, the master instance creation unit 402 is further configured to: determine a non-oversold area and an oversold area of ​​the target physical machine; and create a master instance in the non-oversold area based on the database instance specification.

[0100] In some embodiments, the standby instance creating unit 403 is further configured to: in the oversold region, create a standby instance on the target physical machine based on the oversold ratio.

[0101] In some embodiments, the master instance creation unit 402 is further configured to: determine a resource allocation ratio according to the oversold ratio; and divide the target physical machine into a non-oversold area and an oversold area based on the resource allocation ratio.

[0102] In some embodiments, the standby instance creation unit 403 is further configured to: update resource usage in real time.

[0103] It should be noted that the database access method and the database access device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0104] Figure 5 An exemplary system architecture 500 is shown to which the database access method or database access device according to the embodiment of the present application can be applied.

[0105] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0106] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0107] The terminal devices 501 , 502 , and 503 may be various electronic devices having a database access processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0108] Server 505 can be a server that provides various services, such as a background management server that provides support for database access requests submitted by users using terminal devices 501, 502, and 503 (only as an example). The background management server can receive database access requests and determine the corresponding database instance specifications; determine the target physical machine based on the database instance specifications, and then create a primary instance on the target physical machine based on the database instance specifications; call the database resource pool to determine the corresponding resource utilization rate, and determine the oversold ratio based on the resource utilization rate to create a backup instance on the target physical machine based on the oversold ratio; generate domain names corresponding to the primary instance and the backup instance and return them for users to access the database based on the domain name. The primary instance does not perform storage overselling, and only the backup instance performs storage overselling. The primary instance and the backup instance are determined based on the database instance specifications and resource utilization, respectively, and the non-oversold and oversold areas are divided to improve the performance of the database service and improve the user experience.

[0109] It should be noted that the database access method provided in the embodiment of the present application is generally executed by the server 505 , and accordingly, the database access device is generally set in the server 505 .

[0110] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0111] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present application. Figure 6 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0112] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0113] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0114] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present application are executed.

[0115] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a main instance creation unit, a backup instance creation unit, and an access unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0118] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device receives a database access request and determines the corresponding database instance specifications; determines the target physical machine according to the database instance specifications, and then creates a primary instance on the target physical machine based on the database instance specifications; calls the database resource pool to determine the corresponding resource utilization rate, and determines the oversold ratio based on the resource utilization rate, so as to create a backup instance on the target physical machine based on the oversold ratio; generates and returns the domain names corresponding to the primary instance and the backup instance, so that the user can access the database based on the domain name.

[0119] According to the technical solution of the embodiment of the present application, the storage of the primary instance is not oversold, and only the storage of the backup instance is oversold. The primary instance and the backup instance are determined based on the database instance specifications and resource utilization rates, respectively. By dividing the non-oversold and oversold areas, the performance of the database service is improved and the user experience is improved.

[0120] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A database access method, characterized in that: include: Receive database access requests and determine the corresponding database instance specifications; Determine a target physical machine according to the database instance specifications, and then create a master instance on the target physical machine based on the database instance specifications; The creating a master instance on the target physical machine based on the database instance specification includes: determining a non-oversold area and an oversold area of ​​the target physical machine; creating a master instance based on the database instance specification in the non-oversold area; Calling a database resource pool to determine a corresponding resource usage rate, determining an oversold ratio based on the resource usage rate, and creating a standby instance on the target physical machine based on the oversold ratio; creating a standby instance on the target physical machine based on the oversold ratio includes: creating a standby instance on the target physical machine based on the oversold ratio in the oversold area; Generate and return domain names corresponding to the primary instance and the backup instance so that users can access the database based on the domain names.

2. The method according to claim 1, characterized in that: The determining of the target physical machine includes: Determine the available space specifications corresponding to each available physical machine; Comparing the database instance specification with each of the available space specifications to determine a specification difference; An available physical machine corresponding to a specification difference smaller than a preset threshold is determined as a target physical machine.

3. The method according to claim 1, characterized in that The determining the non-oversold area and the oversold area of ​​the target physical machine includes: Determining a resource allocation ratio according to the oversold ratio; The target physical machine is divided into a non-oversold area and an oversold area based on the resource allocation ratio.

4. The method according to claim 1, characterized in that Before determining the oversold ratio, the method further includes: The resource usage rate is updated in real time.

5. A database access device, characterized in that: include: A receiving unit is configured to receive a database access request and determine a corresponding database instance specification; The master instance creation unit is configured to determine a target physical machine according to the database instance specification, and then create a master instance on the target physical machine based on the database instance specification; the master instance creation unit is further configured to: determine a non-oversold area and an oversold area of ​​the target physical machine; create a master instance in the non-oversold area based on the database instance specification; The standby instance creation unit is configured to call the database resource pool to determine the corresponding resource usage rate, determine the oversold ratio based on the resource usage rate, and create the standby instance on the target physical machine based on the oversold ratio; the standby instance creation unit is further configured to: create the standby instance on the target physical machine based on the oversold ratio in the oversold area; The access unit is configured to generate domain names corresponding to the primary instance and the backup instance and return them so that the user can access the database based on the domain names.

6. The device according to claim 5, characterized in that The master instance creation unit is further configured to: Determine the available space specifications corresponding to each available physical machine; Comparing the database instance specification with each of the available space specifications to determine a specification difference; An available physical machine corresponding to a specification difference smaller than a preset threshold is determined as a target physical machine.

7. A database access electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Cloud computing system and method based on cloud computing mobile network resource management

    CN110113401A

  • Service process scheduling method, device and equipment and storage medium

    CN110688202A