A database processing method, device, electronic device and medium
By detecting user login events and generating target database address links based on the identification, the problem of inefficient data permission management in power grid enterprises is solved, and the direct association between users and databases and the effective management of data permissions are achieved.
Patent Information
- Application Number
- CN202110308827.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-03-23
AI Technical Summary
Existing data permission management is inefficient in power grid enterprises. Users need to run repetitive procedures every time they apply to view data tables, resulting in reduced management efficiency.
By detecting user login events, determining the tenant coding category based on the user ID, generating a target database address link, and associating the user ID with the target database, data operations are implemented.
It improves the management efficiency of data permissions and solves the problem of no correlation between data in the database and users. Users can directly operate the target database, which enhances the effective management of data permissions.
Smart Images

Figure CN113032471B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a database processing method, device, electronic device and medium. Background Art
[0002] In power grid enterprises, power grid data is mainly collected by the subordinate municipal companies and uploaded to the big data platform within the power grid enterprise for archiving; on this basis, when the provincial company and municipal companies need to obtain power grid data, they can only query data through the big data platform within the provincial company, and the power grid data in the big data platform has permission allocation, that is, users of the provincial company have the permission to view the data of the entire provincial power grid, while users of municipal companies can only view the data of their own city. The existing data permission control mainly stores the user ID and the data range that can be viewed by the user in a single table so that users can view their data range.
[0003] The defect of the existing solution is that every time a user applies to view a data table, the system needs to run a related program to control data permissions. A large amount of repetitive work greatly reduces the management efficiency of data permissions. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a database processing method, device, electronic device and medium.
[0005] In a first aspect, the present disclosure provides a method for processing a database, the method comprising:
[0006] If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined according to the user's identifier;
[0007] An address link of a target database is generated according to the coding category, and the user's identifier is associated with the target database according to the address link, so that the user can perform data operations on the target database.
[0008] Optionally, determining the coding category of the tenant code to which the user belongs according to the identifier of the user includes:
[0009] Based on the coding category mapping table, the coding category of the tenant code to which the user belongs is determined according to the user's identifier; wherein the coding category includes a municipal bureau category or a provincial company category.
[0010] Optionally, if the coding category is a municipal bureau category, generating an address link of a target database according to the coding category includes:
[0011] Calling a database information acquisition program to determine the target database information, the target mode of the target database, the user name of the target mode, and the user password of the target mode according to the tenant code to which the user belongs;
[0012] Generate an address link of the target database according to the information of the target database, the target mode of the target database, the user name of the target mode and the user password of the target mode;
[0013] The target database information includes the network protocol IP address, port number and database name.
[0014] Optionally, generating an address link of the target database according to the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode includes:
[0015] Calling a link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode to obtain a conversion result;
[0016] Sequentially combine the characters in the conversion result to obtain the address link of the target database.
[0017] Optionally, if the coding category is a provincial company category, then generating an address link of a target database according to the coding category includes:
[0018] receiving a data table selection request from the user; wherein the data table selection request includes target data;
[0019] Determine the business system to which the target data belongs;
[0020] The address link of the target database is determined according to the business system to which the target data belongs.
[0021] Optionally, determining the address link of the target database according to the business system to which the target data belongs includes:
[0022] Determine a target mode of a target database according to the business system to which the target data belongs;
[0023] Calling a database information acquisition program to determine the IP address, port number, database name, user name, and user password of the target database according to the tenant code to which the user belongs;
[0024] An address link of the target database is generated according to the IP address, port number, database name, target mode of the target database, user name of the target database and user password of the target database.
[0025] Optionally, the method further comprises:
[0026] If a data operation request sent by a user is received, the identification of the user is obtained; wherein the data operation request includes at least one of a data query request, a data control request and a data definition request;
[0027] An associated target database is determined according to the user's identifier, so that the user can perform data operations in the target database.
[0028] In a second aspect, the present disclosure further provides a database processing device, including:
[0029] A coding category determination module, configured to determine the coding category of the tenant code to which the user belongs according to the user's identifier if a platform login event triggered by the user is detected;
[0030] The address link generation and association module is used to generate an address link of a target database according to the coding category, and associate the user's identification with the target database according to the address link, so that the user can perform data operations on the target database.
[0031] Optionally, the coding category determination module is specifically used to:
[0032] Based on the coding category mapping table, the coding category of the tenant code to which the user belongs is determined according to the user's identifier; wherein the coding category includes a municipal bureau category or a provincial company category.
[0033] Optionally, the address link generation and association module includes: an information determination unit and an address link determination unit;
[0034] An information determination unit, configured to call a database information acquisition program, and determine information of a target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode according to a tenant code to which the user belongs;
[0035] An address link determination unit, configured to generate an address link of a target database according to information of the target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode;
[0036] The target database information includes the network protocol IP address, port number and database name.
[0037] Optionally, the address link determination unit is specifically configured to:
[0038] Calling a link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode to obtain a conversion result;
[0039] Sequentially combine the characters in the conversion result to obtain the address link of the target database.
[0040] Optionally, the address link generation and association module further includes: a request receiving unit and a business system determination unit;
[0041] A request receiving unit, configured to receive a data table selection request from the user; wherein the data table selection request includes target data;
[0042] A business system determining unit, used to determine the business system to which the target data belongs;
[0043] The address link determination unit is further used to determine the address link of the target database according to the business system to which the target data belongs.
[0044] Optionally, the address link determination unit is specifically configured to:
[0045] Determine a target mode of a target database according to the business system to which the target data belongs;
[0046] Calling a database information acquisition program to determine the IP address, port number, database name, user name, and user password of the target database according to the tenant code to which the user belongs;
[0047] An address link of the target database is generated according to the IP address, port number, database name, target mode of the target database, user name of the target database and user password of the target database.
[0048] Optionally, it also includes:
[0049] an identification acquisition module, configured to acquire an identification of a user upon receiving a data operation request sent by the user; wherein the data operation request includes at least one of a data query request, a data control request and a data definition request;
[0050] The target database determination module is used to determine the associated target database according to the user's identification, so that the user can perform data operations in the target database.
[0051] In a third aspect, the present disclosure further provides an electronic device, the electronic device comprising:
[0052] one or more processors;
[0053] a storage device for storing one or more programs,
[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the database processing methods described in the embodiments of the present invention.
[0055] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the database processing methods described in the embodiments of the present invention.
[0056] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages: it solves the problem that the data stored in the database has no correlation with the user, enables the user to directly operate the target database according to the correlation when operating the data subsequently, and improves the effective management of data permissions in the target database. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0059] Figure 1 It is a flowchart of a database processing method provided by an embodiment of the present disclosure;
[0060] Figure 2 is a flowchart of another database processing method provided by an embodiment of the present disclosure;
[0061] Figure 3 is a flowchart of another database processing method provided by an embodiment of the present disclosure;
[0062] Figure 4 is a flowchart of another database processing method provided by an embodiment of the present disclosure;
[0063] Figure 5 is a structural schematic diagram of a database processing device provided by an embodiment of the present disclosure;
[0064] Figure 6 It is a structural diagram of an electronic device provided in Embodiment 4 of the present disclosure. DETAILED DESCRIPTION
[0065] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0067] Figure 1 It is a flowchart of a database processing method provided by an embodiment of the present disclosure. This embodiment can be applied to the case where data in a power grid system is assigned permissions. The method of this embodiment can be executed by a database processing device, which can be implemented in hardware and / or software and can be configured in an electronic device. The database processing method described in any embodiment of the present application can be implemented.
[0068] At present, the power grid data of the municipal bureaus and provincial companies are all stored in a power grid big data platform. In the power grid big data platform, the power grid data of the provincial company includes the power grid data of all municipal bureaus within the province. These data are stored in the same database of the power grid big data platform, but the power grid data of each individual municipal bureau are stored separately in different modes of the same database, where the mode can be regarded as a sub-database.
[0069] In the model to which each municipal company belongs, there is no business system that distinguishes the data source, such as the marketing system and the human resources system; in the power grid big data platform, all data of all municipal companies in a province are stored in one model, and the data of the provincial company is stored separately in several models according to the business system to which the data belongs; when users need to query provincial company data or municipal bureau data, they all obtain them through the unified big data platform of the provincial company.
[0070] like Figure 1 As shown, the method specifically includes the following:
[0071] S110: If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined according to the user's identifier.
[0072] In this embodiment, the platform login event is a login request event in which a user logs in to the big data platform to query data. For example, the user enters a registered account and fills in a registered password on the login interface of the big data platform. Before the user logs in to the big data platform, the user needs to perform account registration and identity verification and other audit operations on the platform to verify the user's identity information and avoid leakage of data stored in the big data platform.
[0073] In order to effectively manage the users registered on the platform, each user is identified to effectively distinguish each user; the user's identification can be assigned by the big data platform after the user registers, and the user can also make his or her own choice when registering. The user's identification can be a string combination of numbers, letters and symbols, such as 123_A.
[0074] The tenant code to which the user belongs can be obtained from the code mapping table according to the user's ID; the user's ID and the tenant code to which it belongs are in a many-to-one relationship, that is, one tenant code can be associated with multiple user IDs at the same time; the tenant code can be a combination of numbers and letters, such as T1000. Specifically, the coding category of the tenant code is to distinguish the scope of authority that the user can view data, which may include the municipal bureau category and the provincial company category; users of the municipal bureau category can only view the power grid data of the municipal bureau, while users of the provincial company category can view the power grid data of all municipal companies covered by the province.
[0075] S120: Generate an address link of a target database according to the coding category, and associate the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database.
[0076] In this embodiment, the target database is a storage database of power grid data that can be viewed by the user who triggers the platform login event; the address link can accurately locate the storage location of the target database from multiple databases in the big data platform, and the address link of the target database in this embodiment is dynamically updated according to the tenant code to which the user belongs, thereby ensuring the security of the data stored in the database.
[0077] Associating the user's identification with the target database according to the address link may include: establishing an identification database association table, storing the user's identification and the target database with an associated relationship in the identification database association table; so that the identification database association table can be directly called later to quickly find the target database corresponding to the user's identification and perform permission access.
[0078] If a platform login event triggered by a user is detected in the disclosed embodiment, the coding category of the tenant code to which the user belongs is determined according to the user's identification; an address link of the target database is generated according to the coding category, and the user's identification is associated with the target database according to the address link, so that the user can perform data operations on the target database. The disclosed embodiment solves the problem that the data stored in the database has no correlation with the user, and enables the user to directly operate the target database according to the correlation when operating the data later, while improving the effective management of data permissions in the target database.
[0079] Figure 21 is a flowchart of another database processing method provided by an embodiment of the present disclosure. This embodiment is a further expansion and optimization based on the above embodiment, and can be combined with any optional solution in the above technical solution. Figure 2 As shown, the method includes:
[0080] S210. If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined based on the coding category mapping table and the user's identifier; wherein the coding category includes a municipal bureau category or a provincial company category.
[0081] In this embodiment, the coding category mapping table is established in advance based on the determined association relationship between the tenant code and the coding category; wherein the association relationship between the tenant code and the coding category can be distinguished by professionals. In this embodiment, when determining the coding category of the tenant code, a quick search is performed based on the coding category mapping table pre-stored in the big data platform, which effectively improves the efficiency of searching for the coding category.
[0082] S220. If the coding category is the municipal bureau category, call the database information acquisition program to determine the target database information, the target mode of the target database, the user name of the target mode, and the user password of the target mode according to the tenant code to which the user belongs.
[0083] In this embodiment, the database information acquisition program is an application program pre-written by the programmer to achieve rapid acquisition of information. The mode is a different sub-database in the target database. A target database can have multiple target modes to achieve independent storage of different information in the database; the user name of the target mode is the login name of the user to log in to the target mode to obtain the target data; the user password of the target mode is the mode login password corresponding to the user login name.
[0084] It should be noted that in this embodiment, the information of the municipal companies of the municipal bureau type is stored in different modes under one database, and each mode has its own independent user name and user password.
[0085] S230. Generate an address link of the target database according to the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode; wherein the information of the target database includes the network protocol IP address, the port number, and the database name.
[0086] In this embodiment, since all data are stored in one database, the Internet Protocol (IP) address, port number and database name corresponding to the target database are fixed. This embodiment can generate corresponding address links according to the information of the city bureau class, and can directly establish an effective connection between the user of the city company and the mode of the city company.
[0087] Based on this embodiment, optionally, according to the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode, an address link of the target database is generated, including:
[0088] Calling the link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode and the user password of the target mode into characters to obtain the conversion result;
[0089] Sequentially combine the characters in the conversion result to obtain the address link of the target database.
[0090] The character conversion converts the target database information, the target mode of the target database, the user name of the target mode, and the user password of the target mode into uniform and easily recognizable identification characters, thereby avoiding the problem of duplicate address links caused by similar characters. In this embodiment, the format of the address link of the target database can be obtained according to the sequence combination of each character in the conversion result, which may include: IP address + port number + database name + mode + user name of the mode + user password of the mode.
[0091] S240: Associating the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database.
[0092] Figure 3 1 is a flowchart of another database processing method provided by the embodiment of the present disclosure. This embodiment is further expanded and optimized on the basis of the above embodiment, and can be combined with any optional solution in the above technical solution. Figure 3 As shown, the method includes:
[0093] S310: If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined based on the coding category mapping table and the user's identifier; wherein the coding category includes a municipal bureau category or a provincial company category.
[0094] S320. If the coding category is provincial company category, a data table selection request from the user is received; wherein the data table selection request includes target data.
[0095] In this embodiment, when the user performs a data query, the user selects the data table he wants to use in the query interface of the big data platform, where the data table contains the data he wants to view; the user can send a data table selection request by clicking a virtual button of the data table in the query interface of the big data platform (for example, selecting a circle in the data table, or clicking on the data table).
[0096] S330, determining the business system to which the target data belongs; and determining the address link of the target database according to the business system to which the target data belongs.
[0097] Since the power grid data under the provincial company category is stored according to the business system, it is necessary to determine the business system to which the target data belongs in order to accurately generate the address link of the target database.
[0098] Based on this embodiment, optionally, determining the address link of the target database according to the business system to which the target data belongs includes:
[0099] Determine the target schema of the target database based on the business system to which the target data belongs;
[0100] Call the database information acquisition program to determine the IP address, port number, database name, user name and password of the target database according to the tenant code to which the user belongs;
[0101] Generate an address link of the target database based on the IP address, port number, database name, target mode of the target database, user name of the target database, and user password of the target database.
[0102] Among them, in the big data platform, the target mode of the business system and the target database has a corresponding relationship, so as to quickly find the required mode in multiple target modes of the big data platform. The database name, IP address and port number of the provincial company class are fixed, and are the same as the corresponding information of the prefecture-level bureau class stored in the same database. This embodiment can generate a corresponding address link based on the information of the provincial company class, and can directly establish an effective connection between the user of the provincial company and the mode of the provincial company.
[0103] In this embodiment, a process of obtaining a user name, a user password and a mode is provided; the tenant code is T1000 (Guangdong Power Grid Company) as an example for explanation; it is assumed that the database name is sjk; the port number is 8080; the business system to which the target data belongs is the marketing system, and the mode name is yxxt. The process of implementing the following switchCase statement can be seen as follows:
[0104] Get the database schema:
[0105] "switchCase(getTenantOneCode()=="T1000","yxxt",getTenantOneCode()=="T1001","data_fs",…"
[0106] The above code indicates that if the tenant code is T1000, representing the provincial company, the mode name is yxxt, and if the tenant code is T1001, representing the Foshan Bureau, the mode name is data_fs. The principle of obtaining the user name and password is the same.
[0107] Get the username:
[0108] "switchCase(getTenantOneCode()=="T1000","data_gddw",getTenantOneCode()=="T1001","data_fs",…"
[0109] Get the user password:
[0110] "switchCase(getTenantOneCode()=="T1000","data_gddw",getTenantOneCode()=="T1001","data_fs",…"
[0111] The user name and password are the same, both data_gddw.
[0112] It should be noted that, in this embodiment, if the tenant code to which the user belongs is of the municipal bureau type, the mode of the database used is uniquely determined by the municipal bureau, and each municipal bureau has a unique user name and password under its mode; if the tenant code to which the user belongs is of the provincial company type, the data mode is determined by the business system to which the target data to be viewed belongs, and each business system has an independent user name and password.
[0113] S340: Associating the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database.
[0114] Figure 4 1 is a flowchart of another database processing method provided by the embodiment of the present disclosure. This embodiment is further expanded and optimized on the basis of the above embodiment, and can be combined with any optional solution in the above technical solution. Figure 4 As shown, the method includes:
[0115] S410: If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined according to the user's identifier.
[0116] S420: Generate an address link of a target database according to the coding category, and associate the user identifier with the target database according to the address link.
[0117] S430: If a data operation request sent by a user is received, obtain the user's identification; wherein the data operation request includes at least one of a data query request, a data control request, and a data definition request.
[0118] In this embodiment, when a user needs to perform a data operation on target data associated with the big data platform, the user can click a virtual button for the data operation request in the display page of the big data platform, such as clicking a data query button, a data control button, or a data definition button; wherein a data control request can be for performing a data change operation on the data viewable by the user; a data definition request can be for performing a customized processing on the attributes or characteristics of the data viewable by the user.
[0119] The user's ID can be associated with the user login name used by the user when logging into the big data platform.
[0120] S440: Determine an associated target database according to the user's identifier, so that the user can perform data operations in the target database.
[0121] In this embodiment, since the big data platform stores the association between the registered user's identification and the target database, the target database associated with the user's identification can be quickly searched based on the association relationship and the user's identification, and the target database can be displayed on the platform page for the user to perform related data operations.
[0122] Before determining the associated target database according to the user's identification, the method of this embodiment further includes: judging whether the user is a new user according to the user's identification, if not, performing the operation of determining the associated target database according to the user's identification; if yes, feeding back an error message and instructing the user to log in and register. This can prevent the problem of data leakage caused by the theft of platform data by users who have not undergone identity authentication, and can further reduce the risk of platform data being stolen.
[0123] Figure 5 : is a schematic diagram of a database processing device provided in an embodiment of the present disclosure; the device is configured in an electronic device and can implement the database processing method described in any embodiment of the present application. The device specifically includes the following:
[0124] The coding category determination module 510 is used to determine the coding category of the tenant code to which the user belongs according to the user's identifier if a platform login event triggered by the user is detected;
[0125] The address link generation and association module 520 is used to generate an address link of a target database according to the coding category, and associate the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database.
[0126] Based on the above embodiment, optionally, the coding category determination module 510 is specifically configured to:
[0127] Based on the coding category mapping table, the coding category of the tenant code to which the user belongs is determined according to the user's identifier; wherein the coding category includes a municipal bureau category or a provincial company category.
[0128] Based on the above embodiment, optionally, the address link generation and association module 520 includes: an information determination unit and an address link determination unit;
[0129] An information determination unit, configured to call a database information acquisition program, and determine information of a target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode according to a tenant code to which the user belongs;
[0130] An address link determination unit, configured to generate an address link of a target database according to information of the target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode;
[0131] The target database information includes the network protocol IP address, port number and database name.
[0132] Based on the above embodiment, optionally, the address link determination unit is specifically configured to:
[0133] Calling a link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode to obtain a conversion result;
[0134] Sequentially combine the characters in the conversion result to obtain the address link of the target database.
[0135] Based on the above embodiment, optionally, the address link generation and association module 520 further includes: a request receiving unit and a business system determination unit;
[0136] A request receiving unit, configured to receive a data table selection request from the user; wherein the data table selection request includes target data;
[0137] A business system determining unit, used to determine the business system to which the target data belongs;
[0138] The address link determination unit is further used to determine the address link of the target database according to the business system to which the target data belongs.
[0139] Based on the above embodiment, optionally, the address link determination unit is specifically configured to:
[0140] Determine a target mode of a target database according to the business system to which the target data belongs;
[0141] Calling a database information acquisition program to determine the IP address, port number, database name, user name, and user password of the target database according to the tenant code to which the user belongs;
[0142] An address link of the target database is generated according to the IP address, port number, database name, target mode of the target database, user name of the target database and user password of the target database.
[0143] On the basis of the above embodiment, optionally, the device of this embodiment further includes:
[0144] an identification acquisition module, configured to acquire an identification of a user upon receiving a data operation request sent by the user; wherein the data operation request includes at least one of a data query request, a data control request and a data definition request;
[0145] The target database determination module is used to determine the associated target database according to the user's identification, so that the user can perform data operations in the target database.
[0146] The database processing device of the third embodiment of the present invention solves the problem that the data stored in the database has no correlation with the user, so that the user can directly operate the target database according to the correlation when operating the data later, while improving the effective management of data permissions in the target database.
[0147] The database processing device provided in the embodiment of the present invention can execute the database processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0148] Figure 6 Schematic diagram of the structure of an electronic device provided by the fourth embodiment of the present disclosure. Figure 6 As shown, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of the processor 610 in the electronic device can be one or more. Figure 6 A processor 610 is taken as an example; the processor 610, the memory 620, the input device 630 and the output device 640 in the electronic device can be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0149] The memory 620 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the database processing method in the embodiment of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 620, that is, implements the database processing method provided in the embodiment of the present invention.
[0150] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0151] The input device 630 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 640 may include a display device such as a display screen.
[0152] The embodiment of the present disclosure also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the database processing method provided by the embodiment of the present disclosure.
[0153] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the database processing method provided by any embodiment of the present invention.
[0154] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0155] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0156] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0157] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing a database, characterized in that: The method comprises: If a platform login event triggered by a user is detected, the coding category of the tenant code to which the user belongs is determined according to the identifier of the user; generating an address link of a target database according to the coding category, and associating the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database; Wherein, the coding categories include city bureau category or provincial company category; If the coding category is a city or municipal bureau category, then generating an address link of a target database according to the coding category includes: Calling a database information acquisition program to determine the target database information, the target mode of the target database, the user name of the target mode, and the user password of the target mode according to the tenant code to which the user belongs; Generate an address link of the target database according to the information of the target database, the target mode of the target database, the user name of the target mode and the user password of the target mode; The target database information includes the network protocol IP address, port number and database name; The generating an address link of the target database according to the information of the target database, the target mode of the target database, the user name of the target mode and the user password of the target mode comprises: Calling a link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode to obtain a conversion result; Combine the characters in the conversion result in sequence to obtain the address link of the target database.
2. The method according to claim 1, characterized in that Determining the coding category of the tenant code to which the user belongs according to the identifier of the user includes: Based on the coding category mapping table, the coding category of the tenant code to which the user belongs is determined according to the identifier of the user.
3. The method according to claim 2, characterized in that If the coding category is a provincial company category, then generating an address link of a target database according to the coding category includes: receiving a data table selection request from the user; wherein the data table selection request includes target data; Determine the business system to which the target data belongs; The address link of the target database is determined according to the business system to which the target data belongs.
4. The method according to claim 3, characterized in that The step of determining the address link of the target database according to the business system to which the target data belongs includes: Determine a target mode of a target database according to the business system to which the target data belongs; Calling a database information acquisition program to determine the IP address, port number, database name, user name, and user password of the target database according to the tenant code to which the user belongs; An address link of the target database is generated according to the IP address, port number, database name, target mode of the target database, user name of the target database and user password of the target database.
5. The method according to claim 1, characterized in that The method further comprises: If a data operation request sent by a user is received, the identification of the user is obtained; wherein the data operation request includes at least one of a data query request, a data control request and a data definition request; An associated target database is determined according to the user's identifier, so that the user can perform data operations in the target database.
6. A database processing device, characterized in that: The device comprises: A coding category determination module, configured to determine the coding category of the tenant code to which the user belongs according to the user's identifier if a platform login event triggered by the user is detected; An address link generation and association module, used to generate an address link of a target database according to the coding category, and to associate the user's identifier with the target database according to the address link, so that the user can perform data operations on the target database; Wherein, the coding categories include city bureau category or provincial company category; The address link generation and association module includes: an information determination unit and an address link determination unit; An information determination unit, configured to call a database information acquisition program, and determine information of a target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode according to a tenant code to which the user belongs; An address link determination unit, configured to generate an address link of a target database according to information of the target database, a target mode of the target database, a user name of the target mode, and a user password of the target mode; The target database information includes the network protocol IP address, port number and database name; The address link determination unit is specifically used for: Calling a link generation program to convert the information of the target database, the target mode of the target database, the user name of the target mode, and the user password of the target mode to obtain a conversion result; Sequentially combine the characters in the conversion result to obtain the address link of the target database.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the database processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the database processing method according to any one of claims 1 to 5 is implemented.
