[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN115982148A - Database table processing method and device, electronic equipment and storage medium - Google Patents

Database table processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115982148A
CN115982148A CN202310034511.4A CN202310034511A CN115982148A CN 115982148 A CN115982148 A CN 115982148A CN 202310034511 A CN202310034511 A CN 202310034511A CN 115982148 A CN115982148 A CN 115982148A
Authority
CN
China
Prior art keywords
partition
database table
time
processing
flow
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
CN202310034511.4A
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310034511.4A priority Critical patent/CN115982148A/en
Publication of CN115982148A publication Critical patent/CN115982148A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a processing method and device of a database table, electronic equipment and a storage medium, and relates to the technical field of computers, big data storage, cloud computing and distributed storage. One embodiment of the method comprises: receiving a processing instruction of a database table, and acquiring a corresponding database table and a corresponding processing type; responding to the processing type including pre-partition processing, acquiring target service time of a database table, and inquiring starting time and first ending time of a first partition corresponding to the database table to determine a first partition processing flow of the database table; and responding to the processing type including post-partition processing, determining the target end time corresponding to the database table, and inquiring the second end time of the last partition corresponding to the database table to determine a second partition processing flow of the database table. The method and the device can solve the problem that operation and maintenance personnel frequently operate the database and manually add or delete the partitions one by one, so that the efficiency and the accuracy of partition processing of the data table are low.

Description

Database table processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computers, big data storage, cloud computing and distributed storage, in particular to a processing method and device of a database table, electronic equipment and a storage medium.
Background
With the continuous development and optimization of the database, the database table supports the processing of the large table partition, namely, the large table is divided into a plurality of modes similar to small tables for storage management, and partial partition data can be inquired according to partition keys when the data is accessed, so that the low access efficiency caused by the scanning of the whole table is avoided. In some scenarios, the originally created partitions may be insufficient or redundant, requiring partition expansion or pruning. In the prior art, the creation, expansion and deletion of the database table partitions are usually manually processed by operation and maintenance personnel, but the operation and maintenance personnel frequently operate the database and manually add and delete the partitions one by one, which not only consumes time, but also easily makes mistakes, thus resulting in lower efficiency and accuracy of partition processing of the database table.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing a database table, an electronic device, and a storage medium, which can solve the problem that operation and maintenance staff frequently operate a database and manually add or delete partitions one by one, resulting in low efficiency and accuracy of partition processing of the database table.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method for processing a database table is provided.
The method for processing the database table comprises the following steps: receiving a processing instruction of a database table, and acquiring a corresponding database table and a corresponding processing type;
responding to the processing type including pre-partition processing, acquiring target service time of the database table, inquiring starting time and first ending time of a first partition corresponding to the database table, determining a first partition processing flow of the database table based on the size relationship between the starting time and the target service time and the size relationship between the first ending time and the target service time, and executing the first partition processing flow;
and in response to the processing type including post-partition processing, determining a target end time corresponding to the database table, querying a second end time corresponding to a last partition of the database table, and determining a second partition processing flow of the database table based on a size relationship between the second end time and the target end time so as to execute the second partition processing flow.
In one embodiment, determining the first partition processing flow of the database table based on the size relationship between the start time, the first end time and the target business time comprises:
in response to the target service time being less than the start time, determining that the first partition processing flow is a partition expansion flow; and in response to the target business time being greater than or equal to the starting time, determining a first partition processing flow of the database table based on a magnitude relationship between the first ending time and the target business time.
In another embodiment, determining a first partition process flow of the database table based on a magnitude relationship between the first end time and the target business time comprises:
and determining that the first partition processing flow of the database table is a partition deleting flow in response to the first end time being smaller than the target business time.
In yet another embodiment, after determining that the first partition process flow is a partition expansion flow, executing the first partition process flow comprises:
obtaining a partition step size to expand a partition based on the partition step size, configuring the expanded partition as a first partition of the database table.
In another embodiment, determining a second partition process flow for the database table based on a magnitude relationship between the second end time and the target end time comprises:
and determining that the second partition processing flow of the database table is a partition expansion flow in response to the second end time being less than the target end time.
In another embodiment, determining the target end time corresponding to the database table comprises:
and acquiring the current service time of the data table and a preset partition expansion demand parameter so as to calculate the target end time corresponding to the data table.
In yet another embodiment, the target business time comprises a minimum business time of the database table.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a processing apparatus for a database table.
The processing device of the database table of the embodiment of the invention comprises: the receiving unit is used for receiving a processing instruction of the database table and acquiring the corresponding database table and processing type;
the processing unit is used for responding to the processing type of pre-partition processing, acquiring target service time of the database table, inquiring starting time and first ending time of a first partition corresponding to the database table, determining a first partition processing flow of the database table based on the size relationship between the starting time and the target service time and the size relationship between the first ending time and the target service time, and executing the first partition processing flow;
the processing unit is further configured to determine a target end time corresponding to the database table in response to the processing type being post-partition processing, query a second end time corresponding to a last partition of the database table, and determine a second partition processing flow of the database table based on a size relationship between the second end time and the target end time to execute the second partition processing flow.
In an embodiment, the processing unit is specifically configured to:
in response to the target service time being less than the start time, determining that the first partition processing flow is a partition expansion flow; and in response to the target business time being greater than or equal to the starting time, determining a first partition processing flow of the database table based on a magnitude relationship between the first ending time and the target business time.
In another embodiment, the processing unit is specifically configured to:
and determining that the first partition processing flow of the database table is a partition deleting flow in response to the first end time being smaller than the target business time.
In another embodiment, the processing unit is specifically configured to:
obtaining a partition step size to expand a partition based on the partition step size, configuring the expanded partition as a first partition of the database table.
In another embodiment, the processing unit is specifically configured to:
and in response to the second end time being less than the target end time, determining that a second partition processing flow of the database table is a partition expansion flow.
In another embodiment, the processing unit is specifically configured to:
and acquiring the current service time of the data table and a preset partition expansion demand parameter so as to calculate the target end time corresponding to the data table.
In yet another embodiment, the target business time comprises a minimum business time of the database table.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the processing method of the database table provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, which, when executed by a processor, implements a method for processing a database table provided by an embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer program product.
The computer program product of the embodiment of the invention comprises a computer program, and the computer program realizes the processing method of the database table provided by the embodiment of the invention when being executed by a processor.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, the partition of the database table can be triggered to be processed by triggering the processing instruction of the database table, the partition processing of the database table is divided into two types of front partition processing and rear partition processing, and the automatic maintenance and processing of the partition of the database table are realized by distinguishing different processing modes of the front partition and the rear partition, so that the partition is not required to be manually added and deleted by operation and maintenance personnel, the problems of time consumption and easy error in processing the database table are avoided, and the efficiency and the accuracy of the partition processing of the database table are improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of one principal flow of a method of processing database tables according to an embodiment of the invention;
FIG. 2 is a schematic diagram of another main flow of a processing method of a database table according to an embodiment of the invention;
FIG. 3 is a schematic diagram of another main flow of a processing method of a database table according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main elements of a processing device of a database table according to an embodiment of the invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention 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 invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
The embodiment of the invention provides a database table processing system, which can be used for maintaining and processing scenes of database table partitions, and particularly can be used for processing partition memorability expansion or deletion of the database tables and the like.
It should be noted that, in the embodiment of the present invention, the database table may be a database table in a PG database, and is maintained in a partitioned manner through an automated table, including defining the range of the operation and maintenance table according to schema and fuzzy identification of table names, and even covering a time partition table of the entire database.
An embodiment of the present invention provides a method for processing a database table, where the method may be executed by a database table processing system, and as shown in fig. 1, the method includes:
s101: and receiving a processing instruction of the database table, and acquiring the corresponding database table and the processing type.
Wherein the processing instructions of the database table represent instructions to process a partition of the database table. The processing instructions may be sent to an external system, such as a database table processing system when processing of the database table is required, or may be sent periodically to the database table processing system based on a periodic setting.
The processing instruction of the database table may include information of the database table that needs to be processed, such as an identifier of the database table of the database that needs to be processed. According to the embodiment of the invention, the processing range of the database table can be configured in advance, and then the corresponding database table can be directly obtained based on the preset processing range of the database table after the processing instruction is received.
In the embodiment of the invention, the front partition represents a partition with smaller business time corresponding to the stored data, usually refers to the first partition, and the rear partition represents a partition with larger business time corresponding to the stored data, usually refers to the last partition. The service time corresponding to the data stored in each partition may refer to the service time of the data generation. Taking the service time corresponding to the data stored in the first partition of the database table as 1/2019-12/1/2019 as an example, the start time of the first partition is 1/2019, and the end time of the first partition is 12/1/2019.
Since the partition processing of the database table is usually processing on a front partition and a rear partition, in the embodiment of the present invention, the partition processing of the database table may be divided into two types, i.e., front partition processing and rear partition processing. The processing instruction of the database table may include a processing type, so the processing type corresponding to the processing instruction may be obtained in this step.
S102: responding to the processing type including pre-partition processing, acquiring target service time of the database table, inquiring starting time and first ending time of a first partition corresponding to the database table, determining a first partition processing flow of the database table based on the size relation between the starting time and the target service time and the size relation between the first ending time and the target service time, and executing the first partition processing flow.
When the processing type includes pre-partition processing, it indicates that the pre-partition of the database table needs to be processed at this time, so the start time and the first end time of the first partition corresponding to the database table, that is, the start time and the end time of the service time corresponding to the data stored in the first partition, can be queried to indicate the range of the service time corresponding to the data stored in the first partition in the current state.
Since the data stored in the database table may change with the change of the requirement, for example, some historical data may be deleted without being stored in the database table over time, or the historical data may be stored in a merged manner for the business processing requirement, so that the previous partition of the database table needs to perform the operation of expansion or deletion. Therefore, the target service time of the database table can be obtained in the step, the service time of the currently required stored data in the database table is represented, and the target service time is usually the minimum service time of the currently required stored data in the database table because the previous partition is processed in the step.
In order to make the first partition of the database table store the data with the minimum business time in the database table, in this step, the first partition processing flow of the database table may be determined based on the size relationship between the start time and the target business time, and the first end time, and the first partition processing flow may be executed. The first partition processing flow may be specifically an extended partition flow or a deleted partition flow.
Specifically, in this step, it may be determined whether the target service time is less than the start time. If the target service time is less than the start time, it is indicated that the start time corresponding to the data stored in the first partition of the database table is greater than the target service time, and at this time, the previous partition of the database table needs to be expanded, so that the first partition processing flow can be determined as a partition expansion flow until the start time corresponding to the data stored in the expanded partition can be not less than the target service time; if the target service time is not less than the start time, it is indicated that the data stored in the first partition of the database table meets the current data storage requirement of the database table, and at this time, it is further required to determine again whether the end time of the first partition of the database table is less than the target service time, so as to determine whether the time range corresponding to the data stored in the first partition is the time range required for storing the data in the current database table.
Further, after judging whether the end time of the first partition of the database table is less than the target service time, if the end time of the first partition of the database table is less than the target service time, it indicates that the service time range corresponding to the data stored in the first partition is not in the service time range of the data required to be stored in the database table, so that the first partition can be deleted, that is, the first partition processing flow of the database table is determined to be a partition deletion flow, at this time, after deleting the first partition, the second partition can be automatically updated to the first partition until the start time of the deleted first partition is less than the target service time, and the end time of the deleted first partition is greater than the target service time. If the ending time of the first partition of the database table is not less than the target service time, it indicates that the service time range corresponding to the data stored in the first partition is within the service time range of the data required to be stored in the database table, so that the previous partition of the database table may not be processed, that is, the first partition processing flow is a stop operation.
It should be noted that, in the embodiment of the present invention, after the first partition processing flow is a partition expansion flow, a partition step size may be obtained to expand a partition based on the partition step size, and after the partition is expanded, the expanded partition is configured as a first partition of a database table, and other partitions of the database table are automatically deferred by one partition, so as to facilitate management and processing of the partition, where the partition step size may be preconfigured. Similarly, after the first partition processing flow is the partition deleting flow, the other partitions corresponding to the database table may be automatically advanced by one partition, that is, the original second partition is updated to the first partition.
S103: and responding to the processing type including post-partition processing, determining a target end time corresponding to the database table, inquiring a second end time corresponding to the last partition of the database table, and determining a second partition processing flow of the database table based on a size relation between the second end time and the target end time so as to execute the second partition processing flow.
When the processing type includes the front partition processing, it indicates that the rear partition of the database table needs to be processed this time, so the second ending time of the last partition corresponding to the database table can be queried, that is, the starting time and the ending time of the service time corresponding to the data stored in the last partition, so as to indicate the range of the service time corresponding to the data stored in the last partition in the current state. Since the subsequent partition of the database table is usually the partition expansion of the database table, the target end time corresponding to the database table, that is, the end time of the service time corresponding to the data to be stored after the partition expansion of the database table, may be determined in this step. And further determining a second partition processing flow of the database table based on the magnitude relation between the second end time and the target end time so as to execute the second partition processing flow.
Specifically, the second partition processing flow for determining the database table in this step may be: judging whether the second end time is less than the target end time; if so, indicating that the time range of the number stored in the last partition of the database table cannot meet the target end time, so that the partition needs to be expanded, and determining the second partition processing flow of the database table as a partition expansion flow; if not, the time range of the number stored in the last partition of the database table can meet the target end time, and at this time, the second partition processing flow of the database table can be determined to be the partition operation stopping.
It should be noted that, in the embodiment of the present invention, after it is determined that the second partition processing flow of the database table is the partition expansion flow, the partition step length may be obtained to expand the subsequent partition of the database table, and at the same time, the newly expanded partition may be updated to the last partition, so as to perform the subsequent judgment flow of consistency.
In the embodiment of the present invention, the determining the target end time corresponding to the database table may specifically be: and acquiring the current service time of the data table and a preset partition expansion demand parameter so as to calculate the target end time corresponding to the data table. The current service time represents the service time corresponding to the current storage data in the database, the preset partition expansion demand parameter represents the preset partition expansion demand time, and the target ending time corresponding to the data table can be calculated by adding the preset partition expansion demand parameter and the preset partition expansion demand time. For example, if the current service time is 12 months and 1 day in 2022 years, and the preset partition expansion requirement parameter is 6 months, the target end time is 6 months and 1 day in 2022 years.
In the embodiment of the invention, the partition of the database table can be triggered to be processed by triggering the processing instruction of the database table, the partition processing of the database table is divided into two types of front partition processing and rear partition processing, and the automatic maintenance and processing of the partition of the database table are realized by distinguishing different processing modes of the front partition and the rear partition, so that the partition is not required to be manually added and deleted by operation and maintenance personnel, the problems of time consumption and easy error in processing the database table are avoided, and the efficiency and the accuracy of the partition processing of the database table are improved. In addition, in the embodiment of the invention, the partition is controlled in a proper range by the integrated operation and maintenance of the front partition and the rear partition, so that the error report of the database table caused by insufficient partition is avoided, the full coverage of the partition on the service date of the database table is ensured, and the pressure of operation and maintenance personnel can be greatly reduced by one key operation and maintenance.
With reference to the embodiment shown in fig. 1, a method for processing a database table in step S102 in the embodiment shown in fig. 1 is specifically described, and as shown in fig. 2, the method includes:
s201: and responding to the processing type including pre-partition processing, and acquiring the minimum service time corresponding to the stored data in the database table.
S202: and inquiring the starting time and the ending time corresponding to the stored data in the first partition corresponding to the database table.
S203: and judging whether the minimum service time is less than the starting time, if so, executing the step S204, otherwise, executing the step S205.
S204: and acquiring a preset partition step length to expand the database table, and updating the expanded partition into a first partition of the database table.
After this step is performed, step S202 is performed.
S205: and judging whether the ending time is less than the minimum service time, if so, executing the step S206, otherwise, executing the step S207.
S206: the first partition is deleted and the second partition of the database table is updated to the first partition.
After this step is performed, step S202 is performed.
S207: the processing operation is ended.
It should be noted that the data processing principle in the embodiment of the present invention is the same as the corresponding data processing principle in the embodiment shown in fig. 1, and is not described herein again.
Referring to the embodiment shown in fig. 1, a method for processing a database table in step S103 in the embodiment shown in fig. 1 is specifically described below, and as shown in fig. 3, the method includes:
s301: and determining the target end time corresponding to the database table in response to the processing type including post-partition processing.
S302: and querying the end time corresponding to the storage data in the last partition corresponding to the database table.
S303: and judging whether the end time is less than the end time, if so, executing the step S304, otherwise, executing the step S305.
S304: and acquiring a preset partition step length to expand the database table, and updating the expanded partition into the last partition of the database table.
After this step is performed, step S302 is performed.
S305: the processing operation is ended.
It should be noted that the data processing principle in the embodiment of the present invention is the same as the corresponding data processing principle in the embodiment shown in fig. 1, and is not described herein again.
In order to solve the problems in the prior art, an embodiment of the present invention provides an apparatus 400 for processing a database table, as shown in fig. 4, the apparatus 400 includes:
a receiving unit 401, configured to receive a processing instruction of a database table, and obtain a corresponding database table and a corresponding processing type;
a processing unit 402, configured to, in response to that the processing type is pre-partition processing, obtain a target service time of the database table, query a start time and a first end time of a first partition corresponding to the database table, determine a first partition processing flow of the database table based on a size relationship between the start time and the target service time, and execute the first partition processing flow;
the processing unit 402 is further configured to, in response to that the processing type is post-partition processing, determine a target end time corresponding to the database table, query a second end time corresponding to a last partition of the database table, so as to determine a second partition processing flow of the database table based on a size relationship between the second end time and the target end time, and execute the second partition processing flow.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 1, and the description thereof is omitted.
In an embodiment, the processing unit 402 is specifically configured to:
in response to the target service time being less than the start time, determining that the first partition processing flow is a partition expansion flow; and in response to the target business time being greater than or equal to the starting time, determining a first partition processing flow of the database table based on a magnitude relationship between the first ending time and the target business time.
In another embodiment, the processing unit 402 is specifically configured to:
and determining that the first partition processing flow of the database table is a partition deleting flow in response to the first end time being smaller than the target business time.
In another embodiment, the processing unit 402 is specifically configured to:
obtaining a partition step size to expand a partition based on the partition step size, configuring the expanded partition as a first partition of the database table.
In another embodiment, the processing unit 402 is specifically configured to:
and in response to the second end time being less than the target end time, determining that a second partition processing flow of the database table is a partition expansion flow.
In another embodiment, the processing unit 402 is specifically configured to:
and acquiring the current service time of the data table and a preset partition expansion demand parameter so as to calculate the target end time corresponding to the data table.
In yet another embodiment, the target business time comprises a minimum business time of the database table.
It should be understood that the embodiment of the present invention may be implemented in the same manner as the embodiment shown in fig. 1, 2 or 3, and thus, will not be described herein again.
In the embodiment of the invention, the partition processing of the database table can be triggered by triggering the processing instruction of the database table, the partition processing of the database table is divided into a front partition processing type and a rear partition processing type, and the automatic maintenance and processing of the partition of the database table are realized by distinguishing different processing modes through the front partition and the rear partition, so that the partition is not required to be manually added and deleted by operation and maintenance personnel, the problems of time consumption and error proneness in the processing of the database table are avoided, and the efficiency and the accuracy of the partition processing of the database table are improved.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic device of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the processing method of the database table provided by the embodiment of the invention.
Fig. 5 shows an exemplary system architecture 500 of a processing method of a database table or a processing apparatus of a database table to which an embodiment of the present invention can be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is the medium used to provide communication links between terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. Various client applications may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be, but are not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, and may analyze and process data such as a received product information query request, and feed back a processing result (for example, product information — just an example) to the terminal device.
It should be noted that the processing method of the database table provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the processing apparatus of the database table is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, which may be described as: a processor includes a receiving unit and a processing unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, a receiving unit may also be described as a "unit of an instruction receiving function".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method for processing the database table provided by the present invention.
As another aspect, the present invention further provides a computer program product, which includes a computer program, and when the program is executed by a processor, the computer program implements the method for processing the database table provided in the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

1. A method for processing a database table, comprising:
receiving a processing instruction of a database table, and acquiring a corresponding database table and a corresponding processing type;
responding to the processing type including pre-partition processing, acquiring target service time of the database table, inquiring starting time and first ending time of a first partition corresponding to the database table, determining a first partition processing flow of the database table based on the size relationship between the starting time and the target service time and the size relationship between the first ending time and the target service time, and executing the first partition processing flow;
and responding to the processing type including post-partition processing, determining a target end time corresponding to the database table, inquiring a second end time corresponding to the last partition of the database table, and determining a second partition processing flow of the database table based on a size relation between the second end time and the target end time so as to execute the second partition processing flow.
2. The method of claim 1, wherein determining the first partition process flow of the database table based on the magnitude relationship between the start time and the target business time and the first end time and the target business time comprises:
in response to the target service time being less than the start time, determining that the first partition processing flow is a partition expansion flow; in response to the target business time being greater than or equal to the starting time, determining a first partition processing flow of the database table based on a magnitude relationship between the first ending time and the target business time.
3. The method of claim 2, wherein determining the first partition process flow of the database table based on the magnitude relationship between the first end time and the target business time comprises:
and determining that the first partition processing flow of the database table is a partition deleting flow in response to the first end time being smaller than the target business time.
4. The method of claim 2, wherein after determining that the first partition process flow is a partition expansion flow, performing the first partition process flow comprises:
obtaining a partition step size to expand a partition based on the partition step size, configuring the expanded partition as a first partition of the database table.
5. The method of claim 1, wherein determining a second partition process flow for the database table based on a magnitude relationship between the second end time and the target end time comprises:
and determining that the second partition processing flow of the database table is a partition expansion flow in response to the second end time being less than the target end time.
6. The method of claim 1, wherein determining the target end time corresponding to the database table comprises:
and acquiring the current service time of the data table and a preset partition expansion demand parameter so as to calculate the target end time corresponding to the data table.
7. The method of claim 1, wherein the target business time comprises a minimum business time of the database table.
8. A database table processing apparatus, comprising:
the receiving unit is used for receiving a processing instruction of the database table and acquiring a corresponding database table and a corresponding processing type;
the processing unit is used for responding to the processing type of pre-partition processing, acquiring target business time of the database table, inquiring starting time and first ending time of a first partition corresponding to the database table, determining a first partition processing flow of the database table based on the size relationship between the starting time and the target business time and the size relationship between the first ending time and the target business time, and executing the first partition processing flow;
the processing unit is further configured to determine a target end time corresponding to the database table in response to the processing type being post-partition processing, query a second end time corresponding to a last partition of the database table, and determine a second partition processing flow of the database table based on a size relationship between the second end time and the target end time to execute the second partition processing flow.
9. The apparatus according to claim 8, wherein the processing unit is specifically configured to:
in response to the target service time being less than the start time, determining that the first partition processing flow is a partition expansion flow; and in response to the target business time being greater than or equal to the starting time, determining a first partition processing flow of the database table based on a magnitude relationship between the first ending time and the target business time.
10. The apparatus according to claim 9, wherein the processing unit is specifically configured to:
and determining that the first partition processing flow of the database table is a partition deleting flow in response to the first end time being smaller than the target service time.
11. The apparatus according to claim 9, wherein the processing unit is specifically configured to:
a partition step size is obtained to expand a partition based on the partition step size, configuring the expanded partition as a first partition of the database table.
12. The apparatus according to claim 8, wherein the processing unit is specifically configured to:
and determining that the second partition processing flow of the database table is a partition expansion flow in response to the second end time being less than the target end time.
13. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
14. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
15. A computer program product comprising a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-7.
CN202310034511.4A 2023-01-10 2023-01-10 Database table processing method and device, electronic equipment and storage medium Pending CN115982148A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310034511.4A CN115982148A (en) 2023-01-10 2023-01-10 Database table processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310034511.4A CN115982148A (en) 2023-01-10 2023-01-10 Database table processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115982148A true CN115982148A (en) 2023-04-18

Family

ID=85962947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310034511.4A Pending CN115982148A (en) 2023-01-10 2023-01-10 Database table processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115982148A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312761A (en) * 2023-11-28 2023-12-29 凯美瑞德(苏州)信息科技股份有限公司 Method and device for calculating data fragment processing time

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312761A (en) * 2023-11-28 2023-12-29 凯美瑞德(苏州)信息科技股份有限公司 Method and device for calculating data fragment processing time
CN117312761B (en) * 2023-11-28 2024-03-05 凯美瑞德(苏州)信息科技股份有限公司 Method and device for calculating data fragment processing time

Similar Documents

Publication Publication Date Title
CN111038906A (en) Order sorting method and device
CN107220375B (en) Data reading and writing method and server
CN115982148A (en) Database table processing method and device, electronic equipment and storage medium
CN113076186B (en) Task processing method, device, electronic equipment and storage medium
CN114612212A (en) Business processing method, device and system based on risk control
CN111104125B (en) Intelligent integrated version management method, device, medium and electronic equipment
CN109087097B (en) Method and device for updating same identifier of chain code
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN113076343B (en) Data query method, device, equipment and storage medium
CN113779412B (en) Message touch method, node and system based on blockchain network
CN113742321B (en) Data updating method and device
CN115248735A (en) Log data output control method, device, equipment and storage medium
CN112711572A (en) Online capacity expansion method and device suitable for sub-warehouse and sub-meter
CN113779082B (en) Method and device for updating data
CN113138988B (en) Product code generation method and device
CN114281786B (en) File processing method, device, electronic equipment and storage medium
CN113722548B (en) Method and device for processing quotation relation in service system
CN113129049B (en) File configuration method and system for model training and application
CN113672791B (en) Method and device for determining search result sequence
CN111179097B (en) Method, device, electronic equipment and storage medium for modifying warranty
CN118410038A (en) Data processing method and device
CN117333170A (en) Service processing method, device, electronic equipment and storage medium
CN118331970A (en) Icon data processing method and device, electronic equipment and storage medium
CN115408360A (en) Method, device, equipment and computer readable medium for storing data
CN114331261A (en) Data processing method and device

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