CN116795888A - Database processing method, device, electronic equipment and readable storage medium - Google Patents

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

Info

Publication number
CN116795888A
CN116795888A CN202310971126.2A CN202310971126A CN116795888A CN 116795888 A CN116795888 A CN 116795888A CN 202310971126 A CN202310971126 A CN 202310971126A CN 116795888 A CN116795888 A CN 116795888A
Authority
CN
China
Prior art keywords
version number
target database
database
initial
data 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
CN202310971126.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.)
Mushroom Car Union Information Technology Co Ltd
Original Assignee
Mushroom Car Union Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mushroom Car Union Information Technology Co Ltd filed Critical Mushroom Car Union Information Technology Co Ltd
Priority to CN202310971126.2A priority Critical patent/CN116795888A/en
Publication of CN116795888A publication Critical patent/CN116795888A/en
Pending legal-status Critical Current

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The application provides a database processing method, a database processing device, electronic equipment and a readable storage medium, and relates to the technical field of data processing. The method comprises the following steps: inquiring whether all initial data tables of the target database have corresponding historical data tables or not according to the operation instruction of the target database; if the historical data table does not exist in the target database, determining an update version number according to the initial version number of the target database; a new added data table is created in the target database based on the updated version number. The database is processed in a self-increasing version number mode to monitor the version number change of the database and newly increase the data table, so that the function of dynamically creating the data table is realized in the use process of the database, the operation efficiency of the database is effectively improved, the operation cost of the structured data cache is reduced, the efficiency of the structured data cache is improved, and various use requirements of users are met.

Description

Database processing method, device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a database processing method, a database processing device, an electronic device, and a readable storage medium.
Background
When electronic equipment such as a computer is used in daily life, the network is poor, defects, anomalies and the like occur in an application system, and the problems such as data loss or incapability of checking are caused. Under the condition, the structured data cache is firstly carried out on the database, so that the data can be automatically reported at any time, thereby being beneficial to preventing the data from being lost and improving the problem investigation efficiency.
In the currently used IndexdDB, only a data table structure can be set in advance, dynamic creation of the data table and the table structure cannot be realized in the use process, so that various database functions are limited, the operation cost is higher and the efficiency is lower when the structured data caching is carried out, and the use requirements of users cannot be met.
Disclosure of Invention
Accordingly, an objective of the embodiments of the present application is to provide a database processing method, apparatus, electronic device and readable storage medium, so as to solve the problems of high operation cost and low efficiency in performing the structured data caching in the prior art.
In order to solve the above problems, in a first aspect, an embodiment of the present application provides a database processing method, including:
inquiring whether all initial data tables of a target database have corresponding historical data tables or not according to an operation instruction of the target database;
if the historical data table does not exist in the target database, determining an updated version number according to the initial version number of the target database;
creating a new added data table in the target database based on the updated version number.
In the implementation process, whether the target database has a corresponding historical data table or not can be inquired according to the operation instruction of the target database, when the historical data table is not available, the database is processed in a self-increasing version number mode, so that the version number change of the database is monitored, a new data table is dynamically created according to the update version number when the version number is changed, the function of dynamically creating the data table is realized in the use process of the database, the operation efficiency of the database is effectively improved, the operation cost when the structured data is cached is reduced, the efficiency when the structured data is cached is improved, and various use requirements of users are met.
Optionally, wherein the target database is determined by:
setting configuration parameters of an initial database;
and initializing the initial database according to the configuration parameters to obtain the target database.
In the implementation process, in order to set a plurality of corresponding data tables in the target database, an initial database may be initialized and configured. During configuration, corresponding configuration parameters can be preset, so that the configuration parameters are stored by using a built-in structure table of the initial database, and therefore initialization processing of the initial database is achieved, and the target database which can be actually used is obtained. The database can be configured and initialized correspondingly, and the practicability of the target database is effectively improved.
Optionally, the configuration parameters include: name information and configuration information; the setting of the configuration parameters of the initial database comprises the following steps:
determining the name information of the initial database;
determining the configuration information of one or more of the initial data tables; wherein the configuration information at least comprises the following information: capacity parameters and storage period parameters of each of the initial data tables.
In the implementation process, when the basic configuration is performed, the names of the database and the capacities, storage periods and the like of a plurality of initial data tables in the initial database can be configured so as to effectively configure the basic information, the structures and the like of the database.
Optionally, the querying whether all initial data tables of the target database have corresponding historical data tables according to the operation instruction of the target database includes:
monitoring the operation processing of the target database to obtain a corresponding operation instruction;
acquiring operation data corresponding to the operation instruction;
and matching the operation data with the configuration information corresponding to all the initial data tables so as to determine whether the historical data tables are corresponding.
In the implementation process, in order to determine whether the data table corresponding to the operation instruction exists in the target database, the operation processing of the target database may be monitored first to determine the corresponding operation instruction and the corresponding operation data, and matching is performed according to the operation data and configuration information corresponding to all the initial data tables, so as to determine whether the initial data table corresponding to the operation processing exists in the target database as the history data table. The method can search and match the existing initial data table in the target database to determine the corresponding data table processing mode according to the query result.
Optionally, the creating a new added data table in the target database based on the updated version number includes:
comparing the monitored updated version number with the initial version number to monitor whether the version number of the target database changes or not;
if the version number of the target database is monitored to be changed, the new data table is created in the target database based on the operation data corresponding to the operation instruction.
In the implementation process, in order to monitor and sense the version number change of the target data, the updated version number and the initial version number of the target database can be compared to monitor the version number change, so that a new newly-added data table can be created in the target database when the version number changes. Through the change condition of the version number, the automatic creation function of the data table can be realized, a new database is not required to be manually called to create a corresponding data table, the operation cost is effectively reduced, and the creation efficiency of the data table is improved.
Optionally, the method further comprises:
and if one or more historical data tables exist in the target database, executing the operation instruction in any historical data table.
In the implementation process, if one or more historical data tables corresponding to the operation processing exist in the target database, no new data table is required to be created, and the operation instruction can be directly executed in any historical data table to realize the corresponding operation processing. Corresponding operations can be directly executed in the existing data table without creating a new data table for processing each time, so that the creation cost of the data table is effectively reduced, and the efficiency of operation processing is improved.
Optionally, before the updating version number is determined according to the initial version number of the target database, the method further includes:
monitoring the current version number of the target database to obtain an initial version number of the target database;
the determining the update version number according to the initial version number of the target database comprises the following steps:
and performing self-increasing processing according to the initial version number to obtain the updated version number.
In the implementation process, in the use process of the target database, the current version number can be continuously monitored to serve as the current initial version number of the target database. When no corresponding historical data table exists in the target database, the initial version number is subjected to self-increasing processing to obtain a corresponding updated version number, so that the change function of the version number is realized, and the data table is dynamically created according to the change of the version number. The version numbers can be continuously monitored and subjected to self-increasing processing, so that the uniqueness of each version number is effectively ensured, and the effectiveness of creating the data table based on the version number change is improved.
In a second aspect, an embodiment of the present application further provides a database processing apparatus, where the apparatus includes: the system comprises a query module, a determination module and a creation module;
the query module is used for querying whether all initial data tables of the target database have corresponding historical data tables or not according to the operation instruction of the target database;
if the query module queries that the historical data table does not exist in the target database, the determination module is used for determining an update version number according to the initial version number of the target database;
the creation module is used for creating a new data table in the target database based on the updated version number.
In the implementation process, whether the target database has a corresponding historical data table or not is inquired through an inquiring module according to an operation instruction of the target database, when the historical data table is not available, the database is processed through a determining module in a self-increasing version number mode to obtain an updated version number, the version number change of the database is monitored through a creating module, and the updated data table is dynamically created according to the updated version number when the version number is changed.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and when the processor reads and executes the program instructions, the processor executes steps in any implementation manner of the database processing method.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium having stored therein computer program instructions which, when read and executed by a processor, perform the steps of any implementation of the database processing method described above.
In summary, the embodiments of the present application provide a database processing method, apparatus, electronic device, and readable storage medium, which process a database by means of self-increasing version numbers, so as to monitor version number changes of the database and newly increase a data table, thereby implementing a function of dynamically creating the data table in a use process of the database, effectively improving operation efficiency of the database, reducing operation cost when caching structured data, improving efficiency when caching structured data, and meeting various use requirements of users.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a flowchart of a database processing method according to an embodiment of the present application;
fig. 3 is a detailed flowchart of step S200 according to an embodiment of the present application;
fig. 4 is a detailed flowchart of step S400 according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a database processing device according to an embodiment of the present application.
Icon: 100-an electronic device; 111-memory; 112-a memory controller; 113-a processor; 114-a peripheral interface; 115-an input-output unit; 116-a display unit; 500-database processing means; 510-a query module; 520-a determination module; 530-create module.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on embodiments of the present application without making any inventive effort, are intended to fall within the scope of the embodiments of the present application.
In order to reduce the problem of data loss or incapability of troubleshooting caused by network or system abnormality, a database usually firstly carries out structured data caching, and can automatically report data at any time, thereby being beneficial to preventing data loss and improving the problem troubleshooting efficiency. The IndexedDB is a commonly used database, but the IndexedDB can only set a data table structure in advance, can not realize dynamic creation of a data table and a table structure in the use process, and when data caching and other processes are carried out, a new IndexedDB is required to be called to create a new data table or a table structure, and the visibility is lacking, so that various database functions are limited, the operation cost is higher and the efficiency is lower when structured data caching is carried out, and the use requirements of users can not be met.
In order to solve the above problems, the embodiment of the present application provides a database processing method, which is applied to an electronic device, where the electronic device may be an electronic device with a logic computing function, such as a server, a personal computer (Personal Computer, PC), a tablet computer, a smart phone, a personal digital assistant (Personal Digital Assistant, PDA), etc., and is capable of automatically and dynamically creating a new data table or table structure during the use of an index db.
Optionally, referring to fig. 1, fig. 1 is a block schematic diagram of an electronic device according to an embodiment of the application. The electronic device 100 may include a memory 111, a memory controller 112, a processor 113, a peripheral interface 114, an input output unit 115, and a display unit 116. Those of ordinary skill in the art will appreciate that the configuration shown in fig. 1 is merely illustrative and is not limiting of the configuration of the electronic device 100. For example, electronic device 100 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The above-mentioned memory 111, memory controller 112, processor 113, peripheral interface 114, input/output unit 115 and display unit 116 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute executable modules stored in the memory.
The Memory 111 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 111 is configured to store a program, and the processor 113 executes the program after receiving an execution instruction, and a method executed by the electronic device 100 according to the process definition disclosed in any embodiment of the present application may be applied to the processor 113 or implemented by the processor 113.
The processor 113 may be an integrated circuit chip having signal processing capabilities. The processor 113 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (digital signal processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field Programmable Gate Arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. The general purpose processor may be a microprocessor, but in the alternative, it may be any conventional processor or the like.
The peripheral interface 114 couples various input/output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 may be implemented in a single chip. In other examples, they may be implemented by separate chips.
The input-output unit 115 described above is used to provide input data to a user. The input/output unit 115 may be, but is not limited to, a mouse, a keyboard, and the like.
The display unit 116 described above provides an interactive interface (e.g., a user-operated interface) between the electronic device 100 and a user or is used to display image data to a user reference. In this embodiment, the display unit may be a liquid crystal display or a touch display. In the case of a touch display, the touch display may be a capacitive touch screen or a resistive touch screen, etc. supporting single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations simultaneously generated from one or more positions on the touch display, and the sensed touch operations are passed to the processor for calculation and processing. In an embodiment of the present application, the display unit 116 may display data such as a data table or a table structure existing and created in the database.
The electronic device in this embodiment may be used to execute each step in each database processing method provided in the embodiment of the present application. The implementation of the database processing method is described in detail below by means of several embodiments.
Referring to fig. 2, fig. 2 is a flowchart of a database processing method according to an embodiment of the application, and the method may include steps S200-S400.
Step S200, according to the operation instruction of the target database, inquiring whether all initial data tables of the target database have corresponding historical data tables.
The target database can be an IndexdDB database in a browser environment, can be created and operated by webpage scripts, allows a large amount of data to be stored, provides a search interface, can establish indexes, and abstracts different entities into object interfaces through APIs. Through the IndexdDB simulation relational database, the data structure capable of realizing database and table division is realized by simulating the sql statement, different data are classified and managed, the operation of a background database is simulated, frequent starting can be avoided, the occupation of resources is reduced, and the user experience is improved. When the network is poor or the system has defects and anomalies, the anomalies can be automatically reported, so that the data loss is prevented, and the problem investigation efficiency is improved. The history data table may include data such as a data table and a corresponding table structure.
It should be noted that, the operation instruction may be an instruction corresponding to various operation processes performed on the database by calling the class library, and since the data table corresponding to the operation instruction may be analyzed according to the operation instruction, and some initial data tables exist in the target database, the operation instruction may be queried in the target database to determine whether the historical data table corresponding to the operation instruction exists.
It should be noted that, in order to implement a function of dynamically creating a data table in a target database, the target database may be determined by: setting configuration parameters of an initial database; and initializing the initial database according to the configuration parameters to obtain a target database. The initialization configuration processing can be carried out on the initial database, corresponding configuration parameters can be preset during configuration, so that the configuration parameters are cached by using a built-in structure table of the initial database, the initialization processing of the initial database is realized, and the target database which can be actually used is obtained. The database can be configured and initialized correspondingly, and the practicability of the target database is effectively improved.
Optionally, the configuration parameters may include: name information and configuration information; setting the configuration parameters of the initial database may include: determining name information of an initial database; determining configuration information of one or more initial data tables; wherein, the configuration information may include at least the following information: the capacity parameter and the storage period parameter of each initial data table. The names of the database and the capacities, storage periods, etc. of the plurality of initial data tables in the initial database may be configured, for example, the names of the initial database may be named by type, character string, etc., and the stored capacity parameter of a certain initial data table may be set to 100MB, and the stored period parameter may be set to 2 minutes, so as to limit the expiration period of the data, so after the initial data table is fully stored, some data having a storage period longer than 2 minutes in the storage table may be deleted, so that new data may be continuously stored in the initial data table, and the basic information of the database and the structure of the data table may be effectively configured.
Step S300, if the historical data table does not exist in the target database, determining an updated version number according to the initial version number of the target database.
When the historical data table corresponding to the operation instruction does not exist in the target database, the characterization needs to create a new data table according to the operation instruction so as to realize corresponding operation processing. Thus, the function of dynamically creating the data table can be realized according to the version number of the database.
Alternatively, the initial version number may be the version number of the current version of the target database, e.g., 1.0.0, etc., and the updated version number may be the version number after one or more self-increases in the initial version number, e.g., 1.0.1, 1.0.2, etc.
It should be noted that, before step S300, during the use process of the target database, the current version number of the target database may also be monitored to obtain the initial version number of the target database. Determining the update version number from the initial version number of the target database may include: and performing self-increasing processing according to the initial version number to obtain an updated version number. When no corresponding historical data table exists in the target database, the initial version number is subjected to self-increasing processing to obtain a corresponding updated version number, so that the change function of the version number is realized, and the data table is dynamically created according to the change of the version number. The version numbers can be continuously monitored and subjected to self-increasing processing, so that the uniqueness of each version number is effectively ensured, and the effectiveness of creating the data table based on the version number change is improved.
Step S400, creating a new added data table in the target database based on the updated version number.
The method can monitor the version number change of the database and dynamically create a new data table according to the update version number when the version number is changed.
In the embodiment shown in fig. 2, the function of dynamically creating the data table can be realized in the use process of the database, so that the operation efficiency of the database is effectively improved, the operation cost during the structured data caching is reduced, the efficiency during the structured data caching is improved, and various use requirements of users are met.
Optionally, referring to fig. 3, fig. 3 is a detailed flowchart of step S200 provided in an embodiment of the present application, and step S200 may include steps S210-S230.
Step S210, monitoring the operation processing of the target database to obtain a corresponding operation instruction.
The operation processing of the target database can be monitored, so that when the operation of the target database is monitored, a corresponding operation instruction is extracted.
Step S220, operation data corresponding to the operation instruction is obtained.
For example, in operation, sql statements may be used to perform corresponding processing to obtain corresponding operation data, corresponding query types, data table names, conditions and output fields (such as product names, prices, etc.) are obtained by parsing the sql statements in the operation data, and in search, various search condition traversal data may be used to filter in the sql statements to obtain corresponding data tables, pointers and results of pointer traversal of the output fields.
Step S230, matching is performed based on the configuration information corresponding to the operation data and all the initial data tables, so as to determine whether there is a corresponding history data table.
The configuration information of the data table corresponding to the operation data can be matched with the configuration information of the initial data table existing in the target database to determine whether the initial data table with the same configuration information is used as the historical data table.
It should be noted that if one or more history data tables exist in the target database, the operation instruction is executed in any history data table. If one or more historical data tables corresponding to the operation processing exist in the target database, no new data table is required to be created, and the operation instruction can be directly executed in any historical data table so as to realize the corresponding operation processing. Corresponding operations can be directly executed in the existing data table without creating a new data table for processing each time, so that the creation cost of the data table is effectively reduced, and the efficiency of operation processing is improved.
After determining the history data table or creating the new data table, in order to implement the corresponding operation processing, the processing such as adding in the history data table or the new data table, batch adding, querying according to the condition, deleting, batch deleting, updating, batch updating and the like may be performed. After the related data obtained by the conditional query is exported, the related data can be exported by using an Api interface of a javascript native, and downloaded locally, an http protocol is used for uploading a request during downloading, and in order to ensure normal transmission of the data, a network state can be monitored, for example, the network state can be monitored by using a javascript native Api (connection and connection) or a heartbeat detection technology, and network downloading speed, network change and state, request delay, current network state, connection state and the like can be monitored, so that the transmission efficiency of the data is improved. If the network state is good, the service interface can be called to upload untagged data, and the data of the data table is marked or deleted after uploading, so that the repeated uploading of the data is avoided, and the api interface of the IndexdDB is called to manually close and delete the database link after the operation is finished.
In the embodiment shown in fig. 3, the existing initial data table in the target database can be searched and matched first, so as to determine the corresponding data table processing mode according to the query result.
Optionally, referring to fig. 4, fig. 4 is a detailed flowchart of step S400 provided in an embodiment of the present application, and step S400 may include steps S410-S420.
In step S410, the monitored update version number is compared with the initial version number to monitor whether the version number of the target database is changed.
In order to monitor and sense the version number change of the target data, the updated version number of the target database and the initial version number can be compared to monitor the version number change.
Step S420, if the version number of the target database is monitored to be changed, a new data table is created in the target database based on the operation data corresponding to the operation instruction.
If the updated version number is different from the initial version number, the version number of the monitored target database is changed, corresponding configuration information can be extracted according to operation data corresponding to the operation instruction when the version number is changed, a new added data table is created in the target database according to parameters such as a data table name, storage capacity, storage period and the like, and the new added data table can also comprise data tables, corresponding table structures and the like.
In the embodiment shown in fig. 4, the automatic creation function of the data table can be realized through the change condition of the version number, and a new database is not required to be manually called to create a corresponding data table, so that the operation cost is effectively reduced, and the creation efficiency of the data table is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a database processing device according to an embodiment of the present application, a database processing device 500 may include: a query module 510, a determination module 520, and a creation module 530;
the query module 510 is configured to query whether all initial data tables of the target database have corresponding historical data tables according to an operation instruction of the target database;
if the query module queries that the historical data table does not exist in the target database, the determining module 520 is configured to determine an update version number according to the initial version number of the target database;
the creation module 530 is configured to create a new added data table in the target database based on the updated version number.
In an alternative embodiment, the database processing apparatus 500 may further include a database configuration module for setting configuration parameters of the initial database; and initializing the initial database according to the configuration parameters to obtain a target database.
In an alternative embodiment, wherein the configuration parameters include: name information and configuration information; the database configuration module is specifically configured to: determining name information of an initial database; determining configuration information of one or more initial data tables; wherein the configuration information includes at least the following information: the capacity parameter and the storage period parameter of each initial data table.
In an alternative embodiment, the query module 510 is specifically configured to: monitoring the operation processing of the target database to obtain a corresponding operation instruction; acquiring operation data corresponding to the operation instruction; and matching configuration information corresponding to all the initial data tables based on the operation data to determine whether the corresponding historical data tables exist.
In an alternative embodiment, the creation module 530 is specifically configured to: comparing the monitored updated version number with the initial version number to monitor whether the version number of the target database changes or not; if the version number of the target database is monitored to change, a new data table is created in the target database based on the operation data corresponding to the operation instruction.
In an alternative embodiment, if the query module 510 queries that one or more history data tables exist in the target database, then the operation instructions are executed in any history data table.
In an alternative embodiment, the database processing device 500 may further include a monitoring module, configured to monitor the current version number of the target database to obtain an initial version number of the target database;
the determining module 520 is specifically configured to: and performing self-increasing processing according to the initial version number to obtain an updated version number.
Since the principle of the database processing device 500 in the embodiment of the present application for solving the problem is similar to that of the foregoing embodiment of the database processing method, the implementation of the database processing device 500 in the embodiment of the present application may refer to the description of the foregoing embodiment of the database processing method, and the repetition is omitted.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer program instructions, and when the computer program instructions are read and run by a processor, the steps in any one of the database processing methods provided in the embodiment are executed.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, 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, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent 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 protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.

Claims (10)

1. A database processing method, the method comprising:
inquiring whether all initial data tables of a target database have corresponding historical data tables or not according to an operation instruction of the target database;
if the historical data table does not exist in the target database, determining an updated version number according to the initial version number of the target database;
creating a new added data table in the target database based on the updated version number.
2. The method of claim 1, wherein the target database is determined by:
setting configuration parameters of an initial database;
and initializing the initial database according to the configuration parameters to obtain the target database.
3. The method of claim 2, wherein the configuration parameters comprise: name information and configuration information; the setting of the configuration parameters of the initial database comprises the following steps:
determining the name information of the initial database;
determining the configuration information of one or more of the initial data tables; wherein the configuration information at least comprises the following information: capacity parameters and storage period parameters of each of the initial data tables.
4. A method according to claim 3, wherein said querying whether all initial data tables of the target database have corresponding historical data tables according to the operation instruction of the target database comprises:
monitoring the operation processing of the target database to obtain a corresponding operation instruction;
acquiring operation data corresponding to the operation instruction;
and matching the operation data with the configuration information corresponding to all the initial data tables so as to determine whether the historical data tables are corresponding.
5. The method of claim 4, wherein creating a new added data table in the target database based on the updated version number comprises:
comparing the monitored updated version number with the initial version number to monitor whether the version number of the target database changes or not;
if the version number of the target database is monitored to be changed, the new data table is created in the target database based on the operation data corresponding to the operation instruction.
6. The method according to any one of claims 1-5, further comprising:
and if one or more historical data tables exist in the target database, executing the operation instruction in any historical data table.
7. The method of any of claims 1-5, wherein prior to determining an update version number from an initial version number of the target database, the method further comprises:
monitoring the current version number of the target database to obtain an initial version number of the target database;
the determining the update version number according to the initial version number of the target database comprises the following steps:
and performing self-increasing processing according to the initial version number to obtain the updated version number.
8. A database processing apparatus, the apparatus comprising: the system comprises a query module, a determination module and a creation module;
the query module is used for querying whether all initial data tables of the target database have corresponding historical data tables or not according to the operation instruction of the target database;
if the query module queries that the historical data table does not exist in the target database, the determination module is used for determining an update version number according to the initial version number of the target database;
the creation module is used for creating a new data table in the target database based on the updated version number.
9. An electronic device comprising a memory and a processor, the memory having stored therein program instructions which, when executed by the processor, perform the steps of the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the readable storage medium has stored therein computer program instructions which, when executed by a processor, perform the steps of the method of any of claims 1-7.
CN202310971126.2A 2023-08-03 2023-08-03 Database processing method, device, electronic equipment and readable storage medium Pending CN116795888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310971126.2A CN116795888A (en) 2023-08-03 2023-08-03 Database processing method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310971126.2A CN116795888A (en) 2023-08-03 2023-08-03 Database processing method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116795888A true CN116795888A (en) 2023-09-22

Family

ID=88048209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310971126.2A Pending CN116795888A (en) 2023-08-03 2023-08-03 Database processing method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116795888A (en)

Similar Documents

Publication Publication Date Title
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
US9652220B2 (en) Zero down-time deployment of new application versions
WO2016016734A1 (en) Managing web browser cache for offline browsing
CN107908442B (en) Spring-based resource loading method and device, terminal equipment and computer-readable storage medium
CN111290907A (en) Distributed storage network pressure measurement method and device, computer device and storage medium
CN111046073A (en) Test case query method and device and readable storage medium
CN111190905A (en) Database table processing method and device and electronic equipment
US10747766B2 (en) Context based access path selection
CN113641936A (en) Method and device for page jump, electronic equipment and storage medium
CN110321367B (en) Data storage method, data query method, related device and electronic equipment
CN115758004A (en) Webpage table display method and device, computer readable medium and electronic equipment
CN116795888A (en) Database processing method, device, electronic equipment and readable storage medium
US9769249B2 (en) Impact analysis of service modifications in a service oriented architecture
CN111767442A (en) Data updating method and device, search server, terminal and storage medium
CN115329150A (en) Method and device for generating search condition tree, electronic equipment and storage medium
US11301498B2 (en) Multi-cloud object store access
US11029980B2 (en) Customizable animations
CN109739876B (en) Data query method and device for database based on Sqltoy-orm framework
CN107506299B (en) Code analysis method and terminal equipment
CN112463202A (en) Configuration method and device of operating system functional components
CN107958074B (en) Engineering information display method and device
CN111831319B (en) Method, device, equipment and storage medium for posterior difference data
US20230306031A1 (en) Method for data processing, computing device, and storage medium
CN117033402A (en) Data access method, device, equipment and storage medium
CN112613300A (en) Synonym-based data processing method and device and electronic equipment

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