Data access method and device, electronic equipment and computer readable storage medium
By dividing the database buffer pool into sub-buffer pools and using sub-control locks and counters, the problem of linear search efficiency of database buffer pools is solved, and the database access rate and efficiency are improved.
Patent Information
- Application Number
- CN202510585457.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
AI Technical Summary
The linear search efficiency of traditional database buffer pools significantly decreases when the scale increases and concurrent transactions increase, affecting database performance.
The buffer pool of the database management system is divided into multiple sub-buffer pools. Each sub-buffer pool is configured with a sub-control lock and counter, filters the target sub-buffer pool through metadata access request information, and transfers the data segment to the protection segment interval when the number of accesses reaches the threshold.
It improves the access rate of the database, avoids the problem of degradation in linear search efficiency, and improves the efficiency and reliability of data access.
Smart Images

Figure CN120448428A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to, but are not limited to, the field of data access, and in particular to a data access method, device, electronic device, and computer-readable storage medium. Background Art
[0002] With the rapid development of society and the economy, intelligent systems are increasingly being used to manage related matters. For example, in the insurance sector, insurance business systems can be used to coordinate the management of related insurance businesses. Each intelligent system requires a database management system to manage relevant system data, and generally also uses a buffer pool to manage certain types of metadata, such as storing transaction logs and transaction status information. The buffer pool facilitates rapid data exchange between memory and disk. However, with the continuous expansion of database size and the increase in concurrent transactions, the size of the buffer pool is also increasing. Traditional buffer pools require linear search for buffer replacement. Therefore, the increase in buffer pool size significantly reduces the efficiency of linear search in the buffer pool, thereby affecting the overall performance of the database. Summary of the Invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] In order to solve the problems mentioned in the above background technology, the embodiments of the present application provide a data access method, device, electronic device and computer-readable storage medium to solve the problem of reduced linear search efficiency and improve the data access rate.
[0005] In a first aspect, an embodiment of the present application provides a data access method applied to a database management system buffer pool, wherein the database management system buffer pool includes multiple sub-buffer pools, each of which is configured with a sub-control lock and a counter, the method comprising:
[0006] Get metadata access request information;
[0007] Determining control lock mask information and metadata read mark information according to the metadata access request information;
[0008] Filtering a target sub-buffer pool from a plurality of sub-buffer pools according to the control lock mask information and the sub-control lock;
[0009] Reading a target data segment from the target sub-buffer pool according to the metadata read mark information;
[0010] Calculating the number of accesses to the target data segment according to the counter to obtain the number of data accesses;
[0011] When the number of data accesses reaches a preset threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool.
[0012] In a second aspect, an embodiment of the present application further provides a data access device, characterized in that it is applied to a database management system buffer pool, the database management system buffer pool includes multiple sub-buffer pools, each of the sub-buffer pools is configured with a sub-control lock and a counter, and the device includes:
[0013] An acquisition unit, used to acquire metadata access request information;
[0014] an extraction unit, configured to determine and obtain control lock mask information and metadata read mark information according to the metadata access request information;
[0015] a screening unit, configured to screen a target sub-buffer pool from a plurality of sub-buffer pools according to the control lock mask information and the sub-control lock;
[0016] a reading unit, configured to read a target data segment from the target sub-buffer pool according to the metadata reading mark information;
[0017] a calculation unit, configured to calculate the number of accesses to the target data segment according to the counter to obtain a number of data accesses;
[0018] The transfer unit is configured to transfer the target data segment to a protection segment interval of the database management system buffer pool when the number of data accesses reaches a preset number threshold.
[0019] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data access method as described in the first aspect above is implemented.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the data access method described in the first aspect above.
[0021] The data access method according to the embodiment provided by the present application has at least the following beneficial effects: a database management system buffer pool is divided into multiple sub-buffer pools, and each sub-buffer is configured with a sub-control lock and a counter; during data access, metadata access request information is first obtained; control lock mask information and metadata read flag information are then determined based on the metadata access request information; a target sub-buffer pool is then screened from the multiple sub-buffer pools based on the control lock mask information and the sub-control lock; a target data segment is then read from the target sub-buffer pool based on the metadata read flag information; the number of accesses to the target data segment is then calculated based on the counter to obtain the number of data accesses; and finally, when the number of data accesses reaches a predetermined number threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool. Through the above technical solution, the database management system buffer pool is divided into multiple sub-buffer pools, and the target sub-buffer pool can be screened from the multiple sub-buffer pools based on the control lock mask information and the sub-control lock, eliminating the need for linear search through the database management system buffer pool as in the past, thereby solving the problem of reduced linear search efficiency and improving the database access rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to provide a further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0023] Figure 1 This is a flowchart of a data access method provided by an embodiment of the present application;
[0024] Figure 2 yes Figure 1 A schematic flow chart of a specific implementation of step S200;
[0025] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S300;
[0026] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S400;
[0027] Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S500;
[0028] Figure 6 yes Figure 5 A flowchart of a specific implementation of step S600;
[0029] Figure 7 It is executed Figure 6 A schematic diagram of a specific implementation flow chart after step S630;
[0030] Figure 8 is a schematic diagram of a data access device provided by an embodiment of the present application;
[0031] Figure 9 This is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0033] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, used in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0034] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0035] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0036] AI is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Artificial intelligence is a branch of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. Artificial intelligence can simulate the information processes of human consciousness and thinking. It also refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0037] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0038] Artificial intelligence, or AI, is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0039] The servers involved in artificial intelligence technology can be independent servers or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.
[0040] The present application provides a data access method, device, electronic device and computer-readable storage medium, which divides a database management system buffer pool into multiple sub-buffer pools, and each sub-buffer is configured with a sub-control lock and a counter; in the process of data access, metadata access request information is first obtained; then, control lock mask information and metadata read mark information are determined based on the metadata access request information; then, a target sub-buffer pool is obtained by screening from multiple sub-buffer pools based on the control lock mask information and the sub-control lock; then, a target data segment is read from the target sub-buffer pool based on the metadata read mark information; then, the number of accesses to the target data segment is calculated and processed based on the counter to obtain the number of data accesses; finally, when the number of data accesses reaches a pre-set number threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool. Through the above technical solution, the database management system buffer pool is divided into multiple sub-buffer pools, and the target sub-buffer pool can be obtained by screening from multiple sub-buffer pools based on the control lock mask information and the sub-control lock, eliminating the need to perform linear search through the database management system buffer pool as in the past, solving the problem of reduced linear search efficiency and improving the access rate of the database.
[0041] The data access method provided in the embodiment of the present application relates to the field of data access. The data access method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0042] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0043] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0044] The embodiments of the present application are further described below with reference to the accompanying drawings.
[0045] like Figure 1 As shown, Figure 1 This is a flow chart of a data access method provided by an embodiment of the present application, which includes the following steps:
[0046] Step S100: Obtain metadata access request information.
[0047] The data access method provided in the embodiment of the present application first obtains metadata access request information during the data access process; for example, in an insurance business system, during the process of viewing and processing the detailed information of a certain insurance product, a metadata access request information will be generated in the insurance business system to query and process the detailed information of the insurance product; for another example, in a smart medical system, during the process of viewing and processing the registration information of a hospital, a metadata access request information will be generated in the smart medical system to query and process the registration information in the smart medical system.
[0048] It is worth noting that in order to improve the efficiency of data reading and reduce the number of times data is directly read from the hard disk, the relevant data can be stored in the database management system buffer pool so that data can be read from the database management system buffer pool later, thereby speeding up the data reading efficiency. For example, in the smart medical system, the database metadata of the smart medical system will also be stored in the database management system buffer pool. When the database storage transaction log needs to be queried and processed, the relevant data in the database management system buffer pool of the smart medical system can also be accessed and processed based on the metadata access request information obtained. For another example, in the insurance business system, the database metadata of the insurance business system will also be stored in the database management system buffer pool. When the database transaction status information needs to be queried and processed, the relevant data in the database management system buffer pool of the insurance business system can also be accessed and processed based on the metadata access request information obtained.
[0049] It should be noted that the data access method of the embodiment of the present application is applied to a database management system buffer pool, and the database management system buffer pool is divided into multiple sub-buffer pools, each of which is configured with a sub-control lock and a counter; the database management system buffer pool is divided into multiple sub-buffer pools, and in the later stage of data access, a target sub-buffer pool is first selected from the multiple sub-buffer pools, and then a linear search is performed on the corresponding target sub-buffer pool. Therefore, unlike the previous method of only being able to perform a linear search on the entire database management system buffer pool, the data access efficiency can be greatly accelerated, and the reading efficiency will not decrease due to the increase in data size.
[0050] It's worth noting that each sub-buffer pool is configured with a sub-control lock. This lock prevents data from being overwritten during reads, ensuring more accurate and reliable data reads. A counter is used to count the number of accesses to relevant data in the sub-buffer pool, paving the way for subsequent data transfers.
[0051] Step S200: Determine and obtain control lock mask information and metadata read mark information according to metadata access request information.
[0052] The data access method provided in an embodiment of the present application can, after obtaining metadata access request information, determine control lock mask information and metadata read tag information based on the metadata access request information to prepare for subsequent data access. The control lock mask information is used to select a corresponding target sub-buffer pool from multiple sub-buffer pools. For example, the database management system buffer pool includes four sub-buffer pools, namely the first sub-buffer pool, the second sub-buffer pool, the third sub-buffer pool, and the fourth sub-buffer pool. Each bit of the control lock mask information represents a sub-buffer pool. For example, if the control lock mask information is "0100," the second sub-buffer pool is selected; if the control lock mask information is "0001," the fourth sub-buffer pool is selected. The metadata read tag information is used to read and process the corresponding data from the target sub-buffer pool.
[0053] It is worth noting that in the process of determining the control lock mask information and the metadata read mark information based on the metadata access request information, the sub-buffer pool in the database management system buffer pool can be accurately determined through the control lock mask information, and the corresponding data can be accurately determined from the sub-buffer pool based on the metadata read mark information.
[0054] like Figure 2 As shown, determining the control lock mask information and metadata read mark information according to the metadata access request information may include the following steps:
[0055] Step S210: Splitting the metadata access request information to obtain multiple information blocks;
[0056] Step S220 , filtering the plurality of information blocks according to the preset mask mark to obtain control lock mask information; and filtering the plurality of information blocks according to the preset data mark to obtain metadata reading mark information.
[0057] In steps S210 to S220, when determining the control lock mask information and metadata read flag information based on the metadata access request information, the metadata access request information is first split into multiple information blocks; then, the control lock mask information is filtered from the multiple information blocks based on a predetermined mask flag; and finally, the metadata read flag information is filtered from the multiple information blocks based on a predetermined data flag. This technical solution accurately determines the control lock mask information and metadata read flag information from the metadata access request information, preparing for subsequent metadata access.
[0058] For example, in a smart medical system, when system maintenance personnel need to view the storage transaction log of the database of the smart medical system, corresponding metadata access request information will be generated in the smart medical system; then the corresponding metadata access request information can be split and processed to obtain multiple information blocks, and then the control lock mask information can be filtered from the multiple information blocks obtained by splitting according to a preset mask tag, and the metadata reading tag information can be filtered from the multiple information blocks according to a preset data tag; then the corresponding sub-buffer pool can be selected from the multiple sub-buffer pools of the smart medical system according to the control lock mask information, and the corresponding data can be selected from the corresponding sub-buffer pool according to the data reading tag.
[0059] For example, in an insurance business system, when system maintenance personnel need to view and process transaction status information of a database of the insurance business system, corresponding metadata access request information will also be generated in the insurance business system; then, the corresponding metadata access request information can be split and processed to obtain multiple information blocks, and then, control lock mask information can be filtered from the multiple information blocks obtained by splitting according to a preset mask tag, and metadata reading tag information can be filtered from the multiple information blocks according to a preset data tag; then, a corresponding sub-buffer pool can be selected from multiple sub-buffer pools of the insurance business system according to the control lock mask information, and corresponding data can be selected from the corresponding sub-buffer pool according to the data reading tag.
[0060] It is worth noting that both the mask mark and the data mark can be pre-set. According to the pre-set mask mark, the control lock mask information can be filtered out from multiple information blocks; according to the pre-set data mark, the metadata reading mark information can be filtered out from multiple information blocks.
[0061] Step S300: Filtering a target sub-buffer pool from multiple sub-buffer pools according to the control lock mask information and the sub-control lock.
[0062] The data access method provided in the embodiment of the present application can, after determining the control lock mask information based on the metadata access request information, filter out the corresponding target sub-buffer pool from multiple sub-buffer pools based on the control lock mask information and each sub-control lock, in preparation for subsequent data reading.
[0063] It's worth noting that each sub-control lock corresponds to a sub-buffer pool. Therefore, based on the control lock mask information and the sub-control lock, the corresponding sub-control lock can be selected, and then the corresponding sub-buffer pool can be used as the target sub-buffer pool. For example, the database management system buffer pool includes four sub-buffer pools: the first sub-buffer pool, the second sub-buffer pool, the third sub-buffer pool, and the fourth sub-buffer pool. When the control lock mask information is "0010," the sub-control lock corresponding to the third sub-buffer pool is selected, meaning the third sub-buffer pool is used as the target sub-buffer pool.
[0064] like Figure 3 As shown, screening a target sub-buffer pool from multiple sub-buffer pools according to the control lock mask information and the sub-control lock may include the following steps:
[0065] Step S310, determining the control lock sequence information from multiple sub-control locks;
[0066] Step S320: determining a target sub-control lock from multiple sub-control locks according to the control lock mask information and the control lock sequence number information;
[0067] Step S330: Determine the sub-buffer pool corresponding to the target sub-control lock as the target sub-buffer pool.
[0068] In steps S310 to S330, when selecting a target sub-buffer pool from multiple sub-buffer pools based on the control lock mask information and the sub-control locks, the control lock sequence information is first determined from the multiple sub-control locks. Then, the target sub-control lock is determined from the multiple sub-control locks based on the control lock mask information and the control lock sequence information. Finally, the sub-buffer pool corresponding to the target sub-control lock is determined as the target sub-buffer pool. This technical solution allows for accurate and rapid determination of the target sub-buffer pool, preparing for subsequent data reading.
[0069] For example, a database management system buffer pool includes four sub-buffer pools, namely, a first sub-buffer pool, a second sub-buffer pool, a third sub-buffer pool, and a fourth sub-buffer pool. The sub-control lock of the first sub-buffer pool has a control lock sequence number of "1," the sub-control lock of the second sub-buffer pool has a control lock sequence number of "2," the sub-control lock of the third sub-buffer pool has a control lock sequence number of "3," and the sub-control lock of the fourth sub-buffer pool has a control lock sequence number of "4." The high bit to the low bit of the control lock mask information represents sub-control locks with control lock sequence numbers from small to large. When the control lock mask information is "0100," the sub-control lock with control lock sequence number "2" is selected as the target sub-control lock. When the control lock mask information is "1000," the sub-control lock with control lock sequence number "1" is selected as the target sub-control lock. When the target sub-control lock is determined to be obtained, the sub-buffer pool corresponding to the target sub-control lock can be used as the target sub-buffer pool.
[0070] Step S400: Reading a target data segment from a target sub-buffer pool according to metadata read mark information.
[0071] The data access method provided in the embodiment of the present application determines control lock mask information and metadata read tag information based on metadata access request information, and after screening a target sub-buffer pool from multiple sub-buffer pools based on the control lock mask information and the sub-control lock, the target data segment can be read from the target sub-buffer pool based on the metadata read tag information. Through the above technical solution, the target data segment can be obtained accurately and quickly.
[0072] It is worth noting that in the process of reading the target data segment from the target sub-buffer pool according to the metadata reading mark information, the data reading interval can be determined from the metadata reading mark information. Subsequently, the target data segment can be read from the target sub-buffer pool according to the data reading interval. The entire data reading process is simple, fast and reliable.
[0073] like Figure 4 As shown, reading the target data segment from the target sub-buffer pool according to the metadata read tag information may include the following steps:
[0074] Step S410, determining a data reading interval from metadata reading mark information;
[0075] Step S420 : Read the target data segment from the target sub-buffer pool according to the data reading interval.
[0076] In steps S410 to S420, in the process of reading the target data segment from the target sub-buffer pool based on the metadata read tag information, the data read interval is first determined from the metadata read tag information; then, the target data segment is read from the target sub-buffer pool based on the data read interval. Through the above technical solution, the target data segment can be read from the target sub-buffer pool simply, quickly, and accurately, and the entire process is safe, fast, and reliable.
[0077] For example, in a smart medical system, multiple sub-buffer pools are used to store and process metadata of a database of the smart medical system. After determining a target sub-buffer pool, for example, if the data reading interval is
[001] -
[050] , relevant data will be read and processed from the data reading interval
[001] -
[050] of the target sub-buffer pool, and the data in the data reading interval
[001] -
[050] can be used as the target data segment. For another example, in an insurance business system, multiple sub-buffer pools are used to store and process metadata of a database of the insurance business system. After determining a target sub-buffer pool, for example, if the data reading interval is
[010] -
[070] , relevant data will be read and processed from the data reading interval
[010] -
[070] of the target sub-buffer pool, and the data in the data reading interval
[010] -
[070] can be used as the target data segment.
[0078] Step S500: Calculate the number of accesses to the target data segment according to the counter to obtain the number of data accesses.
[0079] The data access method provided in the embodiment of the present application, when reading a target data segment from a target sub-buffer pool according to metadata read tag information, also uses a counter to calculate the number of accesses to the target data segment to obtain a corresponding data access count; subsequently, the corresponding target data segment can be transferred based on the data access count. The transfer process of the target data segment transfers the relevant data to the protection segment interval of the database management system buffer pool, and subsequently, the data can be directly read from the protection segment interval of the database management system buffer pool, thereby improving data access efficiency.
[0080] It is worth noting that the counter can calculate the number of times the target data segment is accessed, and then the data access number can be compared with a pre-set number threshold; when the data access number reaches the pre-set number threshold, the target data segment will be transferred to the protection segment interval of the database management system buffer pool; among them, when the data segment is stored in the protection segment interval of the database management system buffer pool, the data segment in the protection segment interval will not be frequently changed and modified, making subsequent data reading easier and faster.
[0081] like Figure 5 As shown, calculating the number of accesses to the target data segment according to the counter to obtain the number of data accesses may include the following steps:
[0082] Step S510, capturing the number of accesses to the target data segment to obtain the number of captured operations;
[0083] Step S520 , updating and adjusting the count value of the counter according to the number of operation capture times to obtain the number of data access times.
[0084] In steps S510 to S520, when calculating the number of accesses to the target data segment based on the counter to obtain the data access count, the target data segment access count is first captured to obtain the operation capture count; then, the counter value is updated and adjusted based on the operation capture count to obtain the data access count. Through the above technical solution, the corresponding data access count can be accurately calculated using the counter.
[0085] For example, in a smart healthcare system, when a system maintenance person needs to view and process a database's stored transaction log, the access count for the relevant data segment is calculated; when another system maintenance person continues to view and process the database's stored transaction log, the counter is updated again for the access count for the relevant data segment; when the data access count reaches a pre-set threshold, the relevant data segment is transferred to a protected segment of the database management system's buffer pool, and this portion of data is not frequently modified, allowing subsequent rapid access to this portion of data. For another example, in an insurance business system, when a system maintenance person needs to view and process database transaction status information, the access count for the relevant data segment is calculated; when another system maintenance person continues to view and process the database's transaction status information, the counter is updated again for the access count for the relevant data segment; when the data access count reaches a pre-set threshold, the relevant data segment is transferred to a protected segment of the database management system's buffer pool, and this portion of data is not frequently modified, allowing subsequent rapid access to this portion of data.
[0086] It is worth noting that the number of accesses to the target data segment can be captured to obtain the number of operation captures; finally, the count value of the counter can be updated and adjusted based on the number of operation captures to obtain the corresponding number of data accesses. Through the above technical solution, the counting process of the counter can be made more accurate.
[0087] Step S600: When the number of data accesses reaches a preset threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool.
[0088] The data access method provided in the embodiment of the present application calculates and processes the number of accesses to the target data segment according to the counter to obtain the number of data accesses. Then, when the number of data accesses reaches a preset threshold, the target data segment can be transferred to the protection segment interval of the database management system buffer pool to perform protection processing on the target data segment. The data in the protection segment interval of the database management system buffer pool will not be frequently changed, so that related data can be quickly queried and accessed subsequently.
[0089] It is worth noting that the database management system buffer pool includes a test segment interval and a protection segment interval. Among them, the data in the test segment interval will be frequently changed, while the data in the protection segment interval will not be frequently changed. When the number of data accesses reaches a pre-set threshold, it proves that the corresponding target data segment has been accessed a large number of times, so the target data segment will be transferred to the protection segment interval of the database management system buffer pool.
[0090] For example, in a smart healthcare system, when a system maintenance person views transaction status information in the smart healthcare system's database a predetermined threshold number of times, the transaction status information is transferred to a protected segment of the database management system's buffer pool, allowing for faster subsequent query access and processing of related data. For another example, in an intelligent insurance business system, when a system maintenance person views transaction logs stored in the smart healthcare system's database a predetermined threshold number of times, the transaction logs are transferred to a protected segment of the database management system's buffer pool, allowing for faster subsequent query access and processing of related data.
[0091] like Figure 6 As shown, when the number of data accesses reaches a preset threshold, transferring the target data segment to the protection segment interval of the database management system buffer pool may include the following steps:
[0092] Step S610: When the number of data accesses reaches a threshold, a protection segment interval is selected from the database management system buffer pool;
[0093] Step S620, measuring the data length of the target data segment to obtain data length information;
[0094] Step S630: Divide the protection segment interval into data storage sub-intervals according to the data length information, and mark the data storage sub-intervals so that the data storage sub-intervals correspond to data storage mark information;
[0095] Step S640: transfer the target data segment to the data storage sub-interval.
[0096] For steps S610 to S640, when the number of data accesses reaches a preset threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool. When the number of data accesses reaches the threshold, the protection segment interval can be selected from the database management system buffer pool; then, the data length of the target data segment is measured to obtain data length information; then, data storage sub-intervals are obtained from the protection segment interval based on the data length information, and the data storage sub-intervals are marked so that the data storage sub-intervals correspond to the data storage marking information; finally, the target data segment is transferred to the corresponding data storage sub-interval so that subsequent data reading processing can be directly performed from the protection segment interval of the database management system buffer pool, thereby speeding up the subsequent metadata reading efficiency.
[0097] It is worth noting that when the number of data accesses reaches a threshold, it proves that the number of accesses to the target data segment is large, so a protection segment interval can be selected from the database management system buffer pool; then the data length of the target data segment is measured and processed to obtain data length information; then, based on the data length information, the protection segment interval is divided into data storage sub-intervals, and the data storage sub-intervals are marked so that the data storage sub-intervals correspond to the data storage marking information; finally, the target data segment is transferred to the corresponding data storage sub-interval, and data can be read and processed from the data storage sub-interval in a simple and fast manner subsequently, thereby improving the efficiency of data access. Among them, the data storage sub-interval is marked so that the data storage sub-interval corresponds to the data storage marking information, which makes it convenient to directly read and process data from the data storage sub-interval.
[0098] like Figure 7 As shown, after transferring the target data segment to the data storage subinterval, the following steps may also be included:
[0099] Step S650: obtaining new metadata access request information;
[0100] Step S660 : When the metadata access request information carries metadata read mark information that matches the data storage mark information, the target data segment is read from the data storage sub-interval.
[0101] For steps S650 to S660, after the target data segment is transferred to the storage sub-interval, after obtaining new metadata access request information, if the metadata access request information carries metadata read tag information that matches the data storage tag information, the corresponding target data segment can be directly read from the data storage sub-interval, thereby speeding up the access efficiency of the target data segment, eliminating the need to perform data screening and processing from multiple sub-buffer pools as before, thereby improving data access efficiency.
[0102] For example, in an insurance business system, when a system maintenance person queries the storage transaction log of a database, the relevant data is stored in the data storage sub-interval; when another system maintenance person queries and processes the storage transaction log of the database again, the relevant data can be directly read and processed from the data storage sub-interval, thereby speeding up the efficiency of data access.
[0103] In addition, if Figure 8 As shown, an embodiment of the present application further provides a data access device 10, which is applied to a database management system buffer pool. The database management system buffer pool includes multiple sub-buffer pools, each sub-buffer pool is configured with a sub-control lock and a counter, and the device includes:
[0104] An acquisition unit 100 is configured to acquire metadata access request information;
[0105] Extraction unit 200, used to determine and obtain control lock mask information and metadata read mark information according to metadata access request information;
[0106] A screening unit 300 is configured to screen a target sub-buffer pool from multiple sub-buffer pools according to the control lock mask information and the sub-control lock;
[0107] The reading unit 400 is configured to read a target data segment from a target sub-buffer pool according to metadata reading tag information;
[0108] A calculation unit 500 is configured to calculate the number of accesses to the target data segment according to the counter to obtain the number of data accesses;
[0109] The transfer unit 600 is configured to transfer the target data segment to the protection segment interval of the database management system buffer pool when the number of data accesses reaches a preset number threshold.
[0110] It should be noted that, during the data access process, metadata access request information is first obtained; then, control lock mask information and metadata read tag information are determined based on the metadata access request information; then, a target sub-buffer pool is obtained by screening from multiple sub-buffer pools based on the control lock mask information and the sub-control lock; then, a target data segment is read from the target sub-buffer pool based on the metadata read tag information; then, the number of accesses to the target data segment is calculated and processed based on a counter to obtain the number of data accesses; finally, when the number of data accesses reaches a pre-set number threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool. Through the above technical solution, the database management system buffer pool is divided into multiple sub-buffer pools, and the target sub-buffer pool can be screened from the multiple sub-buffer pools based on the control lock mask information and the sub-control lock. This eliminates the need for linear search through the database management system buffer pool as in the past, thereby solving the problem of reduced linear search efficiency and improving the database access rate.
[0111] The specific implementation of the data access device 10 is substantially the same as the specific embodiment of the above-mentioned data access method, and will not be described in detail here.
[0112] In addition, if Figure 9 As shown, an embodiment of the present application further provides an electronic device 700 , which includes: a memory 720 , a processor 710 , and a computer program stored in the memory 720 and executable on the processor 710 .
[0113] The processor 710 and the memory 720 may be connected via a bus or other means.
[0114] The non-transitory software programs and instructions required to implement the data access methods of the above embodiments are stored in the memory 720 , and when executed by the processor 710 , the data access methods of the above embodiments are executed.
[0115] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0116] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor 710 or a controller, for example, by a processor 710 in the above-mentioned device embodiment, so that the above-mentioned processor 710 can execute the data access method in the above-mentioned embodiment.
[0117] The above embodiments may be used in combination, and modules with the same name in different embodiments may be the same or different.
[0118] The foregoing description describes specific embodiments of the present application, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0119] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, equipment, and computer-readable storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.
[0120] The apparatus, device, computer-readable storage medium and method provided in the embodiments of the present application correspond to each other. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be repeated here.
[0121] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly performed using "logic compiler" software. This is similar to the software compilers used during program development. Before compilation, the original code must be written in a specific programming language, called a hardware description language (HDL). There are many HDLs, including ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also appreciate that simply programming a method flow in one of these hardware description languages and programming it into an integrated circuit can easily create a hardware circuit that implements the logic method flow.
[0122] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0123] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0124] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing the embodiments of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0125] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0129] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0130] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0131] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0132] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0133] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c or a and b and c, where a, b, c can be single or multiple.
[0134] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. Embodiments of the present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0135] The various embodiments in this application are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment.
[0136] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included within the scope of the claims of the present application.
Claims
1. A data access method, characterized in that: Applied to a database management system buffer pool, the database management system buffer pool includes multiple sub-buffer pools, each of the sub-buffer pools is configured with a sub-control lock and a counter, the method includes: Get metadata access request information; Determining control lock mask information and metadata read mark information according to the metadata access request information; Filtering a target sub-buffer pool from a plurality of sub-buffer pools according to the control lock mask information and the sub-control lock; Reading a target data segment from the target sub-buffer pool according to the metadata read mark information; Calculating the number of accesses to the target data segment according to the counter to obtain the number of data accesses; When the number of data accesses reaches a preset threshold, the target data segment is transferred to the protection segment interval of the database management system buffer pool.
2. The data access method according to claim 1, wherein: The determining of the control lock mask information and the metadata read mark information according to the metadata access request information includes: Splitting the metadata access request information to obtain multiple information blocks; The control lock mask information is obtained by screening the plurality of information blocks according to a preset mask mark; and the metadata reading mark information is obtained by screening the plurality of information blocks according to a preset data mark.
3. The data access method according to claim 1, wherein: The step of screening a target sub-buffer pool from a plurality of sub-buffer pools according to the control lock mask information and the sub-control lock includes: Determining control lock sequence information from the plurality of sub-control locks; Determine a target sub-control lock from the plurality of sub-control locks according to the control lock mask information and the control lock sequence number information; The sub-buffer pool corresponding to the target sub-control lock is determined as the target sub-buffer pool.
4. The data access method according to claim 1, wherein: The step of reading the target data segment from the target sub-buffer pool according to the metadata reading tag information includes: Determine a data reading interval from the metadata reading mark information; The target data segment is read from the target sub-buffer pool according to the data reading interval.
5. The data access method according to claim 1, wherein: The step of calculating the number of accesses to the target data segment according to the counter to obtain the number of data accesses includes: Capturing the number of accesses to the target data segment to obtain an operation capture number; The count value of the counter is updated and adjusted according to the number of operation capture times to obtain the number of data access times.
6. The data access method according to claim 1, wherein: When the number of data accesses reaches a preset number threshold, transferring the target data segment to the protection segment interval of the database management system buffer pool includes: When the number of data accesses reaches the number threshold, selecting the protection segment interval from the database management system buffer pool; Measuring the data length of the target data segment to obtain data length information; Dividing the protection segment interval into data storage sub-intervals according to the data length information, and marking the data storage sub-intervals so that the data storage sub-intervals correspond to data storage marking information; The target data segment is transferred to the data storage sub-interval.
7. The data access method according to claim 6, characterized in that: After transferring the target data segment to the data storage subinterval, the method further includes: Obtaining new metadata access request information; In a case where the metadata access request information carries the metadata read mark information that matches the data storage mark information, the target data segment is read from the data storage sub-interval.
8. A data access device, characterized in that: Applied to a database management system buffer pool, the database management system buffer pool includes multiple sub-buffer pools, each of the sub-buffer pools is configured with a sub-control lock and a counter, the device includes: An acquisition unit, used to acquire metadata access request information; an extraction unit, configured to determine and obtain control lock mask information and metadata read mark information according to the metadata access request information; a screening unit, configured to screen a target sub-buffer pool from a plurality of sub-buffer pools according to the control lock mask information and the sub-control lock; a reading unit, configured to read a target data segment from the target sub-buffer pool according to the metadata reading mark information; a calculation unit, configured to calculate the number of accesses to the target data segment according to the counter to obtain a number of data accesses; The transfer unit is configured to transfer the target data segment to a protection segment interval of the database management system buffer pool when the number of data accesses reaches a preset number threshold.
9. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data access method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer-executable instructions are used to execute the data access method according to any one of claims 1 to 7.