CN112699133A - Database operation method and device and computer readable medium - Google Patents

Database operation method and device and computer readable medium Download PDF

Info

Publication number
CN112699133A
CN112699133A CN202110305114.7A CN202110305114A CN112699133A CN 112699133 A CN112699133 A CN 112699133A CN 202110305114 A CN202110305114 A CN 202110305114A CN 112699133 A CN112699133 A CN 112699133A
Authority
CN
China
Prior art keywords
corresponding relation
database
unique identifier
storage medium
storage module
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
CN202110305114.7A
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.)
Zhejiang Taimei Medical Technology Co Ltd
Original Assignee
Zhejiang Taimei Medical 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 Zhejiang Taimei Medical Technology Co Ltd filed Critical Zhejiang Taimei Medical Technology Co Ltd
Priority to CN202110305114.7A priority Critical patent/CN112699133A/en
Publication of CN112699133A publication Critical patent/CN112699133A/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/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

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

Abstract

The invention relates to an operation method and device of a database and a computer readable medium. The operation method comprises the following steps: performing table division processing according to a unique identifier, distributing service data corresponding to the unique identifier to a table in a database, and establishing a corresponding relation between the unique identifier and the table, wherein the database is stored based on a first storage medium; storing the corresponding relation into a storage module as a first corresponding relation, wherein the storage module stores the corresponding relation based on a second storage medium, and the access speed of the second storage medium is higher than that of the first storage medium; and inquiring the first corresponding relation in the storage module according to the unique identifier. According to the operation method, the capacity expansion of the database can be realized without data migration, the operation is simple and convenient, and the result is accurate.

Description

Database operation method and device and computer readable medium
Technical Field
The invention mainly relates to the field of clinical trial research, in particular to an operation method and device of a database and a computer readable medium.
Background
With the development of internet technology, the application of SAAS (Software-as-a-Service) Software is becoming more and more widespread. In the field of clinical trial studies, relevant subject information needs to be collected for research purposes and as the subject information grows with the progress of the study, reasonable management of the subject information is required, usually in the form of databases and tables. However, the storage capacity of the table is limited, and when the data amount reaches the limit of single-table storage, the capacity of the database needs to be considered to be expanded, namely, the data is subjected to table division processing.
In some cases, the new data may be stored directly in the new table. However, in some cases, all data needs to be redistributed. For example, the data stored in the original table is close to the upper limit, which results in slow access speed to the data, and therefore, a part of the data needs to be stored in the new table, and the table position of the part of the data needs to be changed. For another example, 1 original table is divided into 10 tables, and all data are redistributed according to certain rules, for example, the data are distinguished according to the hospitals for data acquisition, and one table is used for storing the data from one hospital, so that the subsequently added data can be respectively filled into different tables according to the hospitals for data acquisition, statistics and management of the data are facilitated, and the original data almost need to be redistributed completely. Such sub-table processing presents a problem of data migration. With the rapid increase of the traffic, the table division processing may be performed multiple times, and each table division processing may cause data migration. Since the data migration may cause the position of the data in the table to change, the migration process is complex, the workload of program operation is increased, and error and leakage are easily caused.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a database operation method, a database operation device and a computer readable medium, wherein the database operation method, the database operation device and the computer readable medium are simple and convenient to operate and accurate in result.
The technical solution adopted to solve the above technical problems is a database operation method, which is characterized by comprising: performing table division processing according to a unique identifier, distributing service data corresponding to the unique identifier to a table in a database, and establishing a corresponding relation between the unique identifier and the table, wherein the database is stored based on a first storage medium; storing the corresponding relation into a storage module as a first corresponding relation, wherein the storage module stores the corresponding relation based on a second storage medium, and the access speed of the second storage medium is higher than that of the first storage medium; and inquiring the first corresponding relation in the storage module according to the unique identifier.
In an embodiment of the present invention, the first storage medium includes a hard disk, and the second storage medium includes a computer memory.
In an embodiment of the present invention, the storing the corresponding relationship in the storage module further includes asynchronously storing the corresponding relationship in the database as a second corresponding relationship; and the step of inquiring the first corresponding relation in the storage module according to the unique identifier further comprises the following steps: and if the first corresponding relation does not exist, inquiring the second corresponding relation in the database according to the unique identifier.
In an embodiment of the present invention, the method further includes: if the second corresponding relation does not exist, performing table division processing according to the unique identifier, distributing the service data corresponding to the unique identifier to a table in the database, and establishing the corresponding relation between the unique identifier and the table; and storing the correspondence in the storage module as the first correspondence.
In an embodiment of the present invention, the step of performing table division processing according to the unique identifier includes: and processing the unique identification by adopting a consistent Hash algorithm, determining the table corresponding to the unique identification according to a calculation result, and establishing the corresponding relation.
In an embodiment of the present invention, the method further includes: and when the corresponding relation is established, storing the corresponding relation to the storage module in real time.
In an embodiment of the present invention, the storage module includes a redis cache.
In an embodiment of the invention, the unique identifier comprises a service key.
In one embodiment of the invention, the business key comprises a subject ID in a clinical trial study.
The present invention further provides an operating device for a database to solve the above technical problems, comprising: a memory for storing instructions executable by the processor; a processor for executing the instructions to implement the method of operation as described above.
The present invention also provides a computer readable medium storing computer program code, which when executed by a processor implements the operating method as described above.
According to the operation method and the device of the database, the corresponding relation between the unique identifier and the table is stored by the storage module when the sub-table processing is executed, the corresponding relation is directly inquired in the storage module when the inquiry operation is executed, the table corresponding to the unique identifier can be obtained, the capacity expansion of the database can be realized without data migration, the operation is simple and convenient, and the result is accurate.
Drawings
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below, wherein:
FIG. 1 is an exemplary flow chart of a method of operation of a database in accordance with an embodiment of the present invention;
FIG. 2A is one of the schematic diagrams of sub-table processing in the method of operation of the present invention;
FIG. 2B is a second schematic diagram illustrating sub-table processing in the method of operation according to the second embodiment of the present invention;
FIG. 2C is a third schematic diagram illustrating a sub-table process in the method of operation according to the present invention;
FIG. 3 is an exemplary flow chart of a method of operation of a database of another embodiment of the present invention;
FIG. 4 is a user-implemented flowchart illustrating a method of operating a database, in accordance with an embodiment of the present invention;
FIG. 5 is a second flowchart illustrating a user-implemented method of operating a database according to an embodiment of the present invention;
fig. 6 is a system block diagram of an operating device for a database according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those specifically described herein, and thus the present invention is not limited to the specific embodiments disclosed below.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements.
The relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description. Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate. In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
It should be noted that the terms "first", "second", and the like are used to define the components, and are only used for convenience of distinguishing the corresponding components, and the terms have no special meanings unless otherwise stated, and therefore, the scope of protection of the present application is not to be construed as being limited. Further, although the terms used in the present application are selected from publicly known and used terms, some of the terms mentioned in the specification of the present application may be selected by the applicant at his or her discretion, the detailed meanings of which are described in relevant parts of the description herein. Further, it is required that the present application is understood not only by the actual terms used but also by the meaning of each term lying within.
Flow charts are used herein to illustrate operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, various steps may be processed in reverse order or simultaneously. Meanwhile, other operations are added to or removed from these processes.
FIG. 1 is an exemplary flow chart of a method of operation of a database in accordance with an embodiment of the present invention. Referring to fig. 1, the operation method of this embodiment includes the steps of:
step S110: performing table division processing according to the unique identifier, distributing the service data corresponding to the unique identifier to a table in a database, and establishing a corresponding relation between the unique identifier and the table, wherein the database is stored based on a first storage medium;
step S120: storing the corresponding relation into a storage module as a first corresponding relation, wherein the storage module stores the corresponding relation based on a second storage medium, and the access speed of the second storage medium is higher than that of the first storage medium; and
step S130: and inquiring the first corresponding relation in the storage module according to the unique identifier.
The above steps are described in detail below.
In step S110, the unique identifier refers to an identifier that can be used to uniquely identify the set of business data for the business data to be stored in the database. For example, for a clinical trial study, the business data to be collected includes categories of subject ID, data collection hospital name, subject name, age, sex, medical history, medication history, etc. for a study, and a set of business data includes specific data corresponding to all these categories. One of all categories is selected as a unique identifier.
In some embodiments, the unique identification comprises a Business Key (Business Key). The service key may be one or more attributes in a table in a database.
In some embodiments, the business key comprises a subject ID in a clinical trial study. For an independent clinical trial study, the subject ID can be used to uniquely identify the subject and its associated business data. Thus, in clinical trial studies, a subject ID is used as a unique identifier that identifies the location of the subject in the database.
In step S110, the service data corresponding to the unique identifier is allocated to a table in the database. The service data corresponding to the unique identifier may be original data in the database, and all the original data need to be redistributed based on the requirement of capacity expansion of the database; or it may be newly added service data that needs to be allocated to a table in the database.
The correspondence R between the unique identifier and the table established in step S110 at least includes the location of the unique identifier and the table that the unique identifier should be stored in. For example, if the business data with subject ID 20210001 is stored in table a, the correspondence R includes at least information such as {202010001, a } via step S110. According to the requirement, the corresponding relation R may further include other service data contents.
In some embodiments, the correspondence is stored in text form, such as json (javascript Object notification) text.
The database in the invention is stored based on the first storage medium, preferably, the first storage medium is a hard disk, which can ensure that the database can stably store a large amount of service data.
In some embodiments, a consistent hashing algorithm is used for processing the unique identifier, a table corresponding to the unique identifier is determined according to a calculation result, and a corresponding relation between the unique identifier and the table is established.
FIG. 2A is a diagram illustrating a sub-table process in the method of operation according to an embodiment of the present invention. Referring to FIG. 2A, according to the consistent hashing algorithm, 0 is taken as the start of circle 210, 232-1 as the end point of the circle 210, data 0~232-1 are evenly distributed on the circumference of the circle 210 in a clockwise direction. Wherein, Node1, Node2, Node3 represent 3 nodes, each Node corresponds to a table in the database, for example, Node1 corresponds to table 1, Node2 corresponds to table 2, Node3 corresponds to table 3, Node4 corresponds to table 4.
After applying a consistent hashing algorithm to the unique identifier, e.g. for subject ID pair 232The result of the modulo would fall somewhere on the circumference of circle 210. Looking clockwise along the position for the first node encountered is the table to which the unique identifier is assigned. For example, if the result 221 of the subject ID1 after being modulo falls between Node4 and Node1, the data corresponding to the subject D1 would be stored in table 1; the result 222 of the subject ID2 after being modulo falls between Node1 and Node2, and the data corresponding to the subject ID2 is stored in Table 2; and so on.
FIG. 2B is a second schematic diagram illustrating sub-table processing in the operating method according to the embodiment of the invention. In contrast to FIG. 2A, FIG. 2B illustrates the situation when a table is deleted in the database. As shown in fig. 2B, assuming table 2 is deleted in the database, the nodes Node2 are deleted accordingly on the circumference of the circle 210 according to the consistent hash algorithm. This delete operation affects the data located between Node1 and Node2, which is otherwise stored in table 2. When table 2 is deleted, the data needs to be stored clockwise in table 3 corresponding to Node 3. As shown in fig. 2B, the result of the modulo of subject ID2 is result 222, and after table 2 is deleted, the data corresponding to subject ID2 is stored in table 3.
Fig. 2C is a third schematic diagram of the sub-table processing in the operation method according to the embodiment of the invention. FIG. 2C shows the case when a table is added to the database. As shown in fig. 2C, assuming table 5 is added to the database, a Node5 is correspondingly added on the circumference of the circle 210. The Node5 is located between the nodes Node1 and Node 2. If tables are reallocated for data according to the consistent hash algorithm, the data with the modulo result between Node1 and Node5 needs to be allocated to table 5 corresponding to Node5, and the rest of the data is not changed. As shown in fig. 2C, the result of subject ID2 after being modulo is result 222, and after table 5 is added, the data corresponding to subject ID2 should be stored in table 5.
The table to be stored is allocated to the data according to the consistent hash algorithm, only a part of the data needs to be reallocated, and the data migration volume can be reduced.
The invention adopts a consistent Hash algorithm to establish the corresponding relation between the unique identifier and the table, uses the corresponding relation in the subsequent steps, does not need the step of actually executing data migration, and can realize zero migration of the sub-table data. Because the data migration amount caused by the consistent hash algorithm is small no matter the table is added or deleted, the number of the corresponding relations established in step S110 of the present invention is also small.
In step S120, the correspondence R established in step S110 is stored in the storage module as the first correspondence R1. The storage module is stored based on a second storage medium, and an access speed of the second storage medium is higher than an access speed of the first storage medium.
The first corresponding relation R1 can be copied from the corresponding relation R, and contains the same content. It is understood that the storage formats of the first correspondence R1 and the correspondence R may be different depending on their storage media based on the respective storage mechanisms.
Preferably, the second storage medium comprises computer memory. Computer memory includes Random Access Memory (RAM), Dynamic RAM (DRAM), Static RAM (SRAM), Synchronous DRAM (SDRAM), Double Data Rate (DDR) SDRAM (DDR-SDRAM), Rambus DRAM (RDRAM), or any device capable of supporting high speed storage of data. The access speed of the computer memory is higher than that of the hard disk. The computer memory also comprises a CPU memory, and the access speed of the CPU memory is higher than that of other computer memories.
When the first storage medium is a hard disk, the second storage medium may be CPU memory or other computer memory.
When the first storage medium is other computer memory, the second storage medium may be CPU memory.
In some embodiments, the first storage medium is different from the second storage medium, and the access speed of the second storage medium is higher than the access speed of the first storage medium.
In some embodiments, the first storage medium is the same as the second storage medium, but the access speed of the second storage medium is higher than the access speed of the first storage medium.
In a preferred embodiment, the second storage medium is a redis cache.
Through steps S110 and S120, the service data and the table are made to establish a correspondence, and the first correspondence R1 is stored in the storage module.
Step S130 corresponds to a query operation on the database. The query is typically made directly to the database. In the present invention, since the correspondence is stored in the storage module when the table splitting process is performed, the first correspondence R1 is queried in the storage module according to the unique identifier in step S130. The storage module has a higher access speed, so that the position of the table where the unique identifier is located can be quickly obtained, and the corresponding relation between the unique identifier and the table is determined.
Fig. 3 is an exemplary flowchart of a method of operation of a database according to another embodiment of the present invention. Referring to fig. 3, the operating method includes the steps of:
step S310: the corresponding relation is stored in a storage module, and the corresponding relation is asynchronously stored in a database to be used as a second corresponding relation; and
step S320: the step of querying the first corresponding relationship in the storage module according to the unique identifier further includes: and if the first corresponding relation does not exist, inquiring the second corresponding relation in the database according to the unique identifier.
Step S310 may be performed simultaneously with step S120 shown in fig. 1. While the correspondence R is stored in the storage module as the first correspondence R1 in step S120, the correspondence R is also asynchronously stored in the database as the second correspondence R2.
Step S310 optionally stores the correspondence R in a database, i.e. in a first storage medium. Certain guarantees are provided for the query operation of step S130.
In some embodiments, if the computer memory is used as the second storage medium, in some cases, when the amount of data in the computer memory reaches an upper limit, the operating system may delete some old data according to a certain deletion policy when new data needs to be stored. If the first corresponding relation R1 to be queried in step S130 happens to be deleted, and the first corresponding relation R1 cannot be found in the storage module, the second corresponding relation R2 provides a backup of the information.
In step S320, when the user queries the first corresponding relation R1 in the storage module according to the unique identifier, but the first corresponding relation R1 does not exist, the user queries the second corresponding relation R2 in the database.
In some embodiments, the embodiment shown in fig. 3 further includes step S330: if the second corresponding relationship does not exist, step S110 is executed. In these embodiments, since neither the first correspondence R1 nor the second correspondence R2 exists, step S110 is performed to create the correspondence R of the unique identifier and the table.
In some embodiments, when the correspondence R is established in step S110, the correspondence R is stored in the storage module in real time as the first correspondence R1. In these embodiments, also in step S310, the correspondence R is asynchronously stored into the database as a second correspondence R2.
The concept of asynchronous storage is explained here. Assuming that the correspondence R is stored in the storage module in real time in the first storage operation, the first storage speed is V1; in the second storing operation, the correspondence R is asynchronously stored to the database, the second storing speed is V2, wherein the first storing speed V1 is different from the second storing speed V2. The first storage operation and the second storage operation occupy different processes or threads, respectively, and can be executed asynchronously at the same time. In some embodiments, the first storage speed V1 is greater than the second storage speed V2. Thus, there may be a case where the second storage operation has not ended while the first storage operation has ended. In the present invention, when the operation of storing the correspondence R in the storage module in real time has ended, the operation of storing the correspondence R in the data asynchronously may not have ended yet.
Fig. 4 is one of the user execution flow diagrams of the database operation method according to an embodiment of the present invention. In conjunction with the embodiments shown in fig. 4 and fig. 1 and 3, in the case that the table division processing is required, the user 410 establishes the correspondence R between the unique identifier and the table in step S420. Step S420, which integrates step S110 and step S310, stores the correspondence R in real time in a storage module based on the second storage medium 421 as the first correspondence R1; while the correspondence R is asynchronously stored in a database based on the first storage medium 422 as a second correspondence R2. Wherein the access speed of the second storage medium 421 is higher than that of the first storage medium 422.
The embodiment shown in fig. 4 illustrates the flow of performing a create operation according to the method of operation of the present invention.
FIG. 5 is a second flowchart illustrating a user-implemented method of operating a database according to an embodiment of the present invention. In conjunction with the embodiments shown in fig. 5 and fig. 1 and 3, the user 510 performs the following query operations from step S520:
step S520: the first correspondence R1 is queried in the storage module according to the unique identification.
Step S530: it is judged whether or not the first correspondence relationship R1 is obtained. If yes, the process is ended; if not, the step S540 is continued.
Step S540: the second correspondence R2 is queried in the database according to the unique identification.
Step S550: it is judged whether or not the second correspondence relationship R2 is obtained. If yes, the process is ended; if not, continue to step S560.
Step S560: and establishing a corresponding relation R of the unique identification and the table. Since the first corresponding relation R1 and the second corresponding relation R2 are not obtained in both step S530 and step S550, in this case, the unique identifier indicating that the user 510 is to query in step S520 does not establish a relationship with the table in the database. In this step, a table division process is performed according to the unique identifier, and a table is allocated to the unique identifier, so that a new corresponding relationship R is established.
Similar to the embodiment shown in fig. 4, after the correspondence R is established, the correspondence R is stored in real time in a storage module based on the second storage medium 571 as the first correspondence R1; the correspondence R is also asynchronously stored as a second correspondence R2 in a database that is based on the first storage medium 572. Wherein the access speed of the second storage medium 571 is higher than that of the first storage medium 572.
The embodiment shown in fig. 5 illustrates the flow of performing query operations and create operations in accordance with the method of operation of the present invention. According to the embodiment shown in fig. 5, the query operation and the creation operation are combined, and when the correspondence R is found not to exist in both the first storage medium 572 and the second storage medium 571, the correspondence R is created.
According to the operation method of the database, when the sub-table processing is executed, the storage module is used for storing the unique identifier and the corresponding relation R of the table, when the query operation is executed, the corresponding relation R is directly queried in the storage module, the table corresponding to the unique identifier can be obtained, the capacity expansion of the database can be realized without data migration, the operation is simple and convenient, and the result is accurate.
According to the operation method of the database, the corresponding relation R is stored in the database besides the storage module, so that double insurance is provided for the created corresponding relation R, and the reliability of data query is guaranteed.
The invention also comprises an operating device of the database, which comprises a memory and a processor. Wherein the memory is to store instructions executable by the processor; the processor is configured to execute the instructions to implement the method of operation for a database described above.
Fig. 6 is a system block diagram of an operating device for a database according to an embodiment of the present invention. Referring to fig. 6, the operating device 600 may include an internal communication bus 601, a processor 602, a Read Only Memory (ROM) 603, a Random Access Memory (RAM) 604, and a communication port 605. When used on a personal computer, the operating device 600 may also include a hard disk 606. The internal communication bus 601 may enable data communication among the components of the operating device 600. Processor 602 may make the determination and issue a prompt. In some embodiments, the processor 602 may be comprised of one or more processors. The communication port 605 can enable data communication between the operation device 600 and the outside. In some embodiments, the operator 600 may send and receive information and data from a network through the communication port 605. The operating device 600 may also include various forms of program storage units and data storage units, such as a hard disk 606, Read Only Memory (ROM) 603 and Random Access Memory (RAM) 604, capable of storing various data files for computer processing and/or communication, and possibly program instructions for execution by the processor 602. The processor executes these instructions to implement the main parts of the method. The results processed by the processor are communicated to the user device through the communication port and displayed on the user interface.
The above-described operation method can be implemented as a computer program, stored in the hard disk 606, and loaded into the processor 602 to be executed, so as to implement the operation method of the present application.
The invention also comprises a computer-readable medium having stored thereon computer program code which, when executed by a processor, implements the method of operation for a database described hereinbefore.
The method of operation for a database, when implemented as a computer program, may also be stored as an article of manufacture in a computer-readable storage medium. For example, computer-readable storage media can include but are not limited to magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD)), smart cards, and flash memory devices (e.g., electrically Erasable Programmable Read Only Memory (EPROM), card, stick, key drive). In addition, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media (and/or storage media) capable of storing, containing, and/or carrying code and/or instructions and/or data.
It should be understood that the above-described embodiments are illustrative only. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processor may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, and/or other electronic units designed to perform the functions described herein, or a combination thereof.
Aspects of the present application may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software. The above hardware or software may be referred to as "data block," module, "" engine, "" unit, "" component, "or" system. The processor may be one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), digital signal processing devices (DAPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or a combination thereof. Furthermore, aspects of the present application may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips … …), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD) … …), smart cards, and flash memory devices (e.g., card, stick, key drive … …).
The computer readable medium may comprise a propagated data signal with the computer program code embodied therein, for example, on a baseband or as part of a carrier wave. The propagated signal may take any of a variety of forms, including electromagnetic, optical, and the like, or any suitable combination. The computer readable medium can be any computer readable medium that can communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device. Program code on a computer readable medium may be propagated over any suitable medium, including radio, electrical cable, fiber optic cable, radio frequency signals, or the like, or any combination of the preceding.
Having thus described the basic concept, it will be apparent to those skilled in the art that the foregoing disclosure is by way of example only, and is not intended to limit the present application. Various modifications, improvements and adaptations to the present application may occur to those skilled in the art, although not explicitly described herein. Such modifications, improvements and adaptations are proposed in the present application and thus fall within the spirit and scope of the exemplary embodiments of the present application.
Also, this application uses specific language to describe embodiments of the application. Reference throughout this specification to "one embodiment," "an embodiment," and/or "some embodiments" means that a particular feature, structure, or characteristic described in connection with at least one embodiment of the present application is included in at least one embodiment of the present application. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, some features, structures, or characteristics of one or more embodiments of the present application may be combined as appropriate.
Numerals describing the number of components, attributes, etc. are used in some embodiments, it being understood that such numerals used in the description of the embodiments are modified in some instances by the use of the modifier "about", "approximately" or "substantially". Unless otherwise indicated, "about", "approximately" or "substantially" indicates that the number allows a variation of ± 20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximations that may vary depending upon the desired properties of the individual embodiments. In some embodiments, the numerical parameter should take into account the specified significant digits and employ a general digit preserving approach. Notwithstanding that the numerical ranges and parameters setting forth the broad scope of the range are approximations, in the specific examples, such numerical values are set forth as precisely as possible within the scope of the application.

Claims (11)

1. A method of operating a database, comprising:
performing table division processing according to a unique identifier, distributing service data corresponding to the unique identifier to a table in a database, and establishing a corresponding relation between the unique identifier and the table, wherein the database is stored based on a first storage medium;
storing the corresponding relation into a storage module as a first corresponding relation, wherein the storage module stores the corresponding relation based on a second storage medium, and the access speed of the second storage medium is higher than that of the first storage medium; and
and inquiring the first corresponding relation in the storage module according to the unique identifier.
2. The method of operation of claim 1 wherein the first storage medium comprises a hard disk and the second storage medium comprises computer memory.
3. The method of operation of claim 1, storing the correspondence in a storage module while also including asynchronously storing the correspondence in the database as a second correspondence; and
the step of querying the first corresponding relationship in the storage module according to the unique identifier further includes: and if the first corresponding relation does not exist, inquiring the second corresponding relation in the database according to the unique identifier.
4. The method of operation of claim 3, further comprising:
if the second corresponding relation does not exist, performing table division processing according to the unique identifier, distributing the service data corresponding to the unique identifier to a table in the database, and establishing the corresponding relation between the unique identifier and the table; and
and storing the corresponding relation into the storage module as the first corresponding relation.
5. The method of claim 1, wherein the step of performing sub-table processing based on the unique identifier comprises: and processing the unique identification by adopting a consistent Hash algorithm, determining the table corresponding to the unique identification according to a calculation result, and establishing the corresponding relation.
6. The method of operation of claim 1, further comprising: and when the corresponding relation is established, storing the corresponding relation to the storage module in real time.
7. The method of operation of claim 1, wherein the storage module comprises a redis cache.
8. The method of operation of claim 1 wherein the unique identification comprises a service key.
9. The method of operation of claim 8, wherein the business key comprises a subject ID in a clinical trial study.
10. An operating device for a database, comprising:
a memory for storing instructions executable by the processor;
a processor for executing the instructions to implement the method of operation of any of claims 1-9.
11. A computer-readable medium having stored thereon computer program code which, when executed by a processor, implements the method of operation of any of claims 1-9.
CN202110305114.7A 2021-03-23 2021-03-23 Database operation method and device and computer readable medium Pending CN112699133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110305114.7A CN112699133A (en) 2021-03-23 2021-03-23 Database operation method and device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110305114.7A CN112699133A (en) 2021-03-23 2021-03-23 Database operation method and device and computer readable medium

Publications (1)

Publication Number Publication Date
CN112699133A true CN112699133A (en) 2021-04-23

Family

ID=75515373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110305114.7A Pending CN112699133A (en) 2021-03-23 2021-03-23 Database operation method and device and computer readable medium

Country Status (1)

Country Link
CN (1) CN112699133A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033882A (en) * 2009-09-25 2011-04-27 中兴通讯股份有限公司 Method and system for storing performance data
CN102968478A (en) * 2012-11-19 2013-03-13 天津书生投资有限公司 Indexing and searching method
CN103425684A (en) * 2012-05-18 2013-12-04 中兴通讯股份有限公司 Method and device for database operation
CN104408073A (en) * 2014-10-31 2015-03-11 广州华多网络科技有限公司 Data operation method and device
CN108763381A (en) * 2018-05-18 2018-11-06 深圳市彬讯科技有限公司 Divide table method and apparatus based on consistency hash algorithm
CN111190928A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Cache processing method and device, computer equipment and storage medium
CN111930716A (en) * 2020-07-31 2020-11-13 中国工商银行股份有限公司 Database capacity expansion method, device and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033882A (en) * 2009-09-25 2011-04-27 中兴通讯股份有限公司 Method and system for storing performance data
CN103425684A (en) * 2012-05-18 2013-12-04 中兴通讯股份有限公司 Method and device for database operation
CN102968478A (en) * 2012-11-19 2013-03-13 天津书生投资有限公司 Indexing and searching method
CN104408073A (en) * 2014-10-31 2015-03-11 广州华多网络科技有限公司 Data operation method and device
CN108763381A (en) * 2018-05-18 2018-11-06 深圳市彬讯科技有限公司 Divide table method and apparatus based on consistency hash algorithm
CN111190928A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Cache processing method and device, computer equipment and storage medium
CN111930716A (en) * 2020-07-31 2020-11-13 中国工商银行股份有限公司 Database capacity expansion method, device and system

Similar Documents

Publication Publication Date Title
US10346363B2 (en) Deduplicated file system
US11176099B2 (en) Lockless synchronization of LSM tree metadata in a distributed system
US20160350302A1 (en) Dynamically splitting a range of a node in a distributed hash table
CN109033360B (en) Data query method, device, server and storage medium
US8719237B2 (en) Method and apparatus for deleting duplicate data
CN117609183A (en) System and method for database tenant migration
US11580162B2 (en) Key value append
CN106484820B (en) Renaming method, access method and device
US20200201821A1 (en) Synchronization of index copies in an lsm tree file system
CN111324665B (en) Log playback method and device
Binani et al. SQL vs. NoSQL vs. NewSQL-a comparative study
CN104111804A (en) Distributed file system
US10685031B2 (en) Dynamic hash partitioning for large-scale database management systems
US10983909B2 (en) Trading off cache space and write amplification for Bε-trees
US10515055B2 (en) Mapping logical identifiers using multiple identifier spaces
CN105005567B (en) Interest point query method and system
WO2024082787A1 (en) Method and apparatus for creating tablespace, storage medium, and electronic device
CN115114232A (en) Method, device and medium for enumerating historical version objects
CN103942301A (en) Distributed file system oriented to access and application of multiple data types
CN107181773A (en) Data storage and data managing method, the equipment of distributed memory system
US10146833B1 (en) Write-back techniques at datastore accelerators
US20190243807A1 (en) Replication of data in a distributed file system using an arbiter
CN111651424B (en) Data processing method, device, data node and storage medium
CN112905708A (en) Database operation method and system based on software as a service (SaaS) system
CN112699133A (en) Database operation method and device and computer readable medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210423

RJ01 Rejection of invention patent application after publication