Database access method and device and electronic equipment

By generating database access configuration tables and access models, and customizing the database environment according to user security level, solving the problems of data security and low operation efficiency in the existing technology, realizing flexible database access control and efficient access model generation.

CN119536844APending Publication Date: 2025-02-28CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411619029.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art is difficult to meet the database environment that different users flexibly customize according to their security and confidentiality levels, making it difficult to ensure data security and low manual operation efficiency, which cannot meet the growing demand.

Method used

By obtaining access constraint information of different database users, generating a database access configuration table, calling the configuration main program to determine the configuration task collection, starting multiple threads to generate access models, determining the target database and access model based on access requests, and realizing access control of the target database.

Benefits of technology

It realizes flexible customization of the database environment according to the user's security level, improves data security and access model generation efficiency, is more applicable and flexible, and can meet a variety of access needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536844A_ABST
    Figure CN119536844A_ABST
Patent Text Reader

Abstract

The invention provides a database access method and device and electronic equipment, and relates to the technical field of data processing. The database access method comprises the following steps: acquiring access constraint information of different database users in respective registered databases, and generating a database access configuration table according to the access constraint information; calling a configuration main program, and reading the access configuration table by the main program to determine a configuration task set of various databases; starting a plurality of threads, and scheduling a configuration task set to the plurality of threads to generate at least one access model of each database; obtaining a database access request sent by the terminal equipment, determining a pre-accessed target database according to the access request, and determining a target access model matched with a target database user; and performing access control on the target database based on the target access model to obtain an access result of the access request, thereby realizing flexible database access control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a database access method, device and electronic device. Background Art

[0002] With the promotion and deepening development of digital business methods, a single database environment and permissions can no longer meet the requirements of different user data security levels. Therefore, it is an urgent problem to enable various users to use data independently, meet users' flexible and changeable data analysis needs, flexibly customize the basic data permissions of the corresponding environment according to the user's security and confidentiality level, and ensure data security. At present, manual processing requires a lot of time and energy, especially when a large number of operations are performed, which is prone to cause view loss. With the development of business, manual operations may not be able to meet the growing needs. Summary of the invention

[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0004] The first embodiment of the present disclosure provides a method for accessing a database, including:

[0005] Obtaining access constraint information of different database users under their respective registered databases, and generating a database access configuration table based on the access constraint information;

[0006] Calling a configuration main program, and having the main program read the access configuration table to determine the configuration task sets of each type of database;

[0007] Starting a plurality of threads, and scheduling the set of configuration tasks to the plurality of threads to generate at least one access model for each type of database, wherein one access model corresponds to at least one database user;

[0008] Obtaining a database access request sent by a terminal device;

[0009] Determine a target database pre-accessed by a target database user according to the access request, and determine a target access model matching the target database user from the access model of the target database;

[0010] Access control is performed on the target database based on the target access model to obtain an access result of the access request.

[0011] A second aspect of the present disclosure provides a database access device, including:

[0012] A first acquisition module is used to acquire access constraint information of different database users under their respective registered databases, and generate a database access configuration table according to the access constraint information;

[0013] A calling module is used to call a configuration main program, and the main program reads the access configuration table to determine the configuration task sets of each type of database;

[0014] A scheduling module, used to start multiple threads and schedule the configuration task set to the multiple threads to generate at least one access model for each type of database, wherein one access model corresponds to at least one database user;

[0015] A second acquisition module, used to acquire a database access request sent by a terminal device;

[0016] A third acquisition module is used to determine the target database pre-accessed by the target database user according to the access request, and determine a target access model matching the target database user from the access model of the target database;

[0017] An access module is used to perform access control on the target database based on the target access model to obtain an access result of the access request.

[0018] The third aspect of the present disclosure provides an electronic device, including:

[0019] at least one processor; and

[0020] a memory communicatively connected to at least one processor; wherein,

[0021] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the database access method provided in the embodiment of the first aspect of the present disclosure.

[0022] The fourth aspect embodiment of the present disclosure proposes a computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are used to enable a computer to execute the database access method provided in the first aspect embodiment of the present disclosure.

[0023] The fifth aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which implements the database access method provided in the first aspect embodiment of the present disclosure when executed by a processor.

[0024] The present application can generate an access configuration table by obtaining access constraint information of different database users, and construct the configuration table in advance according to the actual situation of the database users, so that the configuration is more flexible. The access configuration table is read by calling the configuration main program to obtain a configuration task set, and multiple threads are started to schedule the configuration task set to generate access models corresponding to various databases, thereby improving the generation efficiency of the access model. Then, the target database for pre-access is determined based on the access request, and the corresponding target access model is matched. Access control of the target database is implemented according to the target access model to obtain an access result, which can be applicable to one or more access requirements. The access configuration table can be flexibly changed through configuration to implement the change of the access model, and the access control of the database is more adaptable and flexible. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a flow chart of a method for accessing a database provided by an embodiment of the present disclosure;

[0026] Figure 2 is a flow chart of obtaining access constraint information provided by an embodiment of the present disclosure;

[0027] Figure 3 is a flowchart of another database access method provided by an embodiment of the present disclosure;

[0028] Figure 4 It is a structural block diagram of a database access device provided by an embodiment of the present disclosure;

[0029] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0030] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0032] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of relevant laws and regulations.

[0033] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0034] The following describes the database access method, device and electronic device according to the embodiments of the present disclosure in conjunction with the accompanying drawings.

[0035] Figure 1 is a flowchart of a method for accessing a database provided by an embodiment of the present disclosure, such as Figure 1 As shown, the method comprises the following steps:

[0036] S101, obtaining access constraint information of different database users in their respective registered databases, and generating a database access configuration table according to the access constraint information.

[0037] In some implementations, the access constraint information of a database user can be determined based on the user's security level. For example, the higher the user's security level, the more database information can be accessed in the corresponding access constraint information, and correspondingly, the lower the user's security level, the less database information can be accessed in the corresponding access constraint information.

[0038] Optionally, the access constraint information may include accessible data tables and / or accessible fields, that is, the access constraint information includes data tables and / or accessible fields in the database that the current database user can access.

[0039] Furthermore, a database access configuration table may be generated based on the access constraint information, and the database access configuration table at least includes database users and access constraint information corresponding to the database users. That is, each database user and access constraint information corresponding to the database user may be determined based on the database access configuration table.

[0040] S102, calling the configuration main program, and having the main program read the access configuration table to determine the configuration task sets of each type of database.

[0041] The main program refers to an independent core program that is responsible for the entire program flow; by calling the configuration main program, the main program reads the access configuration table, thereby obtaining the configuration task set of each database from the access configuration table. The configuration task set includes one or more configuration tasks.

[0042] S103, start multiple threads, and schedule a configuration task set to the multiple threads to generate at least one access model for each type of database.

[0043] It can be understood that multiple threads are multiple independent execution paths running simultaneously in the same program. These paths share the resources of the process but are executed independently. Therefore, a task set is scheduled by multiple threads, and at least one access model for each type of database is generated according to the configuration tasks of each database in the task set. One access model corresponds to at least one database user; that is, one or more database users may share an access model at the same time. The access model is a model used to implement access to the database. The access model includes at least access constraint information corresponding to the database user, and the database is accessed according to the access model.

[0044] S104: Obtain a database access request sent by the terminal device.

[0045] In some implementations, the terminal device may be a personal computer, a smart phone, a tablet computer, etc. The terminal device may issue a database access request, which includes at least a database identifier of a target database to be accessed and a user identifier of a user accessing the target database.

[0046] S105 , determining a target database that the target database user pre-accesses according to the access request, and determining a target access model that matches the target database user from the access model of the target database.

[0047] It is understandable that the access request includes the database identifier of the target database, so the target database to be accessed can be determined based on the database identifier of the target database, and the target access model matching the target database user can be determined from the access model corresponding to the target database.

[0048] In some implementations, the target access model can be acquired based on the mapping relationship between the access model of the target database and the database user. For example, a query is performed based on the user identifier of the target database user in the access request to determine the access model that has a mapping relationship with the user identifier, thereby obtaining the target access model that matches the target database user.

[0049] S106: Perform access control on the target database based on the target access model to obtain an access result of the access request.

[0050] Optionally, the target access model may include access rights to the target database, such as access fields of the target database, and access control is performed on the target database based on the target access model to obtain the access result of the access request, thereby ensuring the security of other data in the database.

[0051] In this embodiment, access constraint information of different database users is obtained, and the access constraint information may include accessible databases and accessible field information. A database access configuration table is generated according to the access constraint information. The database access configuration table is read by calling a configuration main program, thereby obtaining a configuration task set for each type of database in the access configuration table. Multiple threads are further started to schedule the configuration task set, thereby generating at least one access model for each type of database. The access model includes access rights to the database. After receiving a database access request sent by a terminal device, a target database to be accessed can be determined according to identification information in the access request, and a target access model of the target database to be accessed can be determined from the database access model, thereby implementing access control on the database according to the target access model, obtaining an access result of the access request, implementing field-level access constraints for each database user, and determining the access model of each database through multi-threaded calling configuration. The configuration is flexible and efficient. The corresponding access model is configured according to the access constraint information of the database user, and data security is guaranteed while accessing the database data.

[0052] Based on the above embodiments, Figure 2 is a flowchart of obtaining access constraint information provided by an embodiment of the present disclosure, such as Figure 2 As shown, the method comprises the following steps:

[0053] S201, obtaining the accessible objects of the database user under the registered database.

[0054] Optionally, the accessible key fields configured by the database user under the registered database may be obtained as accessible objects; that is, only the key fields that need to be accessed are screened out, and the accessible key fields are used as accessible objects for the database user.

[0055] Optionally, the metadata of the database user under the registered database can also be obtained; the metadata is screened according to the attribute information of the database user, and the target metadata accessible to the database user is determined as an accessible object; in some implementations, the attribute information of the user can be the security level of the database user, that is, different security levels of the user correspond to different accessible target metadata, for example, a database user with a higher security level can access all target metadata, and a database user with a lower security level can only access part of the target metadata, so the metadata can be screened according to the security level of the database user, so as to determine the target metadata accessible to the database as an accessible object.

[0056] S202: Determine a return mode of the access result according to the attribute information of the database user, and determine the accessible object and the return mode as access constraint information.

[0057] Optionally, the return mode of the access result may include encrypted return and unencrypted return. For example, some information may be encrypted and returned through special symbols such as asterisks to avoid leakage of excessive data information. The security level of the database user may be determined based on the attribute information of the database user. When the database user's security level is high, it may correspond to the unencrypted return mode. When the database user's security level is low, it may correspond to the encrypted return mode.

[0058] The accessible objects and return modes of the database user are used as the access constraint information of the database user.

[0059] In this embodiment, the accessible key fields and filtered metadata of the database user are obtained as accessible objects, and the return mode of the access result is further determined based on the attribute information of the database user, such as the security level of the database user. The accessible objects and return modes are used as access constraint information, and adaptive access model configuration is performed for each database user to ensure data security.

[0060] Based on the above embodiments, Figure 3 is a flowchart of another database access method provided by an embodiment of the present disclosure, such as Figure 3 As shown, the method comprises the following steps:

[0061] S301, obtaining the accessible objects of the database user under the registered database.

[0062] In the embodiments of the present disclosure, the implementation method of step S301 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0063] S302: Determine a return mode of the access result according to the attribute information of the database user, and determine the accessible object and the return mode as access constraint information.

[0064] In the embodiments of the present disclosure, the implementation method of step S302 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0065] S303: Generate a database access configuration table according to the access constraint information.

[0066] In the embodiments of the present disclosure, the implementation method of step S303 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0067] S304, calling the configuration main program, and having the main program read the access configuration table to determine the configuration task sets of each type of database.

[0068] In some implementations, in response to satisfying a pre-set calling condition, a main program is called based on a calling instruction; optionally, the pre-set calling condition may be setting a calling time, such as setting a fixed time for calling, and calling the main program based on the calling instruction every time the time interval is met, which has flexible configuration and lower cost than manual operation and maintenance.

[0069] The configuration main program reads the access configuration table to obtain the configuration information of each type of database in the access configuration table; based on the configuration information of each type of database, a configuration task set corresponding to each type of database is generated; that is, the configuration information of each type of database is obtained from the access configuration table, and the configuration information may be the access constraint information of each type of database; based on the configuration information, a configuration task set corresponding to each type of database is generated, and the configuration task set includes one or more configuration tasks for configuring the database.

[0070] In the embodiments of the present disclosure, the implementation method of step S304 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0071] S305, start multiple threads, and schedule a configuration task set to the multiple threads to generate at least one access model for each type of database.

[0072] In some implementations, the task amount of the configured task set can be obtained; the task execution capability of each thread in multiple threads can be obtained; and the configured task set is scheduled to multiple threads based on the task amount and the task execution capability; for example, if the task amount of the configured task set is 10 and the task execution capability of each thread in multiple threads is 3, then the configured task set is scheduled to 4 threads based on the task amount and the task execution capability, thereby maximizing the use of thread resources while implementing all configured tasks and avoiding resource waste.

[0073] In some implementations, it is also possible to determine the sub-configuration information of the configuration tasks in the configuration task set based on the configuration information; determine whether there is a historical access model that matches the sub-configuration information in the database; that is, to search the database for a corresponding historical access model based on the self-configuration information of each configuration task; in response to the existence of a historical access model, delete the historical access model and rebuild the access model based on the configuration information; in response to the absence of a historical access model, generate an access model that matches the sub-configuration information in the database to avoid repeated construction of the access model.

[0074] In some implementations, in response to the existence of a historical access model, the historical sub-configuration information and sub-configuration information of the historical access model can also be compared to obtain configuration update information, that is, to determine the difference information between the historical sub-configuration information and the sub-configuration information of the current configuration task as the configuration update information; based on the configuration update information, the historical access model is updated to generate an access model that matches the configuration information of the database, thereby reducing the computational cost of reconstructing the access model.

[0075] Furthermore, the update operation of the access configuration table can also be monitored, and in response to monitoring the update operation, the update data volume of the update operation is obtained; based on the update data volume, an indication message is sent to the main program, and the indication message is used to indicate that the main program can be configured to read the updated access configuration table immediately when the calling condition is not met, so as to update the access model of the database based on the updated access configuration table; that is, after monitoring the update operation, the update data volume of the current update operation is determined, and based on the update data volume, an indication message is sent to the main program to instruct the main program to read the updated access configuration table immediately when the calling condition is not met, so as to update the access model in real time based on the updated access configuration table, thereby reducing the time cost of manual operation and maintenance and providing flexible and convenient configuration.

[0076] In the embodiments of the present disclosure, the implementation method of step S305 can be implemented by any of the methods in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0077] S306: Obtain a database access request sent by the terminal device.

[0078] In the embodiments of the present disclosure, the implementation method of step S306 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0079] S307 , determining the target database that the target database user pre-accesses according to the access request, and determining a target access model that matches the target database user from the access model of the target database.

[0080] In the embodiments of the present disclosure, the implementation method of step S307 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0081] S308: Perform access control on the target database based on the target access model to obtain an access result of the access request.

[0082] In some implementations, the target database user's login information in the target database can be obtained, and the target database user's login verification can be performed based on the login information; in response to passing the login verification, the target access model is called, and access control is performed on the target database based on the target access model. For example, the login information includes the user's login account and login password, and the target database user is logged in and verified according to the login account and login password. After the target database user is successfully verified, the target access model is called, thereby performing access control on the target database, ensuring the security of data in the database, and reducing the probability of illegal access by abnormal users.

[0083] In the embodiments of the present disclosure, the implementation method of step S308 may be implemented in any manner in the embodiments of the present disclosure, which is not limited here and will not be described in detail.

[0084] In this embodiment, based on the accessible key fields and filtered metadata of the database user as the accessible objects, the corresponding return mode is determined in combination with the security level of the database user, the access constraint information is determined according to the return mode and the accessible object, and the access configuration table is further generated according to the access constraint information, and the main program is called according to whether the calling condition is met, so as to obtain the configuration task set of each type of database; further, the configuration task set is configured by scheduling multiple threads, and the thread resources are maximized according to the task execution capability of each thread. It is also possible to determine whether there are repeated historical access models according to the configuration information, and delete and rebuild the historical access models when they exist, or determine the update information between the historical access models to update the access model to avoid repeated construction of the access model. It is also possible to monitor the update of the access configuration table, and send indication information to the main program in real time based on the update data volume of the access configuration table, so that the main program can immediately obtain the updated access configuration table, and update the access model according to the updated access configuration table, so as to reduce the time cost of manual operation and maintenance, and make the configuration more flexible. Before the database user accesses the database based on the target access model, the login information of the database user can also be verified to improve the security of data access in the database and reduce the probability of abnormal data access.

[0085] Figure 4 A structural block diagram of a database access device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the database access device 400 of the embodiment of the present disclosure includes:

[0086] The first acquisition module 401 is used to acquire access constraint information of different database users under their respective registered databases, and generate a database access configuration table according to the access constraint information;

[0087] The calling module 402 is used to call the configuration main program, and the main program reads the access configuration table to determine the configuration task set of each type of database;

[0088] The scheduling module 403 is used to start multiple threads and schedule a set of configuration tasks to the multiple threads to generate at least one access model for each type of database, wherein one access model corresponds to at least one database user;

[0089] The second acquisition module 404 is used to acquire a database access request sent by a terminal device;

[0090] The third acquisition module 405 is used to determine the target database pre-accessed by the target database user according to the access request, and determine the target access model matching the target database user from the access model of the target database;

[0091] The access module 406 is used to perform access control on the target database based on the target access model to obtain the access result of the access request.

[0092] In some implementations, calling module 402 includes:

[0093] In response to satisfying a preset calling condition, calling a main program based on a calling instruction;

[0094] The configuration main program reads the access configuration table to obtain the configuration information of various databases in the access configuration table;

[0095] According to the configuration information of each type of database, a configuration task set corresponding to each type of database is generated.

[0096] In some implementations, the scheduling module 403 includes:

[0097] Get the task amount of the configured task set;

[0098] Get the task execution capability of each thread among multiple threads;

[0099] According to the task volume and task execution capability, a set of tasks is scheduled and configured to multiple threads.

[0100] In some implementations, the apparatus 400 further includes:

[0101] Determine, according to the configuration information, sub-configuration information of the configuration task in the configuration task set;

[0102] Determine whether there is a historical access model matching the sub-configuration information in the database;

[0103] In response to the existence of a historical access model, the historical access model is deleted, and the access model is rebuilt according to the configuration information;

[0104] In response to the absence of a historical access model, an access model matching the sub-configuration information of the database is generated.

[0105] In some implementations, the apparatus 400 further includes:

[0106] In response to the existence of the historical access model, comparing the historical sub-configuration information and the sub-configuration information of the historical access model to obtain configuration update information;

[0107] The historical access model is updated based on the configuration update information to generate an access model that matches the configuration information of the database.

[0108] In some implementations, the apparatus 400 further includes:

[0109] Performing update operation monitoring on the access configuration table, and in response to monitoring the update operation, obtaining the update data volume of the update operation;

[0110] Based on the amount of updated data, an indication message is sent to the main program, where the indication message is used to indicate that the configuration main program can be called to read the updated access configuration table immediately when the calling condition is not met, so as to update the access model of the database based on the updated access configuration table.

[0111] In some implementations, the first acquisition module 401 includes:

[0112] Get the accessible objects of the database user under the registered database;

[0113] Determine the return mode of access results according to the attribute information of the database user;

[0114] Determines accessible objects and returns modes as access constraint information.

[0115] In some implementations, the first acquisition module 401 includes:

[0116] Get the accessible key fields configured by the database user under the registered database as accessible objects; or,

[0117] Get the metadata of the database user under the registered database;

[0118] According to the attribute information of the database user, the metadata is screened to determine the target metadata accessible to the database user as the accessible object.

[0119] In some implementations, the access module 406 includes:

[0120] Obtain the target database user's login information in the target database, and perform login verification on the target database user based on the login information;

[0121] In response to passing the login authentication, the target access model is called, and access control is performed on the target database based on the target access model.

[0122] In this embodiment, based on the accessible key fields and filtered metadata of the database user as the accessible objects, the corresponding return mode is determined in combination with the security level of the database user, the access constraint information is determined according to the return mode and the accessible object, and the access configuration table is further generated according to the access constraint information, and the main program is called according to whether the calling condition is met, so as to obtain the configuration task set of each type of database; further, the configuration task set is configured by scheduling multiple threads, and the thread resources are maximized according to the task execution capability of each thread. It is also possible to determine whether there are repeated historical access models according to the configuration information, and delete and rebuild the historical access models when they exist, or determine the update information between the historical access models to update the access model to avoid repeated construction of the access model. It is also possible to monitor the update of the access configuration table, and send indication information to the main program in real time based on the update data volume of the access configuration table, so that the main program can immediately obtain the updated access configuration table, and update the access model according to the updated access configuration table, so as to reduce the time cost of manual operation and maintenance, and make the configuration more flexible. Before the database user accesses the database based on the target access model, the login information of the database user can also be verified to improve the security of data access in the database and reduce the probability of abnormal data access.

[0123] Figure 5 FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Figure 5 As shown, the electronic device 500 includes:

[0124] The memory 510 and the processor 520, a bus 530 connecting different components (including the memory 510 and the processor 520), the memory 510 stores a computer program, and when the processor 520 executes the program, the database access method described in the embodiment of the present disclosure is implemented.

[0125] Bus 530 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0126] The electronic device 500 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.

[0127] The memory 510 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 540 and / or cache memory 550. The electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 560 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 530 via one or more data medium interfaces. The memory 510 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0128] A program / utility 580 having a set (at least one) of program modules 570 may be stored, for example, in the memory 510, such program modules 570 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 570 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0129] The electronic device 500 may also communicate with one or more external devices 590 (e.g., keyboard, pointing device, display 591, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 592. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 593. Figure 5 As shown, the network adapter 593 communicates with other modules of the electronic device 500 via the bus 530. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0130] The processor 520 executes various functional applications and data processing by running the programs stored in the memory 510 .

[0131] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the database access method of the embodiment of the present disclosure, which will not be repeated here.

[0132] In order to implement the above embodiments, the present disclosure also proposes a computer-readable storage medium.

[0133] When the instructions in the computer-readable storage medium are executed by the processor of the business server, the business server can execute the database access method as described above. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0134] In order to implement the above embodiments, the present disclosure further provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the database access method as described above is implemented.

[0135] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims. It should be understood that the present disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for accessing a database, characterized in that: include: Obtaining access constraint information of different database users under their respective registered databases, and generating a database access configuration table based on the access constraint information; Calling a configuration main program, and having the main program read the access configuration table to determine the configuration task sets of each type of database; Starting a plurality of threads, and scheduling the set of configuration tasks to the plurality of threads to generate at least one access model for each type of database, wherein one access model corresponds to at least one database user; Obtaining a database access request sent by a terminal device; Determine a target database pre-accessed by a target database user according to the access request, and determine a target access model matching the target database user from the access model of the target database; Access control is performed on the target database based on the target access model to obtain an access result of the access request.

2. The method according to claim 1, characterized in that The step of determining the configuration task sets of each type of database includes: In response to satisfying a preset calling condition, calling the main program based on a calling instruction; The configuration main program reads the access configuration table to obtain configuration information of various databases in the access configuration table; According to the configuration information of each type of database, a configuration task set corresponding to each type of database is generated.

3. The method according to claim 1, characterized in that The step of scheduling the configuration task set to the multiple threads includes: Obtaining the task amount of the configuration task set; Obtaining the task execution capability of each thread in the multiple threads; The configuration task set is scheduled to the multiple threads according to the task amount and the task execution capability.

4. The method according to claim 2, characterized in that: The method further comprises: Determine, according to the configuration information, sub-configuration information of the configuration task in the configuration task set; Determine whether there is a historical access model matching the sub-configuration information in the database; In response to the existence of the historical access model, deleting the historical access model and reconstructing the access model according to the configuration information; In response to the absence of the historical access model, an access model matching the sub-configuration information of the database is generated.

5. The method according to claim 4, characterized in that The method further comprises: In response to the existence of the historical access model, comparing the historical sub-configuration information of the historical access model with the sub-configuration information to obtain configuration update information; The historical access model is updated based on the configuration update information to generate an access model that matches the configuration information of the database.

6. The method according to claim 2, characterized in that The method further comprises: Performing update operation monitoring on the access configuration table, and in response to monitoring the update operation, acquiring the update data volume of the update operation; Based on the updated data volume, indication information is sent to the main program, wherein the indication information is used to indicate that the configuration main program can be called to read the updated access configuration table immediately when the calling condition is not met, so as to update the access model of the database based on the updated access configuration table.

7. The method according to any one of claims 1 to 6, characterized in that The obtaining of access constraint information of databases registered by different database users includes: Obtaining the accessible objects of the database user under the registered database; Determining a return mode of the access result according to the attribute information of the database user; The accessible object and the return mode are determined as the access constraint information.

8. The method according to claim 7, characterized in that The obtaining of the accessible objects of the database user in the registered database includes: Obtaining the accessible key field configured by the database user under the registered database as the accessible object; or, Obtaining metadata of the database user under the registered database; The metadata is screened according to the attribute information of the database user, and target metadata accessible to the database user is determined as the accessible object.

9. The method according to any one of claims 1 to 6, characterized in that: The performing access control on the target database based on the target access model includes: Acquire the login information of the target database user in the target database, and perform login verification on the target database user based on the login information; In response to passing the login verification, the target access model is called, and access control is performed on the target database based on the target access model.

10. A database access device, characterized in that: include: A first acquisition module is used to acquire access constraint information of different database users under their respective registered databases, and generate a database access configuration table according to the access constraint information; A calling module is used to call a configuration main program, and the main program reads the access configuration table to determine the configuration task sets of each type of database; A scheduling module, used to start multiple threads and schedule the configuration task set to the multiple threads to generate at least one access model for each type of database, wherein one access model corresponds to at least one database user; A second acquisition module, used to acquire a database access request sent by a terminal device; A third acquisition module is used to determine the target database pre-accessed by the target database user according to the access request, and determine a target access model matching the target database user from the access model of the target database; An access module is used to perform access control on the target database based on the target access model to obtain an access result of the access request.

11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.

13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.

Citation Information

Cited By

  • Database access management method and device, electronic equipment and storage medium

    CN120653687A