Database dynamic memory estimation method and device, equipment, medium and product
By obtaining information from the source database and combining the memory processing mechanism of the target database, the dynamic memory requirements of domestic databases are accurately estimated, which solves the problem of difficulty in evaluating dynamic memory in traditional methods, ensuring the reliability and business stability of device selection.
Patent Information
- Application Number
- CN202411817810.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-18
AI Technical Summary
During the database transformation process, traditional methods find it difficult to accurately evaluate the dynamic memory requirements of domestic databases, resulting in the possibility of insufficient memory in the production environment, which will affect business stability and transformation progress.
By obtaining relevant information from the source database, combining the memory processing mechanism of the target database, dynamic memory requirements are estimated, and the server memory specifications of the target database are determined based on this result, providing a reliable basis for device selection.
This method can accurately estimate the dynamic memory requirements of the target database, avoid business interruptions and delays in transformation progress caused by insufficient memory in the production environment, and improve the accuracy and reliability of equipment selection.
Smart Images

Figure CN119645655A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer science and technology, can be applied to the field of financial technology, and in particular to a database dynamic memory estimation method, device, equipment, medium and product. Background Art
[0002] In the current complex international context, traditional databases are transforming to domestic databases, and equipment selection is the first step in the transformation of applications using domestic databases. The selection of equipment depends on the results of performance capacity evaluation, which is a comprehensive evaluation based on CPU, dynamic memory, storage, etc. However, due to the different memory processing mechanisms of traditional databases and domestic databases, it is impossible to evaluate the dynamic memory usage of traditional databases before transformation. Therefore, the evaluation of dynamic memory is a major difficulty in performance capacity evaluation.
[0003] Currently, dynamic memory is evaluated by actual testing in the testing phase. First, domestic database equipment is applied for with reference to traditional server specifications. In the performance testing phase, the overall resource usage is tested to see whether the server memory can support the application business. However, since there are still differences between the business in the test environment and the actual business in the production environment, even if the stress test in the test environment shows that the current server can support the business, there is still a possibility that the memory cannot support it after the actual production is put into production. Summary of the invention
[0004] The present invention provides a database dynamic memory estimation method, device, equipment, storage medium and product, which obtains source database related information and estimates the required dynamic memory in combination with the memory processing mechanism, providing a reliable basis for server selection in the early stage of transformation.
[0005] According to one aspect of the present invention, a method for dynamic memory estimation of a database is provided, comprising:
[0006] Acquire source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of all stored procedures called by a single session;
[0007] Determine the required dynamic memory according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation;
[0008] Determine the server memory specification of the target database based on the required dynamic memory and the server memory occupied by the database.
[0009] According to another aspect of the present invention, a database dynamic memory estimation device is provided, comprising:
[0010] A source database information acquisition module is used to acquire source database information from a source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedure calls by a single session;
[0011] A dynamic memory demand determination module is used to determine the dynamic memory demand according to the source database information, the cache function activation status of the target database, and the memory occupied by code compilation;
[0012] The memory specification determination module is used to determine the server memory specification of the target database according to the required dynamic memory and the server memory occupied by the database.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the database dynamic memory estimation method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the database dynamic memory estimation method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for dynamic database memory estimation according to any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention estimates the required dynamic memory of the target database through the different memory mechanisms of the source database information results, solves the problem of how to estimate the dynamic memory required for data storage when the source data is transformed to the target database, and provides reliable data support for server selection, thereby preventing the situation in which the server memory cannot support the actual business during the testing phase or after it has been produced, and repeated rework is prevented, thereby delaying the entire transformation progress.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a database dynamic memory estimation method provided according to an embodiment of the present invention;
[0023] Figure 2 is a flow chart of a database dynamic memory estimation method provided according to an embodiment of the present invention;
[0024] Figure 3 is a structural block diagram of a database dynamic memory estimation device provided according to an embodiment of the present invention;
[0025] Figure 4 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0028] In addition, it should be noted that the collection, storage, use, processing, transmission, provision and disclosure of database information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0029] Figure 1This is a flowchart of a database dynamic memory estimation method provided according to an embodiment of the present invention. The present invention is applicable to the case of database dynamic memory estimation, and is particularly applicable to the case of dynamic memory estimation for domestic databases during the equipment selection stage during database transformation. The method can be executed by a database dynamic memory estimation device provided by an embodiment of the present invention. The database dynamic memory estimation device can be implemented in the form of hardware and / or software, and can be integrated into an electronic device that carries a dynamic memory estimation function, such as a server. Figure 1 As shown, the method includes:
[0030] S110, obtaining source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedure calls by a single session.
[0031] Among them, the source database is the traditional database that needs to perform data migration; the total number of stored procedure lines is a set of predefined SQL statements, which are the number of code lines used to execute specific tasks or operations. You can choose to manually count or use database management tools to obtain the total number of stored procedure lines; the maximum number of session connections is the maximum limit on the number of sessions that can exist simultaneously in the database system. The maximum number of session connections can be set by modifying the parameters in the corresponding parameter files in different databases; the proportional coefficient of the number of full stored procedures called by a single session is the ratio of the number of stored procedure calls by a single session within a certain period of time to the total number of stored procedure calls by all sessions in the system.
[0032] Specifically, by logging in to the source database, the total number of stored procedure rows corresponding to the source database, the maximum number of session connections, the number of times a single session calls a stored procedure within a certain period of time, and the total number of times all sessions in the system call a stored procedure are obtained; illustratively, assuming that within a certain period of time, all sessions in the system call a total of N stored procedures, among which a certain session calls M stored procedures, then the proportion coefficient corresponding to the session can be expressed as M / N; then the proportion coefficient of the number of calls to all stored procedures by a single session can be determined based on the source database information.
[0033] Optionally, obtain source database information from the source database, including:
[0034] Log in to the source database;
[0035] View and obtain source database information in the form of views.
[0036] Specifically, log in to the source database and query the corresponding view in the source database to view the total number of stored procedure rows involved in the database. By viewing the corresponding view of historical sessions in the source database, you can get the maximum number of online session connections of the database. By viewing the view corresponding to the cache, you can get the maximum number of caches for a single session and the maximum number of caches in each application, and get the proportion coefficient of the number of full stored procedures called by a single session.
[0037] It can be understood that by viewing the corresponding source database information in the form of a view, various information of the source database can be obtained more quickly, vividly and intuitively, thereby improving the efficiency of subsequent estimation of dynamic memory requirements of the source database.
[0038] S120: Determine the required dynamic memory according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation.
[0039] Among them, the target database is a transformed database, which can be a domestic database with functional characteristics, technical advantages and security that meet domestic needs, such as an open database (openGauss); the cache function activation status of the target database includes turning on the global cache or not turning on the global cache; the memory occupied by code compilation includes the memory size occupied by compiling 10,000 lines of code; the required dynamic memory is the dynamic memory size required for the stored procedure call.
[0040] Specifically, the target database is logged in to determine whether the global cache function of the target database is enabled, and based on the global cache function enabling status, the required dynamic memory is determined according to the corresponding source database information and the memory occupied by code compilation.
[0041] It should be noted that the method for querying whether the global cache function is turned on varies depending on the database management system; it can be done by checking the database parameters, or the corresponding database result cache view; for example, in openGauss, it is determined whether the global cache is turned on by querying the global cache parameters (enable_global_plsqlcach); it can be seen that relevant technicians can select a suitable viewing method according to the database management system, and the embodiments of the present invention do not specifically limit this.
[0042] It is understandable that the dynamic memory required by the target database is estimated based on whether the cache function of the target database is enabled; the method is simple and easy to use, does not require performance testing, and is estimated by obtaining relevant information of the source database and combining it with the memory processing mechanism.
[0043] Optionally, after determining the dynamic memory size required for the stored procedure call based on the source database information, the cache function activation status of the target database, and the memory occupied by code compilation, the dynamic memory required for the stored procedure call is further divided by 50% as the required dynamic memory.
[0044] It is understandable that database dynamic memory also includes other operations such as query execution, transaction processing, connection management, etc., so the actual dynamic memory demand needs to further consider these factors and make appropriate adjustments; set the dynamic memory required for stored procedure calls to 50% of the total dynamic memory of the database, and obtain the required dynamic memory by dividing the calculated dynamic memory required for stored procedure calls by 50%. By making appropriate adjustments to the actual dynamic memory demand, the usage of dynamic memory can be accurately estimated, the performance capacity evaluation can be more comprehensive, and a reliable basis for equipment selection can be provided.
[0045] S130. Determine the server memory specification of the target database according to the required dynamic memory and the server memory occupied by the database.
[0046] The server memory occupied by the database is the memory ratio between the database and the server, which can be calculated based on the existing server specifications. It is a fixed percentage value. Based on the required dynamic memory and the server memory ratio of the database, determine the server memory specifications of the target database.
[0047] Optionally, determine the server memory specifications of the target database based on the required dynamic memory and the server memory occupied by the database, including:
[0048] Determine the memory required by the server based on the dynamic memory required and the server memory occupied by the database;
[0049] Determine the server memory specifications for the target database based on the memory required by the server.
[0050] Specifically, the memory required by the server is determined according to the dynamic memory demand and the ratio of the memory required by the database to the server memory, and the server memory specification of the target database is selected according to the memory required by the server, so that the server memory specification is greater than the memory required by the server.
[0051] For example, dividing the required dynamic memory by the memory ratio yields a server memory requirement of 80; then a target database with a server memory specification larger than the server memory requirement can be selected. If the target server has 80, 96, and 120, then a target database with a server memory specification of 96 can be selected.
[0052] It is understandable that the target database should be matched based on the memory required by the server to avoid selecting a device that is too small, which may easily fill up the database resources after the business connects to the target database, causing downtime and the business cannot run normally; or the device is too large, resulting in a waste of resources; improve the efficiency and accuracy of server memory specification selection.
[0053] The embodiment of the present invention obtains source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedures called by a single session; the required dynamic memory is determined according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation; the server memory specification of the target database is determined according to the required dynamic memory and the server memory occupied by the database; the above technical solution solves the problem of how to accurately estimate the dynamic memory required for data storage when the source data is transformed to the target database, and accurately estimates the required dynamic memory of the target database by obtaining the source database information and combining different memory mechanisms; ensures that a reliable basis is provided for server selection in the early stage of transformation, and prevents the situation that the server memory cannot support it in the testing stage or after the actual business has been undertaken in production, and repeated rework is prevented, delaying the entire transformation progress; and only by obtaining relevant information of the source production library and estimating it in combination with the memory processing mechanism, the whole method is simple and easy to use, and does not need to pass performance testing.
[0054] Figure 2 It is a flowchart of a database dynamic memory estimation method provided according to an embodiment of the present invention. In the embodiment of the present invention, based on the above embodiment, the code compilation memory occupancy includes the compilation occupancy of global memory and the compilation session occupancy of memory, or the code cache product occupancy of memory; based on this, the specific determination method for determining the required dynamic memory is supplemented. It should be noted that for the part not described in detail in the embodiment of the present invention, please refer to the relevant description of other embodiments. Figure 2 As shown, the method includes:
[0055] S210, obtaining source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedures called by a single session.
[0056] S220: If the cache function of the target database is enabled, the required dynamic memory is determined according to the source database information, the global memory occupied by the compilation, and the memory occupied by the compilation session.
[0057] Among them, when the cache function of the target database is turned on and the database is in global cache state, the dynamic memory occupied by multiple sessions calling stored procedures can be shared, and the memory space occupied by multiple sessions needs to be calculated; the global memory occupied by compilation is the average memory size occupied in the global cache after 10,000 lines of code are compiled, which can be obtained as a fixed value through the actual editing and calling results of pilot applications; the memory occupied by compiled sessions is the average memory size occupied by a single session after 10,000 lines of code are compiled, which can be obtained as a fixed value through the actual editing and calling results of pilot applications.
[0058] Specifically, the required dynamic memory is calculated through source database information, the memory size occupied by 10,000 lines of code compiled in the global cache, and the memory size occupied by a single session after the average 10,000 lines of code are compiled.
[0059] Optionally, determine the required dynamic memory based on the source database information, the global memory occupied by the compilation, and the memory occupied by the compilation session, including:
[0060] Determine the global cache based on the total number of stored procedure rows and the global memory occupied by compilation;
[0061] Determine the first session-level cache based on the total number of stored procedure rows, the ratio coefficient of the number of full stored procedure calls by a single session, and the memory occupied by the compiled session;
[0062] Determine a first session cache according to the first session level cache and the maximum number of session connections;
[0063] The required dynamic memory is determined based on the global cache and the first session cache.
[0064] Specifically, the product of the total number of stored procedure lines in the acquired source database information and the average memory size occupied in the global cache after 10,000 lines of code are compiled is used as the global cache value; the average memory size occupied in the global cache after 10,000 lines of code are compiled is the average value of the memory size occupied in the global cache after 10,000 lines of code are compiled; the product of the proportion coefficient of the total number of stored procedure lines in the source database information and the number of full stored procedure calls in a single session and the memory occupied by the compiled session is used as the first session-level cache; the product of the first session-level cache and the maximum number of session connections in the source database information is used as the first session cache; the global cache and the first session cache are summed, and the sum result is used as the dynamic memory value required by the database when the global cache is enabled.
[0065] It is understandable that after the global cache is enabled, the required dynamic memory is estimated based on the source database information, the global memory occupied by the compilation, and the memory occupied by the compilation session to improve the accuracy of the memory estimation.
[0066] S230: If the cache function of the target database is not enabled, determine the required dynamic memory based on the source database information and the memory occupied by the code cache product.
[0067] Among them, the cache function of the target database is not enabled, and there is no global cache function. The session-level memory management mechanism is adopted, and each session that calls the stored procedure occupies dynamic memory. Therefore, it is only necessary to calculate the memory space occupied by a single session. The memory occupied by the code cache product is the average memory occupied by the cache product of 10,000 lines of code.
[0068] Specifically, when the cache function is not enabled, that is, the database does not have a global cache function, the required dynamic memory is obtained based on the source database information and the memory occupied by the code cache product.
[0069] Optionally, determine the required dynamic memory based on the source database information and the memory occupied by the code cache product, including:
[0070] Determine the second session-level cache based on the total number of stored procedure rows, the ratio coefficient of the number of full stored procedure calls in a single session, and the memory occupied by the code cache product;
[0071] Determine the required dynamic memory based on the second session level cache and the maximum number of session connections.
[0072] Among them, the memory occupied by the code cache product is the average memory occupied by the cache product of 10,000 lines of code, which can be obtained through the actual editing and calling results of the pilot application and is a fixed value.
[0073] The second session-level cache is determined based on the product of the total number of stored procedure rows in the source database information and the ratio coefficient of the number of all stored procedure calls in a single session, and the memory occupied by the code cache products; the required dynamic memory is determined based on the product of the second session-level cache and the maximum number of session connections in the source database information library.
[0074] Exemplarily, when the cache function is not enabled, the dynamic memory size required for the stored procedure call is the product of the session-level cache and the number of session connections, specifically the product of the total number of stored procedure rows, the proportional coefficient of the number of full stored procedure calls by a single session, the maximum number of session connections, and the memory occupied by the average cache product per ten thousand lines of code. The required dynamic memory value is calculated.
[0075] It can be understood that the dynamic memory estimation method for demand without enabling global cache is determined based on the product of session-level cache and the number of session connections, thereby improving the accuracy of memory estimation.
[0076] S240. Determine the server memory specification of the target database according to the required dynamic memory and the server memory occupied by the database.
[0077] The embodiment of the present invention obtains information such as the number of stored procedure rows contained in the target library, the maximum number of business connection sessions, the proportion of sessions calling stored procedures, etc., and combines different dynamic memory processing mechanisms to sort out a set of dynamic memory estimation methods to ensure that the usage of dynamic memory can be accurately estimated during the database transformation process, providing a reliable basis for equipment selection.
[0078] Figure 3: is a structural block diagram of a database dynamic memory estimation device provided according to an embodiment of the present invention. The present invention is applicable to the case of database dynamic memory estimation, and is particularly applicable to the case of dynamic memory estimation for domestic databases during the equipment selection stage during database transformation. The database dynamic memory estimation device can be implemented in the form of hardware and / or software, and can be integrated into an electronic device that carries the dynamic memory estimation function, such as a server. Figure 3 As shown, the database dynamic memory estimation device 300 includes a source database information acquisition module 310 , a required dynamic memory determination module 320 , and a memory specification determination module 330 .
[0079] The source database information acquisition module 310 is used to acquire source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedure calls by a single session;
[0080] The dynamic memory demand determination module 320 is used to determine the dynamic memory demand according to the source database information, the cache function activation status of the target database, and the memory occupied by code compilation;
[0081] The memory specification determination module 330 is used to determine the server memory specification of the target database according to the required dynamic memory and the server memory occupied by the database.
[0082] The embodiment of the present invention obtains source database information from the source database; the source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedures called by a single session; the required dynamic memory is determined according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation; the server memory specification of the target database is determined according to the required dynamic memory and the server memory occupied by the database; the above technical solution solves the problem of how to accurately estimate the dynamic memory required for data storage when the source data is transformed to the target database, and accurately estimates the required dynamic memory of the target database by obtaining the source database information and combining different memory mechanisms; ensures that a reliable basis is provided for server selection in the early stage of transformation, and prevents the situation that the server memory cannot support it in the testing stage or after the actual business has been undertaken in production, and repeated rework is prevented, delaying the entire transformation progress; and only by obtaining relevant information of the source production library and estimating it in combination with the memory processing mechanism, the whole method is simple and easy to use, and does not need to pass performance testing.
[0083] Optionally, the memory occupied by code compilation includes the memory occupied by global memory and compilation session, or the memory occupied by code cache products;
[0084] Correspondingly, the required dynamic memory determination module 320 is specifically used to determine the required dynamic memory based on the source database information, the global memory occupied by compilation, and the memory occupied by the compilation session if the cache function of the target database is turned on; if the cache function of the target database is not turned on, the required dynamic memory is determined based on the source database information and the memory occupied by the code cache product.
[0085] Optionally, a dynamic memory demand determination module 320 is specifically used to determine the global cache according to the total number of rows of the stored procedure and the global memory occupied by the compilation;
[0086] Determine the first session-level cache based on the total number of stored procedure rows, the ratio coefficient of the number of full stored procedure calls by a single session, and the memory occupied by the compiled session;
[0087] Determine a first session cache according to the first session level cache and the maximum number of session connections;
[0088] The required dynamic memory is determined based on the global cache and the first session cache.
[0089] Optionally, a dynamic memory demand determination module 320 is specifically used to determine the second session level cache according to the total number of stored procedure rows, the ratio coefficient of the number of full stored procedure calls by a single session, and the memory occupied by the code cache product;
[0090] Determine the required dynamic memory based on the second session level cache and the maximum number of session connections.
[0091] Optionally, the memory specification determination module 330 includes a required memory determination unit and a memory specification determination unit:
[0092] A required memory determination unit is used to determine the memory required by the server according to the dynamic memory required and the server memory occupied by the database;
[0093] The memory specification determining unit is used to determine the server memory specification of the target database according to the memory required by the server.
[0094] The source database information acquisition module 310 is specifically used to log in to the source database; and to view and acquire the source database information in the form of views.
[0095] The device provided by the embodiment of the present invention can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0096] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.
[0097] Figure 41 is a block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0098] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0099] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a database dynamic memory estimation method.
[0101] In some embodiments, the database dynamic memory estimation method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the scenario simulation method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the database dynamic memory estimation method in any other appropriate manner (for example, by means of firmware).
[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0103] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0105] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0106] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0107] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0108] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0109] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A database dynamic memory estimation method, characterized in that: include: Obtain source database information from the source database; The source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedure calls by a single session; Determine the required dynamic memory according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation; Determine the server memory specification of the target database based on the required dynamic memory and the server memory occupied by the database.
2. The method according to claim 1, characterized in that The memory occupied by code compilation includes the memory occupied by compilation global memory and compilation session memory, or the memory occupied by code cache products; Accordingly, the required dynamic memory is determined according to the source database information, the activation status of the cache function of the target database, and the memory occupied by code compilation, including: If the cache function of the target database is enabled, the required dynamic memory is determined according to the source database information, the global memory occupied by compilation, and the memory occupied by compilation session; If the cache function of the target database is not enabled, the required dynamic memory is determined according to the source database information and the memory occupied by the code cache product.
3. The method according to claim 2, characterized in that Determine the required dynamic memory according to the source database information, the global memory occupied by the compilation, and the memory occupied by the compilation session, including: Determine a global cache according to the total number of rows of the stored procedure and the global memory occupied by the compilation; Determining a first session-level cache according to the total number of rows of the stored procedure, the ratio coefficient of the number of all stored procedures called by the single session, and the memory occupied by the compiled session; Determine a first session cache according to the first session level cache and the maximum number of session connections; The required dynamic memory is determined according to the global cache and the first session cache.
4. The method according to claim 2, characterized in that: Determine the required dynamic memory according to the source database information and the memory occupied by the code cache product, including: Determining a second session-level cache according to the total number of rows of the stored procedure, the ratio coefficient of the number of calls to the full stored procedure by the single session, and the memory occupied by the code cache product; The required dynamic memory is determined according to the second session level cache and the maximum number of session connections.
5. The method according to claim 1, characterized in that Determine the server memory specifications of the target database based on the required dynamic memory and the server memory occupied by the database, including: Determine the memory required by the server according to the required dynamic memory and the server memory occupied by the database; Determine the server memory specification of the target database based on the memory required by the server.
6. The method according to claim 1, characterized in that Obtain source database information from the source database, including: Log in to the source database; View and obtain the source database information in the form of views.
7. A database dynamic memory estimation device, characterized in that: include: A source database information acquisition module is used to acquire source database information from a source database; The source database information includes the total number of stored procedure rows, the maximum number of session connections, and the ratio coefficient of the number of full stored procedure calls by a single session; A dynamic memory demand determination module is used to determine the dynamic memory demand according to the source database information, the cache function activation status of the target database, and the memory occupied by code compilation; The memory specification determination module is used to determine the server memory specification of the target database according to the required dynamic memory and the server memory occupied by the database.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the database dynamic memory estimation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the database dynamic memory estimation method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the database dynamic memory estimation method according to any one of claims 1 to 6.