A method, device and electronic device for setting database parameters

By identifying the issuance of the in-memory database setting request, distinguishing the settings pages of the client and management nodes, and only responding to the setting requests of the boot instructions, solving the system risks caused by the user's arbitrary settings, and achieving the security and stability of parameter settings.

CN114328446BActive Publication Date: 2025-08-01BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111418462.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-08-01
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

The arbitrary nature of users when setting in-memory database parameters leads to system risks, and the prior art cannot effectively reduce this risk.

Method used

By identifying the issuance method of setting request, it is distinguished from the first issuance method based on the client and the second issuance method based on the designated set page of the management node. Only respond to the request of the second issuance method, reject the request of the first issuance method, and use the guidance instructions provided by the management node to reduce risks.

Benefits of technology

It effectively reduces the risk of users when setting in-memory database parameters and ensures the security and stability of parameter settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328446B_ABST
    Figure CN114328446B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, and electronic device for setting database parameters, which are applied to an in-memory database in a computing node. The method includes: receiving a setting request for in-memory database parameters as a target setting request; identifying the sending method of the target setting request; where the sending method includes a first sending method based on a client corresponding to the in-memory database and a second sending method based on a specified setting page, and the specified setting page is a page provided by a management node corresponding to the computing node for a user and having guiding instructions for parameter setting; if it is identified that the sending method of the target setting request is the second sending method, responding to the target setting request; if it is identified that the sending method of the target setting request is the first sending method, refusing to respond to the target setting request. Through this solution, the risk for a user to set parameters of the in-memory database can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, and particularly to a method, apparatus, and electronic device for setting database parameters. Background Art

[0002] Currently, in-memory databases have been widely used in data storage, such as the Redis database. When using an in-memory database in a computing node, a user can directly perform relevant parameter settings on the in-memory database through a client, where the client is also used for read and write operations of the database. However, random parameter settings by the user may pose risks to the system, and prohibiting the user from setting relevant database parameters cannot meet the actual usage requirements.

[0003] Therefore, how to reduce the risk when a user sets parameters of an in-memory database is an urgent problem to be solved. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, apparatus, and electronic device for setting database parameters to reduce the risk when a user sets configuration parameters of an in-memory database. The specific technical solutions are as follows:

[0005] In a first aspect, the embodiments of the present invention provide a method for setting database parameters, which is applied to an in-memory database in a computing node; the method includes:

[0006] Receiving a setting request for database parameters as a target setting request;

[0007] Identifying the sending method of the target setting request; where the sending method includes a first sending method based on a client corresponding to the in-memory database, and a second sending method based on a specified setting page, and the specified setting page is a page provided by a management node corresponding to the computing node for the user and having guiding instructions for parameter settings;

[0008] If it is identified that the sending method of the target setting request is the second sending method, responding to the target setting request to set the in-memory database based on the setting content given in the target setting request;

[0009] If it is identified that the sending method of the target setting request is the first sending method, rejecting to respond to the target setting request.

[0010] Optionally, the in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: the IP address of the sender of any setting request when sending through the second sending method;

[0011] The identifying the sending method of the target setting request includes:

[0012] Identify whether the IP address of the sender of the target setting request is the IP address in the whitelist;

[0013] If so, determine that the sending method of the target setting request is the second sending method; otherwise, determine that the sending method of the target setting request is the first sending method.

[0014] Optionally, the second sending method based on the specified setting page provided by the management node includes:

[0015] The method of sending any setting request from the proxy server to the in-memory database;

[0016] Wherein, the proxy server is located in the computing node, and any setting request is sent by the proxy server after receiving the initial request forwarded by the management node, and the initial request is a request for setting database parameters sent by the user based on the specified setting page;

[0017] Correspondingly, the local IP address of the computing node is included in the whitelist.

[0018] Optionally, the first sending method based on the client corresponding to the in-memory database includes:

[0019] The method of sending any setting request from the client corresponding to the in-memory database to the in-memory database, and any setting request is a request sent by the client when detecting a setting operation of the user for database parameters.

[0020] Optionally, the specified setting page displays configuration guidance information and / or risk description content of database parameters.

[0021] In a second aspect, an embodiment of the present invention provides a database parameter setting device, which is applied to an in-memory database in a computing node; the device includes:

[0022] A receiving module, which receives a setting request for database parameters as a target setting request;

[0023] An identification module, which identifies the sending method of the target setting request; wherein, the sending method includes a first sending method based on the client corresponding to the in-memory database and a second sending method based on a specified setting page, and the specified setting page is a page provided by the management node corresponding to the computing node for the user and having a guiding description for parameter setting;

[0024] A response module, if it identifies that the sending method of the target setting request is the second sending method, responds to the target setting request to set the in-memory database based on the setting content given in the target setting request;

[0025] A rejection module, if it identifies that the sending method of the target setting request is the first sending method, rejects responding to the target setting request.

[0026] Optionally, the in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: when sending any setting request through the second sending method, the IP address of the sender of the setting request;

[0027] The identification module is specifically used for:

[0028] Identifying whether the IP address of the sender of the target setting request is an IP address in the whitelist;

[0029] If so, determining that the sending method of the target setting request is the second sending method, otherwise, determining that the sending method of the target setting request is the first sending method.

[0030] Optionally, the second sending method based on the specified setting page provided by the management node includes:

[0031] The method of sending any setting request from the proxy server to the in-memory database;

[0032] Wherein, the proxy server is located in the computing node, and any setting request is sent by the proxy server after receiving the initial request forwarded by the management node, and the initial request is a request for setting database parameters sent by the user based on the specified setting page;

[0033] Correspondingly, the whitelist includes the local IP address of the computing node.

[0034] Optionally, the first sending method based on the client corresponding to the in-memory database includes:

[0035] The method of sending any setting request from the client corresponding to the in-memory database to the in-memory database, and any setting request is a request sent by the client when detecting a setting operation of the user for database parameters.

[0036] Optionally, the specified setting page displays configuration guidance information and / or risk description content of configurable database parameters.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0038] The memory is used to store a computer program;

[0039] The processor is configured to implement the steps of the above database setting method when executing the program stored on the memory.

[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the above database setting method are implemented.

[0041] The embodiment of the present invention also provides a computer program product including instructions, which when running on a computer, causes the computer to execute the above database parameter setting method.

[0042] Advantages of the embodiment of the present invention:

[0043] In the solution provided by the embodiment of the present invention, when the in-memory database recognizes that the issuing method of the target setting request is the method issued based on the specified setting page, since it is considered that there are guiding instructions for parameter setting in the specified setting page, the randomness of the setting content given by the target setting request is relatively low and the risk is small. Therefore, the target setting request is responded to; while when it is recognized that the issuing method of the target setting request is the method issued based on the client, since it is considered that the randomness of the setting content given by the target setting request may be relatively large and the risk is large, the response to the target setting request is refused. It can be seen that through this solution, the risk of the user setting the parameters of the in-memory database is reduced.

[0044] Of course, implementing any product or method of the present invention does not necessarily need to achieve all the above advantages at the same time. Description of the Drawings

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.

[0046] Figure 1 It is a flowchart of a database parameter setting method provided by an embodiment of the present invention;

[0047] Figure 2 It is another flowchart of a database parameter setting method provided by an embodiment of the present invention;

[0048] Figure 3 The structural schematic diagram of a parameter setting device provided by an embodiment of the present invention;

[0049] Figure 4 The structural schematic diagram of an electronic device provided by an embodiment of the present invention. Specific embodiments

[0050] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art based on this application belong to the scope of protection of the present invention.

[0051] Since the so-called in-memory database refers to a database that caches the data to be accessed in memory. Deploying an in-memory database in any computing node can greatly improve the read and write speed of the computing node. Among them, exemplarily, the in-memory database may include a Redis (Remote Dictionary Server) database, a key-value database with in-memory high-speed caching.

[0052] Currently, in the use of in-memory databases, users can set the parameters of the in-memory database on the client side, so that the client generates and sends a parameter setting request, thereby performing relevant parameter settings on the in-memory database. For example, if a user needs to set the maximum value of the number of logs in the in-memory database to 1024, at this time, the user can enter the config set command on the client page: config set slowlog-max-len 1024. Correspondingly, the client can generate a setting request based on the config set command and send the setting request to the in-memory database in the computing node. Thus, the in-memory database responds to the setting request to set the maximum number of logs to be saved to 1024. Among them, the function of the client is not limited to this, and it is also used for read and write operations of the database.

[0053] However, since users may not be very clear about the relevant principles of various parameters, randomly setting relevant parameters by users on the client side may bring risks to the system. For example, in the above request for setting the maximum number of logs to be saved, if the user sets the number of logs to be saved too large, occupying too much storage space, it will affect the working efficiency of the in-memory database. However, if users are prohibited from setting the relevant parameters of the in-memory database, it cannot meet the usage requirements of users.

[0054] In order to reduce the risks generated when users set the parameters of the in-memory database, an embodiment of the present invention provides a method, device, and electronic device for setting database parameters.

[0055] First, a method for setting database parameters provided by an embodiment of the present invention will be introduced below.

[0056] Among them, a method for setting database parameters provided by an embodiment of the present invention is applied to the in-memory database of a computing node. Exemplarily, the in-memory database can be a Redis database, but of course it is not limited thereto.

[0057] Moreover, the computing node in this embodiment can be a node in the cloud for deploying the in-memory database. Of course, it can also be a node in the local area network for deploying the in-memory database. In addition, a computing node can correspond to a management node, and the management node can manage the computing node. For example, monitor the running status, resource usage, etc. of the computing node.

[0058] A method for setting database parameters provided by an embodiment of the present invention is applied to the in-memory database in a computing node; the method includes:

[0059] Receive a setting request for in-memory database parameters as a target setting request;

[0060] Identify the sending method of the target setting request; wherein, the sending method includes a first sending method based on the client corresponding to the in-memory database, and a second sending method based on a specified setting page. The specified setting page is a page provided by the management node corresponding to the computing node for the user and having guiding instructions for parameter setting.

[0061] If it is identified that the sending method of the target setting request is the second sending method, respond to the target setting request to set the in-memory database based on the setting content given in the target setting request;

[0062] If it is identified that the sending method of the target setting request is the first sending method, reject responding to the target setting request.

[0063] In the solution provided by the embodiment of the present invention, when the in-memory database identifies that the sending method of the target setting request is the method based on the specified setting page, since it is considered that the specified setting page has guiding instructions for parameter setting, the randomness of the setting content given in the target setting request is relatively low and the risk is small. Therefore, the target setting request is responded to; while when it is identified that the sending method of the target setting request is the method based on the client, since it is considered that the randomness of the setting content given in the target setting request may be relatively large and the risk is large, the target setting request is rejected from being responded to. It can be seen that through this solution, the risk when the user sets the parameters of the in-memory database is reduced.

[0064] The following introduces a method for setting database parameters provided by an embodiment of the present invention in conjunction with the accompanying drawings.

[0065] As Figure 1 shown, a method for setting database parameters provided by an embodiment of the present invention is applied to an in-memory cache in-memory database in a computing node; the method includes the following steps:

[0066] S101, receiving a setting request for database parameters as a target setting request;

[0067] Exemplarily, the setting content given by the target setting request includes: the maximum number of logs to be saved, debug error-checking instructions, saving the current data to disk, etc.

[0068] S102, identifying the sending method of the target setting request; wherein, the sending method includes a first sending method based on a client corresponding to the in-memory database, and a second sending method based on a specified setting page, and the specified setting page is a page provided by a management node corresponding to the computing node for users and having guiding instructions for parameter setting;

[0069] In this embodiment, an in-memory database in a computing node corresponds to a client, and users can perform read and write operations on the in-memory database through this client; moreover, this client can also provide an entry for setting database parameters, so that users can set parameters for the in-memory database. For example: users enter the config set command in the page of the client, and correspondingly, the client generates a setting request based on the config set command and sends it to the in-memory database in the computing node.

[0070] And, the management node can provide a specified setting page for users, and specifically, the specified setting page can be provided by a database service component or a database backend control platform pre-deployed in the management node. Through this specified setting page, users can set parameters for the in-memory database in the computing node; in this way, through the transfer of the setting request by the management node, the in-memory database in the computing node can respond to the setting request.

[0071] Based on the above description, it can be known that the target setting request can be sent to the in-memory database by adopting the first sending method: the sending method based on the client, that is, after users enter a setting command for database parameters in the client, the in-memory database receives the target setting request; and the target setting request received by the in-memory database can also be sent to the in-memory database by adopting the second sending method: the sending method based on the specified setting page, that is, after users perform parameter setting in the specified setting page, the in-memory database receives the target setting request.

[0072] When the target setting request is sent through the second sending method, since the setting command is directly input by the user through the client, the randomness of the setting content given by the target setting request is relatively large, and there are relatively high risks. When the target setting request is sent through the second sending method, since the user makes the settings based on the guiding instructions, the randomness is greatly reduced and the risks are also relatively low.

[0073] Therefore, in order to reduce the risks when the user sets the parameters of the in-memory database, after receiving the target setting request, the in-memory database does not directly respond to the target setting request. Instead, it identifies the sending method of the target setting request and performs different operations according to the identification result. It should be noted that in the management node of the server of the present invention, a specified setting page is provided for the user, and the interfaces of the parameters that can be set are placed in the specified setting page. The user directly sets the parameters in the specified setting page without writing the config set instruction, and thus can complete the configuration of the in-memory database parameter setting.

[0074] It should be noted that in order to prevent the risks that may be brought about by the user's random parameter setting, guiding instructions for parameter setting are preset in the specified setting page provided by the management node for the user. Exemplarily, the specified setting page displays configuration guiding information and / or risk description content of the database parameters. The configuration guiding information may be a risk-free configuration range and / or a risky configuration range, and the risk description content may be an indication of whether there is a risk and the specific risk content. The user refers to the configuration guiding content displayed in the specified setting page to set the parameters, so that the risks caused by the set parameters can be effectively avoided. In addition, when the parameters set by the user exceed the risk-free configuration range or are in the risky configuration range, the specified setting page can remind the user of the possible risks or directly reject the generation of the target setting request.

[0075] In addition, it can be understood that the above-mentioned first sending method based on the client corresponding to the in-memory database includes:

[0076] The method of sending any setting request from the client corresponding to the in-memory database to the in-memory database, where any setting request is the request sent by the client when detecting the user's setting operation for the database parameters. For the first sending method, the sender of any setting request is the client.

[0077] There are various above-mentioned second sending methods based on the specified setting page provided by the management node. Exemplarily, in one implementation, the second sending method based on the specified setting page provided by the management node may include: the method of sending any setting request from the management node to the in-memory database. In this implementation, the sender of any setting request is the management node.

[0078] In another implementation, the second sending method based on the specified setting page provided by the management node may include:

[0079] A method of sending any setting request from the proxy server to the in-memory database;

[0080] Wherein, the proxy server is located in the computing node, and any setting request is sent by the proxy server after receiving the initial request forwarded by the management node, and the initial request is a request for setting database parameters sent by the user based on the specified setting page.

[0081] In this implementation, the management node sends any setting request to the proxy server in the computing node, and then the proxy server forwards it to the in-memory database. Among them, the proxy server may also have the following functions: receiving other types of requests sent by the management node to the in-memory database, such as: database creation requests; and monitoring the running status of the in-memory database and reporting it to the management node, and so on.

[0082] There are various specific implementation methods for identifying the sending method of the target setting request. Exemplarily, in one implementation, it can be identified whether the target setting request carries a predetermined character, and the predetermined character is a character added by the management node when relaying the request. For the sake of clear layout and clear solution, the specific implementation method for identifying the sending method of the target setting request will be introduced in combination with other embodiments later.

[0083] S103, if it is identified that the sending method of the target setting request is the second sending method, respond to the target setting request to set the in-memory database based on the setting content given by the target setting request;

[0084] That is, it is identified that the target setting request comes from the specified setting page. The setting content is the content that can be set through the config set command. There are guiding instructions for parameter setting on the specified setting page. Responding to the target setting request from the specified setting page can effectively avoid risks when users set the setting parameters of the in-memory database.

[0085] S104, if it is identified that the sending method of the target setting request is the first sending method, reject responding to the target setting request.

[0086] That is, reject responding to the target setting request from the client.

[0087] In the solution provided by the embodiments of the present invention, when the in-memory database identifies that the issuing manner of the target setting request is the manner issued based on the specified setting page, since it is considered that the specified setting page has guiding instructions for parameter setting, the randomness of the setting content given by the target setting request is relatively low and the risk is relatively small. Therefore, the target setting request is responded to. When it is identified that the issuing manner of the target setting request is the manner issued based on the client, since it is considered that the randomness of the setting content given by the target setting request may be relatively large and the risk is relatively large, the response to the target setting request is refused. It can be seen that through this solution, the risk for users to set parameters of the in-memory database is reduced.

[0088] It can be understood that when the issuing party of any setting request is the client, that is, when any setting request is issued through the first issuing manner, the IP address of the issuing party of the setting request is the IP address of the user side. When any setting request is issued through the second issuing manner, since the transit operation of the management node is required, the issuing party of the setting request can be considered not to be the user side. Specifically: if the second issuing manner includes the manner of the management node issuing any setting request to the in-memory database, the issuing party of the setting request is the management node; if the second issuing manner includes the manner of the proxy server issuing any setting request to the in-memory database, the issuing party of the setting request is the proxy server.

[0089] It can be seen that when any setting request is sent through different issuing manners, the issuing party of the setting request is different, and the IP address is the identification information of the issuing party. Moreover, when the second issuing manner is adopted, the number of issuing parties is limited. Therefore, the IP address of the issuing party when the second issuing manner is adopted can be used as the basis for identifying the issuing manner of any setting request.

[0090] Based on this processing idea, optionally, in another embodiment of the present invention, the in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: the IP address of the issuing party of the setting request when sent through the second issuing manner;

[0091] The identifying the issuing manner of the target setting request includes:

[0092] Identifying whether the IP address of the issuing party of the target setting request is the IP address in the whitelist;

[0093] If so, determining that the issuing manner of the target setting request is the second issuing manner, otherwise, determining that the issuing manner of the target setting request is the first issuing manner.

[0094] In this embodiment, by setting the whitelist, the issuing manner of the target setting request can be quickly and effectively identified.

[0095] Moreover, if the second sending method includes: the method of sending any setting request from the management node to the in-memory database, then the sender of the setting request; correspondingly, the IP address of the management node is included in the whitelist.

[0096] If the second sending method includes: the method of sending any setting request from the proxy server to the in-memory database, then the sender of the setting request is the proxy server; correspondingly, since the proxy server is located in the computing node, the IP address of the computing node is included in the whitelist. In this way, there is no need to know the IP address of the management node in advance, nor to consider the number of management nodes, making the setting of the whitelist more convenient and fast.

[0097] In this embodiment, by identifying whether the IP address of the sender of the target setting request is the IP address in the whitelist, the sending method of the target setting request is identified. In this way, the sending method can be quickly and effectively identified, thereby improving the setting efficiency of the parameters of the in-memory database.

[0098] For the convenience of understanding the database parameter setting method of the present invention, the following is combined with Figure 2 for an exemplary introduction.

[0099] As Figure 2 shown, the user generates a parameter setting instruction for the in-memory database through the specified setting page as the initial setting request. If the user sets a parameter that may cause risks, the specified setting page reminds the user of the possible risks or directly refuses to generate the target setting request.

[0100] After that, the management node forwards the initial setting request to the proxy server, and then the proxy server sends a setting request to the in-memory database according to the initial setting request. The setting content of the target setting request is the same as that of the initial setting request. Since the IP address of the proxy server is the local IP address of the computing node, therefore, the local IP address is preset and stored in the whitelist of the in-memory database. When receiving the target setting request, the in-memory database can determine whether the sending method of the target setting request is: the method sent based on the specified setting page by judging whether the IP address of the source of the target setting request is the local IP. If so, the in-memory database is set according to the setting content given by the target setting request; if not, the target setting request is ignored, that is, the response to the target setting request is refused.

[0101] Through the solution provided by this embodiment, the risk of the user setting the parameters of the in-memory database can be reduced.

[0102] Corresponding to the above method embodiment, the embodiment of the present invention also provides a database parameter setting device, which is applied to the in-memory cache in-memory database in the computing node; as Figure 3As shown in the figure, the device includes:

[0103] A receiving module 310 that receives a setting request for database parameters as a target setting request;

[0104] An identification module 320 that identifies the sending method of the target setting request; wherein, the sending method includes a first sending method based on a client corresponding to the in-memory database, and a second sending method based on a specified setting page, and the specified setting page is a page provided by a management node corresponding to the computing node for a user and having guiding instructions for parameter setting;

[0105] A response module 330 that, if it identifies that the sending method of the target setting request is the second sending method, responds to the target setting request to set the in-memory database based on the setting content given in the target setting request;

[0106] A rejection module 340 that, if it identifies that the sending method of the target setting request is the first sending method, rejects responding to the target setting request.

[0107] Optionally, the in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: the IP address of the sender of any setting request when sending through the second sending method;

[0108] The identification module 320 is specifically configured to:

[0109] Identify whether the IP address of the sender of the target setting request is an IP address in the whitelist;

[0110] If so, determine that the sending method of the target setting request is the second sending method, otherwise, determine that the sending method of the target setting request is the first sending method.

[0111] Optionally, the second sending method based on the specified setting page provided by the management node includes:

[0112] A method of sending any setting request from an agent server to the in-memory database;

[0113] wherein, the agent server is located in the computing node, and any setting request is sent by the agent server after receiving an initial request forwarded by the management node, and the initial request is a request for setting database parameters sent by a user based on the specified setting page;

[0114] Correspondingly, the whitelist includes the local IP address of the computing node.

[0115] Optionally, the first sending method of the client corresponding to the in-memory database includes:

[0116] A method in which the client corresponding to the in-memory database sends any setting request to the in-memory database, where any setting request is a request sent by the client when detecting a user's setting operation for database parameters.

[0117] Optionally, the specified setting page displays configuration guidance information and / or risk description content of configurable database parameters.

[0118] An embodiment of the present invention further provides an electronic device, as Figure 4 shown, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404. Among them, the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404.

[0119] The memory 403 is used to store computer programs;

[0120] The processor 401 is used to implement the above database parameter setting method when executing the program stored on the memory 403.

[0121] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0122] The communication interface is used for communication between the above electronic device and other devices.

[0123] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0124] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may 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 gate or transistor logic devices, discrete hardware components.

[0125] In another embodiment provided by the present invention, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of the above database parameter setting method are implemented.

[0126] In another embodiment provided by the present invention, a computer program product including instructions is further provided. When it runs on a computer, it causes the computer to execute the database parameter setting method in the above embodiment.

[0127] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).

[0128] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0129] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the related content.

[0130] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.

Claims

1. A method for setting database parameters, characterized in that, An in-memory database applied to a computing node; the method includes: Receiving a setting request for database parameters as a target setting request; Identifying the sending mode of the target setting request; wherein, the sending mode includes a first sending mode based on a client corresponding to the in-memory database, and a second sending mode based on a specified setting page, and the specified setting page is a page provided by a management node corresponding to the computing node for a user and having guiding instructions for parameter setting; the first sending mode is: a sending mode in which a config set instruction is written through the client and the setting request corresponding to the written instruction is sent to the in-memory database; If it is identified that the sending mode of the target setting request is the second sending mode, responding to the target setting request to set the in-memory database based on the setting content given by the target setting request; If it is identified that the sending mode of the target setting request is the first sending mode, refusing to respond to the target setting request.

2. The method according to claim 1, wherein The in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: when any setting request is sent through the second sending mode, the IP address of the sender of the setting request; The identifying the sending mode of the target setting request includes: Identifying whether the IP address of the sender of the target setting request is an IP address in the whitelist; If so, determining that the sending mode of the target setting request is the second sending mode, otherwise, determining that the sending mode of the target setting request is the first sending mode.

3. The method according to claim 2, wherein The second sending mode based on the specified setting page provided by the management node includes: A mode in which a proxy server sends any setting request to the in-memory database; Wherein, the proxy server is located in the computing node, and any setting request is sent by the proxy server after receiving an initial request forwarded by the management node, and the initial request is a request sent by a user based on the specified setting page for setting database parameters; Correspondingly, the whitelist includes the local IP address of the computing node.

4. The method according to claim 1, wherein The first sending mode based on the client corresponding to the in-memory database includes: A mode in which a client corresponding to the in-memory database sends any setting request, and any setting request is a request sent by the client when detecting a user's setting operation for database parameters.

5. The method according to any one of claims 1-4, characterized in that, The specified setting page displays configuration guiding information and / or risk description content of database parameters.

6. A database parameter setting device, characterized in that, An in-memory database applied to a computing node; the device includes: A receiving module, which receives a setting request for database parameters as a target setting request; An identification module that identifies the sending method of the target setting request; wherein, the sending method includes a first sending method based on the client corresponding to the in-memory database, and a second sending method based on a specified setting page, and the specified setting page is a page provided by the management node corresponding to the computing node for the user and having guiding instructions for parameter setting; the first sending method is: a sending method in which a config set instruction is written through the client and the setting request corresponding to the written instruction is sent to the in-memory database. A response module that, if it identifies that the sending method of the target setting request is the second sending method, responds to the target setting request to set the in-memory database based on the setting content given in the target setting request. A rejection module that, if it identifies that the sending method of the target setting request is the first sending method, rejects responding to the target setting request.

7. The device according to claim 6, characterized in that, The in-memory database pre-stores a whitelist of IP addresses, where the whitelist includes: when any setting request is sent through the second sending method, the IP address of the sender of the setting request. The identification module is specifically used for: Identifying whether the IP address of the sender of the target setting request is an IP address in the whitelist. If so, determining that the sending method of the target setting request is the second sending method; otherwise, determining that the sending method of the target setting request is the first sending method.

8. The device according to claim 7, characterized in that, The second sending method based on the specified setting page provided by the management node includes: A method in which the proxy server sends any setting request to the in-memory database. Wherein, the proxy server is located in the computing node, and any setting request is sent by the proxy server after receiving the initial request forwarded by the management node, and the initial request is a request for setting database parameters sent by the user based on the specified setting page. Correspondingly, the whitelist includes the local IP address of the computing node.

9. The device according to claim 6, characterized in that The first sending method based on the client corresponding to the in-memory database includes: A method in which the client corresponding to the in-memory database sends any setting request, and any setting request is a request sent by the client when detecting a user's setting operation for database parameters.

10. The device according to any one of claims 6-9, characterized in that, The specified setting page displays configuration guiding information and / or risk description content of configurable database parameters.

11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus. The memory is used to store computer programs. The processor, when executing the programs stored on the memory, implements the method steps described in any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the method steps described in any one of claims 1-5.

Citation Information

Patent Citations

  • System risk dynamic monitoring method and system, computer equipment and storage medium

    CN112491930A

  • Parameter control method and system based on request identifier

    CN113076502A