CN114238345A - Database processing and data query method and device - Google Patents

Database processing and data query method and device Download PDF

Info

Publication number
CN114238345A
CN114238345A CN202210112334.2A CN202210112334A CN114238345A CN 114238345 A CN114238345 A CN 114238345A CN 202210112334 A CN202210112334 A CN 202210112334A CN 114238345 A CN114238345 A CN 114238345A
Authority
CN
China
Prior art keywords
data
database
data item
attribute value
database table
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
CN202210112334.2A
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.)
Advanced New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN202210112334.2A priority Critical patent/CN114238345A/en
Publication of CN114238345A publication Critical patent/CN114238345A/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
    • G06F16/24553Query execution of query operations
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP

Abstract

The application discloses a database processing method and a database data query method and device, comprising the following steps: for the business data stored in the sub-database and sub-table, a first database table can be obtained by taking a first data item as a splitting unit; and converting the first database table into a second database table obtained by taking the second data item as a splitting unit according to the second data item contained in the first database table, wherein the business data stored in the second database table is the same as the business data stored in the first database table. Therefore, the second database table can be obtained in a short time, namely, no matter which data item is queried, the technical scheme provided by the embodiment of the application can ensure the integrity of the business data, ensure the efficiency of data processing, shorten the query time and improve the performance of the whole system.

Description

Database processing and data query method and device
Technical Field
The present application relates to the field of computer technology and distributed storage, and in particular, to a method and device for processing and querying a database.
Background
With the development of electronic commerce technology, a large amount of business data is generated through the internet. In the face of the large amount of generated business data, the business data are stored in a relational database in a database-based and table-based mode.
The database and table splitting refers to splitting received service data by using a certain data attribute of the service data as a splitting principle, and storing the split service data in different data tables respectively. These tables have the same table structure, but different table names.
For example: the service data can be split according to the data attribute of the user identifier, and the service data containing the user identifier 1 is stored in the data table 1; storing service data containing the user identification 2 in a data table 2; … …, respectively; and storing the service data containing the user identification n in a data table n. Thus, the service data is divided into n parts, and the n parts are respectively stored in different data tables. The tables have different table names but the same table structure, and the user identification can be used as an index key of the tables.
That is, after the data is stored in the above-mentioned manner, if the data attribute is used as a search keyword, it can be quickly determined in which data table or data tables the service data corresponding to the search keyword is located, and the efficiency of data query is effectively improved.
However, it is found through research that once the search key words are converted for the service data stored in the data table, the data table needs to be scanned in a full table, which consumes system resources of the database, reduces the data processing efficiency of the database, and simultaneously, because the data volume is large, the whole query time is long, and the performance of the database is reduced.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for processing a database and a method and an apparatus for querying data, so as to solve the problem that the data processing efficiency of a database is reduced in the prior art.
The embodiment of the application adopts the following technical scheme:
the embodiment of the application provides a database processing method, which comprises the following steps:
determining a first data warehouse table, wherein the first data warehouse table is obtained by taking a first data item as a splitting unit, and the first data warehouse table comprises a second data item;
and converting the first database table into a second database table according to the second data item, wherein the business data stored in the second database table is the same as the business data stored in the first database table, and the second database table is obtained by taking the second data item as a splitting unit.
The embodiment of the present application further provides a data query method, including:
receiving a query request, wherein the query request comprises an attribute value of a second data item;
and inquiring business data meeting the attribute value of the second data item from a second data warehouse table according to the table structure of the logic table containing the second data item.
The embodiment of the present application further provides a data query method, including:
receiving a query request, wherein the query request comprises an attribute value of a second data item;
determining the attribute value of a first data item which meets the attribute value of a second data item according to the mapping relation between the second data item and the first data item contained in a logic table;
and inquiring business data meeting the attribute value of the second data item from a first database table according to the attribute value of the first data item.
An embodiment of the present application further provides a database processing device, including:
the determining unit is used for determining a first data warehouse table, wherein the first data warehouse table is obtained by taking a first data item as a splitting unit, and the first data warehouse table comprises a second data item;
and the processing unit is used for converting the first database table into a second database table according to the second data item, wherein the business data stored in the second database table is the same as the business data stored in the first database table, and the second database table is obtained by taking the second data item as a splitting unit.
An embodiment of the present application further provides a data query device, including:
the receiving unit is used for receiving a query request, wherein the query request comprises the attribute value of the second data item;
and the query unit is used for querying the business data meeting the attribute value of the second data item from a second data warehouse table according to the table structure of the logic table containing the second data item.
An embodiment of the present application further provides a data query device, including:
the receiving unit is used for receiving a query request, wherein the query request comprises the attribute value of the second data item;
the determining unit is used for determining the attribute value of the first data item meeting the attribute value of the second data item according to the mapping relation between the second data item and the first data item contained in the logic table;
and the query unit is used for querying the business data meeting the attribute value of the second data item from the first database table according to the attribute value of the first data item.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme provided by the embodiment of the application, for the business data stored in the sub-database and the sub-table, a first data item can be determined as a split unit to obtain a first database table; and converting the first database table into a second database table obtained by taking the second data item as a splitting unit according to the second data item contained in the first database table, wherein the business data stored in the second database table is the same as the business data stored in the first database table. Therefore, the second database table can be obtained in a short time, namely, no matter which data item is queried, the technical scheme provided by the embodiment of the application can ensure the integrity of the business data, ensure the efficiency of data processing, shorten the query time and improve the performance of the whole system.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a database processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a data query method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a data query method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a processing device of a database according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a data query device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data query device according to an embodiment of the present application.
Detailed Description
In order to achieve the purpose of the present application, embodiments of the present application provide a database processing method, a data query method, and a device, where for business data stored in sub-databases and sub-tables, a first data item may be determined as a splitting unit to obtain a first database table; and converting the first database table into a second database table obtained by taking the second data item as a splitting unit according to the second data item contained in the first database table, wherein the business data stored in the second database table is the same as the business data stored in the first database table. Therefore, the second database table can be obtained in a short time, namely, no matter which data item is queried, the technical scheme provided by the embodiment of the application can ensure the integrity of the business data, ensure the efficiency of data processing, shorten the query time and improve the performance of the whole system.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a database processing method according to an embodiment of the present application. The method may be as follows.
Step 101: determining a first data warehouse table, wherein the first data warehouse table is obtained by taking a first data item as a splitting unit, and the first data warehouse table comprises a second data item.
In the embodiment of the application, in the data warehouse system, for a large amount of received service data, the received service data can be split according to a preset splitting principle and stored in different data tables respectively. The preset splitting principle can be understood as which data item is split as a splitting unit.
It is assumed that in this embodiment of the present application, for a large amount of received service data, splitting is performed with a first data item (e.g., a user identifier) as a splitting unit, and the service data obtained by splitting is stored in different data tables, respectively. And further obtaining a data table 1 corresponding to the user identifier 1, data tables 2 and … … corresponding to the user identifier 2, and a data table n corresponding to the user identifier n. In the n data tables, the table structures used are the same.
Therefore, when the service data is obtained subsequently, the name of the data table stored by the service data can be determined according to the user identification in the service data, and the service data is stored in the data table corresponding to the name.
Take one of the data tables as an example. As shown in table 1, in order to obtain the data table 1 with the user identifier as the splitting unit:
TABLE 1
User identification Device identification Merchant identification Transaction time Amount of transaction
1 00000 01 T1 100
1 00000 02 T2 50
1 00001 01 T3 10
1 00010 03 T4 40
As can be seen from table 1, each piece of service data includes a plurality of data items.
In order to facilitate subsequent query of the service data in the n data tables, the n obtained data tables may be synchronized to a first data warehouse table, where the first data warehouse table includes all the service data in the n data tables.
It should be noted that, in this embodiment of the present application, a logic table corresponding to a first data item (this logic table may be referred to as a first logic table) may be created, and the first logic table includes a table structure of each corresponding sub-table and a search keyword (i.e., the first data item); a first database table corresponding to the first logical table may also be created. The first data warehouse table stores business data according to a table structure contained in the first logical table. At the beginning of the creation of the first data warehouse table, more business data need to be synchronized, but after the existing data synchronization is completed, an incremental synchronization mode is adopted, namely only newly-added data in each data sub-table is synchronized each time, and the data synchronization efficiency is effectively improved.
Step 102: and converting the first database table into a second database table according to the second data item, wherein the business data stored in the second database table is the same as the business data stored in the first database table, and the second database table is obtained by taking the second data item as a splitting unit.
In this embodiment of the application, because the first database table stores data according to the table structure included in the first logical table, under the condition that it is ensured that data is not lost, the splitting principle of the business data in the first database table is adjusted, the business data in the first database table can be split according to the second data item as the splitting unit, a data storage structure for the second data item is generated, and then the business data in the first database table is stored in the second database table according to the data storage structure.
Preferably, the method further comprises:
and creating a logical table (which may be referred to as a second logical table) containing the second data item according to the second data warehouse table, where the logical table contains a table structure of the sub-table corresponding to the second data warehouse table, and the table structure contains a mapping relationship between the second data item and the first data item.
The contents shown in table 1 above are also taken as an example. Assuming that the second data item is a merchant identification, the resulting second data repository table is shown in table 2:
TABLE 2
Merchant identification Device identification User identification Transaction time Amount of transaction
01 00000 1 T1 100
01 00001 1 T3 10
02 00000 1 T2 30
03 00010 1 T4 40
Preferably, the method further comprises:
and respectively synchronizing the service data in the second data warehouse table to each sub-table corresponding to the second data item according to the table structure contained in the logic table.
For the service data stored in table 2, the first two (i.e. the service data with merchant identifier 01) may be synchronized into the same data table 1; business data with merchant identification 02 are synchronized into another data table 2; business data identified by merchant 03 is synchronized into another data table 3.
Preferably, the method further comprises:
and leading the obtained logic table into a relational database on the line.
In this way, the relational database includes not only the first logical table (which uses the first data item as the search key) but also the second logical table (which uses the second data item as the search key and also includes the mapping relationship between the second data item and the first data item). Therefore, by adopting the scheme described in the embodiment of the application, the logic table for different data items can be obtained, and the mapping relation between the data item and the first data item can be determined in the logic table, and no matter which data item is received, the associated service data can be determined by means of the mapping relation, so that the query efficiency of the service data is effectively improved.
After the first data warehouse table is converted into the second data warehouse table, if the business data in the first data warehouse table changes, the business data in the second data warehouse table is synchronously processed.
For example: when business data is added or deleted in the first data warehouse table, not only the data items in the first logic table need to be added or deleted, but also the business data in the second data warehouse table needs to be synchronously added or deleted, so that the data items in the second logic table can be synchronously added or deleted, and the consistency of the data in the second logic table and the data in the original table is effectively ensured.
According to the technical scheme provided by the embodiment of the application, for the business data stored in the sub-database and the sub-table, a first data item can be determined as a split unit to obtain a first database table; and converting the first database table into a second database table obtained by taking the second data item as a splitting unit according to the second data item contained in the first database table, wherein the business data stored in the second database table is the same as the business data stored in the first database table. Therefore, the second database table can be obtained in a short time, namely, no matter which data item is queried, the technical scheme provided by the embodiment of the application can ensure the integrity of the business data, ensure the efficiency of data processing, shorten the query time and improve the performance of the whole system.
Fig. 2 is a schematic flowchart of a data query method according to an embodiment of the present application. The method may be as follows.
Step 201: and receiving a query request, wherein the query request comprises the attribute value of the second data item.
Step 202: and inquiring business data meeting the attribute value of the second data item from a second data warehouse table according to the table structure of the logic table containing the second data item.
In this embodiment of the application, since the second database table is obtained through conversion in the above embodiment, and the second database table contains all the service data, when the query request is received, the service data that satisfies the attribute value of the second data item is queried from the second database table according to the table structure of the second logical table and using the attribute value of the second data item as a query condition.
However, in the data warehouse system, the first database table stores all the business data, and the second database table also stores all the business data, and if different database tables are obtained by conversion according to the number of data items, the storage resources of the data warehouse system will be wasted, so the data query method shown in fig. 2 is not a preferred embodiment.
Fig. 3 is a schematic flowchart of a data query method according to an embodiment of the present application. The method may be as follows.
Step 301: and receiving a query request, wherein the query request comprises the attribute value of the second data item.
In the embodiment of the present application, a query request is received, and since the query request includes an attribute value of a second data item, according to the prior art, all data in a first database table needs to be traversed, so that query efficiency is low and system resource consumption is high. According to the technical scheme provided by the embodiment of the application, the second logic table can be obtained according to the technical scheme described above. The second logical table stores a mapping relationship between the first data item and the second data item.
Step 302: and determining the attribute value of the first data item which meets the attribute value of the second data item according to the mapping relation between the second data item and the first data item contained in the logic table.
In this embodiment of the application, after the second logical table is obtained, the second logical table is imported into the relational database, so that when a query request is received, if the query request only includes the attribute value of the second data item, the attribute value of the first data item that satisfies the attribute value of the second data item may be determined according to the mapping relationship between the second data item and the first data item included in the second logical table.
Step 303: and inquiring business data meeting the attribute value of the second data item from a first database table according to the attribute value of the first data item.
In an embodiment of the present application, once the attribute value of the first data item is determined, business data satisfying the attribute value of the first data item may be queried from the first database table. Or the service data can be obtained from each data sublist corresponding to the attribute value of the first data item.
Assuming that the attribute value of the second data item included in the query request is the merchant identifier 01 in table 2, it may be determined that the user identifier corresponding to the merchant identifier 01 is 1 according to the mapping relationship between the merchant identifier 01 and the user identifier stored in the second logic table, and then the service data meeting the merchant identifier 01 is found from the data table corresponding to the user identifier 1.
Fig. 4 is a schematic structural diagram of a database processing device according to an embodiment of the present application. The processing device of the prime number database comprises: a determination unit 401 and a processing unit 402, wherein:
a determining unit 401, configured to determine a first database table, where the first database table is obtained by using a first data item as a splitting unit, and the first database table includes a second data item;
the processing unit 402 is configured to convert the first database table into a second database table according to the second data item, where the service data stored in the second database table is the same as the service data stored in the first database table, and the second database table is obtained by using the second data item as a splitting unit.
In another embodiment of the present application, the processing device further comprises: a creating unit 403 in which:
the creating unit 403 creates a logical table including the second data item according to the second data warehouse table, where the logical table includes a table structure of a sub-table corresponding to the second data warehouse table, and the table structure includes a mapping relationship between the second data item and the first data item.
In another embodiment of the present application, the processing device further comprises: a synchronization unit 404, wherein:
the synchronizing unit 404 synchronizes the service data in the second data repository table to each sub-table corresponding to the second data item according to the table structure included in the logical table.
In another embodiment of the present application, the processing device further comprises: an import unit 405, wherein:
the import unit 405 imports the obtained logical table into a relational database on the line.
In another embodiment of the present application, after the first database table is converted into the second database table, if the business data in the first database table changes, the processing unit 402 processes the business data in the second database table synchronously.
It should be noted that the processing device of the database provided in the embodiment of the present application may be implemented by software, or may be implemented by hardware, and is not limited specifically herein. The processing device provided by the embodiment of the application can determine that the first data item is taken as the splitting unit to obtain the first data warehouse table for the business data stored in the sub-warehouse and the sub-table; and converting the first database table into a second database table obtained by taking the second data item as a splitting unit according to the second data item contained in the first database table, wherein the business data stored in the second database table is the same as the business data stored in the first database table. Therefore, the second database table can be obtained in a short time, namely, no matter which data item is queried, the technical scheme provided by the embodiment of the application can ensure the integrity of the business data, ensure the efficiency of data processing, shorten the query time and improve the performance of the whole system.
Fig. 5 is a schematic structural diagram of a data query device according to an embodiment of the present application. The data query device comprises: a receiving unit 501 and a querying unit 502, wherein:
a receiving unit 501, configured to receive an inquiry request, where the inquiry request includes an attribute value of a second data item;
the query unit 502 queries, according to the table structure of the logical table containing the second data item, the service data satisfying the attribute value of the second data item from the second data repository table.
It should be noted that the data query device provided in the embodiment of the present application may be implemented in a software manner, or may be implemented in a hardware manner, which is not limited specifically herein.
Fig. 6 is a schematic structural diagram of a data query device according to an embodiment of the present application. The data query device comprises: a receiving unit 601, a determining unit 602, and a querying unit 603, wherein:
the receiving unit is used for receiving a query request, wherein the query request comprises the attribute value of the second data item;
the determining unit is used for determining the attribute value of the first data item meeting the attribute value of the second data item according to the mapping relation between the second data item and the first data item contained in the logic table;
and the query unit is used for querying the business data meeting the attribute value of the second data item from the first database table according to the attribute value of the first data item.
It should be noted that the data query device provided in the embodiment of the present application may be implemented in a software manner, or may be implemented in a hardware manner, which is not limited specifically herein.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, AtmelAT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A method of processing a database, comprising:
determining a first data warehouse table, wherein the first data warehouse table is obtained by splitting received service data by taking a first data item as a splitting unit, and the first data warehouse table comprises a second data item;
and converting the first database table into a second database table according to the second data item, wherein the business data stored in the second database table is the same as the business data stored in the first database table, and the second database table is obtained by splitting the first database table by taking the second data item as a splitting unit.
2. The method of processing a database as claimed in claim 1, the method further comprising:
and creating a logic table containing the second data item according to the second data warehouse table, wherein the logic table contains a table structure of a sub-table corresponding to the second data warehouse table, and the table structure contains a mapping relation between the second data item and the first data item.
3. The method of processing a database as claimed in claim 1, the method further comprising:
and respectively synchronizing the service data in the second data warehouse table to each sub-table corresponding to the second data item according to the table structure contained in the logic table.
4. The method of processing a database as claimed in claim 1, the method further comprising:
and leading the obtained logic table into a relational database on the line.
5. The method of processing a database as claimed in claim 1, after converting the first database table into a second database table, the method further comprising:
and if the business data in the first database table changes, synchronously processing the business data in the second database table.
6. A method of data query, comprising:
receiving a query request, wherein the query request comprises an attribute value of a second data item;
and inquiring business data meeting the attribute value of the second data item from a second data warehouse table according to the table structure of the logic table containing the second data item.
7. A method of data query, comprising:
receiving a query request, wherein the query request comprises an attribute value of a second data item;
determining the attribute value of a first data item which meets the attribute value of a second data item according to the mapping relation between the second data item and the first data item contained in a logic table;
and inquiring business data meeting the attribute value of the second data item from a first database table according to the attribute value of the first data item.
8. A database processing apparatus comprising:
the determining unit is used for determining a first database table, the first database table is obtained by splitting the received service data by taking a first data item as a splitting unit, and the first database table comprises a second data item;
and the processing unit is used for converting the first database table into a second database table according to the second data item, wherein the business data stored in the second database table is the same as the business data stored in the first database table, and the second database table is obtained by splitting the first database table by taking the second data item as a splitting unit.
9. The database processing device of claim 8, the processing device further comprising: a creating unit, wherein:
the creating unit creates a logical table containing the second data item according to the second data warehouse table, wherein the logical table contains a table structure of a sub-table corresponding to the second data warehouse table, and the table structure contains a mapping relation between the second data item and the first data item.
10. The database processing device of claim 8, the processing device further comprising: a synchronization unit, wherein:
and the synchronization unit synchronizes the service data in the second data warehouse table to each sub-table corresponding to the second data item according to the table structure contained in the logic table.
11. The database processing device of claim 8, the processing device further comprising: an import unit, wherein:
and the import unit imports the obtained logic table into a relational database on the line.
12. The database processing device according to claim 8,
and after the first database table is converted into a second database table, if the business data in the first database table changes, the processing unit synchronously processes the business data in the second database table.
13. A data query device, comprising:
the receiving unit is used for receiving a query request, wherein the query request comprises the attribute value of the second data item;
and the query unit is used for querying the business data meeting the attribute value of the second data item from a second data warehouse table according to the table structure of the logic table containing the second data item.
14. A data query device, comprising:
the receiving unit is used for receiving a query request, wherein the query request comprises the attribute value of the second data item;
the determining unit is used for determining the attribute value of the first data item meeting the attribute value of the second data item according to the mapping relation between the second data item and the first data item contained in the logic table;
and the query unit is used for querying the business data meeting the attribute value of the second data item from the first database table according to the attribute value of the first data item.
CN202210112334.2A 2017-05-26 2017-05-26 Database processing and data query method and device Pending CN114238345A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210112334.2A CN114238345A (en) 2017-05-26 2017-05-26 Database processing and data query method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210112334.2A CN114238345A (en) 2017-05-26 2017-05-26 Database processing and data query method and device
CN201710396146.6A CN108959330B (en) 2017-05-26 2017-05-26 Database processing and data query method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201710396146.6A Division CN108959330B (en) 2017-05-26 2017-05-26 Database processing and data query method and device

Publications (1)

Publication Number Publication Date
CN114238345A true CN114238345A (en) 2022-03-25

Family

ID=64494937

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201710396146.6A Active CN108959330B (en) 2017-05-26 2017-05-26 Database processing and data query method and device
CN202210112334.2A Pending CN114238345A (en) 2017-05-26 2017-05-26 Database processing and data query method and device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201710396146.6A Active CN108959330B (en) 2017-05-26 2017-05-26 Database processing and data query method and device

Country Status (1)

Country Link
CN (2) CN108959330B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857738A (en) * 2019-01-07 2019-06-07 平安科技(深圳)有限公司 Date storage method, device, computer equipment and storage medium
CN110245150B (en) * 2019-05-30 2023-03-17 创新先进技术有限公司 Data processing method, data processing device, data query method, data query device, data processing equipment and data processing system
CN117931423A (en) * 2020-08-17 2024-04-26 支付宝(杭州)信息技术有限公司 Task processing method, device and electronic equipment, and risk identification task processing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102999526B (en) * 2011-09-16 2016-04-06 阿里巴巴集团控股有限公司 A kind of fractionation of database relational table, querying method and system
CN103577590A (en) * 2013-11-12 2014-02-12 北京润乾信息系统技术有限公司 Data query method and system
CN103995879B (en) * 2014-05-27 2017-12-15 华为技术有限公司 Data query method, apparatus and system based on OLAP system

Also Published As

Publication number Publication date
CN108959330A (en) 2018-12-07
CN108959330B (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN106970936B (en) Data processing method and device and data query method and device
KR102258437B1 (en) Blockchain-based data storage and query method and device
CN107562775B (en) Data processing method and device based on block chain
CN108959330B (en) Database processing and data query method and device
CN107391537B (en) Method, device and equipment for generating data relation model
CN110955714A (en) Method and device for converting unstructured text into structured text
CN106933842B (en) Database query method and device
CN110399359B (en) Data backtracking method, device and equipment
CN116303625B (en) Data query method and device, storage medium and electronic equipment
CN106156050B (en) Data processing method and device
CN110083602B (en) Method and device for data storage and data processing based on hive table
CN107025265B (en) Search method, device, system and generation method of command converter
CN111125216A (en) Method and device for importing data into Phoenix
CN112541001A (en) Data query method, device, storage medium and equipment
CN111008198A (en) Service data acquisition method and device, storage medium and electronic equipment
CN107463618B (en) Index creating method and device
CN110019544B (en) Data query method and system
CN113448969B (en) Data processing method, device and storage medium
CN115391426A (en) Data query method and device, storage medium and electronic equipment
CN111339117B (en) Data processing method, device and equipment
CN110245150B (en) Data processing method, data processing device, data query method, data query device, data processing equipment and data processing system
CN108062329B (en) Data import method and device
CN113127660A (en) Timing graph database storage method and device
CN108228604B (en) Model construction method based on memory object, information query method and device
CN108121719B (en) Method and device for realizing data extraction conversion loading ETL

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