Dynamic loading database operation method and system, electronic equipment and storage medium
Through dynamically loading the database operation method, the problems of long start time of database operations and waste of resources in the traditional mode are solved, and more efficient resource utilization and system scalability are achieved.
Patent Information
- Application Number
- CN202510668107.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-23
AI Technical Summary
In traditional database operation mode, applications need to preload all possible database connections and operation classes when starting, resulting in extended startup time, waste of resources and reduced performance, which is particularly prominent in large systems.
Using a dynamically loaded database operation method, a connection is established with the preset data source through the database operation request sent by the data engine module, the call library table verification component is checked whether the database and table exist, dynamically load the required basic components and target data processing components, and cache the loaded components in memory for reuse.
It effectively shortens the startup time of the application, avoids resource waste, optimizes resource utilization efficiency, improves system flexibility and scalability, and reduces system maintenance costs and downtime.
Smart Images

Figure CN120179341A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database data processing, and in particular, to a method, system, electronic device, and storage medium for dynamically loading database operations. Background Art
[0002] In the traditional database operation mode, an application usually pre-loads all possible database connections and operation classes during the startup phase to ensure the smooth execution of subsequent business logics. Although this one-time loading method can meet the requirements in simple application scenarios, its drawbacks become increasingly prominent in complex application scenarios involving a large number of database operations and some operations with low usage frequencies.
[0003] First of all, since the application needs to complete the loading of all database connections and operation classes during the initialization phase, the startup time is significantly prolonged, especially in large-scale systems, and this problem is more prominent. This not only reduces the user experience but also may affect the rapid deployment and elastic expansion capabilities of the system.
[0004] Secondly, in the traditional mode, even if some database operations are rarely called during the actual operation, the corresponding resources will still reside in the memory for a long time, resulting in the ineffective occupation of memory resources. This resource waste not only increases the operating overhead of the system but also may cause performance degradation or even stability problems due to excessive memory pressure, especially in resource-constrained environments. Summary of the Invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a method, system, electronic device, and storage medium for dynamically loading database operations. The technical problems to be solved by the present invention are realized through the following technical solutions: The first aspect of the embodiment of the present invention provides a method for dynamically loading database operations, including the following steps: A method for dynamically loading database operations, including the following steps: In response to a database operation request sent by a data engine module, establish a connection with a preset data source according to the database operation request; wherein, the database operation request indicates a preset data source and data source operation configuration information; Call a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information; Dynamic loading step: If the database of the preset data source and the target business table already exist, load a basic component and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If it has been loaded, obtain a reference to the target data processing component from the component container, and then the data engine calls the reference to perform the database operation indicated by the data source operation configuration information; If it has not been loaded, find and load the target data processing component from the component container, then obtain a reference to the target data processing component, and the data engine calls the reference to perform the database operation indicated by the data source operation configuration information; If the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
[0006] In an embodiment of the present invention, the step of, if the database of the preset data source and the target business table already exist, loading the basic component and determining whether the target data processing component indicated by the data source operation configuration information has been loaded includes: If the database of the preset data source and the target business table already exist, load the basic component and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information; If they are inconsistent, update the structure of the target business table, and then determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If they are consistent, determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
[0007] In an embodiment of the present invention, the method further includes: Cache the loaded target data processing component in the cache management module; Determine whether the database operation request is the first database operation request; If not, obtain a reference to the target data processing component from the cache management module; The cache management module unloads the target data processing component according to the cache space and the cache eviction algorithm.
[0008] In an embodiment of the present invention, the method further includes: Load the monitoring interface component from the component container, and then obtain a reference to the monitoring interface component to monitor the status of the preset data source.
[0009] A second aspect of the embodiments of the present invention provides a database operating system with dynamic loading, including: A processing module, configured to establish a connection with a preset data source in response to a database operation request sent by a data engine module, where the database operation request indicates the preset data source and data source operation configuration information; An invocation module, configured to invoke a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information; A loading module, for the dynamic loading step: if the database of the preset data source and the target business table already exist, load the basic components and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; An acquisition module, configured to, if already loaded, acquire a reference to the target data processing component from a component container, and then the data engine invokes the reference to execute the database operation indicated by the data source operation configuration information; A search module, configured to, if not loaded, search for and load the target data processing component from the component container, and then acquire a reference to the target data processing component, and the data engine invokes the reference to execute the database operation indicated by the data source operation configuration information; A management module, configured to, if the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
[0010] In an embodiment of the present invention, the step of, if the database of the preset data source and the target business table already exist, loading the basic components and determining whether the target data processing component indicated by the data source operation configuration information has been loaded includes: If the database of the preset data source and the target business table already exist, load the basic components and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information; If they are inconsistent, update the structure of the target business table, and then determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If they are consistent, determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
[0011] In an embodiment of the present invention, it further includes: A cache management module, configured to cache the already loaded target data processing components into the cache management module; A judgment module, configured to judge whether the database operation request is the first database operation request; The obtaining module is further configured to, if not, obtain a reference to the target data processing component from the cache management module; The cache management module is further configured to unload the target data processing component according to the cache space and the cache eviction algorithm.
[0012] In an embodiment of the present invention, it further includes: A monitoring and loading module, configured to load a monitoring interface component from a component container, and then obtain a reference to the monitoring interface component to monitor the status of the preset data source.
[0013] A third aspect of an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements a method for dynamically loading database operations provided in the first aspect of the embodiment of the present invention.
[0014] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements a method for dynamically loading database operations provided in the first aspect of the embodiment of the present invention.
[0015] Advantages of the present invention: The present invention uses a library table verification component to verify whether the database and tables exist, so as to ensure the normal operation of subsequent data processing. At the same time, by only loading the basic components and the target data processing components, it effectively avoids the waste of resources caused by loading all database operation components at startup; the modular on-demand loading of data processing components further optimizes the resource utilization efficiency, avoids unnecessary resource waste, and realizes the maximization of resource utilization. In the complex scenario of parallel development of multiple data engines, it realizes the unified management of all data source operation items and methods, ensures the standardization and consistency of the development process, effectively improves the development efficiency, reduces repetitive development work, provides great convenience for team collaboration and project management, and promotes the efficient progress and successful delivery of the project.
[0016] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in the written specification, claims, and drawings.
[0017] Next, through the drawings and embodiments, the technical solutions of the present invention will be further described in detail. Description of the Drawings
[0018] The accompanying drawings are used to provide a further understanding of the present invention and form a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention. In the accompanying drawings: Figure 1 It is a schematic flowchart of a database operation method with dynamic loading provided by an embodiment of the present invention; Figure 2 It is a schematic block diagram of a database operation system with dynamic loading provided by an embodiment of the present invention. Detailed implementation manners
[0019] The following further describes the present invention in detail with reference to specific embodiments, but the implementation manners of the present invention are not limited thereto.
[0020] As Figure 1 shown, a first aspect of an embodiment of the present invention provides a database operation method with dynamic loading, including the following steps: Step 11, in response to a database operation request sent by a data engine module, establish a connection with a preset data source according to the database operation request.
[0021] Among them, the database operation request indicates the preset data source and data source operation configuration information.
[0022] Step 12, call a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information.
[0023] Step 13, dynamic loading step: If the database of the preset data source and the target business table already exist, load the basic component and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
[0024] Step 14, if it has been loaded, obtain a reference to the target data processing component from the component container, and the data engine calls the reference to execute the database operation indicated by the data source operation configuration information.
[0025] Step 15, if it has not been loaded, find and load the target data processing component from the component container, and then obtain a reference to the target data processing component.
[0026] Step 16, if the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
[0027] In this embodiment, the basic components are loaded first, and then the required components are loaded, significantly shortening the startup time of the application and effectively avoiding the waste of resources caused by loading all database operation components at startup. The database functions are independently encapsulated into components and pre-stored in the component container, greatly improving the flexibility and scalability of the system, making it easy to add and update database operation components without restarting the application, effectively reducing the system maintenance cost and downtime; at the same time, it can perfectly adapt to various data sources of the data engine, realize efficient data operation and management of various data sources, and meet the diverse needs of different users and business scenarios.
[0028] At the same time, the on-demand loading feature of the data processing component further optimizes the resource utilization efficiency, avoids unnecessary resource waste, and realizes the maximization of resource utilization; as an independent project, the data processing component successfully realizes code and resource isolation, effectively reducing the mutual interference between different data source operations, greatly facilitating the system maintenance and upgrade, significantly improving the security and stability of the system, and escorting the enterprise's data security. Moreover, in the complex scenario of parallel development of multiple data engines, it realizes the unified management of all data source operation items and methods, ensures the standardization and consistency of the development process, effectively improves the development efficiency, reduces the repetitive development work, provides great convenience for team collaboration and project management, and promotes the efficient progress and successful delivery of the project.
[0029] Based on the first aspect of the embodiment of the present invention, the second aspect of the embodiment of the present invention further details a dynamically loaded database operation method. The second aspect of the embodiment of the present invention provides a dynamically loaded database operation method, including the following steps: Step 21, in response to a database operation request sent by the data engine module, establish a connection with a preset data source according to the database operation request. This step is for the data engine module or the application to receive the database operation request in the initialization state.
[0030] Among them, the database operation request indicates the preset data source and data source operation configuration information.
[0031] The data source includes one or more database data such as source-side data, target-side data, database management service data, and object storage data that need to be synchronized and are required to be operated by the data engine or the application. The data source operation configuration information indicates the relevant parameter information for operating the database, including but not limited to the operation type parameter and business parameter that need to be executed.
[0032] The preset data source information indicated in the database operation request is also the data source that the data engine or the application needs to operate, and a connection is established with the preset data source according to this information.
[0033] Here, the database operation request can also be sent by an application.
[0034] Step 22, call the library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information.
[0035] In this step, after establishing a connection with the preset data source, it is necessary to verify whether the database and business table of the preset data source exist. Only when the verification is successful can the subsequent database operations be executed normally. The target business table is one of the business parameters. The target business table is the table of the database that the data engine or application needs to operate on. The data engine or application can perform various data processing and operations on the target business table, including but not limited to operations such as addition, deletion, modification, query, statistics, incremental synchronization, and full synchronization.
[0036] Step 23, if the database of the preset data source and the target business table already exist, load the basic components from the component container and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
[0037] In this step, the component container stores various database operation components that are independently encapsulated, including basic components and various data processing components. The components in the component container are stored in a hash table. If the database of the preset data source and the target business table already exist, the basic components can be loaded first. The basic components are the core components necessary to maintain the system operation for database operations.
[0038] Exemplarily, the basic components include a basic configuration file reader component, a basic logging component, an interface class detection component, etc. In the initialization state, the basic components need to be loaded first. In the non-initialization state, since the basic components have been loaded in the initialization state, there is no need to load the basic components, and directly determine whether to load the target data processing component.
[0039] Judge whether the required target database operation component has been loaded according to parameters such as the operation type parameter in the data source operation configuration information. Here, the data processing components include a source-side data processing component, a target-side data processing component, a database management business data processing component, and an object storage data processing component. Each type of component in the four types of components includes corresponding business operation class interface components and monitoring interface components, etc. Exemplarily, the business operation class interface components include but are not limited to an engine statistics information writing component, an alarm information writing component, an incremental synchronization operation component, a full synchronization operation component, etc.
[0040] Specifically, the specific steps of step 23 include steps 231 - 233: Step 231: If the database of the preset data source and the target business table already exist, load the basic components and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information.
[0041] Step 232: If they are inconsistent, update the structure of the target business table, and then determine whether the target data processing components indicated by the data source operation configuration information have been loaded according to the data source operation configuration information.
[0042] In this step, ensure that the business tables in the data source meet the requirements of the required business processing.
[0043] Step 233: If they are consistent, determine whether the target data processing components indicated by the data source operation configuration information have been loaded according to the data source operation configuration information.
[0044] Step 24: If the target data processing components indicated by the data source operation configuration information have been loaded, obtain a reference to the target data processing components from the component container, and then the data engine or application calls the reference to execute the database operations indicated by the data source operation configuration information.
[0045] If the target data processing components have been loaded, obtain a reference to the components to facilitate quickly calling the components to execute database operations.
[0046] Step 25: If not loaded, find and load the target data processing components from the component container, then obtain a reference to the target data processing components, and then the data engine or application calls the reference to execute the database operations indicated by the data source operation configuration information.
[0047] For example, if the operation type parameter in the data source operation configuration information is of the statistical type, load the engine statistical information writing component; if the parameter is of the incremental synchronization type, load the incremental synchronization operation component. The incremental synchronization type parameters are shown in Table 1: Table 1
[0048] In this embodiment, the target data processing components are found in the hash table in the component container. Among them, the information based on which the hash value is calculated is the parameter information such as the data source type, version identifier, schema, library table, etc. in the data source operation configuration information.
[0049] In a feasible implementation manner, the loaded target data processing components are cached in the cache management module. When a database operation request is received again, determine whether the database operation request is the first database operation request or a previously requested one; if it is not the first but a repeated request, obtain a reference to the target data processing components from the cache management module.
[0050] Among them, the cache management module unloads the target data processing component according to the cache space and the cache eviction algorithm. The cache management module decides whether to unload the component according to a preset policy, comprehensively considering factors such as the possibility of the component being reused in the short term and the system memory resource status.
[0051] Step 26, if the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to step 23.
[0052] In this step, if the target business table in the database does not exist, create the required target business table according to the parameters. Usually, the non-existent target business table is the business table that needs to write data.
[0053] Among them, if the database of the preset data source does not exist, an exception prompt message is returned.
[0054] In a feasible implementation, during the process of loading the target data processing component and during the process of the data engine calling the reference of the target data processing component to execute database operations, the monitoring interface component can be loaded from the component container, and the reference of the component can be obtained to execute the monitoring operation on the preset data source. Here, the dynamic monitoring of the access to the connected data source, the real-time output and statistics of important indicators such as the number of connections, tablespace, CPU memory usage, disk I / O, query performance, cache hit rate, etc., so as to discover and solve potential problems in time. Continuously monitor the specified data source in real time, accurately count and output various monitoring indicators, and provide key data support for the performance optimization and risk warning of the system.
[0055] Exemplarily, the monitoring interface components include: database engine status monitoring interface component, jvm memory monitoring interface component, cpu monitoring interface component, etc. One or more of these components can be loaded for monitoring, and the monitoring parameters are shown in Table 2.
[0056] Table 2
[0057] In a feasible implementation, the data source operation configuration information in the database operation request can carry monitoring-related parameters. For example, if the operation type parameter is the cpu monitoring type, the cpu monitoring interface component is loaded. If some parameters in Table 2 can be carried in the database operation request, only these cpu attribute information are monitored. If no parameters are carried, all cpu attribute information in Table 2 are monitored by default.
[0058] The usage scenario of the present invention is the scenario of realizing data synchronization between the source end and the target end. At the same time, the present invention realizes database operations through the lazy loading mechanism.
[0059] Such as Figure 2As shown in the figure, the third aspect of the embodiment of the present invention provides a dynamically loaded database operating system, including: A processing module 31, configured to respond to a database operation request sent by a data engine module, and establish a connection with a preset data source according to the database operation request; wherein, the database operation request indicates the preset data source and data source operation configuration information; An invocation module 32, configured to invoke a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information; A loading module 33, configured to perform a dynamic loading step: if the database of the preset data source and the target business table already exist, load a basic component and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; An obtaining module 34, configured to, if it has been loaded, obtain a reference to the target data processing component from a component container, and then the data engine invokes the reference to execute the database operation indicated by the data source operation configuration information; A searching module 35, configured to, if it has not been loaded, search for the target data processing component from the component container and load it, and then obtain a reference to the target data processing component, and the data engine invokes the reference to execute the database operation indicated by the data source operation configuration information; A management module 36, configured to, if the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
[0060] In an embodiment of the present invention, if the database of the preset data source and the target business table already exist, loading the basic component and determining whether the target data processing component indicated by the data source operation configuration information has been loaded includes: If the database of the preset data source and the target business table already exist, load the basic component and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information; If they are inconsistent, update the structure of the target business table, and then determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If they are consistent, determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
[0061] In an embodiment of the present invention, it further includes: A cache management module, configured to cache the loaded target data processing component into the cache management module; A judgment module, configured to judge whether the database operation request is the first database operation request; The acquisition module is further configured to, if not, obtain a reference to the target data processing component from the cache management module; The cache management module is further configured to unload the target data processing component according to the cache space and the cache eviction algorithm.
[0062] In an embodiment of the present invention, it further includes: The monitoring and loading module is configured to load the monitoring interface component from the component container, and then obtain a reference to the monitoring interface component to monitor the state of the preset data source.
[0063] A fourth aspect of the embodiments of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements a dynamic loading database operation method provided by the embodiments of the present invention described above.
[0064] A fifth aspect of the embodiments of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of a dynamic loading database operation method provided by the embodiments of the present invention described above.
[0065] Among them, the memory may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0066] The aforementioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware systems.
[0067] The method provided by the embodiments of the present invention can be applied to an electronic device. Specifically, the electronic device may be: a desktop computer, a portable computer, a smart mobile terminal, a server, etc. This is not limited herein, and any electronic device that can implement the present invention belongs to the protection scope of the present invention.
[0068] For system / electronic device embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, please refer to the corresponding description in the method embodiments.
[0069] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0070] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction system that implements the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0072] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A method for dynamically loading database operations, characterized in that, It includes the following steps: In response to a database operation request sent by a data engine module, establish a connection with a preset data source according to the database operation request; wherein, the database operation request indicates the preset data source and data source operation configuration information; Call a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information; Dynamic loading step: If the database of the preset data source and the target business table already exist, load the basic component and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If it has been loaded, obtain a reference to the target data processing component from the component container, and then the data engine calls the reference to execute the database operation indicated by the data source operation configuration information; If it has not been loaded, find and load the target data processing component from the component container, then obtain a reference to the target data processing component, and the data engine calls the reference to execute the database operation indicated by the data source operation configuration information; If the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
2. The method according to claim 1, characterized in that, The step of if the database of the preset data source and the target business table already exist, load the basic component and determine whether the target data processing component indicated by the data source operation configuration information has been loaded, includes: If the database of the preset data source and the target business table already exist, load the basic component and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information; If they are inconsistent, update the structure of the target business table, and then determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If they are consistent, determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
3. The method according to claim 1, characterized in that, The method further includes: Cache the loaded target data processing component into a cache management module; Determine whether the database operation request is the first database operation request; If not, obtain a reference to the target data processing component from the cache management module; The cache management module unloads the target data processing component according to the cache space and cache eviction algorithm.
4. The method according to claim 1, characterized in that, The method further includes: Load a monitoring interface component from the component container, and then obtain a reference to the monitoring interface component to monitor the status of the preset data source.
5. A database operation system with dynamic loading, characterized in that, It includes: A processing module, configured to establish a connection with a preset data source according to a database operation request in response to a database operation request sent by a data engine module; wherein, the database operation request indicates the preset data source and data source operation configuration information; A calling module, configured to call a library table verification component to verify the database of the preset data source and the target business table according to the data source operation configuration information; Loading module, for dynamic loading steps: If the database of the preset data source and the target business table already exist, load the basic components and determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; Obtaining module, for if already loaded, obtain a reference to the target data processing component from the component container, and then the data engine calls the reference to execute the database operation indicated by the data source operation configuration information; Searching module, for if not loaded, search for and load the target data processing component from the component container, and then obtain a reference to the target data processing component, and the data engine calls the reference to execute the database operation indicated by the data source operation configuration information; Management module, for if the database of the preset data source already exists and the target business table does not exist, create the target business table according to the data source operation configuration information, and then return to the dynamic loading step.
6. The system according to claim 5, characterized in that, The step of, if the database of the preset data source and the target business table already exist, loading the basic components and determining whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information, includes: If the database of the preset data source and the target business table already exist, load the basic components and determine whether the structure of the target business table is consistent with the structure of the target business table indicated by the data source operation configuration information; If not consistent, update the structure of the target business table, and then determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information; If consistent, determine whether the target data processing component indicated by the data source operation configuration information has been loaded according to the data source operation configuration information.
7. The system according to claim 5, characterized in that, It further includes: Cache management module, for caching the loaded target data processing component into the cache management module; Judgment module, for judging whether the database operation request is the first database operation request; The obtaining module is further used for, if not, obtaining a reference to the target data processing component from the cache management module; The cache management module is further used for unloading the target data processing component according to the cache space and the cache eviction algorithm.
8. The system according to claim 5, wherein It further includes: Monitoring loading module, for loading the monitoring interface component from the component container, and then obtaining a reference to the monitoring interface component to monitor the state of the preset data source.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein When the processor executes the program, it implements the dynamic loading database operation method according to any one of claims 1 to 4.
10. A computer-readable storage medium, having a computer program stored thereon, wherein When the computer program is executed by the processor, it implements the dynamic loading database operation method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and apparatus for using stored procedures with a database management system
CA2222349A1
Module management method and device of application program, storage medium and electronic equipment
CN112231008A
Multi-tenant data source management method based on cache mechanism and readable storage medium
CN114064781A
Dynamic service loading method, testing method and computer program product
CN115700471A
Data index result calculation processing method, calculation processing system and application
CN118484474A