Data interaction method, device and equipment, medium and program product
By centralizing the management of client database connection information, the security risks and cumbersome management issues associated with storing client-database connection information in plaintext are resolved, thereby improving security and management efficiency.
Patent Information
- Application Number
- CN202511179990.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-05
AI Technical Summary
In existing technologies, the connection information between the client and the database is stored in plaintext, which poses security risks and is inconvenient to manage. Updating configuration files is cumbersome, making it difficult to achieve efficient and secure connection management.
The database connection information of the client is managed in a unified manner through a central database. When the client requests connection information from the central database, the central database performs a validity verification and returns the corresponding connection information, which simplifies the communication process between the client and the database.
It improves the security and management efficiency of client-database connections, eliminating the need to update configuration information on the client and simplifying the connection process.
Smart Images

Figure CN121071015A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular to a data interaction method and device, equipment, medium and program product. BACKGROUND
[0002] Currently, the information for connecting the client with the database is stored in the configuration file of the client in plaintext, such as IP address, port information, username and password, and the like. These information is the key information for establishing the database connection to identify the client identity of the database, and is stored in plaintext in the client, which has a security risk and is extremely easy to cause the leakage of the database connection information. Meanwhile, this way of storing the connection information by the client itself causes the management to be scattered and difficult, when the username and password of the database are replaced, the client needs to generate new encrypted username and encrypted password by using the encryption algorithm, so as to replace the original related information in the configuration file, and the change of the configuration file needs to be executed according to a certain release process and after layer-by-layer approval, which has the problems of multiple steps and complicated execution process. SUMMARY
[0003] The present application provides a data interaction method, device, equipment, medium and program product, which can not only simplify the process of the communication connection between the client and the database, but also manage the database connection information of each database by means of the central database, without the need to update and manage the configuration information in the client, thereby improving the security and management efficiency of the connection between the client and the database.
[0004] In a first aspect, the present application provides a data interaction method applied to a central database, and the method comprises:
[0005] In response to a database connection information acquisition request sent by a client, the legality of the client is verified according to the registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is sent by the client when the client registers the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client;
[0006] In the case that the legality verification is passed, the database connection information requested by the client is retrieved from the pre-stored database connection information, or the connectable database corresponding to the client is retrieved according to the registration information of the client, and the database connection information of the connectable database is acquired; wherein the pre-stored database connection information is the information transferred from the configuration information of the client to the central database for management;
[0007] returning the database connection information to the client, so that the client establishes a communication connection with a database based on the database connection information.
[0008] In a second aspect, the present application provides a data interaction method, applied to a client, and the method comprises:
[0009] sending a database connection information obtaining request to a central database, so that the central database returns database connection information in response to the database connection information obtaining request;
[0010] receiving database connection information returned by the central database; wherein the database connection information is obtained from pre-stored database connection information by the central database after passing verification of the legality of the client according to registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from configuration information of the client to the central database for management; and the registration information used for verification in the central database is sent by the client when the client sends a registration request to the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client.
[0011] establishing a communication connection with a database based on the database connection information.
[0012] In a third aspect, the present application provides a data interaction device, applied to an electronic device corresponding to a central database, and the device comprises:
[0013] an obtaining request response module, configured to verify the legality of the client according to registration information contained in a database connection information obtaining request sent by the client in response to the database connection information obtaining request;
[0014] a database connection information determination module, configured to retrieve database connection information requested by the client from pre-stored database connection information in the case of passing the verification of the legality; wherein the pre-stored database connection information is information transferred from configuration information of the client to the central database for management.
[0015] a database connection information return module, configured to return the database connection information to the client, so that the client establishes a communication connection with a database based on the database connection information.
[0016] In a fourth aspect, the present application provides a data interaction device, applied to an electronic device corresponding to a client, and the device comprises:
[0017] The acquisition request sending module is configured to send a database connection information acquisition request to the central database, so that the central database returns database connection information in response to the database connection information acquisition request;
[0018] The database connection information receiving module is configured to receive the database connection information returned by the central database; wherein the database connection information is obtained from pre-stored database connection information by the central database after the central database verifies the legitimacy of the client according to the registration information contained in the database connection information acquisition request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management;
[0019] The communication connection establishing module is configured to establish a communication connection with a database based on the database connection information.
[0020] In a fifth aspect, the present application provides an electronic device, which comprises:
[0021] a processor, and a memory in communication connection with the processor;
[0022] The memory stores computer execution instructions.
[0023] The processor executes the computer execution instructions stored in the memory, so as to implement the data interaction method applied to the central database provided in the first aspect of the present application, or implement the data interaction method applied to the client provided in the second aspect of the present application.
[0024] In a sixth aspect, the present application provides a computer readable storage medium, which stores computer execution instructions; when the computer execution instructions are executed by a processor, the computer execution instructions are used to implement the data interaction method applied to the central database provided in the first aspect of the present application, or implement the data interaction method applied to the client provided in the second aspect of the present application.
[0025] In a seventh aspect, the present application provides a computer program product, which comprises a computer program; when the computer program is executed by a processor, the computer program implements the data interaction method applied to the central database provided in the first aspect of the present application, or implements the data interaction method applied to the client provided in the second aspect of the present application.
[0026] The data interaction method, device, equipment and storage medium provided by the application, in response to the database connection information acquisition request sent by the client, the legality of the client is verified according to the registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is sent by the client when the client sends a registration request to the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client; if the legality verification is passed, the database connection information requested by the client is retrieved from the pre-stored database connection information, or the connectable database corresponding to the client is retrieved according to the registration information of the client, and the database connection information of the connectable database is obtained; wherein the pre-stored database connection information is the information transferred from the configuration information of the client to the central database for management; the database connection information is returned to the client, so that the client establishes a communication connection with the database based on the database connection information. The technical scheme of the embodiment of the application, by the central database, the database connection information transferred by each client is uniformly managed, and the client only needs to request the related database connection request to the central database when it needs to connect with the database, which simplifies the process of communication connection between the client and the database. At the same time, with the help of the central database, each database connection information is uniformly managed, without modifying and maintaining the configuration information in the client, and the security and management efficiency of the connection between the client and the database are also improved.
[0027] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application together with the description.
[0029] Figure 1 A flowchart of a data interaction method provided by an embodiment of the application;
[0030] Figure 2 A flowchart of another data interaction method provided by an embodiment of the application;
[0031] Figure 3 A flowchart of a data interaction method provided by an embodiment of the application;
[0032] Figure 4 A flowchart of another data interaction method provided by an embodiment of the application;
[0033] Figure 5A timing diagram of a data interaction method provided in an embodiment of the present application;
[0034] Figure 6 A structural schematic diagram of a data interaction apparatus provided in an embodiment of the present application;
[0035] Figure 7 A structural schematic diagram of another data interaction apparatus provided in an embodiment of the present application;
[0036] Figure 8 A structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0037] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and the following description are not intended to limit the scope of the present application in any way, but to explain the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0038] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The same numbers are used in different drawings to represent the same or similar elements. The following detailed description is not intended to limit the scope of the present application, but to explain the principles of the present application as detailed in the appended claims. The present application is directed to obtaining, transmitting, storing, using, processing, etc. data in accordance with relevant provisions of national laws and regulations.
[0039] It should be noted that in the embodiments of the present application, some software, components, models, etc. in the industry may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but does not mean that the applicant has or will necessarily use the scheme.
[0040] Figure 1 A flowchart of a data interaction method provided in an embodiment of the present application. The embodiments of the present application can be applied to the case of data interaction between a client and a central database. The method can be executed by a data interaction apparatus applied to the central database, which can be realized in the form of hardware and / or software, and the data interaction apparatus can be configured in an electronic device. As shown in the figure, the data interaction method comprises: Figure 1
[0041] S110, in response to the database connection information acquisition request sent by the client, verifying the legitimacy of the client according to the registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is sent by the client when the client registers in the central database to request the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client.
[0042] The database connection information acquisition request is sent by the client to the central database, and the central database will respond to the database connection information acquisition request. The registration information is the information registered by the client in the central database, and the registration information reflects the information related to the client when the client registers. The registration information can include the client name and the client IP address, and the content contained in the registration information can be set based on actual needs, for example, the registration information can also include the registration time and the database name corresponding to the client connection.
[0043] After the central database receives the database connection information acquisition request, the central database parses the registration information from the database connection information acquisition request, and verifies the legitimacy of the client based on the registration information. The verification of the legitimacy of the client specifically includes: verifying whether the parsed registration information is completely consistent with the registration information recorded in the central database. If it exists, the legitimacy verification of the client is passed; if it does not exist, the legitimacy verification of the client is not passed.
[0044] It should be noted that the registration information for verification in the central database is sent by the client when the client registers in the central database to request the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client. Specifically, when the configuration information containing the database connection information exists in the client, the client will send a registration request to the central database to make the central database manage its own database connection information, and the registration information contained in the registration request is received by the central database. After that, the central database will verify the legitimacy of the client based on the registration information in the subsequent scheme. That is, the registration information for verification in the central database is essentially the registration information sent by the client when the client first registers in the central database.
[0045] S120, retrieve the database connection information requested by the client from the pre-stored database connection information or retrieve the connectable database corresponding to the client according to the registration information of the client, and obtain the database connection information of the connectable database, in a case where the legality verification is passed; wherein the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management.
[0046] The configuration information of the client contains information that the client can establish a communication connection with the database. That is, the configuration information of the client contains database connection information, such as IP address information, port information, username, and password required for the client to establish a connection with the database. However, in the embodiments of the present application, each client does not save and manage these database connection information by itself, but uniformly transfers the database connection information of each client from the configuration information of each client to the central database for unified saving and management by the central database. The information transferred to the central database is the pre-stored database connection information.
[0047] The pre-stored database connection information contains at least one piece of database connection information. The pre-stored database connection information contains database connection information between different clients and databases that can be connected by them. Based on the database connection information, a communication connection between the client and the database can be realized. That is, the pre-stored database connection information records the association relationship between each client and each database. For example, assuming that the client A can be connected with the database A, and the client B can be connected with the database B, and corresponding to this, the pre-stored database connection information contains database connection information that enables the client A to connect with the database A, and contains database connection information that enables the client B to connect with the database B.
[0048] Specifically, in a case where the legality verification is passed, the central database can determine the client number allocated to the client, and then retrieve the database connection information requested by the client from the pre-stored database connection information based on the corresponding client number.
[0049] Alternatively, in a case where the legality verification is passed, the central database can retrieve the connectable database corresponding to the client according to the registration information of the client, and obtain the database connection information of the connectable database.
[0050] Optionally, in a case where the legality verification is not passed, a prompt information that the verification is not passed is returned to the client.
[0051] S130, return the database connection information to the client, so that the client establishes a communication connection with the database based on the database connection information.
[0052] The central database returns the database connection information to the client after retrieving the database connection information requested by the client, so that the client establishes a communication connection with the database based on the returned database connection information.
[0053] The database connection information includes the IP address, port number, username and password of the database. The client can request to connect with the database based on the IP address and port number of the database, and log in the database to establish a communication connection based on the username and password. After the client successfully establishes a communication connection with the database, the client can perform specific data resource access and acquisition operations.
[0054] It should be noted that in the embodiments of the present application, the database connection information is not managed by each client itself, but each client transfers its corresponding database connection information to the central database for unified management. When the client needs to establish a communication connection with the database, the client needs to request the corresponding database connection information from the central database. The central database returns the corresponding database connection information to the client only after verifying the legality of the client. That is, the central database in the embodiments of the present application plays a management and verification role, and the database only stores the data resources that the client actually needs to access and acquire in the actual scenario.
[0055] The data interaction method, device, equipment and storage medium provided by the present application, in response to the database connection information acquisition request sent by the client, the legality of the client is verified according to the registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is sent by the client when the client sends a registration request to the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client; if the legality verification is passed, the database connection information requested by the client is retrieved from the pre-stored database connection information, or the connectable database corresponding to the client is retrieved according to the registration information of the client, and the database connection information of the connectable database is obtained; wherein the pre-stored database connection information is the information transferred from the configuration information of the client to the central database for management; the database connection information is returned to the client, so that the client establishes a communication connection with the database based on the database connection information. The technical scheme of the embodiments of the present application, by the central database, the database connection information transferred by each client is uniformly managed, and the client only needs to request the related database connection request from the central database when it needs to connect with the database, which simplifies the process of communication connection between the client and the database. At the same time, with the help of the central database, the database connection information is uniformly managed, without the need to modify and maintain the configuration information in the client, and the security and management efficiency of the connection between the client and the database are also improved.
[0056] Figure 2 The flowchart of another data interaction method provided by the embodiment of the application, the technical solution of the embodiment is further optimized on the basis of the technical solution of the above-mentioned embodiment, the process before the above-mentioned embodiment responds to the database connection information acquisition request sent by the client is further optimized, the solutions not described in detail in the embodiment are described in the above-mentioned embodiment, and the embodiment can be combined with each optional solution in one or more of the above-mentioned embodiments. As shown in the embodiment, the data interaction method comprises: Figure 2
[0057] S210, the registration request sent by the client is accepted, the client is registered based on the registration information in the client registration request, and the client number and the key are allocated.
[0058] The registration request is a request of the client for registration in the central database. The registration request contains registration information. The registration request is sent by the client to the central database.
[0059] The central database will accept the registration request sent by the client, register the client based on the registration information in the client registration request, and allocate the client number and the key. The central database will send the allocated client number and key to the corresponding client. The client number is a system number set by the central database for the client, and the corresponding client can be uniquely identified in the central database based on the client number. The key can be a symmetric key or an asymmetric key.
[0060] It should be noted that the central database allocates the key for the client, so that the two can encrypt and decrypt the information in the subsequent data interaction process, which can effectively improve the security and reliability of data transmission.
[0061] S220, the database connection information acquisition request sent by the client is decrypted based on the key, and the request data is obtained; wherein the database connection information acquisition request is sent after being encrypted based on the key allocated by the central database.
[0062] In order to improve the security of data interaction, the client will encrypt the database connection information acquisition request based on the key allocated and returned by the central database during the previous registration when sending the database connection information acquisition request to the central database, and will send the database connection information acquisition request to the central database after the encryption is completed.
[0063] The central database decrypts the database connection information acquisition request sent by the client based on the relevant key after receiving the encrypted database connection information acquisition request to obtain the request data. The request data includes the registration information of the client and the client number allocated to the client by the central database.
[0064] S230, verifying the legitimacy of the client according to the registration information and the client number carried in the request data.
[0065] The central database verifies the legitimacy of the client according to the registration information and the client number carried in the request data after obtaining the request data.
[0066] As an optional but non-limiting implementation, verifying the legitimacy of the client according to the registration information and the client number carried in the request data can include the following steps A1-A2:
[0067] Step A1: comparing the client name, IP address and client number carried in the request data with the registered client name, IP address and client number allocated to the client.
[0068] Specifically, the central database parses the client name, IP address and client number carried in the request data based on the request data, and compares these data with the registered client name, IP address and client number allocated to the client one by one, that is, comparing whether the client name carried in the request data is consistent with the registered client name, comparing whether the IP address carried in the request data is consistent with the registered IP address, and comparing whether the client number carried in the request data is consistent with the client number allocated to the client.
[0069] Step A2: if all the comparisons are consistent, it is determined that the legitimacy verification of the client is passed.
[0070] If all the information is consistent after comparison, it is determined that the legitimacy verification of the client is passed, which means that the client is a legitimate user who has successfully registered and registered.
[0071] S240, in the case where the legitimacy verification is passed, retrieving the database connection information requested by the client from the pre-stored database connection information, or retrieving the connectable database corresponding to the client according to the registration information of the client to obtain the database connection information of the connectable database; wherein the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management.
[0072] S250, return the database connection information to the client, so that the client establishes a communication connection with the database based on the database connection information.
[0073] Optionally, the central database can encrypt the retrieved database connection information based on the key assigned to the client, and return the encrypted database connection information to the client, so that the client establishes a communication connection with the database based on the decrypted database connection information.
[0074] As an optional but non-limiting implementation, after the client is registered based on the registration information in the client registration request and the client number and the key are assigned, the data interaction method further comprises: establishing a mapping relationship between the client number and the database corresponding to the client; and correspondingly, retrieving the database connection information requested by the client from the pre-stored database connection information, comprising: retrieving the database connection information of the database corresponding to the client number from the pre-stored database connection information.
[0075] Specifically, after the client is registered and the client number and the key are assigned, the central database will also establish a mapping relationship between the client number and the database corresponding to the client. Correspondingly, when retrieving the database connection information requested by the client from the pre-stored database connection information, the corresponding requested database can be determined based on the mapping relationship and the client number, and then the database connection information that can establish a communication connection with the database can be retrieved.
[0076] For example, for the client A and its corresponding database A, the central database assigns the client number 001 to the client, and then establishes a mapping relationship between "client number 001" and "database A". Correspondingly, when retrieving the database connection information requested by the client A from the pre-stored database connection information, "database A" can be determined based on the mapping relationship and "client number 001", and then the database connection information corresponding to "database A" can be quickly retrieved from the pre-stored database connection information.
[0077] As an optional but non-limiting implementation, the data interaction method further comprises the following steps B1-B2:
[0078] Step B1: detecting whether the pre-stored database connection information has at least one of password change, database migration and database expansion.
[0079] Although the pre-stored database connection information is uniformly managed by the central database, the client and the database associated with each piece of database connection information can change. For example, the client changes the login password when accessing the database, or the database migrates or expands the original data content. Such problems can cause the pre-stored database connection information to change. To this end, the central database needs to detect possible changes to improve the accuracy and reliability of various related information.
[0080] Specifically, the central database can detect whether the pre-stored database connection information has at least one of password change, database migration, and database expansion. The detection of the pre-stored database connection information by the central database can be periodic detection, or detection triggered as soon as the client transfers the database connection information to the central database.
[0081] Step B2: If there is, and the central database does not receive the database connection information acquisition request sent by the client within the first preset time, the central database prompts the client to reacquire the database connection information, or prompts the client to restart and reacquire the database connection information.
[0082] The first preset time is a time period with a certain length of time set in advance, and the first preset time can be set based on actual needs.
[0083] If the central database detects that the pre-stored database connection information has at least one of password change, database migration, and database expansion, it indicates that the pre-stored database connection information has changed. For these changes, the client needs to be prompted to update accordingly in a timely manner, otherwise it will cause the client to fail to successfully communicate with the database based on the original database connection information. The client can obtain the latest database connection information by means of the re-sent database connection information acquisition request, thereby updating the relevant changed content in the client.
[0084] Specifically, if the central database detects that there is, and the central database does not receive the database connection information acquisition request sent by the client within the first preset time, it indicates that although the content has changed, the client has not implemented self-initiated update by means of the re-sent database connection information acquisition request. The client still retains the original database connection information and has not obtained the latest database connection information. The central database can prompt the client to reacquire the database connection information, or prompt the client to restart and reacquire the database connection information.
[0085] As an optional but non-limiting implementation, after prompting the client to reacquire the database connection information or prompting the client to restart and reacquire the database connection information, the data interaction method further comprises steps C1-C3.
[0086] Step C1: If the database connection information acquisition request sent by the client is still not received within the second preset time after prompting, the connection state of the client and the database is acquired from the client or the database.
[0087] The second preset time is also a time period with a certain length of time, and the second preset time can also be set based on actual needs. However, the length of time of the second preset time is greater than the length of time of the first preset time.
[0088] If the database connection information acquisition request sent by the client is still not received within the second preset time after prompting, it indicates that the client still does not update the content of the change spontaneously by means of the re-sent database connection information acquisition request after a longer time, and the client still does not acquire the latest database connection information. The central database acquires the connection state of the client and the database from the client or the database to determine whether the client and the database are in communication connection within the second preset time, and further determine whether to continue prompting the client.
[0089] Specifically, the client and the database are both provided with a corresponding listening process, and the listening process is used to listen to the connection state between the client and the database. The connection state includes connected and not connected.
[0090] Step C2: If the connection state is not connected, continue to prompt the client to reacquire the database connection information or prompt the client to restart.
[0091] If the connection state is not connected, the central database continues to prompt the client to reacquire the database connection information or prompt the client to restart and reacquire the database connection information.
[0092] Step C3: If the connection state is connected, stop prompting.
[0093] If the connection state is connected, it indicates that the client and the database can successfully perform communication connection at present, and the central database can stop prompting.
[0094] As an optional but non-limiting implementation, the data interaction method further comprises: building a software operation service, and determining, in the software operation service, that the entry parameter of the access is a client number, a signature mode, a signature, and a database connection information obtaining request; and determining, in the software operation service, that the return object of the access is the signature mode, the signature, and encrypted database connection information.
[0095] The software operation service is built on the central database and is a service for communication between the client and the central database. With the software operation service, communication and data interaction between the client and the central database can be achieved. For example, the software operation service can be a SAAS service for getDBConnectionInfo. The signature mode can be an RSA algorithm.
[0096] Specifically, after the software operation service is built, it can be determined in the software operation service that the entry parameter of the access is the client number, the signature mode, the signature, and the database connection information obtaining request; and it can be determined in the software operation service that the return object of the access is the signature mode, the signature, and the encrypted database connection information.
[0097] For example, the client can generate a signature according to the assigned client number, the current timestamp, and the signature mode. Then, the client can encrypt the database connection information obtaining request according to the RSA algorithm. The client can perform data interaction with the central database based on the software operation service. After obtaining the encrypted database connection information returned by the central database, the client can decrypt the IP address, the port number, the username, and the password of the database by using the RSA public key. Then, the client can generate a database connection string based on the information and establish a communication connection with the database based on the database connection string.
[0098] The data interaction method, device, equipment and storage medium provided by the application, in response to the database connection information acquisition request sent by the client, the legality of the client is verified according to the registration information contained in the database connection information acquisition request;Among them, the registration information for verification in the central database is sent by the client when the client registers the database connection information management request to the central database in the case that the configuration information containing the database connection information exists in the client;If the legality verification is passed, the database connection information requested by the client is retrieved from the pre-stored database connection information, or the connectable database corresponding to the client is retrieved according to the registration information of the client, and the database connection information of the connectable database is obtained;Among them, the pre-stored database connection information is the information transferred from the configuration information of the client to the central database for management;The database connection information is returned to the client, so that the client establishes a communication connection with the database based on the database connection information. The technical scheme of the embodiment of the application, the database connection information transferred by each client is uniformly managed by the central database, and the client only needs to request the related database connection request to the central database when it needs to connect with the database, which simplifies the process of communication connection between the client and the database. At the same time, with the help of the central database, each database connection information is uniformly managed, without the need to modify and maintain the configuration information in the client, and the security and management efficiency of the client and the database connection are also improved.
[0099] Figure 3 The flowchart of a data interaction method provided by the embodiment of the application. The embodiment of the application can be applied to the case that the client and the central database interact with each other. The method can be executed by a data interaction device applied to the client, which can be realized in the form of hardware and / or software, and the data interaction device can be configured in an electronic device. As shown in the figure, the data interaction method comprises: Figure 3
[0100] S310, send a database connection information acquisition request to the central database, so that the central database returns the database connection information in response to the database connection information acquisition request.
[0101] Among them, the database connection information acquisition request is to obtain the database connection information that can establish a communication connection with the database. The database connection information acquisition request is sent by the client to the central database, and the central database will respond to the database connection information acquisition request to obtain the corresponding database connection information and return it to the client. The client can realize communication connection with the database based on the database connection information.
[0102] S320, receiving the database connection information returned by the central database; wherein the database connection information is obtained by the central database from the pre-stored database connection information after the central database verifies the legality of the client based on the registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; the registration information used for verification in the central database is registration information sent by the client when the client sends a registration request to the central database to request the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client.
[0103] The registration information is information registered by the client in the central database, and the registration information reflects information related to the client to be recorded by the client when registering. The registration information can include the client name and the client IP address, and the content contained in the registration information can be set based on actual needs. For example, the registration information can also include the registration time and the database name corresponding to the connection of the client.
[0104] After the central database receives the database connection information obtaining request sent by the client, the central database parses the registration information from the database connection information obtaining request and verifies the legality of the client based on the registration information. The verification of the legality of the client specifically includes: verifying whether the parsed registration information is completely consistent with the registration information recorded in the central database. If yes, the legality verification of the client is passed; if not, the legality verification of the client is not passed. It should be noted that the registration information used for verification in the central database is registration information sent by the client when the client sends a registration request to the central database to request the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client. Specifically, when the configuration information containing the database connection information exists in the client, the client sends a registration request to the central database to request the central database to manage its own database connection information, and the registration information contained in the registration request is received by the central database. After that, the central database verifies the legality of the client based on the registration information in the subsequent scheme. That is, the registration information used for verification in the central database is essentially the registration information sent by the client when the client sends a registration request to the central database for the first time.
[0105] In the case that the legality verification passes, the central database can retrieve the database connection information requested by the client from the pre-stored database connection information, or the central database retrieves the connectable database corresponding to the client according to the registration information of the client, and obtains the database connection information of the connectable database. The pre-stored database connection information is information transferred from the configuration information of the client to the central database for management. The database connection information includes the IP address, port number, username and password of the database.
[0106] It should be noted that in the embodiments of the present application, the database connection information is not managed by each client itself, but each client transfers its corresponding database connection information to the central database for unified management. When the client needs to establish a communication connection with the database, the client needs to request the corresponding database connection information from the central database. The central database returns the corresponding database connection information to the client only after verifying the legality of the client. That is, the central database in the embodiments of the present application plays a management and verification role, and the database only stores the data resources that the client actually needs to access and obtain in the actual scenario.
[0107] S330, establishing a communication connection with the database based on the database connection information.
[0108] After the client receives the database connection information returned by the central database, it can determine that the database connection information contains the IP address, port number, username and password of the database based on the database connection information. It can request to connect with the database based on the IP address and port number of the database, and log in to the database based on the username and password to establish a communication connection.
[0109] After the client and the database successfully establish a communication connection, the client can perform specific data resource access and acquisition operations.
[0110] The data interaction method, device, equipment and storage medium provided by the present application send a database connection information obtaining request to the central database, so that the central database returns database connection information in response to the database connection information obtaining request; receive the database connection information returned by the central database; wherein the database connection information is obtained from the pre-stored database connection information by the central database after passing the verification of the legality of the client according to the registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; the registration information used for verification in the central database is sent by the client when the client registers with the central database to request the management of the database connection information in the case that the configuration information containing the database connection information exists in the client; and a communication connection is established with the database based on the database connection information. The technical scheme of the present application embodiment, by the central database to the database connection information transferred by each client for unified management, the client only needs to request the related database connection request to the central database when it needs to connect with the database, which simplifies the process of communication connection between the client and the database. At the same time, with the help of the central database to manage each database connection information, the security and management efficiency of the client and the database connection are also improved.
[0111] Figure 4 The flowchart of another data interaction method provided by the present application embodiment, the technical scheme of the present application embodiment is further optimized on the basis of the technical scheme of the above-mentioned embodiment, and the scheme not described in detail in the present embodiment is described in the above-mentioned embodiment. The present embodiment can be combined with each optional scheme in one or more of the above-mentioned embodiments. As shown in the figure, Figure 4 The data interaction method comprises:
[0112] S410, send a registration request to the central database, and register the client and assign a client number and a key based on the registration information in the client registration request by the central database.
[0113] The registration request is a request for the client to register in the central database. The registration request contains registration information.
[0114] The client will send a registration request to the central database, the central database will accept the received registration request, and register the client and assign a client number and a key based on the registration information in the client registration request. At the same time, the central database will send the assigned client number and key to the corresponding client. The client number is a system number set by the central database for the client, and the corresponding client can be uniquely identified in the central database based on the client number. The key can be a symmetric key or an asymmetric key.
[0115] It should be noted that the central database assigns the key to the client, so that the two can encrypt and decrypt the information in the subsequent data interaction process, which can effectively improve the security and reliability of data transmission.
[0116] S420, receiving the client number and the key returned by the central database.
[0117] The client receives the client number and the key returned by the central database.
[0118] S430, sending a database connection information acquisition request to the central database, so that the central database returns the database connection information in response to the connection information acquisition request.
[0119] As an optional but non-limiting implementation, sending the database connection information acquisition request to the central database can include the following steps D1-D2:
[0120] Step D1: generating request data carrying registration information and client number, encrypting the request data based on the key assigned by the central database to obtain the encrypted database connection information acquisition request.
[0121] The request data contains the registration information of the client and the client number assigned by the central database to the client.
[0122] After generating the request data, the client will encrypt the request data based on the key assigned by the central database to obtain the encrypted database connection information acquisition request.
[0123] Step D2: sending the encrypted database connection information acquisition request to the central database.
[0124] After obtaining the encrypted database connection information acquisition request, the client will send the encrypted database connection information acquisition request to the central database.
[0125] S440, receiving the database connection information returned by the central database; wherein the database connection information is obtained by the central database from the pre-stored database connection information after verifying the legitimacy of the client according to the registration information contained in the database connection information acquisition request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; and the registration information used for verification in the central database is sent by the client when the client registers with the central database to request management of the database connection information.
[0126] S450, establishing a communication connection with the database based on the database connection information.
[0127] As an optional but non-limiting implementation, receiving the database connection information returned by the central database includes: decrypting the database connection information based on the key assigned by the central database to obtain decrypted database connection information; wherein the database connection information is sent after being encrypted by the central database based on the key assigned to the client; the database connection information includes the IP address, port number, username and password of the database; and correspondingly, establishing a communication connection with the database based on the database connection information includes: requesting to connect with the database based on the IP address and port number of the database, and logging in the database to establish a communication connection based on the username and password.
[0128] Specifically, to improve the security in the data interaction process, the central database will encrypt the retrieved database connection information based on the key assigned to the client in advance after retrieving the database connection information, and send it to the client after encryption. After receiving it, the client can decrypt the database connection information based on the key assigned by the central database, thereby obtaining the decrypted database connection information.
[0129] Among them, the database connection information includes the IP address, port number, username and password of the database. The client can request to connect with the database based on the IP address and port number of the database, and log in the database to establish a communication connection based on the username and password. After the client and the database successfully establish a communication connection, the client can perform specific data resource access and acquisition operations.
[0130] As an optional but non-limiting implementation, the data interaction method can further include steps E1-E2:
[0131] Step E1: If the central database prompts to reacquire the database connection information or prompts the client to restart, re-send the database connection information acquisition request to the central database or send the database connection information acquisition request to the central database after restarting to acquire the updated database connection information in the central database.
[0132] The database connection information uniformly managed by the central database may change in content, for example, at least one of the pre-stored database connection information changes in password, database migration and database expansion. Therefore, the client also needs to update its original database connection information to ensure that it can successfully establish a communication connection with the database based on the latest database connection information. When the central database detects that the pre-stored database connection information has changed, the central database will prompt the client accordingly.
[0133] Specifically, if the client receives a prompt from the central database to reacquire the database connection information, or the client receives a prompt from the central database to restart the client, the client can re-send a request for the database connection information to the central database, or the client sends a request for the database connection information to the central database after restarting, to acquire the updated database connection information in the central database. Thus, the client saves the latest database connection information, so that the client and the database can successfully establish a communication connection subsequently.
[0134] Step E2: If no prompt is received from the central database to reacquire the database connection information, or no prompt is received from the central database to restart the client, the client continues to establish a communication connection with the database based on the current database connection information.
[0135] If the client does not receive a prompt from the central database to reacquire the database connection information, or the client does not receive a prompt from the central database to restart the client, the client can continue to establish a communication connection with the database based on the current database connection information.
[0136] As an optional but non-limiting implementation, the data interaction method can further include the following steps F1-F2:
[0137] Step F1: If the configuration information includes the database connection information, the database connection information in the configuration information is transferred to the central database, and the central database manages the database connection information.
[0138] The configuration information of the client includes information that the client can use to establish a communication connection with the database. That is, the configuration information of the client includes the database connection information, such as IP address information, port information, a username, and a password required for the client to establish a connection with the database.
[0139] Specifically, if the client has configuration information including the database connection information, the database connection information in the configuration information is transferred to the central database, and the central database uniformly manages the database connection information.
[0140] Step F2: If the configuration information does not include the database connection information, and there is user-added database connection information, the database connection information is directly sent to the central database, and the central database manages the database connection information.
[0141] Specifically, if the configuration information of the client does not include the database connection information, and there is user-added database connection information, the client can directly send the database connection information to the central database, and the central database manages the database connection information.
[0142] The data interaction method, device, equipment and storage medium provided by the application send a database connection information obtaining request to the central database, so that the central database returns database connection information in response to the database connection information obtaining request; receive the database connection information returned by the central database; wherein the database connection information is obtained from the pre-stored database connection information by the central database after the legality of the client is verified according to the registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; the registration information used for verification in the central database is sent by the client when the client registers with the central database to request the management of the database connection information when the configuration information containing the database connection information exists in the client; and the communication connection is established based on the database connection information and the database. The technical scheme of the embodiment of the application unifies the management of the database connection information transferred by each client by the central database, and the client only needs to request the related database connection request from the central database when the client needs to be connected with the database, thereby simplifying the process of the communication connection between the client and the database. At the same time, the unified management of each database connection information by the central database also improves the security and management efficiency of the connection between the client and the database.
[0143] Figure 5 A timing diagram of a data interaction method provided by the embodiment of the application. In the embodiment of the application, the data interaction among the client, the central database and the database is involved, and the schemes not described in detail in the embodiment are described in the above embodiments. As shown in the data interaction method, Figure 5
[0144] The client sends a registration request to the central database; after receiving the registration request, the central database will accept it, specifically, the central database will register the name and IP address of the client, and allocate a client number and a key to the client, wherein the key can use an asymmetric key, including a public key and a private key.
[0145] After the client receives the client number and the key allocated and returned by the central database, the client can construct request data based on the request parameters, and the request data contains registration information and a client number. After the request data is constructed, the client will encrypt the request data based on the allocated key, and the encrypted database connection information obtaining request is generated, and then the client sends the encrypted database connection information obtaining request to the central database to request the required database connection information from the central database.
[0146] The central database decrypts the encrypted database connection information acquisition request based on the key assigned to the client after receiving the encrypted database connection information acquisition request. After decryption, the client name, IP address and client number carried in the request data can be obtained, and these data are compared with the client name, IP address and client number assigned to the client registered in the central database to verify the legitimacy of the client.
[0147] If the legitimacy verification is passed, the central database retrieves the database connection information requested by the client from the relevant database (which stores preset database connection information) based on the client number assigned to the client. Then, the central database encrypts the retrieved database connection information based on the key and returns the encrypted database connection information to the client.
[0148] The client decrypts the database connection information returned by the central database based on the assigned key after receiving the encrypted database connection information, thereby obtaining the decrypted database connection information, and determining the IP address, port number, username and password of the database contained in the database connection information. Then, the client generates a database connection string based on these information, and then establishes a communication connection with the database based on the database connection string.
[0149] Figure 6 A structure diagram of a data interaction device provided by the embodiment of the application is shown in FIG. 6. The device can execute the data interaction method applied to the central database in the application, and has the corresponding function modules and beneficial effects of the execution method. Figure 6 As shown in FIG. 6, the data interaction device comprises:
[0150] The acquisition request response module 610 is configured to verify the legitimacy of the client based on the registration information contained in the database connection information acquisition request in response to the database connection information acquisition request sent by the client. The registration information for verification in the central database is sent by the client when the client registers with the central database to request management of the database connection information in the case that the configuration information containing the database connection information exists in the client.
[0151] The database connection information determination module 620 is configured to retrieve the database connection information requested by the client from the pre-stored database connection information or retrieve the database connection information of the connectable database corresponding to the client according to the registration information of the client in the case that the legitimacy verification is passed. The pre-stored database connection information is the information transferred from the configuration information of the client to the central database for management.
[0152] The database connection information returning module 630 is configured to return the database connection information to the client, so that the client establishes a communication connection with a database based on the database connection information.
[0153] Optionally, the data interaction apparatus further comprises:
[0154] The registration request receiving module is configured to receive the registration request sent by the client, and register the client based on the registration information in the registration request of the client, and assign a client number and a key to the client;
[0155] Correspondingly, the request response obtaining module 610 specifically comprises:
[0156] The request data determining unit is configured to decrypt the database connection information obtaining request sent by the client based on the key, to obtain request data; wherein the database connection information obtaining request is sent by the client after being encrypted based on the key assigned by the central database;
[0157] The legitimacy verifying unit is configured to verify the legitimacy of the client according to the registration information and the client number carried in the request data.
[0158] Optionally, the legitimacy verifying unit is specifically configured to compare the client name, the IP address and the client number carried in the request data with the registered client name, the registered IP address and the client number assigned to the client; if all the comparisons are consistent, it is determined that the legitimacy verification of the client is passed.
[0159] Optionally, the data interaction apparatus further comprises:
[0160] The mapping relationship establishing module is configured to establish a mapping relationship between the client number and the database corresponding to the client;
[0161] Correspondingly, the database connection information determining module 620 is configured to retrieve the database connection information requested by the client from the pre-stored database connection information, specifically comprising: retrieving the database connection information of the database corresponding to the client number from the pre-stored database connection information.
[0162] Optionally, the data interaction apparatus further comprises:
[0163] The first detecting module is configured to detect whether the pre-stored database connection information has at least one of a password change, a database migration and a database expansion;
[0164] The first prompting module is configured to prompt the client to reacquire the database connection information or to restart and reacquire the database connection information if it is detected that the client exists and the database connection information acquisition request sent by the client is not received within the first preset time.
[0165] The connection state determining module is configured to acquire the connection state between the client and the database from the client or the database if the database connection information acquisition request sent by the client is not received within the second preset time after prompting.
[0166] The second prompting module is configured to continue to prompt the client to reacquire the database connection information or to restart the client if the connection state is not connected, and to stop prompting if the connection state is connected.
[0167] Optionally, the data interaction apparatus further comprises:
[0168] The software operation service building module is configured to build a software operation service, and determine that an access entry parameter in the software operation service is a client number, a signature mode, a signature and a database connection information acquisition request, and determine that a return object in the software operation service is the signature mode, the signature and encrypted database connection information.
[0169] The data interaction apparatus provided in the embodiments of the present application can execute the data interaction method applied to a central database provided in the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0170] Figure 7 Another data interaction apparatus provided in the embodiments of the present application is shown in FIG. 6. The apparatus can execute the data interaction method applied to a client in the present application, and has the corresponding function modules and beneficial effects of the execution method. As shown in FIG. 6, the data interaction apparatus comprises: Figure 7
[0171] The acquisition request sending module 710 is configured to send a database connection information acquisition request to a central database, so that the central database returns database connection information in response to the database connection information acquisition request.
[0172] The database connection information receiving module 720 is configured to receive database connection information returned by the central database; wherein the database connection information is obtained from the pre-stored database connection information by the central database after the central database verifies the legality of the client based on the registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; and the registration information used for verification in the central database is registration information sent by the client when the client sends a registration request to the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client.
[0173] The communication connection establishing module 730 is configured to establish a communication connection with a database based on the database connection information.
[0174] Optionally, the data interaction apparatus further comprises:
[0175] The registration request module is configured to send a registration request to the central database, and the central database registers the client based on the registration information in the registration request of the client, and assigns a client number and a key to the client;
[0176] The returned information receiving module is configured to receive the client number and the key returned by the central database.
[0177] Optionally, the obtaining request sending module 710 specifically comprises:
[0178] The request data generating unit is configured to generate request data carrying registration information and a client number, encrypt the request data based on the key assigned by the central database, and obtain an encrypted database connection information obtaining request;
[0179] The obtaining request sending unit is configured to send the encrypted database connection information obtaining request to the central database.
[0180] Optionally, the database connection information receiving module 720 specifically comprises:
[0181] The decryption unit is configured to decrypt the database connection information based on the key assigned by the central database, and obtain decrypted database connection information; wherein the database connection information is sent by the central database after being encrypted based on the key assigned to the client; and the database connection information comprises an IP address, a port number, a username and a password of the database.
[0182] Correspondingly, the communication connection establishing module 730 is specifically configured to: request to connect with the database based on the IP address and the port number of the database, and establish a communication connection with the database based on the username and the password.
[0183] Optionally, the data interaction apparatus further includes:
[0184] The database connection information obtaining request re-sending module is configured to: if receiving a prompt of the central database to re-obtain database connection information or a prompt of the central database to restart the client, re-sending a database connection information obtaining request to the central database or sending a database connection information obtaining request to the central database after restarting the client to obtain updated database connection information in the central database; if not receiving the prompt of the central database to re-obtain database connection information or the prompt of the central database to restart the client, continuing to establish a communication connection with the database based on the current database connection information.
[0185] Optionally, the data interaction apparatus further includes:
[0186] The database connection information transferring module is configured to: if the configuration information includes database connection information, transferring the database connection information in the configuration information to the central database to manage the database connection information by the central database; if the configuration information does not include database connection information and there is user-added database connection information, directly sending the database connection information to the central database to manage the database connection information by the central database.
[0187] The data interaction apparatus provided in the embodiments of the present application can execute the data interaction method for a client provided in the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0188] Figure 8 A structural schematic diagram of an electronic device provided in the embodiments of the present application is shown in FIG. 1. Figure 8 As shown in FIG. 1, the electronic device can include a transceiver 121, a processor 122 and a memory 123.
[0189] The processor 122 executes computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiments. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor NP, etc.; and can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0190] The memory 123 is connected with the processor 122 through the system bus and completes mutual communication, and the memory 123 is used for storing computer program instructions.
[0191] The transceiver 121 can be used to obtain a to-be-run task and configuration information of the to-be-run task.
[0192] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as a client, a read-write library and a read-only library). The memory can include a random access memory (RAM), and can also include a non-volatile memory.
[0193] The electronic device provided by the embodiment of the application can be the terminal device of the above-mentioned embodiment.
[0194] The embodiment of the application further provides a chip for running instructions, which is used for executing the technical scheme of the data interaction method in the above-mentioned embodiment.
[0195] The embodiment of the application further provides a computer readable storage medium, which stores computer instructions, and when the computer instructions are run on a computer, the computer executes the technical scheme of the data interaction method in the above-mentioned embodiment.
[0196] The embodiment of the application further provides a computer program product, which includes a computer program stored in a computer readable storage medium, at least one processor can read the computer program from the computer readable storage medium, and when the at least one processor executes the computer program, the technical scheme of the data interaction method in the above-mentioned embodiment can be realized.
[0197] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the application are indicated by the following claims.
[0198] It is to be understood that the application is not limited to the precise construction herein described and as shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims
1. A data interaction method, characterized in that, The method applied to a central database comprises: In response to a database connection information acquisition request sent by a client, verifying the legitimacy of the client according to registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is sent by the client when the client registers with the central database to manage the database connection information in the case that the configuration information of the client contains the database connection information; In the case that the legitimacy verification is passed, retrieving the database connection information requested by the client from the pre-stored database connection information, or retrieving the connectable database corresponding to the client according to the registration information of the client, and acquiring the database connection information of the connectable database; wherein the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; Returning the database connection information to the client to enable the client to establish a communication connection with the database based on the database connection information.
2. The method of claim 1, wherein, Before responding to the database connection information acquisition request sent by the client, the method further comprises: Receiving the registration request sent by the client, registering the client based on the registration information in the client registration request and assigning a client number and a key to the client; Correspondingly, in response to the database connection information acquisition request sent by the client, verifying the legitimacy of the client according to the registration information contained in the database connection information acquisition request comprises: Decrypting the database connection information acquisition request sent by the client based on the key to obtain request data; wherein the database connection information acquisition request is sent by the client after being encrypted based on the key assigned by the central database; Verifying the legitimacy of the client according to the registration information and the client number carried in the request data.
3. The method of claim 2, wherein, After registering the client based on the registration information in the client registration request and assigning a client number and a key to the client, the method further comprises: Establishing a mapping relationship between the client number and the database corresponding to the client; Correspondingly, retrieving the database connection information requested by the client from the pre-stored database connection information comprises: Retrieving the database connection information of the database corresponding to the client number from the pre-stored database connection information.
4. The method of claim 1, wherein, The method further comprises: Detecting whether at least one of password change, database migration and database expansion exists in the pre-stored database connection information; If it exists and no database connection information acquisition request sent by the client is received within a first preset time, prompting the client to reacquire the database connection information, or prompting the client to restart and reacquire the database connection information.
5. The method of claim 4, wherein, After prompting the client to reacquire the database connection information or prompting the client to restart and reacquire the database connection information, the method further comprises: If the database connection information acquisition request sent by the client is not received within the second preset time after the prompt, the connection state of the client and the database is acquired from the client or the database; If the connection state is not connected, the client is prompted to reacquire the database connection information, or the client is prompted to restart; If the connection state is connected, the prompting is stopped.
6. The method of claim 1, wherein, The method further comprises: Building a software operation service, and determining in the software operation service that the entry parameter of the access is the client number, the signature mode, the signature, and the database connection information acquisition request; Determining in the software operation service that the return object of the access is the signature mode, the signature, and the encrypted database connection information.
7. A data interaction method, characterized by, Applied to the client, the method comprises: Sending a database connection information acquisition request to a central database, so that the central database returns database connection information in response to the database connection information acquisition request; Receiving the database connection information returned by the central database; wherein the database connection information is retrieved from pre-stored database connection information by the central database after passing the verification of the legitimacy of the client according to the registration information contained in the database connection information acquisition request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; the registration information used for verification in the central database is sent by the client when the client registers with the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client; Based on the database connection information, a communication connection with a database is established.
8. The method of claim 7, wherein, Before sending the database connection information acquisition request to the central database, the method further comprises: Sending a registration request to the central database, and registering the client and assigning a client number and a key to the client by the central database based on the registration information in the client registration request; Receiving the client number and the key returned by the central database.
9. The method of claim 8, wherein, Sending the database connection information acquisition request to the central database comprises: Generating request data carrying registration information and a client number, encrypting the request data based on the key assigned by the central database to obtain an encrypted database connection information acquisition request; Sending the encrypted database connection information acquisition request to the central database.
10. The method of claim 8, wherein, Receiving the database connection information returned by the central database comprises: Decrypting the database connection information based on the key assigned by the central database to obtain decrypted database connection information; wherein the database connection information is sent by the central database after being encrypted based on the key assigned to the client; the database connection information includes the IP address, the port number, the username, and the password of the database; Correspondingly, based on the database connection information, a communication connection with a database is established, which comprises: Requesting to connect with the database based on the IP address and the port number of the database, and establishing a communication connection with the database based on the username and the password.
11. The method of claim 7, wherein, The method further comprises: If the central database prompts to reacquire the database connection information or prompts the client to restart, re-sending the database connection information acquisition request to the central database or sending the database connection information acquisition request to the central database after restarting to acquire the updated database connection information in the central database; If the central database does not prompt to reacquire the database connection information or prompt the client to restart, continue to communicate with the database based on the current database connection information.
12. The method according to claim 9 or 10, characterized in that, The method further comprises: If the configuration information includes the database connection information, transferring the database connection information in the configuration information to the central database, and managing the database connection information by the central database; If the configuration information does not include the database connection information, and there is user-added database connection information, directly sending the database connection information to the central database, and managing the database connection information by the central database.
13. A data interaction device, characterized by The device is applied to an electronic device corresponding to the central database, and the device comprises: An acquisition request response module, configured to respond to the database connection information acquisition request sent by the client, and verify the legitimacy of the client according to the registration information contained in the database connection information acquisition request; wherein the registration information for verification in the central database is registration information sent by the client to the central database when the client registers to manage the database connection information in the case that the configuration information containing the database connection information exists in the client; A database connection information determination module, configured to retrieve the database connection information requested by the client from the pre-stored database connection information or retrieve the connectable database corresponding to the client according to the registration information of the client and acquire the database connection information of the connectable database in the case that the legitimacy verification is passed; wherein the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; A database connection information return module, configured to return the database connection information to the client, so that the client establishes a communication connection with the database based on the database connection information.
14. A data interaction device, characterized by The device is applied to an electronic device corresponding to the client, and the device comprises: An acquisition request sending module, configured to send a database connection information acquisition request to the central database, so that the central database returns the database connection information in response to the database connection information acquisition request; An acquisition request sending module, configured to send a database connection information acquisition request to the central database, so that the central database returns the database connection information in response to the database connection information acquisition request; The database connection information receiving module is configured to receive database connection information returned by the central database; wherein the database connection information is obtained from the pre-stored database connection information after the central database verifies the legality of the client according to the registration information contained in the database connection information obtaining request; the pre-stored database connection information is information transferred from the configuration information of the client to the central database for management; and the registration information used for verification in the central database is information sent by the client when the client sends a registration request to the central database to manage the database connection information in the case that the configuration information containing the database connection information exists in the client. The communication connection establishing module is configured to establish a communication connection with a database based on the database connection information.
15. An electronic device, comprising: The application comprises: a processor and a memory connected with the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to realize the data interaction method applied to the central database according to any one of claims 1-6, or realize the data interaction method applied to the client according to any one of claims 7-12.
16. A computer readable storage medium characterized by: The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to realize the data interaction method applied to the central database according to any one of claims 1-6, or realize the data interaction method applied to the client according to any one of claims 7-12.
17. A computer program product, characterised in that, The computer program is executed by the processor to realize the data interaction method applied to the central database according to any one of claims 1-6, or realize the data interaction method applied to the client according to any one of claims 7-12.