A method and system for updating database password

By increasing the access connection between the middleware node and the database server, updating the database password and restarting the application server, the problem of business service interruption when the database password is updated is solved and the continuity and stability of the service are achieved.

CN118170782BActive Publication Date: 2024-09-24PARK DO CREDIT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410444598.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2024-09-24
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

In the existing technology, when the database password is updated, the application needs to be restarted, causing interruption of business services and making it impossible to maintain service continuity during the update process.

Method used

By increasing the number of access connections between the middleware node and the database server, updating the database server and middleware node configuration files with the new database password, restarting the middleware and application server in sequence, ensuring that the new database password is used to access the database server after restarting, to avoid Interruption of business services.

Benefits of technology

There is no need to interrupt the business services executed by the application during the database password update process, ensuring service continuity and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170782B
    Figure CN118170782B
Patent Text Reader

Abstract

The present application provides a method and system for updating a database password, wherein the method comprises: using a new database password to update an original database password in a database server and an original database password stored in a node configuration file of each node in a middleware; restarting each node in the middleware in sequence, and after the node is restarted, using the new database password in the node configuration file of the node to refresh the original database password stored in the node memory; using the new database password to update the original database password stored in the application configuration file of each application server in an application server cluster; restarting each application server in sequence, and after the application server is restarted, using the new database password in the application configuration file of the application server to update the original database password stored in the application memory of the application server; in this way, in the process of updating the database password, there is no need to interrupt the business service performed by the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and system for updating a database password. Background Art

[0002] In accordance with network security requirements, the database password needs to be changed regularly. The database password refers to the password used by the application to access the database.

[0003] Specifically, the database password is usually encrypted and stored in the configuration file of the application server. When the application starts, the application server reads the database password ciphertext from the configuration file, decrypts it to obtain the database password, and loads the database password into the memory of the application server. When the application server accesses the database server, it uses the database password stored in the memory of the application server to access it. Currently, after the database password is modified, the application needs to be restarted to refresh the database password stored in the memory of the application server. This will cause the business services executed by the application to be interrupted. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a method and system for updating a database password, so that during the process of updating the database password, there is no need to interrupt the business services executed by the application.

[0005] In a first aspect, an embodiment of the present application provides a method for updating a database password, the method being applied to a system for updating a database password; the system comprising: an application server cluster, middleware, and a database server; the method comprising:

[0006] When the original database password in the database server needs to be updated, the number of access connections between each node in the middleware and the database server is increased; wherein the node is used to receive an access request sent by the application server, and access the database server according to the access request and the access connection;

[0007] Using the new database password, updating the original database password in the database server, and updating the original database password stored in the node configuration file of each node in the middleware;

[0008] Restarting each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server;

[0009] Using the new database password, updating the original database password stored in the application configuration file of each application server in the application server cluster;

[0010] Restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the original database password stored in the application memory of the application server is updated with the new database password in the application configuration file of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.

[0011] In combination with the first aspect, an embodiment of the present application provides a first possible implementation of the first aspect, wherein all application servers included in the application server cluster are used to respond to task instructions of the same application; for each task instruction of the application, any application server that is currently in the started state in the application server cluster is used to respond, so that the application server generates an access request for the task instruction.

[0012] In combination with the first aspect, an embodiment of the present application provides a second possible implementation of the first aspect, wherein increasing the number of access connections between each node in the middleware and the database server includes:

[0013] Increase the number of access connections between each node in the middleware and the database server to a historical peak number.

[0014] In combination with the first aspect, the embodiment of the present application provides a third possible implementation of the first aspect, wherein the using the new database password to update the original database password in the database server includes:

[0015] The database server responds to the first password update operation of the first administrator to update the original database password in the database server using the new database password input by the first administrator.

[0016] In combination with the first aspect, the embodiment of the present application provides a fourth possible implementation of the first aspect, wherein the using of the new database password to update the original database password stored in the node configuration file of each node in the middleware includes:

[0017] For each of the nodes in the middleware, the node responds to the second password update operation of the second administrator to update the original database password in the node configuration file of the node using the new database password input by the second administrator.

[0018] In combination with the first aspect, the embodiment of the present application provides a fifth possible implementation of the first aspect, wherein the sequentially restarting each node in the middleware includes:

[0019] The nodes in the middleware are restarted in sequence according to the preset restart order of each node in the middleware; wherein, after the restart of the currently restarted node is completed, the next sequential node of the node starts to restart.

[0020] In combination with the first aspect, the embodiment of the present application provides a sixth possible implementation of the first aspect, wherein the using the new database password to update the original database password stored in the application configuration file of each application server in the application server cluster includes:

[0021] For each of the application servers in the application server cluster, the application server responds to the third password update operation of the third administrator to update the original database password stored in the application configuration file of the application server using the target hash value input by the third administrator; wherein the target hash value is a hash value calculated by the SM3 hash algorithm for the new database password;

[0022] The updating of the original database password stored in the application memory of the application server using the new database password in the application configuration file of the application server comprises:

[0023] Using the target hash value in the application configuration file of the application server to update the original database password stored in the application memory of the application server;

[0024] After the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server, including:

[0025] After the application server is restarted, the access request sent by the application server to the node of the middleware includes the target hash value stored in the application memory of the application server.

[0026] In combination with the sixth possible implementation of the first aspect, an embodiment of the present application provides a seventh possible implementation of the first aspect, wherein, after the node receives the access request containing the target hash value sent by the restarted application server, if the node completes the restart, it reads the new database password stored in the memory, performs an SM3 hash algorithm calculation on the new database password, and obtains an SM3 hash value. When the SM3 hash value is the same as the target hash value, the node uses the access request and the new database password stored in the node memory to access the database server; if the node has not completed the restart, it reads the new database password stored in the node configuration file, performs an SM3 hash algorithm calculation on the new database password, and obtains an SM3 hash value. When the SM3 hash value is the same as the target hash value, the node uses the access request and the original database password stored in the node memory to access the database server.

[0027] In combination with the first aspect, an embodiment of the present application provides an eighth possible implementation of the first aspect, wherein, after all the application servers in the application server cluster are restarted, each node in the middleware, after receiving the access request sent by the application server, determines whether the access request carries a new database password; when the access request carries a new database password, the database server is accessed according to the access request and the access connection.

[0028] In a second aspect, an embodiment of the present application further provides a database password update system, the system comprising: an application server cluster, middleware, and a database server;

[0029] The middleware is used to increase the number of access connections between each node in the middleware and the database server when the original database password in the database server needs to be updated; wherein the node is used to receive the access request sent by the application server, and access the database server according to the access request and the access connection;

[0030] The database server is used to update the original database password in the database server with the new database password;

[0031] The middleware is further used to update the original database password stored in the node configuration file of each node in the middleware using the new database password;

[0032] The middleware is further used to restart each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server;

[0033] The application server cluster is used to update the original database password stored in the application configuration file of each of the application servers in the application server cluster using the new database password;

[0034] The application server cluster is also used to restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the original database password stored in the application memory of the application server is updated with the new database password in the application configuration file of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.

[0035] In combination with the second aspect, an embodiment of the present application provides a first possible implementation of the second aspect, wherein all application servers included in the application server cluster are used to respond to task instructions of the same application; for each task instruction of the application, any application server that is currently in the started state in the application server cluster is used to respond, so that the application server generates an access request for the task instruction.

[0036] In combination with the second aspect, an embodiment of the present application provides a second possible implementation of the second aspect, wherein the middleware, when used to increase the number of access connections between each node in the middleware and the database server, is specifically used to:

[0037] Increase the number of access connections between each node in the middleware and the database server to a historical peak number.

[0038] In combination with the second aspect, the embodiment of the present application provides a third possible implementation of the second aspect, wherein the database server, when used to update the original database password in the database server using the new database password, is specifically used to:

[0039] The database server responds to the first password update operation of the first administrator to update the original database password in the database server using the new database password input by the first administrator.

[0040] In combination with the second aspect, an embodiment of the present application provides a fourth possible implementation of the second aspect, wherein the middleware, when used to update the original database password stored in the node configuration file of each node in the middleware using the new database password, is specifically used to:

[0041] For each of the nodes in the middleware, the node responds to the second password update operation of the second administrator to update the original database password in the node configuration file of the node using the new database password input by the second administrator.

[0042] In combination with the second aspect, an embodiment of the present application provides a fifth possible implementation of the second aspect, wherein the middleware, when used to restart each node in the middleware in sequence, is specifically used to:

[0043] The nodes in the middleware are restarted in sequence according to the preset restart order of each node in the middleware; wherein, after the restart of the currently restarted node is completed, the next sequential node of the node starts to restart.

[0044] In combination with the second aspect, an embodiment of the present application provides a sixth possible implementation of the second aspect, wherein the application server cluster, when used to update the original database password stored in the application configuration file of each application server in the application server cluster using the new database password, is specifically used to:

[0045] For each of the application servers in the application server cluster, the application server responds to the third password update operation of the third administrator to update the original database password stored in the application configuration file of the application server using the target hash value input by the third administrator; wherein the target hash value is a hash value calculated by the SM3 hash algorithm for the new database password;

[0046] When the application server cluster is used to update the original database password stored in the application memory of the application server using the new database password in the application configuration file of the application server, the application server cluster is specifically used to:

[0047] Using the target hash value in the application configuration file of the application server to update the original database password stored in the application memory of the application server;

[0048] After the application server cluster is restarted, when the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server, it is specifically used to:

[0049] After the application server is restarted, the access request sent by the application server to the node of the middleware includes the target hash value stored in the application memory of the application server.

[0050] In combination with the sixth possible implementation of the second aspect, the embodiment of the present application provides a seventh possible implementation of the second aspect, wherein the middleware is used when, before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server, specifically for:

[0051] After receiving the access request containing the target hash value sent by the restarted application server, if the node has completed the restart, the node reads the new database password stored in the memory, performs SM3 hash algorithm calculation on the new database password to obtain the SM3 hash value, and when the SM3 hash value is the same as the target hash value, the node uses the access request and the new database password stored in the node memory to access the database server; if the node has not completed the restart, the node reads the new database password stored in the node configuration file, performs SM3 hash algorithm calculation on the new database password to obtain the SM3 hash value, and when the SM3 hash value is the same as the target hash value, the node uses the access request and the original database password stored in the node memory to access the database server.

[0052] In combination with the sixth possible implementation of the second aspect, an embodiment of the present application provides an eighth possible implementation of the second aspect, wherein, after all the application servers in the application server cluster are restarted, each node in the middleware is further used to: after receiving an access request sent by the application server, determine whether the access request carries a new database password; when the access request carries a new database password, access the database server according to the access request and the access connection.

[0053] The embodiment of the present application provides a method and system for updating a database password, wherein, when the database password of a database server is updated, since each application server is restarted separately, when the application has a task to be executed, the application server that is not currently restarted (including those that have been restarted and those that have not been restarted) can respond to the task. If the application server has been restarted, the application server can generate an access request based on the new database password and give it to any node. Each node in the middleware can respond to both the access request containing the original database password and the access request containing the new database password. Therefore, if the node is restarted, an access connection can be established based on the access request containing the new database password to access the database server. If the node has not been restarted, the node can also access the database server based on the access request containing the new database password and the access connection originally established. If the application server has not been restarted, the application server can generate an access request based on the original database password and give it to any node. If the node is restarted, an access connection can be established based on the access request containing the original database password to access the database server. If the node has not been restarted, the node can also access the database server according to the access request containing the original database password and the previously established access connection. It can be seen that through the update method of this embodiment, in the process of updating the database password, there is no need to interrupt the business service performed by the application.

[0054] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A flowchart of a method for updating a database password provided in an embodiment of the present application is shown;

[0057] Figure 2 A schematic diagram of the structure of a database password updating system provided in an embodiment of the present application is shown;

[0058] Figure 3 A schematic diagram of the structure of a second database password updating system provided in an embodiment of the present application is shown;

[0059] Figure 4A schematic diagram of the structure of a third database password updating system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0060] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0061] Considering that in the prior art, when the database password is modified, the application needs to be restarted to refresh the database password stored in the application server memory. This will cause the problem of interruption of the business services performed by the application. Based on this, the embodiment of the present application provides a method and system for updating the database password, so that in the process of updating the database password, there is no need to interrupt the business services performed by the application, which is described below through an embodiment.

[0062] To facilitate understanding of this embodiment, a method for updating a database password disclosed in the embodiment of this application is first introduced in detail. The method is applied to a database password update system; the database password update system includes: an application server cluster, middleware and a database server. Figure 1 A flowchart of a method for updating a database password provided in an embodiment of the present application is shown. Figure 1 As shown, the method includes the following steps S101-S105:

[0063] S101: When the original database password in the database server needs to be updated, increase the number of access connections between each node in the middleware and the database server; wherein the node is used to receive an access request sent by the application server, and access the database server according to the access request and the access connection.

[0064] Figure 2 A schematic diagram of the structure of a database password updating system provided in an embodiment of the present application is shown. Figure 2As shown, the application server cluster includes multiple application servers, which are all background operation servers of the same application. The database server includes the data required by the application server cluster, or in other words, the database server includes the data required to run the application. Middleware is deployed between the application server cluster and the database server to assist the application servers in the application server cluster to access the database in the database server.

[0065] like Figure 2 As shown in the figure, before the database password is updated, the database password in the database server is the original database password, such as 123. The node configuration file in each node in the middleware and the database password stored in the node memory are all the original database passwords. The application configuration file in each application server in the application server cluster and the database password stored in the application memory are all the original database passwords.

[0066] In this embodiment, when the original database password in the database server needs to be updated, for example, when the database password of the database server is to be changed from the original database password 123 to the new database password 456, the number of access connections in the database connection pool between the middleware and the database server is increased to the historical peak level. The database connection pool contains access connections between each node of the middleware and the database server. Figure 2 As shown, the number of access connections between each node and the database server can be one or more.

[0067] S102: Use the new database password to update the original database password in the database server, and update the original database password stored in the node configuration file of each node in the middleware.

[0068] In this embodiment, the new database password is used to update the original database password in the database server. After the update is completed, the current password in the database server is the new database password, and the original database password is the historical database password. In other words, after the database password in the database server is updated, the database server contains both the new database password and the original database password.

[0069] The middleware includes multiple nodes, and each node includes its own node configuration file. For each node in the middleware, the original database password stored in the node configuration file of the node is updated using the new database password. After the update is completed, the password currently stored in the node configuration file is the new database password, and the original database password becomes the historical database password. In this embodiment, after the database password in the node is updated, the node configuration file of the node includes the new database password and the original database password. And, at this time (before the node is restarted), the database password stored in the node memory of the node is the original database password.

[0070] S103: Restart each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein, before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server.

[0071] In this embodiment, the switch for accepting the new and old database passwords in the middleware is turned on. At this time, each node in the middleware can use the new database password to access the database server, and can also use the original database password to access the database server.

[0072] Specifically, Figure 3 FIG. 1 shows a schematic diagram of the structure of a second database password updating system provided in an embodiment of the present application. Figure 3 As shown, for each node in the middleware, when the node is restarted, the access connection between the node and the database server is disconnected. At the same time, the new database password stored in the node configuration file of the node is used to update the original database password stored in the node memory of the node, so that the new database password and the original database password are stored in the node memory.

[0073] In this embodiment, before the node is restarted, since only the original database password is stored in the memory of the node, and the access connection between the node and the database server still exists, when the node accesses the database server, it uses the original database password stored in the memory and the existing access connection to access the database server.

[0074] After the node is restarted, since the node's memory contains the new database password and the access connection between the node and the database server is disconnected, when accessing the database server, the node uses the new database password stored in the memory to re-establish a new access connection with the database server, and then uses the new database password stored in the memory and the new access connection to access the database server.

[0075] S104: Using the new database password, update the original database password stored in the application configuration file of each application server in the application server cluster.

[0076] Figure 4 FIG. 4 shows a schematic diagram of the structure of a third database password updating system provided in an embodiment of the present application. Figure 4 As shown, for each application server in the application server cluster, the original database password stored in the application configuration file of the application server is updated with the new database password. At this time, the password currently stored in the application configuration file of the application server is the new database password, and the original database password becomes the historical database password. In addition, since the application server has not been restarted at this time, the original database password is stored in the application memory of the application server.

[0077] S105: Restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the new database password in the application configuration file of the application server is used to update the original database password stored in the application memory of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.

[0078] In this embodiment, each application server is restarted respectively. After the application server is restarted, the new database password in the application configuration file of the application server is used to update the original database password stored in the application memory of the application server, so that the database password in the application memory becomes the new database password.

[0079] In this embodiment, before the application server is restarted, since the original database password is still stored in the application memory of the application server, the application server generates an access request based on the original database password stored in the application memory, and then sends the access request containing the original database password to the node that is running (i.e., not in the restart process), and the node accesses the database server based on the access request.

[0080] After the application server is restarted, the new database encryption password is stored in the application memory of the application server. Therefore, the application server generates an access request based on the new database password stored in the application memory, and then sends the access request containing the new database password to the node that is running (i.e., not in the restart process), and the node accesses the database server based on the access request.

[0081] It can be seen that each node in the middleware of this embodiment can respond to access requests containing the original database password as well as access requests containing the new database password.

[0082] In one possible implementation, all application servers included in the application server cluster are used to respond to task instructions of the same application; for each task instruction of the application, any application server currently in the application server cluster that is in an activated state responds so that the application server generates an access request for the task instruction.

[0083] In this embodiment, the application server currently in the startup state refers to the application server that is not currently being restarted. Specifically, the application server currently in the startup state includes the application server that has been restarted and the application server that has not been restarted.

[0084] If the application server currently in the startup state is an application server that has been restarted, the application server generates an access request containing a new database password. If the application server currently in the startup state is an application server that has not been restarted, the application server generates an access request containing an original database password.

[0085] In a possible implementation manner, when executing step S101 to increase the number of access connections between each node in the middleware and the database server, the following steps may be specifically performed:

[0086] Increase the number of access connections between each node in the middleware and the database server to the historical peak number.

[0087] In this embodiment, for each node in the middleware, the number of connections between the node and the database server is increased to the historical peak number of the node.

[0088] In a possible implementation manner, when executing step S102 to use the new database password to update the original database password in the database server, the following steps may be specifically performed:

[0089] The database server responds to the first password update operation of the first administrator to update the original database password in the database server using the new database password input by the first administrator.

[0090] In a possible implementation, when executing step S102 to use the new database password to update the original database password stored in the node configuration file of each node in the middleware, the following steps may be specifically performed:

[0091] For each node in the middleware, the node responds to the second password update operation of the second administrator to update the original database password in the node configuration file of the node using the new database password input by the second administrator.

[0092] In a possible implementation manner, when executing step S103 to sequentially restart each node in the middleware, the following steps may be specifically performed:

[0093] The nodes in the middleware are restarted in sequence according to the preset restart order of each node in the middleware; wherein, after the restart of the currently restarted node is completed, the next sequential node of the node starts to restart.

[0094] In this embodiment, the nodes in the middleware are not restarted at the same time, and generally after one node is restarted, another node is restarted, so as to ensure that there is always a node that can respond to the task.

[0095] In a possible implementation, in order to protect the security of the new database password and prevent the new database password stored in the application configuration file from being leaked, when executing step S104 and using the new database password to update the original database password stored in the application configuration file of each application server in the application server cluster, the following steps may be specifically performed:

[0096] For each application server in the application server cluster, the application server responds to the third password update operation of the third administrator to update the original database password stored in the application configuration file of the application server using the target hash value input by the third administrator; wherein the target hash value is the hash value of the new database password calculated by the SM3 hash algorithm.

[0097] When executing step S105, the original database password stored in the application memory of the application server is updated using the new database password in the application configuration file of the application server, the following steps may be specifically performed:

[0098] The target hash value in the application configuration file of the application server is used to update the original database password stored in the application memory of the application server.

[0099] After the application server is restarted in step S105, when the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server, the following steps may be specifically performed:

[0100] After the application server is restarted, the access request sent by the application server to the node of the middleware includes the target hash value stored in the application memory of the application server.

[0101] In one possible implementation, after receiving an access request containing a target hash value sent by a restarted application server, if the node has completed the restart, it reads the new database password stored in the memory, performs an SM3 hash algorithm on the new database password, and obtains an SM3 hash value. When the SM3 hash value is the same as the target hash value, the node uses the access request and the new database password stored in the node memory to access the database server; if the node has not completed the restart, it reads the new database password stored in the node configuration file, performs an SM3 hash algorithm on the new database password, and obtains an SM3 hash value. When the SM3 hash value is the same as the target hash value, the node uses the access request and the original database password stored in the node memory to access the database server.

[0102] In one possible implementation, after all application servers in the application server cluster have been restarted, each node in the middleware, after receiving an access request sent by the application server, determines whether the access request carries a new database password. When the access request carries a new database password, the database server is accessed based on the access request and the access connection.

[0103] In this embodiment, when all application servers in the application server cluster are restarted, the access request sent by each application server contains the new database password. At this time, the switch for the middleware to accept the new and old passwords is canceled.

[0104] At this time, each node in the middleware will only respond to the access request containing the new database password. If the access request sent by the application server received by the node at this time carries the original database password, the access request will not be used to access the database server.

[0105] Based on the same technical concept, the present application also provides a database password update system, such as Figure 2 As shown, the database password updating system includes: an application server cluster, middleware and a database server;

[0106] The middleware is used to increase the number of access connections between each node in the middleware and the database server when the original database password in the database server needs to be updated; wherein the node is used to receive the access request sent by the application server, and access the database server according to the access request and the access connection;

[0107] The database server is used to update the original database password in the database server with the new database password;

[0108] The middleware is further used to update the original database password stored in the node configuration file of each node in the middleware using the new database password;

[0109] The middleware is further used to restart each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server;

[0110] The application server cluster is used to update the original database password stored in the application configuration file of each of the application servers in the application server cluster using the new database password;

[0111] The application server cluster is also used to restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the original database password stored in the application memory of the application server is updated with the new database password in the application configuration file of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.

[0112] Optionally, all application servers included in the application server cluster are used to respond to task instructions of the same application; for each task instruction of the application, any application server currently in the application server cluster that is in an activated state responds, so that the application server generates an access request for the task instruction.

[0113] Optionally, when the middleware is used to increase the number of access connections between each node in the middleware and the database server, it is specifically used to:

[0114] Increase the number of access connections between each node in the middleware and the database server to a historical peak number.

[0115] Optionally, when the database server is used to update the original database password in the database server with the new database password, the database server is specifically used to:

[0116] The database server responds to the first password update operation of the first administrator to update the original database password in the database server using the new database password input by the first administrator.

[0117] Optionally, when the middleware is used to update the original database password stored in the node configuration file of each node in the middleware with the new database password, it is specifically used to:

[0118] For each of the nodes in the middleware, the node responds to the second password update operation of the second administrator to update the original database password in the node configuration file of the node using the new database password input by the second administrator.

[0119] Optionally, when the middleware is used to restart each node in the middleware in sequence, it is specifically used to:

[0120] The nodes in the middleware are restarted in sequence according to the preset restart order of each node in the middleware; wherein, after the restart of the currently restarted node is completed, the next sequential node of the node starts to restart.

[0121] Optionally, when the application server cluster is used to update the original database password stored in the application configuration file of each application server in the application server cluster using the new database password, the application server cluster is specifically used to:

[0122] For each of the application servers in the application server cluster, the application server responds to the third password update operation of the third administrator to update the original database password stored in the application configuration file of the application server using the target hash value input by the third administrator; wherein the target hash value is a hash value calculated by the SM3 hash algorithm for the new database password;

[0123] When the application server cluster is used to update the original database password stored in the application memory of the application server using the new database password in the application configuration file of the application server, the application server cluster is specifically used to:

[0124] Using the target hash value in the application configuration file of the application server to update the original database password stored in the application memory of the application server;

[0125] After the application server cluster is restarted, when the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server, it is specifically used to:

[0126] After the application server is restarted, the access request sent by the application server to the node of the middleware includes the target hash value stored in the application memory of the application server.

[0127] Optionally, the middleware is used when, before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server, specifically for:

[0128] After receiving the access request containing the target hash value sent by the restarted application server, if the node has completed the restart, the node reads the new database password stored in the memory, performs SM3 hash algorithm calculation on the new database password to obtain the SM3 hash value, and when the SM3 hash value is the same as the target hash value, the node uses the access request and the new database password stored in the node memory to access the database server; if the node has not completed the restart, the node reads the new database password stored in the node configuration file, performs SM3 hash algorithm calculation on the new database password to obtain the SM3 hash value, and when the SM3 hash value is the same as the target hash value, the node uses the access request and the original database password stored in the node memory to access the database server.

[0129] Optionally, after all the application servers in the application server cluster have been restarted, each node in the middleware is also used to: after receiving an access request sent by the application server, determine whether the access request carries a new database password; when the access request carries a new database password, access the database server according to the access request and the access connection.

[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0131] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0134] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0135] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for updating a database password. It is characterized in that The method is applied to a database password update system; The system comprises: an application server cluster, middleware and a database server; the method comprises: When the original database password in the database server needs to be updated, the number of access connections between each node in the middleware and the database server is increased; wherein the node is used to receive an access request sent by the application server, and access the database server according to the access request and the access connection; Using the new database password, updating the original database password in the database server, and updating the original database password stored in the node configuration file of each node in the middleware; Restarting each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server; Using the new database password, updating the original database password stored in the application configuration file of each application server in the application server cluster; Restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the original database password stored in the application memory of the application server is updated with the new database password in the application configuration file of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.

2. The method according to claim 1, It is characterized in that All application servers contained in the application server cluster are used to respond to task instructions of the same application program; for each task instruction of the application program, any application server currently in the application server cluster that is in the startup state responds so that the application server generates an access request for the task instruction.

3. The method according to claim 1, It is characterized in that The increasing the number of access connections between each node in the middleware and the database server includes: Increase the number of access connections between each node in the middleware and the database server to a historical peak number.

4. The method according to claim 1, It is characterized in that The step of using the new database password to update the original database password in the database server includes: The database server responds to the first password update operation of the first administrator to update the original database password in the database server using the new database password input by the first administrator.

5. The method according to claim 1, It is characterized in that The using of the new database password to update the original database password stored in the node configuration file of each node in the middleware includes: For each of the nodes in the middleware, the node responds to the second password update operation of the second administrator to update the original database password in the node configuration file of the node using the new database password input by the second administrator.

6. The method according to claim 1, It is characterized in that The step of restarting each node in the middleware in sequence includes: The nodes in the middleware are restarted in sequence according to the preset restart order of each node in the middleware; wherein, after the restart of the currently restarted node is completed, the next sequential node of the node starts to restart.

7. The method according to claim 1, It is characterized in that The using the new database password to update the original database password stored in the application configuration file of each application server in the application server cluster includes: For each of the application servers in the application server cluster, the application server responds to the third password update operation of the third administrator to update the original database password stored in the application configuration file of the application server using the target hash value input by the third administrator; wherein the target hash value is a hash value calculated by the SM3 hash algorithm for the new database password; The updating of the original database password stored in the application memory of the application server using the new database password in the application configuration file of the application server comprises: Using the target hash value in the application configuration file of the application server to update the original database password stored in the application memory of the application server; After the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server, including: After the application server is restarted, the access request sent by the application server to the node of the middleware includes the target hash value stored in the application memory of the application server.

8. The method according to claim 7, It is characterized in that After receiving the access request including the target hash value sent by the restarted application server, if the node completes the restart, the node reads the new database password stored in the memory, performs SM3 hash algorithm calculation on the new database password to obtain an SM3 hash value, and when the SM3 hash value is the same as the target hash value, the node uses the access request and the new database password stored in the node memory to access the database server; If the node has not completed the restart, the new database password stored in the node configuration file is read, and the SM3 hash algorithm is performed on the new database password to obtain the SM3 hash value. When the SM3 hash value is the same as the target hash value, the node uses the access request and the original database password stored in the node memory to access the database server.

9. The method according to claim 1, It is characterized in that After all the application servers in the application server cluster have been restarted, each node in the middleware, after receiving the access request sent by the application server, determines whether the access request carries a new database password. When the access request carries a new database password, the database server is accessed according to the access request and the access connection.

10. A database password updating system, It is characterized in that The system includes: an application server cluster, middleware and a database server; The middleware is used to increase the number of access connections between each node in the middleware and the database server when the original database password in the database server needs to be updated; wherein the node is used to receive the access request sent by the application server, and access the database server according to the access request and the access connection; The database server is used to update the original database password in the database server with the new database password; The middleware is further used to update the original database password stored in the node configuration file of each node in the middleware using the new database password; The middleware is further used to restart each node in the middleware in sequence, so that after the node is restarted, the original database password stored in the node memory of the node is refreshed using the new database password in the node configuration file of the node; wherein before the node is restarted, the node uses the access request and the original database password stored in the node memory to access the database server; after the node is restarted, the node uses the access request and the new database password stored in the node memory to access the database server; The application server cluster is used to update the original database password stored in the application configuration file of each of the application servers in the application server cluster using the new database password; The application server cluster is also used to restart the application servers in the application server cluster in sequence, so that after the application server is restarted, the original database password stored in the application memory of the application server is updated with the new database password in the application configuration file of the application server; wherein, before the application server is restarted, the access request sent by the application server to the node of the middleware includes the original database password stored in the application memory of the application server; after the application server is restarted, the access request sent by the application server to the node of the middleware includes the new database password stored in the application memory of the application server.