CN114647634A - Method for creating database, method and device for operating database - Google Patents

Method for creating database, method and device for operating database Download PDF

Info

Publication number
CN114647634A
CN114647634A CN202210274610.5A CN202210274610A CN114647634A CN 114647634 A CN114647634 A CN 114647634A CN 202210274610 A CN202210274610 A CN 202210274610A CN 114647634 A CN114647634 A CN 114647634A
Authority
CN
China
Prior art keywords
storage space
database
space layer
request
target database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210274610.5A
Other languages
Chinese (zh)
Inventor
王宇
汪洋
王益飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210274610.5A priority Critical patent/CN114647634A/en
Publication of CN114647634A publication Critical patent/CN114647634A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a method for creating a database, a method for operating the database, a device, equipment, a storage medium and a program product, and relates to the technical field of computers, in particular to the technical fields of artificial intelligence such as knowledge graphs and big data. The method for creating the database comprises the following steps: in response to receiving a database creation request, creating a target database and a first sub-database; packaging the first sub-database into a first storage space layer of a target database; and determining the first storage space layer as an available storage space layer for the target database. The method for operating the database comprises the following steps: receiving an original operation request aiming at a target database; determining an available storage space layer of a target database; and operating the available storage space layer according to the original operation request.

Description

Method for creating database, method and device for operating database
Technical Field
The present disclosure relates to the field of computer technology, and more particularly to the field of artificial intelligence techniques such as knowledge maps and big data.
Background
The full update of the database refers to the update of all data in the database. In database applications, part of the users need to update the online data all at once. The efficiency and the safety of the database when the database updates the data in a full amount are important performance indexes of the database.
Disclosure of Invention
The present disclosure provides a method of creating a database, a method of operating a database, an apparatus, a device, a storage medium, and a program product.
According to an aspect of the present disclosure, there is provided a method of creating a database, including: in response to receiving a database creation request, creating a target database and a first sub-database; packaging the first sub-database into a first storage space layer of the target database; and determining the first storage space layer as an available storage space layer for the target database.
According to another aspect of the present disclosure, there is provided a method of operating a database, including: receiving an original operation request aiming at a target database; determining an available storage space layer of the target database; and operating the available storage space layer according to the original operation request, wherein the target database is created according to the method of the embodiment of the present disclosure.
According to another aspect of the present disclosure, there is provided an apparatus for creating a database, including: the creating module is used for responding to the received database creating request and creating a target database and a first sub database; a packaging module, configured to package the first sub-database into a first storage space layer of the target database; and a first determination module to determine the first storage space layer as an available storage space layer for the target database.
According to another aspect of the present disclosure, there is provided an apparatus for operating a database, including: the receiving module is used for receiving an original operation request aiming at a target database; a second determination module to determine an available storage space layer of the target database; and an operation module for operating the available storage space layer according to the original operation request, wherein the target database is created according to the method of the embodiment of the present disclosure.
Another aspect of the present disclosure provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the embodiments of the present disclosure.
According to another aspect of the disclosed embodiments, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method shown in the disclosed embodiments.
According to another aspect of an embodiment of the present disclosure, a computer program product is provided, which includes computer programs/instructions, and is characterized in that when being executed by a processor, the computer programs/instructions implement the steps of the method shown in the embodiment of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of an exemplary database in accordance with an embodiment of the present disclosure;
FIG. 2 schematically shows a flow diagram of a method of creating a database according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method of creating a database according to another embodiment of the present disclosure;
FIG. 4 schematically shows a flow diagram of a method of operating a database according to an embodiment of the present disclosure;
FIG. 5 schematically shows a schematic diagram of a method of operating a database according to another embodiment of the present disclosure;
FIG. 6 schematically shows a block diagram of an apparatus for creating a database according to an embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of an apparatus for operating a database in accordance with an embodiment of the disclosure; and
FIG. 8 schematically shows a block diagram of an example electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The database of the embodiment of the present disclosure will be described below with reference to fig. 1.
FIG. 1 is a schematic diagram of an exemplary database in accordance with an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a database to which the embodiment of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiment of the present disclosure may not be applied to other databases.
As shown in fig. 1, the database 100 may include a database tier (database)110 and storage space tiers (space)120, 130.
According to embodiments of the present disclosure, each storage space layer may contain one sub-database. For example, storage space layer 120 contains sub-database 121 and storage space layer 130 contains sub-database 131.
According to embodiments of the present disclosure, a sub-database in each storage space layer may correspond to one or more spatial slices for storing data. For example, sub-database 121 in storage space layer 120 may correspond to spatial slices 122 and 123, and sub-database 131 in storage space layer 130 may correspond to spatial slices 132, 133, 134, and 135.
According to an embodiment of the present disclosure, each storage space layer may be configured with meta-information (meta) that may be used to indicate the number of slices and data distribution relationship in the storage space layer. The number of the space slices and the distribution relation of the data in the space slices can be set according to the meta-information.
According to an embodiment of the present disclosure, the database 100 may set one of all the storage space layers it contains as an available storage space layer. When a user sends a database operation request, the database operation request may be converted into an operation request for the available storage space layer.
For example, the database 100 may set the storage space layer 120 as an available storage space layer. When a user sends a database operation request, the database operation request can be converted into an operation request for the available storage space layer to perform a corresponding operation on the storage space layer 120.
According to an embodiment of the present disclosure, the available storage space layer may be switched as needed. For example, the storage space layer 120 may be set as an available storage space layer at an initial stage, and initial data uploaded by the user is stored in the storage space layer 120. Subsequently, if the user needs to perform a full data update on the data in the database, the available storage space layer can be switched from storage space layer 120 to storage space layer 130, so as to store the subsequent updated data in storage space 130.
According to an embodiment of the present disclosure, a user views the database 100 from the outside, seeing only one database. A user may not perceive the presence of multiple storage space layers while operating database 100. When the memory space layer in the database 100 is switched, the use of the database 100 by the user is not affected.
According to an embodiment of the present disclosure, the number of storage space layers in the database 100 may be set as desired. When the storage requirement is not enough, a storage space layer can be added.
Under the condition that the database is updated in a full amount and the data amount to be updated rises or falls, if the original space fragmentation number and data distribution relation of the database is used, the resource waste is caused.
According to the embodiment of the disclosure, by packaging the sub-databases into storage space layers of the target database, different storage space layers each contain completely independent sub-databases, and each storage space layer can be configured with different space fragmentation numbers and data distribution relations. When the data volume of the user rises, a new storage space layer can be created, and the space fragmentation number and the data distribution relation of the storage space layer are configured according to the data volume after rising, so that the resource waste is reduced.
In the technical scheme of the disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the common customs of public order.
FIG. 2 schematically shows a flow chart of a method of creating a database according to an embodiment of the present disclosure.
As shown in fig. 2, the method 200 of creating a database includes creating a target database and a first sub-database in response to receiving a database creation request at operation S210.
Then, the first sub-database is packaged as a first storage space layer of the target database in operation S220.
In operation S230, a first storage space layer is determined as an available storage space layer of the target database.
According to an embodiment of the present disclosure, the actual data storage space may not be created when the target database is created, but the first sub-database is packaged as a storage space layer of the target database as the actual data storage space.
According to an embodiment of the present disclosure, the available storage space layer may be a storage space actually operated for the target database.
According to the embodiment of the disclosure, the flexibility of the storage space of the target database can be improved by packaging the sub-databases as the storage space layer of the target database.
According to another embodiment of the present disclosure, the metadata of the storage space layer may support a custom configuration, wherein the metadata may include, for example, the number of slices, data distribution relationships, and the like. The number of the slices and the data distribution relation of the corresponding storage space layer can be set by configuring the metadata of the storage space layer.
For example, a user may send a configuration request for any storage space layer in the target database. In response to receiving a configuration request for a storage space layer, meta-information for the storage space layer can be configured according to the configuration request.
According to an embodiment of the present disclosure, a configuration interface may be preset, for example, for receiving a configuration request for a storage space layer. The user can actively call the configuration interface to adjust the meta information of the storage space layer according to the requirement of the user. The configuration interface may include, for example, an HTTP (Hyper Text Transfer Protocol) interface.
According to an embodiment of the present disclosure, packaging the first sub-database as the first storage space layer of the target database may include, for example: and generating an operation interface of the first storage space layer according to the operation function of the first sub-database. The operation function may include, for example, an add operation function, a delete operation function, a modify operation function, a query operation function, and the like. And generating an operation interface of the first storage space layer by the operation function according to the first sub-database. Therefore, the first sub-database can be packaged in the target database, so that the target database can receive the operation request and convert the operation request into the operation of the corresponding sub-database.
According to an embodiment of the present disclosure, the first storage space layer may be a storage space layer initially created for the target database. In addition to the first memory space, other memory spaces may be created for the target database. It is to be understood that the target database can have any number of storage space layers, and the present disclosure does not specifically limit the number of storage space layers in the target database.
Based on this, fig. 3 schematically shows a flow chart of a method of creating a database according to another embodiment of the present disclosure.
As shown in fig. 3, after the first storage space has been created, the method of creating a database may further include creating a second sub-database in operation S340.
In operation S350, the second sub-database is packaged as a second storage space layer of the target database.
In operation S360, in response to receiving a second configuration request for the second storage space layer, meta information of the second storage space layer is configured according to the second configuration request.
Then, in response to receiving a handover request for the second storage space layer, the second storage space layer is determined as an available storage space layer in operation S370.
According to the embodiment of the present disclosure, a method for encapsulating the second sub-database into the second storage space layer of the target database is the same as a method for encapsulating the first sub-database into the first storage space layer of the target database, and reference may be specifically made to the above, which is not described herein again.
According to embodiments of the present disclosure, the available storage space layer may be a storage space that is actually operated for the target database. The available storage space layer can be switched as needed. For example, the user can send a switch request for the second storage space layer to the target database, which can determine the second storage space layer as an available storage space layer from the switch request.
According to the embodiment of the present disclosure, for example, the switching interface may be preset and provided to the user. When a user is requested by a storage space layer switch, a switch request may be sent to the switch interface. The target database can receive a switching request of a user through the switching interface and carry out corresponding switching operation.
According to an embodiment of the present disclosure, after the available storage space layer is switched from the original storage space layer to the new storage space layer, it is also possible to roll back from the new storage space layer to the original storage space layer again, so as to implement data roll-back. The user may trigger a rollback operation by sending a rollback request to the target database.
For example, where the available storage space layer of the target database is configured from the first storage space to the second storage space layer, the available storage space layer of the target database may be configured as the first storage space layer in response to receiving the rollback request.
According to the embodiment of the disclosure, each sub-database is packaged into the storage space layer of the target database, different storage space layers respectively contain completely independent sub-databases, and each storage space layer can have different data distribution relations, so that the expansibility and the configuration flexibility of the database are improved.
According to the embodiment of the disclosure, when the data amount of a user changes, a new storage space layer can be created, and the data distribution relationship of the new storage space layer is configured according to the change of the data amount to adapt to the change of the data amount, so that the waste of resources is reduced.
FIG. 4 schematically shows a flow diagram of a method of operating a database according to an embodiment of the disclosure.
As shown in fig. 4, the method 400 of operating a database includes receiving an original operation request for a target database at operation S410.
In operation S420, an available storage space layer of the target database is determined.
In operation S430, the available storage space layer is operated according to the original operation request.
According to the embodiment of the disclosure, a user can send an operation request to a target database to operate on data in the target database. And sending an operation request, namely the original operation request, to the target database by the user. The operation request may include, for example, a request for adding data, a request for modifying data, a request for deleting data, a request for querying data, a request for modifying data, and the like. Wherein the new data request may be for requesting an add operation to be performed on data in the database. The delete data request may be for requesting that a delete operation be performed on data in the database. The modify data request may be for requesting that a modify operation be performed on data in the database. The query data request may be for requesting that a query operation be performed on data in a database.
Since the actual stored data in the target database is in each storage space layer. Therefore, after receiving the original operation request, the target database can determine the storage space layer currently in an available state, i.e., the available storage space layer. And then performing corresponding operation on the available storage space layer according to the original operation request.
For example, the target database may generate a target operation request for the available storage space layer from the original operation request. The target operation request is then sent to the operation interface of the available storage space layer for operating the available storage space layer.
According to the embodiment of the disclosure, from the external view, a user can only see one database of the target database, and cannot see each storage space layer in the target database. From the perspective of the user, the user's operations on the database are only directed to the target database, not to the storage space layer inside the target database. When the internal storage space layer of the target database is switched, the use of the database by the user is not influenced.
The method of operating the database shown above is further described with reference to fig. 5 in conjunction with specific embodiments. Those skilled in the art will appreciate that the following example embodiments are only for the understanding of the present disclosure, and the present disclosure is not limited thereto.
Fig. 5 schematically shows a schematic diagram of a method of operating a database according to another embodiment of the present disclosure.
As shown in fig. 5, the database may include a database tier database and a storage space tier space encapsulated under the database tier. Where database is used to provide access to users, and each space represents a physical database. There may be two spaces under each database, each space being independent of each other.
Illustratively, in this embodiment, when a database is created, one database and one storage space layer space-0 are created. And simultaneously presetting a mapping relation, wherein the mapping relation records the storage space layer which is used under the database, namely the available storage space layer, and the mapping relation is in one-to-one correspondence. The user can query the available storage space layer currently in use through a preset query interface. Initially, the mapping relation records the mapping relation of database- > space-0.
When a user wants to delete a database, a delete instruction may be sent to the database. In response to receiving a user delete instruction for the database, the database and all spaces in the database may be deleted.
In use, a new storage space layer space-1 may be created for the database. When the data online operation is triggered, the available storage space layer can be switched to space-1, and then the data of the new online can be stored under space-1. More specifically, the available storage space layer may be switched to space-1 by calling a mapping Switch (Switch) interface to change the mapping relationship to database- > space-1. When data is written subsequently, the data is written into the new space-1. Note that the old space-0 is still present after the handover is performed.
The user can add, delete, check and change the data in the database. For users, when adding, deleting, checking, changing and the like, the database layer is accessed by the users. Which space is specifically accessed within the database layer is determined by the mapping relationship maintained.
According to the embodiment of the disclosure, the old space-0 still exists after the new data of the user is on line. Therefore, when the user needs to perform data rollback, the mapping relationship can be adjusted to database- > space0 by calling the mapping switching interface, so that the data is rolled back.
According to the embodiment of the disclosure, space-0 and space-1 respectively correspond to one sub-database and are completely independent of each other. Each space has independent meta-information meta and independent underlying storage space, where meta-information may include, for example, the number of slices, data distribution relationships, and the like. The user can dynamically adjust the meta information of the space data according to the data volume. In this embodiment, a configuration interface may be provided for adjusting meta information of space data. For example, the configuration interface may be provided to the user in the form of an HTTP interface. The user can actively call the HTTP interface to adjust the meta information of the space according to the requirement of the user.
According to the embodiment of the disclosure, the sub-databases can be packaged into spaces in database, so that each space corresponds to a completely independent sub-database, and each space can have different fragment numbers and data distribution relations, thereby improving the configuration flexibility of the database. In addition, the fragment number and the data distribution relation of the space can be configured according to the data volume, so that the resource utilization rate is improved.
An apparatus for creating a database according to an embodiment of the present disclosure will be described below with reference to fig. 6.
FIG. 6 schematically shows a block diagram of an apparatus for creating a database according to an embodiment of the present disclosure.
As shown in fig. 6, the apparatus 600 for creating a database includes a first creating module 610, a first packaging module 620, and a first determining module 630.
A first creation module 610 for creating the target database and the first sub-database in response to receiving the database creation request.
A first packaging module 620, configured to package the first sub-database into a first storage space layer of the target database.
A first determining module 630 for determining the first storage space layer as an available storage space layer of the target database.
According to an embodiment of the present disclosure, the apparatus for creating a database may further include a first configuration module, which may be configured to configure the meta information of the first storage space layer according to a first configuration request in response to receiving the first configuration request for the first storage space layer.
According to an embodiment of the present disclosure, the meta-information may include, for example, the number of slices and/or the data distribution relationship.
According to an embodiment of the present disclosure, the encapsulation module may include a generation sub-module, which may be configured to generate an operation interface of the first storage space layer according to an operation function of the first sub-database.
According to an embodiment of the present disclosure, the apparatus for creating a database may further include a second creating module, a second packaging module, a second configuring module, and a switching module. The second creating module may be configured to create a second sub-database. A second packaging module, which may be configured to package the second sub-database as a second storage space layer of the target database. A second configuration module, in response to receiving a second configuration request for the second storage space layer, may be to configure meta information of the second storage space layer according to the second configuration request. A switching module operable to determine the second storage space layer as the available storage space layer in response to receiving a switching request for the second storage space layer.
According to an embodiment of the present disclosure, the apparatus for creating a database may further include a rollback module configured to configure the available storage space layer of the target database as the first storage space layer in response to receiving a rollback request in a case where the available storage space layer of the target database is configured as the second storage space layer.
An apparatus for operating a database according to an embodiment of the present disclosure will be described below with reference to fig. 7.
FIG. 7 schematically illustrates a block diagram of an apparatus for operating a database according to an embodiment of the present disclosure.
As shown in fig. 7, the apparatus 700 for operating a database includes a receiving module 710, a second determining module 720, and an operating module 730.
A receiving module 710, configured to receive an original operation request for a target database.
A second determining module 720 for determining an available storage space layer of the target database.
An operation module 730, configured to operate the available storage space layer according to the original operation request.
Wherein, the target database is created according to the method for creating the database of the embodiment of the disclosure.
According to an embodiment of the present disclosure, the operation module may include a conversion sub-module and a transmission sub-module. The conversion sub-module may be configured to generate a target operation request for the available storage space layer according to the original operation request. A sending submodule, configured to send the target operation request to an operation interface of the available storage space layer, so as to operate the available storage space layer.
According to an embodiment of the present disclosure, the original operation request may include at least one of a request for adding data, a request for deleting data, a request for querying data, and a request for modifying data, for example.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 8 schematically illustrates a block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 801 performs the respective methods and processes described above, such as the method of operating a database and the method of creating a database. For example, in some embodiments, the methods of operating and creating a database may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by computing unit 801, may perform one or more of the steps of the above-described methods of operating and creating databases. Alternatively, in other embodiments, the computing unit 801 may be configured in any other suitable manner (e.g., by means of firmware) to perform the method of operating a database and the method of creating a database.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and a VPS service (Virtual Private Server, or VPS for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (21)

1. A method of creating a database, comprising:
in response to receiving a database creation request, creating a target database and a first sub-database;
packaging the first sub-database into a first storage space layer of the target database; and
determining the first storage space layer as an available storage space layer of the target database.
2. The method of claim 1, further comprising:
in response to receiving a first configuration request for the first storage space layer, configuring meta information of the first storage space layer according to the first configuration request.
3. The method of claim 2, wherein the meta-information comprises a number of shards and/or a data distribution relationship.
4. The method of claim 1, wherein said packaging the first sub-database as a first storage space layer of the target database comprises:
and generating an operation interface of the first storage space layer according to the operation function of the first sub-database.
5. The method of claim 1, further comprising:
creating a second sub-database;
packaging the second sub-database as a second storage space layer of the target database;
in response to receiving a second configuration request for the second storage space layer, configuring meta information of the second storage space layer according to the second configuration request; and
determining the second storage space layer as the available storage space layer in response to receiving a handover request for the second storage space layer.
6. The method of claim 5, further comprising:
in response to receiving a rollback request, configuring the available storage space layer of the target database as the first storage space layer if the available storage space layer of the target database is configured as the second storage space layer.
7. A method of operating a database, comprising:
receiving an original operation request aiming at a target database;
determining an available storage space layer of the target database; and
operating the available storage space layer according to the original operation request, wherein the target database is created according to the method of any of claims 1-6.
8. The method of claim 7, wherein said operating the available storage space layer according to the original operation request comprises:
generating a target operation request aiming at the available storage space layer according to the original operation request; and
sending the target operation request to an operation interface of the available storage space layer in order to operate the available storage space layer.
9. The method of claim 7 or 8, wherein the original operation request comprises at least one of an add data request, a modify data request, a delete data request, a query data request, and a modify data request.
10. An apparatus for creating a database, comprising:
the first creating module is used for responding to the received database creating request and creating a target database and a first sub database;
a first packaging module, configured to package the first sub-database into a first storage space layer of the target database; and
a first determination module to determine the first storage space layer as an available storage space layer for the target database.
11. The apparatus of claim 10, further comprising:
a first configuration module to configure meta information of the first storage space layer according to a first configuration request in response to receiving the first configuration request for the first storage space layer.
12. The apparatus of claim 11, wherein the meta-information comprises a number of shards and/or a data distribution relationship.
13. The apparatus of claim 10, wherein the encapsulation module comprises:
and the generation submodule is used for generating an operation interface of the first storage space layer according to the operation function of the first sub-database.
14. The apparatus of claim 10, further comprising:
the second creating module is used for creating a second sub-database;
a second packaging module, configured to package the second sub-database into a second storage space layer of the target database;
a second configuration module to configure meta information of the second storage space layer according to a second configuration request in response to receiving the second configuration request for the second storage space layer; and
a switching module to determine the second storage space layer as the available storage space layer in response to receiving a switching request for the second storage space layer.
15. The apparatus of claim 14, further comprising:
a rollback module to configure an available storage space layer of the target database as the first storage space layer in response to receiving a rollback request if the available storage space layer of the target database is configured as the second storage space layer.
16. An apparatus for operating a database, comprising:
the receiving module is used for receiving an original operation request aiming at a target database;
a second determination module to determine an available storage space layer of the target database; and
an operation module for operating the available storage space layer according to the original operation request, wherein the target database is created according to the method of any of claims 1-6.
17. The apparatus of claim 16, wherein the operation module comprises:
a conversion submodule, configured to generate a target operation request for the available storage space layer according to the original operation request; and
a sending submodule, configured to send the target operation request to an operation interface of the available storage space layer, so as to operate the available storage space layer.
18. The apparatus of claim 16 or 17, wherein the original operation request comprises at least one of an add data request, a delete data request, a query data request, and a modify data request.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method of any of claims 1-9.
CN202210274610.5A 2022-03-18 2022-03-18 Method for creating database, method and device for operating database Pending CN114647634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210274610.5A CN114647634A (en) 2022-03-18 2022-03-18 Method for creating database, method and device for operating database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210274610.5A CN114647634A (en) 2022-03-18 2022-03-18 Method for creating database, method and device for operating database

Publications (1)

Publication Number Publication Date
CN114647634A true CN114647634A (en) 2022-06-21

Family

ID=81996239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210274610.5A Pending CN114647634A (en) 2022-03-18 2022-03-18 Method for creating database, method and device for operating database

Country Status (1)

Country Link
CN (1) CN114647634A (en)

Similar Documents

Publication Publication Date Title
CN110019080B (en) Data access method and device
WO2023088313A1 (en) Input device virtualization method and apparatus, electronic device, and storage medium
CN110837409A (en) Method and system for executing task regularly
KR20220151585A (en) Business data processing method, apparatus, electronic apparatus, storage media and computer program
CN111259060B (en) Data query method and device
WO2023221416A1 (en) Information generation method and apparatus, and device and storage medium
KR102583532B1 (en) Scheduling method and apparatus, device and storage medium
CN112671892B (en) Data transmission method, device, electronic equipment and medium
CN113282589A (en) Data acquisition method and device
CN111949648B (en) Memory data caching system and data indexing method
CN115934076B (en) Cross-platform client micro-service providing device and method and electronic equipment
CN115514718B (en) Data interaction method, control layer and equipment based on data transmission system
CN116126916A (en) Data query method, device and equipment based on intelligent network card
CN116185578A (en) Scheduling method of computing task and executing method of computing task
CN114647634A (en) Method for creating database, method and device for operating database
CN113051510B (en) Interactive processing method, device, front-end equipment, back-end equipment and storage medium
CN113297516A (en) Customer interaction interface generation method and device and electronic equipment
CN109213815B (en) Method, device, server terminal and readable medium for controlling execution times
CN112965836A (en) Service control method and device, electronic equipment and readable storage medium
CN114416414B (en) Fault information positioning method, device, equipment and storage medium
CN111459981A (en) Query task processing method, device, server and system
CN112989250B (en) Web service response method and device and electronic equipment
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN114528444B (en) Graph data processing method and device, electronic equipment and storage medium
CN110262756B (en) Method and device for caching data

Legal Events

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