CN115828308B - Data access method, data access device, electronic equipment and storage medium - Google Patents

Data access method, data access device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115828308B
CN115828308B CN202310104684.9A CN202310104684A CN115828308B CN 115828308 B CN115828308 B CN 115828308B CN 202310104684 A CN202310104684 A CN 202310104684A CN 115828308 B CN115828308 B CN 115828308B
Authority
CN
China
Prior art keywords
server
information
data access
database
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310104684.9A
Other languages
Chinese (zh)
Other versions
CN115828308A (en
Inventor
刘鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Primitive Data Beijing Information Technology Co ltd
Original Assignee
Primitive Data Beijing Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Primitive Data Beijing Information Technology Co ltd filed Critical Primitive Data Beijing Information Technology Co ltd
Priority to CN202310104684.9A priority Critical patent/CN115828308B/en
Publication of CN115828308A publication Critical patent/CN115828308A/en
Application granted granted Critical
Publication of CN115828308B publication Critical patent/CN115828308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data access method, a data access device, electronic equipment and a storage medium, which belong to the technical field of data processing, and the data access method, the data access device, the electronic equipment and the storage medium can reduce the data quantity of a data table to be maintained by responding to a first creation request of a client, creating database information of a second server, responding to a second creation request of the client, creating object information to be logged in of the second server, responding to the data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, acquiring table metadata information from the second server, and accessing table data of the second server according to the table metadata information.

Description

Data access method, data access device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data access method, a data access device, an electronic device, and a storage medium.
Background
In the related art, the data access is performed on the data table by creating the same data table as the external database in the local database. However, in this data access method, when the table structure of the data table of the external database is changed, the data table of the local database needs to be modified according to the table structure, so that the data amount of the data table required to be maintained by the local database increases. Therefore, how to reduce the data size of the data table that needs to be maintained in the local database becomes a technical problem to be solved.
Disclosure of Invention
The embodiment of the application mainly aims to provide a data access method, a data access device, electronic equipment and a storage medium, which aim to reduce the data volume of a data table which needs to be maintained by a local database.
To achieve the above object, a first aspect of an embodiment of the present application proposes a data access method, applied to a first server, where the method includes:
creating database information of a second server in response to a first creation request of a client;
responding to a second creation request of the client, and creating object information to be logged in of a second server; the object information to be logged in is information that the client can log in the second server;
responding to a data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, and acquiring table metadata information from the second server;
and accessing the table data of the second server according to the table metadata information.
In some embodiments, the responding to the data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, and obtaining the table metadata information from the second server includes:
analyzing the data access request to obtain the identity information of the client, the name of the database to be accessed and the table name of the database;
and if the identity information is the same as the object information to be logged in and the database name is the same as the host name in the database information, logging in the second server according to the database information, and acquiring the table metadata information corresponding to the database table name from the second server according to the database table name.
In some embodiments, after the obtaining the table metadata information from the second server, the data access method further includes:
storing the table metadata information in a memory of the first server;
and if the storage time length of the table metadata information is greater than or equal to a preset time length threshold value, acquiring the table metadata information from the second server again.
In some embodiments, the accessing the table data of the second server according to the table metadata information includes:
and adding, deleting, modifying and inquiring the table data according to the table metadata information.
In some embodiments, the data access request includes a spacer, the parsing the data access request to obtain identity information of the client, a database name to be accessed, and a database table name includes:
acquiring position data of the spacer;
and splitting the data access request according to the position data of the spacer to obtain the identity information, the database name and the database table name.
In some embodiments, the database information includes an internet protocol address, a host name, and a port number of the second server.
In some embodiments, the table metadata information includes a field number, a field name, and a field type.
To achieve the above object, a second aspect of the embodiments of the present application proposes a data access device applied to a first server, the device including:
the first creating module is used for responding to a first creating request of the client and creating database information of the second server;
the second creating module is used for responding to a second creating request of the client and creating object information to be logged of a second server; the object information to be logged in is information that the client can log in the second server;
the metadata acquisition module is used for responding to the data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, and acquiring the table metadata information from the second server;
and the access module is used for accessing the table data of the second server according to the table metadata information.
To achieve the above object, a third aspect of the embodiments of the present application proposes an electronic device, which includes a memory and a processor, the memory storing a computer program, the processor implementing the method according to the first aspect when executing the computer program.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of the first aspect.
According to the data access method, the data access device, the electronic equipment and the computer readable storage medium, the database information of the second server is created by responding to the first creation request of the client, the object information to be logged in of the second server is created by responding to the second creation request of the client, and the security of the client logging in the external server can be increased by creating the database information of the external database and the object information to be logged in the local database, so that the security of data access is increased. Further, in response to a data access request of a client, logging in a second server according to the data access request, the database information and the object information to be logged in, acquiring the table metadata information from the second server, accessing the table data of the second server according to the table metadata information instead of creating the appearance of the external database in the local database, when the table structure of the external database is changed, acquiring the changed table structure from the external database in real time, and re-constructing the table metadata information according to the table structure, so that the amount of the appearance data required to be maintained by the local database can be reduced.
Drawings
FIG. 1 is a flow chart of a data access method provided by an embodiment of the present application;
fig. 2 is a flowchart of step S130 in fig. 1;
fig. 3 is a flowchart of step S210 in fig. 2;
FIG. 4 is another flow chart of a data access method provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data access device according to an embodiment of the present application;
fig. 6 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
In the related art, the data access is performed on the data table by creating the same data table as the external database in the local database. However, in this data access method, when the table structure of the data table of the external database is changed, the data table of the local database needs to be modified according to the table structure, so that the data amount of the data table required to be maintained by the local database increases. Therefore, how to reduce the data size of the data table that needs to be maintained in the local database becomes a technical problem to be solved.
Based on this, the embodiment of the application provides a data access method, a data access device, an electronic device and a computer readable storage medium, which aim to reduce the data volume of a data table required to be maintained by a local database.
The data access method, the data access device, the electronic device and the computer readable storage medium provided in the embodiments of the present application are specifically described by the following embodiments, and the data access method in the embodiments of the present application is first described.
The embodiment of the application provides a data access method, and relates to the technical field of data processing. The data access method provided by the embodiment of the application can be applied to the terminal, the server side and software running in the terminal or the server side. In some embodiments, the terminal may be a smart phone, tablet, notebook, desktop, etc.; the server side can be configured as an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms and the like; the software may be an application or the like that implements the data access method, but is not limited to the above form.
The subject application is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Fig. 1 is an optional flowchart of a data access method provided in an embodiment of the present application, where the method in fig. 1 is applied to a first server, and may include, but is not limited to, steps S110 to S140.
Step S110, in response to a first creation request of a client, creating database information of a second server;
step S120, in response to a second creation request of the client, creating object information to be logged in of a second server; the information of the object to be logged in is information that the client can log in the second server;
step S130, responding to a data access request of a client, logging in a second server according to the data access request, database information and object information to be logged in, and acquiring table metadata information from the second server;
step S140, accessing the table data of the second server according to the table metadata information.
In the steps S110 to S140 illustrated in the embodiments of the present application, the database information of the second server is created in response to the first creation request of the client, the object information to be logged in of the second server is created in response to the second creation request of the client, and the security of logging in the external server by the client can be increased by creating the database information of the external database and the object information to be logged in the local database, thereby increasing the security of data access. Further, in response to a data access request of a client, logging in a second server according to the data access request, the database information and the object information to be logged in, acquiring the table metadata information from the second server, accessing the table data of the second server according to the table metadata information instead of creating the appearance of the external database in the local database, when the table structure of the external database is changed, acquiring the changed table structure from the external database in real time, and re-constructing the table metadata information according to the table structure, so that the amount of the appearance data required to be maintained by the local database can be reduced.
In step S110 of some embodiments, the client sends a first creation request to a first server, the first server receives the first creation request, and in response to the first creation request, the first server creates database information of a second server locally, where the first server is a server where a local database is located, the second server is a server where an external database is located, and the database information is information required for the local database to connect to the external database, including an internet protocol address, a host name, a port number, and the like of the second server. It will be appreciated that the specific instruction form of the first creation request needs to be determined according to the type of database, with different types of databases having different creation instructions.
In step S120 of some embodiments, the client sends a second creation request to the first server, the first server receives the second creation request, and in response to the second creation request, the first server creates object information to be logged in of the second server locally, where the object information to be logged in is user information that the client can log in to the second server, and includes information such as an account number, a user name, a password, and the like of the user of the client. It will be appreciated that the specific instruction form of the second creation request needs to be determined according to the type of database, with different types of databases having different creation instructions.
Referring to fig. 2, in some embodiments, step S130 may include, but is not limited to, steps S210 to S220:
step S210, analyzing the data access request to obtain the identity information of the client, the name of the database to be accessed and the table name of the database;
step S220, if the identity information is the same as the object information to be logged in and the database name is the same as the host name in the database information, logging in the second server according to the database information, and obtaining the table metadata information corresponding to the database table name from the second server according to the database table name.
In step S210 of some embodiments, in order to access data on the second server, the client sends a data access request to the first server, where the data access request includes identity information of a user of the client, a database name of the second server, and a database table name, and the first server receives the data access request, and parses the data access request in response to the data access request to obtain identity information of the user of the client, the database name to be accessed, and the database table name. It should be noted that, the data access request is obtained by means of a database SQL instruction.
In step S220 of some embodiments, the first server compares the identity information with the object information to be logged locally stored in the first server, if the identity information is the same as the object information to be logged, that is, the user account number, the user name and the password in the identity information need to be the same as related information in the object information to be logged, it is indicated that the client user corresponding to the identity information is a user authorized by the first server, if the database name is the same as the host name in the database information, it is indicated that the server to be accessed is an external server authorized by the first server, when the identity information is the same as the object information to be logged, and the database name is the same as the host name in the database information, it is indicated that the client user is a user authorized by the first server, and has access rights to the second server, then the first server is connected to the second server according to the database information, and obtains the metadata information corresponding to the database table name from the second server according to the database table name, where the metadata information includes the number of fields, the field name and the field type. It can be understood that the second server includes a plurality of table metadata information of the appearance, and the second server performs query processing on the external database according to the table name of the database to obtain the table metadata information corresponding to the table name of the database.
Through the steps S210 to S220, the first server may obtain the table metadata information of the table data of the second server, that is, the table metadata information of the table data of the second server, so as to perform addition, deletion and modification check on the table data of the second server according to the table metadata information, without creating the table locally on the first server, and when the table structure of the table of the second server changes, the client can enable the first server to obtain the table metadata information of the table in real time through the data access request, thereby avoiding the situation that the table of the second server is modified or added, and reducing the amount of the table data to be maintained by the local database.
Referring to fig. 3, in some embodiments, the data access request includes a spacer, and step S210 may include, but is not limited to, steps S310 to S320:
step S310, obtaining position data of the spacer;
step S320, the data access request is segmented according to the position data of the spacer, and identity information, database names and database table names are obtained.
In step S310 of some embodiments, the spacer may be a symbol, such as "%", distinguishing identity information, database name, database table name. The first server reads the data access request and records the position index of the spacer appearing in the data access request to obtain the position data.
In step S320 of some embodiments, the data access request is split into a plurality of data segments according to the position data of the spacer, and the data segments are determined to be identity information, database names and database table names according to the types of the data segments.
Through the steps S310 to S320, the first server can obtain the identity information of the user of the client, the name of the database to be accessed by the client, the table name of the database, and the like, so as to connect with the second server according to the information, and access the data on the second server.
Referring to fig. 4, in some embodiments, after step S130, the data access method may include, but is not limited to, steps S410 to S420:
step S410, storing the table metadata information in the memory of the first server;
step S420, if the storage time length of the table metadata information is greater than or equal to the preset time length threshold, the table metadata information is acquired from the second server again.
In step S410 of some embodiments, in order to make it unnecessary for the first server to frequently acquire the metadata information from the second server, the efficiency of the first server to acquire the metadata information is improved, and the metadata information is stored in the memory of the first server.
In step S420 of some embodiments, the first server analyzes the data access request of the client to obtain a database name and a database table name, where the database name and the database table name are both matched with the stored table metadata information, and the storage duration of the table metadata information is less than a preset duration threshold, and the first server does not need to connect to the second server to obtain the table metadata information, and directly adds, deletes, modifies and queries the table data of the second server through the table metadata information. And if the database name or the database table name is not matched with the stored table metadata information, connecting a second server according to the database information, and acquiring the corresponding table metadata information from the second server. And when the database name and the database table name are matched with the stored table metadata information, and the storage time length of the table metadata information is greater than or equal to a preset time length threshold value, deleting the locally stored table metadata information, and acquiring the table metadata information from the second server again.
By the above steps S410 to S420, the speed of the first server acquiring the metadata information can be increased, so that the first server does not have to acquire the metadata information from the second server frequently.
In step S140 of some embodiments, the first server constructs a data instruction according to the table metadata information, where the data instruction includes at least one of a data addition instruction, a data deletion instruction, a data modification instruction, or a data query instruction, and sends the data instruction to the second server, so that the second server performs an addition, deletion, modification, or query operation on the table data according to the data instruction.
Referring to fig. 5, an embodiment of the present application further provides a data access device, applied to a first server, capable of implementing the above data access method, where the device includes:
a first creation module 510, configured to create database information of a second server in response to a first creation request of a client;
a second creating module 520, configured to create object information to be logged on of a second server in response to a second creating request of the client; the information of the object to be logged in is information that the client can log in the second server;
the metadata acquisition module 530 is configured to respond to a data access request of the client, log in to the second server according to the data access request, the database information, and the object information to be logged in, and acquire the table metadata information from the second server;
and an accessing module 540, configured to access the table data of the second server according to the table metadata information.
The specific implementation of the data access device is basically the same as the specific embodiment of the data access method described above, and will not be described herein.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the data access method when executing the computer program. The electronic equipment can be any intelligent terminal including a tablet personal computer, a vehicle-mounted computer and the like.
Referring to fig. 6, fig. 6 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
the processor 610 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an application-specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), or one or more integrated circuits, etc. for executing related programs to implement the technical solutions provided by the embodiments of the present application;
the memory 620 may be implemented in the form of read-only memory (ReadOnlyMemory, ROM), static storage, dynamic storage, or random access memory (RandomAccessMemory, RAM). Memory 620 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present disclosure are implemented in software or firmware, relevant program codes are stored in memory 620 and invoked by processor 610 to perform the data access method of the embodiments of the present disclosure;
an input/output interface 630 for implementing information input and output;
the communication interface 640 is configured to implement communication interaction between the device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
bus 650 transmits information between the various components of the device (e.g., processor 610, memory 620, input/output interface 630, and communication interface 640);
wherein processor 610, memory 620, input/output interface 630, and communication interface 640 enable communication connections among each other within the device via bus 650.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the data access method when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
According to the data access method, the data access device, the electronic equipment and the computer readable storage medium, the database information of the second server is created by responding to the first creation request of the client, the object information to be logged in of the second server is created by responding to the second creation request of the client, and the security of the client for logging in the external server can be increased by creating the database information of the external database and the object information to be logged in the local database, so that the security of data access is increased. Further, in response to a data access request of a client, logging in a second server according to the data access request, the database information and the object information to be logged in, acquiring the table metadata information from the second server, accessing the table data of the second server according to the table metadata information instead of creating the appearance of the external database in the local database, when the table structure of the external database is changed, acquiring the changed table structure from the external database in real time, and re-constructing the table metadata information according to the table structure, so that the amount of the appearance data required to be maintained by the local database can be reduced.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the technical solutions shown in the figures do not constitute limitations of the embodiments of the present application, and may include more or fewer steps than shown, or may combine certain steps, or different steps.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.

Claims (10)

1. A data access method, applied to a first server, the method comprising:
creating database information of a second server in response to a first creation request of a client;
responding to a second creation request of the client, and creating object information to be logged in of a second server; the object information to be logged in is information that the client can log in the second server;
responding to a data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, and acquiring table metadata information from the second server;
and accessing the table data of the second server according to the table metadata information.
2. The method according to claim 1, wherein the logging in the second server according to the data access request, the database information, the object information to be logged in, and obtaining the table metadata information from the second server in response to the data access request of the client, includes:
analyzing the data access request to obtain the identity information of the client, the name of the database to be accessed and the table name of the database;
and if the identity information is the same as the object information to be logged in and the database name is the same as the host name in the database information, logging in the second server according to the database information, and acquiring the table metadata information corresponding to the database table name from the second server according to the database table name.
3. The data access method according to claim 1, wherein after the obtaining of the table metadata information from the second server, the data access method further comprises:
storing the table metadata information in a memory of the first server;
and if the storage time length of the table metadata information is greater than or equal to a preset time length threshold value, acquiring the table metadata information from the second server again.
4. The data access method according to claim 1, wherein the accessing the table data of the second server according to the table metadata information includes:
and adding, deleting, modifying and inquiring the table data according to the table metadata information.
5. The method according to claim 2, wherein the data access request includes a spacer, and the parsing the data access request to obtain the identity information of the client, the database name to be accessed, and the database table name includes:
acquiring position data of the spacer;
and splitting the data access request according to the position data of the spacer to obtain the identity information, the database name and the database table name.
6. The data access method according to any one of claims 1 to 5, wherein the database information includes an internet protocol address, a host name, and a port number of the second server.
7. The data access method according to any one of claims 1 to 5, wherein the table metadata information includes a field number, a field name, and a field type.
8. A data access device for application to a first server, the device comprising:
the first creating module is used for responding to a first creating request of the client and creating database information of the second server;
the second creating module is used for responding to a second creating request of the client and creating object information to be logged of a second server; the object information to be logged in is information that the client can log in the second server;
the metadata acquisition module is used for responding to the data access request of the client, logging in the second server according to the data access request, the database information and the object information to be logged in, and acquiring the table metadata information from the second server;
and the access module is used for accessing the table data of the second server according to the table metadata information.
9. An electronic device, characterized in that the electronic device comprises a memory and a processor, the memory storing a computer program, the processor implementing the data access method of any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the data access method of any one of claims 1 to 7.
CN202310104684.9A 2023-02-13 2023-02-13 Data access method, data access device, electronic equipment and storage medium Active CN115828308B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310104684.9A CN115828308B (en) 2023-02-13 2023-02-13 Data access method, data access device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310104684.9A CN115828308B (en) 2023-02-13 2023-02-13 Data access method, data access device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115828308A CN115828308A (en) 2023-03-21
CN115828308B true CN115828308B (en) 2023-05-12

Family

ID=85521066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310104684.9A Active CN115828308B (en) 2023-02-13 2023-02-13 Data access method, data access device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115828308B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6513112B1 (en) * 1999-07-26 2003-01-28 Microsoft Corporation System and apparatus for administration of configuration information using a catalog server object to describe and manage requested configuration information to be stored in a table object
CN108153825A (en) * 2017-12-07 2018-06-12 石化盈科信息技术有限责任公司 Data access method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10009348B2 (en) * 2016-05-11 2018-06-26 International Business Machines Corporation Hybrid database access control in external-to-database security systems
CN112131590A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Database connection establishing method and device, computer equipment and storage medium
CN113010911B (en) * 2021-02-07 2024-05-10 腾讯科技(深圳)有限公司 Data access control method, device and computer readable storage medium
CN113392415A (en) * 2021-06-18 2021-09-14 作业帮教育科技(北京)有限公司 Access control method and system for data warehouse and electronic equipment
CN115577033A (en) * 2022-11-09 2023-01-06 北京奥星贝斯科技有限公司 Database access method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6513112B1 (en) * 1999-07-26 2003-01-28 Microsoft Corporation System and apparatus for administration of configuration information using a catalog server object to describe and manage requested configuration information to be stored in a table object
CN108153825A (en) * 2017-12-07 2018-06-12 石化盈科信息技术有限责任公司 Data access method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
用户跨本地数据库,访问另外一个数据库表中的数据解决方法;GYXGYXYY;CSDN;1 *

Also Published As

Publication number Publication date
CN115828308A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
US9817858B2 (en) Generating hash values
EP3323053B1 (en) Document capture using client-based delta encoding with server
US20130218919A1 (en) Method and apparatus for managing content
CN106534268B (en) Data sharing method and device
CN105302920A (en) Optimal management method and system for cloud storage data
CN110245128B (en) Meta-model establishing method and device, storage medium and electronic device
CN111651424B (en) Data processing method, device, data node and storage medium
CN101959178A (en) Method and equipment for identifying terminal attribute of wireless terminal
US9350738B2 (en) Template representation of security resources
CN115828308B (en) Data access method, data access device, electronic equipment and storage medium
CN112084199A (en) Scene-based general parameter maintenance method and device
CN111767481A (en) Access processing method, device, equipment and storage medium
CN111625528A (en) Configuration management database verification method and device and readable storage medium
CN108845995B (en) Data processing method, data processing apparatus, storage medium, and electronic apparatus
CN114039801B (en) Short link generation method, short link analysis system, short link analysis equipment and storage medium
CN112346672B (en) Log dyeing method, device, equipment and storage medium
US10114864B1 (en) List element query support and processing
CN112131239B (en) Data processing method, computer equipment and readable storage medium
CN116861455B (en) Event data processing method, system, electronic device and storage medium
CN116775698B (en) Partition clipping method and device for database, computer equipment and storage medium
CN111026936B (en) Data cognition method, device, terminal and computer storage medium of interaction theme
CN113515532B (en) Change processing method, device, equipment and storage medium based on data exchange
CN112861030B (en) CDN refreshing method and device, cache server and storage medium
US20230289354A1 (en) Endpoint scan and profile generation
CN108829645B (en) Electronic document processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant