Method for dynamically updating database address
Dynamically generate and manage data source link routing in the database management system through dynamic data source acquisition technology and parsing engine, solving the problem that traditional systems are difficult to adapt to database address changes in multi-tenant and cloud environments, and achieving efficient and flexible database access and management.
Patent Information
- Application Number
- CN202411445127.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional database management systems are difficult to adapt to frequent changes in database addresses in multi-tenant environments and cloud environments, resulting in increased system management complexity and maintenance costs, and are unable to respond quickly to changes in business needs.
By introducing dynamic data source acquisition technology, setting data source configuration information and parsing engines, dynamically generating data source link routing, and reusing and recycling of data source link routing through remote connection pools and local cache lists, supporting address updates and Notification mechanism.
It realizes the flexibility and efficiency of the database management system, can adjust database access policies based on data source configuration information in real time and dynamically, reduces system overhead, improves response speed and performance, and supports a variety of database types and configuration solutions.
Smart Images

Figure CN119415531A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of database management, in particular to a method for dynamically updating a database address. Background Art
[0002] With the rapid development of Internet technology, the core position of database systems in various applications has become increasingly prominent, becoming an indispensable infrastructure to support business operations. Especially in a multi-tenant environment, in order to ensure data security and isolation, user data is usually carefully deployed in separate database instances. Although this architectural model effectively protects the privacy of user data, it also places higher requirements on the database management system.
[0003] Traditionally, database access relies on a pre-set and relatively fixed database address configuration. This approach may be effective enough when dealing with static or infrequently changing environments, but it is not enough when facing the challenge of multi-tenant systems or cloud environments where database addresses may change frequently. Fixed address configuration not only limits the system's ability to adapt to dynamic changes, but also increases management complexity and maintenance costs, making it difficult for the system to quickly respond to changes in business needs.
[0004] In view of this, how to dynamically obtain the user database address according to the data source configuration has become an important issue that needs to be solved in the current database management field. This technical requirement aims to break the shackles of traditional methods and introduce a more flexible and intelligent data source management mechanism to enable the database system to obtain the address of the target database in real time and accurately according to the user's actual needs and configuration information, thereby achieving efficient and secure database access.
[0005] The information disclosed in this background technology section is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as acknowledging or suggesting in any form that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0006] In view of the defects existing in the prior art, the purpose of the present invention is to provide a method for dynamically updating the database address. By introducing dynamic data source acquisition technology, the flexibility and efficiency of database management can be effectively improved, and more stable and reliable data support can be provided for various applications.
[0007] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0008] A method for dynamically updating a database address, characterized by comprising:
[0009] Set the configuration information of the data source, which includes: database name, database address, optional connection parameters, user name, and user password;
[0010] Setting a parsing engine, the parsing engine is used to obtain configuration information and dynamically generate data source link routing;
[0011] The generated data source link routes are stored in the remote connection pool to achieve reuse and recycling of data source link routes;
[0012] Set up a local cache list to maintain a set of data source link routes by user name based on access frequency, so as to reduce the overhead of remote resolution and acquisition of data source link routes.
[0013] Based on the above technical solution, in response to the received address update request, the configuration information is read through the parsing engine, the data source link route is dynamically generated, and then stored in the remote connection pool, and a response identification code is generated in the remote connection pool for the unique corresponding address update request;
[0014] After the request initiator obtains the response identification code, it obtains the data source link route from the remote connection pool based on the response identification code, and completes the address update operation based on the data source link route.
[0015] Based on the above technical solution, the request initiator sends an address update notification to the group based on its authority and the group it belongs to. Users in other groups obtain the address update notification based on subscription and complete the address update operation in real time.
[0016] Based on the above technical solution, the request initiator collects the access frequency of the data source link route, and then updates the data source link route with higher access frequency in the local cache list.
[0017] On the basis of the above technical solution, before storing in the remote connection pool, the existing data source link routes in the remote connection pool are first deduplicated and compared to avoid repeated caching of the same data source link routes.
[0018] On the basis of the above technical solution, the remote connection pool provides an independent database connection pool for each tenant in a multi-tenant environment.
[0019] Based on the above technical solution, the multi-tenant environment is a SaaS system supporting multiple tenants, or a cloud database system supporting multiple tenants.
[0020] On the basis of the above technical solution, when a new tenant type appears, a new default configuration information is allocated to it in the configuration information of the data source to automatically adapt to different tenant types.
[0021] Based on the above technical solution, the parsing engine first obtains the user authentication result from the identity authentication module, and then parses the user's authority and group based on the authentication result, and maps to the corresponding configuration information based on the first keyword;
[0022] The first keyword is any one of the following:
[0023] Group, user name, user permissions, tenant ID number;
[0024] The parsing engine determines which data sources in the database connection pool have access rights according to the configuration information, then obtains the link route of at least one of the data sources, and dynamically generates the data source link route;
[0025] If there is no data source available in the database connection pool, a prompt message is returned indicating that a data source needs to be created.
[0026] Based on the above technical solution, the optional connection parameters are used to introduce a metadata set, which identifies the user's attribute information and filters through a second keyword based on the attribute information to complete the tracking of the user and the setting of data source access rights; the metadata set is also used to receive the filtering results of the second keyword and store them as data source access records and data source update records to achieve data source updates and usage tracking in a multi-tenant environment.
[0027] The method for dynamically updating a database address described in the present invention has the following beneficial effects:
[0028] By introducing dynamic data source acquisition technology, the database management system can be both flexible and efficient, thus building a more stable and reliable data support platform for various applications. The core of this technology is that it can adjust the database access strategy in real time and dynamically according to the data source configuration information, completely getting rid of the constraints of traditional static address configuration.
[0029] In terms of flexibility, dynamic data source acquisition technology allows the system to quickly respond to environmental changes and business needs. Whether it is facing the frequent migration of user databases in multi-tenant systems or the dynamic adjustment of resource pools in cloud environments, this technology can ensure that the database connection always points to the correct address, ensuring business continuity and data consistency. In addition, it also supports a variety of database types and configuration schemes, providing a wider range of choices for complex and changing application scenarios.
[0030] In terms of efficiency, this technology significantly reduces system overhead and improves response speed by optimizing the database connection management mechanism. The introduction of the cache mechanism reduces the overhead of repeated parsing of data source configurations, while the connection pool management realizes the reuse and efficient recycling of database connections, avoiding the waste of resources caused by frequent establishment and destruction of connections. The combined effect of these measures has significantly improved the overall performance of the database system, enabling it to better cope with challenges such as high concurrency and large data volumes.
[0031] Dynamic data source acquisition technology also indirectly improves the stability and reliability of applications. By reducing service interruptions caused by database address errors or connection failures, this technology effectively reduces the complexity and risk of system operation and maintenance. At the same time, it also provides application developers with a more flexible and convenient data access interface, promoting rapid iteration and optimization of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention has the following accompanying drawings:
[0033] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0034] Figure 1 A flowchart of embodiment 1 of a method for dynamically updating a database address according to the present invention.
[0035] Figure 2 A flowchart of a second embodiment of a method for dynamically updating a database address according to the present invention.
[0036] Figure 3 A flowchart of Embodiment 3 of a method for dynamically updating a database address according to the present invention.
[0037] Figure 4 A flowchart of a fourth embodiment of a method for dynamically updating a database address according to the present invention.
[0038] Figure 5 A flowchart of Embodiment 5 of a method for dynamically updating a database address according to the present invention. DETAILED DESCRIPTION
[0039] The present invention is further described in detail below in conjunction with the accompanying drawings. The detailed description is an explanation made in conjunction with the exemplary embodiments of the present invention, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0040] like Figure 1As shown, the method for dynamically updating a database address of the present invention includes:
[0041] Set the configuration information of the data source, which includes: database name, database address, optional connection parameters, user name, and user password;
[0042] Setting a parsing engine, the parsing engine is used to obtain configuration information and dynamically generate data source link routing;
[0043] The generated data source link routes are stored in the remote connection pool to achieve reuse and recycling of data source link routes;
[0044] Set up a local cache list to maintain a set of data source link routes by user name based on access frequency, so as to reduce the overhead of remote resolution and acquisition of data source link routes.
[0045] This embodiment dynamically obtains the user database address by parsing the data source configuration, supports multiple database types and configuration schemes, can be dynamically adjusted according to different user configurations, and improves the flexibility of the system; through the caching mechanism and connection pool management, the overhead of repeated parsing is reduced, and the system response speed and performance are improved; users can change the database configuration without directly modifying the code, reducing maintenance costs; it is suitable for scenarios such as multi-tenant SaaS systems and cloud database management systems, and helps to improve resource utilization and flexibility.
[0046] For frequently accessed data source link routes, in addition to the caching mechanism, you can also consider introducing load balancing technology to optimize system performance. The system uses intelligent load balancing technology to dynamically adjust resource allocation based on the access frequency and response time of the data source link route, which can ensure system stability and performance in high-concurrency scenarios. In addition, for the management of remote connection pools, more sophisticated monitoring and dynamic adjustment strategies can be introduced to cope with changes in resource requirements in different time periods or for different tenants.
[0047] For important data stored in the remote connection pool and local cache, you can consider further adopting data backup and recovery strategies to prevent data loss or damage from causing serious impact on the system.
[0048] Based on the above technical solution, Figure 2 As shown, in response to the received address update request, the configuration information is read through the parsing engine, the data source link route is dynamically generated, and then stored in the remote connection pool, and a response identification code is generated in the remote connection pool for the unique corresponding address update request;
[0049] After the request initiator obtains the response identification code, it obtains the data source link route from the remote connection pool based on the response identification code, and completes the address update operation based on the data source link route.
[0050] When the parsing engine processes the configuration information, if it encounters a format error or a required item is missing, it will record the error log and return the corresponding error code to the request initiator. At the same time, the system supports an automatic retry mechanism to try to re-parse the configuration information within a preset number of times.
[0051] Based on the above technical solution, Figure 3 As shown, the request initiator sends an address update notification to the group based on its authority and the group it belongs to. Users in other groups obtain the address update notification based on subscription and complete the address update operation in real time.
[0052] By requesting the initiator to send an address update notification based on permissions and the group to which it belongs, other group users can obtain and update the address in real time based on subscription, which enhances the flexibility and dynamism of the system. By allowing users in the group to receive and update the database address in real time, the system can quickly adapt to changes in the database configuration without waiting for each user to manually update or the system to push updates uniformly. This instant update mechanism makes the system more flexible and able to respond to changes in the external environment more quickly; the group-based notification mechanism makes it easier to expand the system to multi-tenant environments or other scenarios that require group management. Each group can independently manage its members and database configuration, reducing the complexity and cost of system maintenance; at the same time, when it is necessary to add a new group or modify the group configuration, it is only necessary to make the corresponding settings in the system without modifying the code or performing complex system reconstruction.
[0053] This embodiment also plays a role in optimizing user experience. Users do not need to actively pay attention to changes in database addresses or manually update configuration information. Once the address update notification is sent to the group, users who have subscribed to the group can automatically receive and update the database address, thereby simplifying the user's operation process, improving user experience, improving system security and data consistency, and being more suitable for multi-tenant and cloud environments. Through the group notification mechanism, the system can easily achieve data isolation and configuration update management between tenants. Each tenant can independently manage its database address and other configuration information without affecting other tenants.
[0054] Based on the above technical solution, the request initiator collects the access frequency of the data source link route, and then updates the data source link route with higher access frequency in the local cache list.
[0055] In this embodiment, by counting the access frequency of the data source link route, the system can more accurately understand which routes are frequently accessed by users. Based on this information, the system can optimize the cache strategy and store the routes with higher access frequency in the local cache list to reduce the dependence on the remote connection pool and reduce the access delay. This optimization can significantly improve the response speed and performance of the system, improve the cache hit rate, and not only reduce the system load and response time, but also reduce the pressure and resource consumption of the remote connection pool.
[0056] It is understandable that with limited cache resources, the system needs to reasonably allocate cache capacity to maximize cache benefits. By counting access frequency, the system can dynamically adjust the capacity and storage strategy of the local cache list to ensure that the most valuable routes are saved in the cache. For example, when the cache capacity is insufficient, the system can prioritize the removal of routes with low access frequency to make room for new popular routes. In addition, in a multi-data source or distributed database environment, the load between different data sources may be unbalanced. By counting access frequency, the system can understand which data sources are under higher access pressure. Based on this information, the system can implement a load balancing strategy to disperse requests to different data sources to avoid single-point overload; at the same time, when a data source fails, the system can quickly transfer requests to a backup data source with a higher access frequency to achieve failover and disaster recovery backup.
[0057] On the basis of the above technical solution, before storing in the remote connection pool, the existing data source link routes in the remote connection pool are first deduplicated and compared to avoid repeated caching of the same data source link routes.
[0058] Repeated caching of the same data source link route will occupy unnecessary system resources, including memory, storage, and the number of connections in the connection pool. Through deduplication comparison, the system can ensure that each data source link route is only stored once in the connection pool, thereby saving system resources and improving resource utilization.
[0059] When there are a large number of duplicate data source link routes in the connection pool, the system may unnecessarily search and match the same route multiple times when processing requests, thereby increasing the system's processing time and latency. Through deduplication matching, the system can reduce such unnecessary operations and improve the system's response speed and performance; through deduplication matching, the system can ensure that each route update is unique, thereby enhancing the system's stability and reliability.
[0060] In a multi-tenant and distributed environment, different tenants or nodes may share the same connection pool. If there are a large number of duplicate data source link routes in the connection pool, resource competition and conflicts between these tenants or nodes may intensify. Through deduplication comparison, the system can reduce such competition and conflicts and ensure that each tenant or node can fairly access and use the resources in the connection pool.
[0061] Based on the above technical solution, the remote connection pool provides an independent database connection pool for each tenant in a multi-tenant environment, thereby realizing resource isolation between tenants, avoiding data interference between tenants, and ensuring data security and privacy.
[0062] By allocating an independent database connection pool to each tenant, this embodiment ensures that the data between different tenants is isolated from each other. This isolation mechanism effectively prevents data interference and illegal access between tenants, thereby enhancing data security. From the perspective of protecting user privacy, each tenant can only access and operate his own data, avoiding the risk of data leakage and abuse. By providing an independent database connection pool for each tenant, the system can dynamically adjust the size and configuration of the connection pool according to the tenant's needs and resource usage. This flexible expansion mechanism enables the system to easily cope with the growth of the number of tenants and changes in business needs, and more reasonably optimize resource utilization.
[0063] Independent database connection pools also help improve system reliability and stability. When a tenant's database connection pool fails or encounters a performance bottleneck, it will not affect other tenants' database connection pools. This fault isolation mechanism enables the system to resume service faster and reduce the risk of overall system crashes caused by a single tenant problem.
[0064] On the basis of the above technical solution, the multi-tenant environment is a SaaS system (Software as a Service) supporting multiple tenants, or a cloud database system supporting multiple tenants.
[0065] Based on the above technical solution, when a new tenant type appears, a new default configuration information is assigned to it in the configuration information of the data source to automatically adapt to different tenant types, avoiding complex code modifications or system reconstruction.
[0066] Based on the above technical solution, Figure 4 As shown, the parsing engine first obtains the user authentication result from the identity authentication module, and then parses the user's authority and group based on the authentication result, and maps to the corresponding configuration information based on the first keyword;
[0067] The first keyword is any one of the following:
[0068] Group, user name, user permissions, tenant ID number;
[0069] The parsing engine determines which data sources in the database connection pool have access rights according to the configuration information, then obtains the link route of at least one of the data sources, and dynamically generates the data source link route;
[0070] If there is no data source available in the database connection pool, a prompt message is returned indicating that a data source needs to be created.
[0071] Authenticating users through the identity authentication module ensures that only legitimate users can access system resources. This step is the basis of system security and can effectively prevent unauthorized users from accessing sensitive data or performing illegal operations.
[0072] Based on the user's authentication results, the parsing engine can further parse the user's permissions and groups, thereby achieving fine-grained permission control for different users or groups. This permission control mechanism enables the system to provide different data access and operation permissions according to the needs of different users or groups, enhancing the flexibility and security of the system.
[0073] In this embodiment, the first keyword (such as the group to which it belongs, user name, user authority, tenant ID number) is mapped to the corresponding configuration information, and the system can flexibly manage a large number of user and data source configurations; when a new user, group or data source needs to be added, it is only necessary to add the corresponding configuration information to the system, without the need for large-scale modification or reconstruction of the system, which facilitates system expansion and maintenance.
[0074] The parsing engine dynamically generates data source link routes based on configuration information, allowing the system to flexibly switch data sources according to different user or group needs. This dynamic data source configuration mechanism enables the system to cope with complex and changing business needs, improving the flexibility and adaptability of the system. If there is no available data source in the database connection pool, the system can return a prompt message that a data source needs to be created, avoiding service interruption or data loss due to insufficient data sources.
[0075] Based on the above technical solution, Figure 5 As shown, the optional connection parameter is used to introduce a metadata set, which identifies the attribute information of the user, and filters through the second keyword based on the attribute information to complete the tracking of the user and the setting of the data source access rights; the metadata set is also used to receive the filtering results of the second keyword and store them as data source access records and data source update records, so as to realize data source update and usage tracking in a multi-tenant environment.
[0076] In this embodiment, the user's attribute information is identified by the metadata set, and the attribute information is used as the second keyword for filtering, so that the system can achieve fine control over the user's access to the data source. This means that the system can dynamically adjust the user's data source access rights according to the user's specific attributes (such as role, department, geographic location, etc.), thereby meeting complex and changing security and compliance requirements.
[0077] This embodiment can improve management efficiency in a multi-tenant environment, where data sources and access rights of different tenants are often isolated from each other. By introducing metadata sets and recording data source access and update records, the system can clearly track the data usage of each tenant and provide personalized data management and services for tenants. At the same time, this also facilitates system administrators to manage and audit tenants and improve overall management efficiency. By filtering user attributes and setting permissions, the system can ensure that only users with legitimate permissions can access the corresponding data sources, which not only effectively prevents data leakage and abuse, but also ensures data security and privacy, especially when processing sensitive or confidential data.
[0078] The introduction of metadata sets and the use of optional connection parameters for user tracking, data source access permission setting, and data source update and usage tracking technical details enhance the fine-grained control of data access, improve management efficiency in multi-tenant environments, ensure data security and privacy, support data tracking and traceability, promote business insights and decision support, and improve user experience.
[0079] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
[0080] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by those skilled in the art based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.
Claims
1. A method for dynamically updating a database address, characterized in that: include: Set the configuration information of the data source, which includes: database name, database address, optional connection parameters, user name, and user password; Setting a parsing engine, the parsing engine is used to obtain configuration information and dynamically generate data source link routing; The generated data source link routes are stored in the remote connection pool to achieve reuse and recycling of data source link routes; Set up a local cache list to maintain a set of data source link routes by user name based on access frequency, so as to reduce the overhead of remote resolution and acquisition of data source link routes.
2. A method for dynamically updating a database address as claimed in claim 1, characterized in that: In response to the received address update request, the configuration information is read through the parsing engine, a data source link route is dynamically generated, and then stored in a remote connection pool, and a response identification code is generated in the remote connection pool for uniquely corresponding to the address update request; After the request initiator obtains the response identification code, it obtains the data source link route from the remote connection pool based on the response identification code, and completes the address update operation based on the data source link route.
3. A method for dynamically updating a database address as claimed in claim 2, characterized in that: The request initiator sends an address update notification to the group based on its permissions and the group it belongs to. Users in other groups receive the address update notification based on subscription and complete the address update operation in real time.
4. A method for dynamically updating a database address as claimed in claim 2, characterized in that: The request initiator collects the access frequency of the data source link route and then updates the data source link route with a higher access frequency in the local cache list.
5. A method for dynamically updating a database address as claimed in claim 1, characterized in that: Before storing in the remote connection pool, first perform a deduplication comparison on the existing data source link routes in the remote connection pool to avoid repeated caching of the same data source link routes.
6. A method for dynamically updating a database address as claimed in claim 1, characterized in that: The remote connection pool provides an independent database connection pool for each tenant in a multi-tenant environment.
7. A method for dynamically updating a database address as claimed in claim 6, characterized in that: The multi-tenant environment is a SaaS system supporting multiple tenants, or a cloud database system supporting multiple tenants.
8. A method for dynamically updating a database address as claimed in claim 1, characterized in that: When a new tenant type appears, a new default configuration information is assigned to it in the configuration information of the data source to automatically adapt to different tenant types.
9. A method for dynamically updating a database address as claimed in claim 1, characterized in that: The parsing engine first obtains the user authentication result from the identity authentication module, then parses the user's authority and group based on the authentication result, and maps to the corresponding configuration information based on the first keyword; The first keyword is any one of the following: Group, user name, user permissions, tenant ID number; The parsing engine determines which data sources in the database connection pool have access rights according to the configuration information, then obtains the link route of at least one of the data sources, and dynamically generates the data source link route; If there is no data source available in the database connection pool, a prompt message is returned indicating that a data source needs to be created.
10. A method for dynamically updating a database address as claimed in claim 9, characterized in that: The optional connection parameter is used to introduce a metadata set, the metadata set identifies the attribute information of the user, and filters based on the attribute information through the second keyword to complete the tracking of the user and the setting of the data source access rights; The metadata set is also used to receive the filtering result of the second keyword and store it as a data source access record and a data source update record, so as to realize data source update and usage tracking in a multi-tenant environment.