Electronic commerce database data page pre-reading method and system
By determining access modes and frequencies, the method optimizes data page pre-reading in e-commerce databases, enhancing accuracy and speed, thus improving website performance.
Patent Information
- Application Number
- CN202411162319.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing data page pre-reading methods in e-commerce databases suffer from excessive and incorrect pre-reading, leading to reduced efficiency and performance under high concurrent access.
A method and system that determine the access mode and frequency of data pages in e-commerce databases, selectively pre-read data pages based on access patterns, and optimize their placement in buffer pools to improve accuracy and speed.
Enhances the accuracy and speed of data page pre-reading, improving the performance of e-commerce websites by reducing excessive and erroneous pre-reading.
Smart Images

Figure CN119106211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of e-commerce, and in particular to an e-commerce database data page pre-reading method and system. Background Art
[0002] E-commerce is changing people's lifestyles. From shopping to payment to logistics, all links are becoming more convenient and efficient. Consumers can browse and purchase global goods anytime and anywhere, without being restricted by the business hours and geographical location of physical stores. E-commerce platforms involve a large amount of product information, user data, order records, transaction history, etc., which need to be stored and managed efficiently and securely. Database systems provide structured storage solutions for these data to ensure data integrity, consistency and high availability. The traffic and data volume of e-commerce platforms continue to increase with the growth of business. The database needs to have good high-concurrency processing capabilities to support simultaneous access and operation by thousands of users.
[0003] Data page pre-reading technology can load the data that may be needed into the memory before the user actually makes a request. It can not only reduce the bottleneck caused by frequent disk access, but also reduce the number of I / O operations of the database under high concurrent access. The website can respond to more user requests in a short time and optimize the overall query performance. However, the existing pre-reading methods have the problems of excessive pre-reading and incorrect pre-reading, which reduce the actual effect of pre-reading technology in the database. Summary of the invention
[0004] In order to solve the above problem, the present invention provides a method for pre-reading data pages of an e-commerce database, the method comprising the following steps: Obtain access records for all data pages in the data table to which the data page belongs, find the session that contains the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs, and add it to the pre-read list; When a preset condition is met, a session including access to the data page to be pre-read is found from the access record, and a data page most relevant to the data page to be pre-read is found in the session and added to the pre-read list; The location of the buffer pool where the pre-read data page is pre-read is determined according to the source of the data page in the pre-read list.
[0005] Preferably, the access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
[0006] Preferably, the step of determining the data page to be pre-read and adding it to the pre-read list according to the access mode and the access frequency to the data table to which the data page belongs is specifically as follows: Determining the preset number based on the access frequency to the data table to which the data page belongs; If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
[0007] Preferably, the step of finding the data page most relevant to the data page to be pre-read in the session and adding the data page to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
[0008] Preferably, determining the location of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-read list is specifically: Different weights are assigned to data pages according to their sources in the pre-read list, and historical access frequencies are weighted according to the weights. Data pages with weighted frequencies greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area.
[0009] In addition, the present invention also provides an e-commerce database data page pre-reading system, the system comprising the following modules: A first pre-read data page determination module is used to obtain access records to all data pages in the data table to which the data page belongs, find the session that includes the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, and determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and add it to the pre-read list; A second pre-read data page determination module is used to find a session including access to the data page to be pre-read from the access record when a preset condition is met, find a data page most relevant to the data page to be pre-read in the session and add it to a pre-read list; The pre-reading module is used to determine the position of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-reading list.
[0010] Preferably, the access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
[0011] Preferably, the step of determining the data page to be pre-read and adding it to the pre-read list according to the access mode and the access frequency to the data table to which the data page belongs is specifically as follows: Determining the preset number based on the access frequency to the data table to which the data page belongs; If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
[0012] Preferably, the step of finding the data page most relevant to the data page to be pre-read in the session and adding the data page to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
[0013] Preferably, determining the location of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-read list is specifically: Different weights are assigned to data pages according to their sources in the pre-read list, and historical access frequencies are weighted according to the weights. Data pages with weighted frequencies greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area.
[0014] Finally, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described above is implemented.
[0015] Aiming at the problem that users of e-commerce websites are relatively scattered and database pre-reading is prone to excessive pre-reading or erroneous pre-reading, the present invention determines the access mode to which a data page belongs based on the access record in the session, and determines the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and adds it to the pre-reading list; and when the preset conditions are met, the data page related to the data page in the pre-reading list is further added to the pre-reading list, and in addition, the location of the pre-reading to the buffer pool is determined according to the source of the data page in the pre-reading list. Not only the accuracy of pre-reading is improved, but also the speed of the database can be improved, and the performance of the e-commerce website is significantly improved when large amounts of e-commerce data are accessed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flow chart of Embodiment 1; Figure 2 This is a structural diagram of the second embodiment. DETAILED DESCRIPTION
[0017] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0018] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0019] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0020] In a first aspect, the present invention provides a method for pre-reading data pages in an e-commerce database, such as Figure 1 As shown, the method comprises the following steps: S1, obtain access records of all data pages in the data table to which the data page belongs, find the session that includes the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs, and add it to the pre-read list; Different data tables store different data, and a data table will have at least one data page. In an e-commerce database, a table is usually very large, which will correspond to multiple data pages. Since there are many users on an e-commerce website, and each user has different situations and browsing preferences, etc., the access records of all data pages in the data table to which the data page belongs are obtained, and the session containing the access to the data page is found. This data page is the basic data page. The so-called basic data page refers to the pre-loading of other data pages related to this data page into the buffer pool based on this data page, that is, the pre-reading is based on this basic data page, and all data pages can be basic data pages. For the sake of convenience, data page A is used as the basic data page below. Find the session containing the access to the data page. There are many ways to divide the session. In one embodiment, a Session is a session. If there is an access to data page A in a session, then this session is the session to be found. The access records of all found sessions are used to determine the access mode to which the data page belongs. The access modes are sequential mode, random mode, and mixed mode. The sequential mode refers to accessing other data pages in sequence or at equal intervals according to the order of the data pages, the random mode refers to accessing data pages without regularity, and the mixed mode refers to including both the sequential mode and the random mode. Since the access records of all found sessions include access to data page A, the access mode to data page A can be determined by statistics. Among them, the access record refers to the access record to the data page.
[0021] In one embodiment, the access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; For each of all the sessions found, extract the data page access records within the preset range starting from data page A in the access record. Assume that the preset range is 8. In session 1, the data page access records within the preset range are data pages 5, 7, 9, 11, 13, 15, 17, and 18, where the preset range is determined according to the memory of the server where the database is located. If the memory is large, the preset range can be set larger, otherwise it can be set smaller. Based on the data page access records within the preset range, determine the access method of data page A in each session. In the above example, the data page access has an obvious pattern, which is sequential access. If the data page access records are 5, 8, 1, 9, 3, 18, 34, and 86, the data page access has no pattern, which is random access.
[0022] An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
[0023] After obtaining the access mode of each session, the probability of sequential access is calculated. For example, there are 40 sessions found, of which 35 have sequential access mode, and the probability of sequential access is 0.875. If the probability is greater than 0.8, the access mode of data page A is determined to be sequential access. If the probability is less than 0.2, the access mode of data page A is determined to be random access. If the probability is between [0.2, 0.8], it is a mixed mode. The above 0.8 and 0.2 are examples, and other values such as 0.7 and 0.3 can also be used.
[0024] The data pages to be pre-read are determined according to the access mode and the access frequency to the data table to which the data pages belong and added to the pre-read list. In one embodiment, specifically: The preset number is determined based on the access frequency to the data table to which the data page belongs; the higher the access frequency, the larger the preset number. For example, if the access frequency in the last 5 minutes is 1000 times / s, the preset number is 10. If the access frequency drops to 500 times / s, the preset number is 5.
[0025] If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode of data page A is a sequential mode, it indicates that the access to data page A is mostly sequential. At this time, a preset number of data pages are determined from the subsequent data pages of the data page according to the data page number as the data pages to be pre-read and added to the pre-read list. In one embodiment, the interval of the data pages in the sequential access to data page A is determined, and a preset number of data pages closest to data page A are selected from the subsequent data pages of data page A according to the interval. Assuming that data page A is numbered 2, the interval is 2, and the preset number is 3, data pages numbered 4, 6, and 8 are selected as the data pages to be pre-read and added to the pre-read list.
[0026] If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode of data page A is random, then all sessions that include access to data page A are obtained, and the probability of the next data page to be accessed after data page A is accessed in these sessions is counted. For example, after accessing data page A, the probability of accessing data page 7 is 0.51, the probability of accessing data page 13 is 0.22, the probability of accessing data page 1 is 0.15, and the probability of accessing data page 3 is 0.12. Further assuming that the preset number is 3, data pages 7, 13, and 1 are taken as data pages to be pre-read and added to the pre-read list.
[0027] If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
[0028] If the access mode of data page A is a mixed mode, it means that a part of the access to the data table is relatively random, while the other part is relatively regular. If only sequential pre-reading or random pre-reading is used, excessive pre-reading or erroneous pre-reading may occur. In the present invention, when the access mode is a mixed mode, the ratio of sequential access and random access in all sessions including access to data page A is calculated, and the first value and the second value are determined according to the ratio and the preset number. For example, if the ratio is 4:3 and the preset number is 14, the first value is 8 and the second value is 6. If the determined first value and second value are not integers, the sum of the first value and the second value is equal to the preset number by rounding up or rounding down, and the ratio of the first value and the second value is closest to the ratio. After determining the first value, the data pages of the first value number are determined according to the access mode being the sequential mode, and added to the pre-reading list. Similarly, after determining the second value, the data pages of the second value number are determined according to the access mode being the random mode, and added to the pre-reading list.
[0029] S2, when a preset condition is met, finding a session including access to the data page to be pre-read from the access record, finding a data page most relevant to the data page to be pre-read in the session and adding it to a pre-read list; When the preset conditions are met, such as the access frequency to the data table where the data page is located increases to a certain value, the access popularity to the data table where data page A is located is very high. At this time, in addition to pre-reading the data pages related to data page A, the data pages related to the data pages in the pre-read list are also pre-loaded. Specifically, for each data page to be pre-read in the pre-read list, all sessions that include access to the pre-read data page are found, and the data page most related to the data page to be pre-read is further found and added to the pre-read list. For example, after S1, there are two data pages B and C to be pre-read in the pre-read list. The data page most related to data page B is found, and the data page most related to data page C is found, and the two data pages found are also added to the pre-read list.
[0030] In one embodiment, the step of finding the data page most relevant to the data page to be pre-read in the session and adding the data page to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
[0031] For example, in all sessions that include access to data page B, the next data page to be accessed after accessing data page B is , The probability of data page B is the largest. , As the most relevant data page of data page B.
[0032] S3, determining the location of the buffer pool where the pre-read data page is to be pre-read according to the source of the data page in the pre-read list.
[0033] The buffer pool of the database is divided into a young area and an old area. The data in the young area is hotter than that in the old area. If all the data in the pre-read list are added to the young area, the hot data may be replaced. If all the data are pre-read to the old area, the efficiency may be affected. In the present invention, the location of the buffer pool where the pre-read data page is pre-read is determined according to the source of the data page in the pre-read list, and the location is the young area and the old area. In one embodiment, if the data page in the pre-read list comes from step S1, the data page is pre-read to the young area, and if the data page in the pre-read list comes from step S2, the data page is pre-read to the old area.
[0034] In another embodiment, different weights are assigned to data pages according to their sources in the pre-read list, and the historical access frequencies are weighted according to the weights. Data pages whose weighted frequencies are greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area. Different weights are assigned to data pages from S1 and S2 in the pre-read list. Preferably, the weight of the data page from S1 is greater than the weight of the data page from S2. Then, the historical access frequency of each data page in the pre-read list is counted, for example, the number of accesses in the past 10 minutes or 60 minutes. Each data page in the pre-read list has a weight and a historical access frequency. The two are multiplied to obtain the frequency weighted value of each data page. If the weighted frequency is greater than the threshold, the data page is pre-read to the young area of the buffer pool, otherwise it is pre-read to the old area of the buffer pool. In another alternative embodiment, the data pages in the pre-read list are sorted from large to small according to the frequency weighted value and divided into two parts, the first part is pre-read to the young area, and the second part is pre-read to the old area, wherein the frequency weighted value of the first part is greater than the frequency weighted value of the second part.
[0035] In a second aspect, the present invention provides an e-commerce database data page pre-reading system, such as Figure 2 As shown, the system includes the following modules: A first pre-read data page determination module is used to obtain access records to all data pages in the data table to which the data page belongs, find the session that includes the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, and determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and add it to the pre-read list; A second pre-read data page determination module is used to find a session including access to the data page to be pre-read from the access record when a preset condition is met, find a data page most relevant to the data page to be pre-read in the session and add it to a pre-read list; The pre-reading module is used to determine the position of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-reading list.
[0036] Preferably, the access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
[0037] Preferably, the step of determining the data page to be pre-read and adding it to the pre-read list according to the access mode and the access frequency to the data table to which the data page belongs is specifically as follows: Determining the preset number based on the access frequency to the data table to which the data page belongs; If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
[0038] Preferably, the step of finding the data page most relevant to the data page to be pre-read in the session and adding the data page to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
[0039] Preferably, determining the location of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-read list is specifically: Different weights are assigned to data pages according to their sources in the pre-read list, and historical access frequencies are weighted according to the weights. Data pages with weighted frequencies greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area.
[0040] In a third aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect.
[0041] In a fourth aspect, this embodiment provides a computer program product, including a computer program, which, when executed by a processor, can implement the method described in the first aspect.
[0042] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The above-mentioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the above-mentioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0043] The embodiments of the present application are 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 processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes 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.
Claims
1. A method for pre-reading data pages in an e-commerce database, characterized in that: The method comprises the following steps: Obtain access records for all data pages in the data table to which the data page belongs, find the session that contains the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs, and add it to the pre-read list; When a preset condition is met, a session including access to the data page to be pre-read is found from the access record, and a data page most relevant to the data page to be pre-read is found in the session and added to the pre-read list; The location of the buffer pool where the pre-read data page is pre-read is determined according to the source of the data page in the pre-read list.
2. The method according to claim 1, characterized in that The access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
3. The method according to claim 1, characterized in that The method of determining the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and adding the data page to the pre-read list is specifically as follows: Determining the preset number based on the access frequency to the data table to which the data page belongs; If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
4. The method according to claim 1, characterized in that The step of finding the data page most relevant to the data page to be pre-read in the session and adding it to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
5. The method according to claim 1, characterized in that The step of determining the location of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-read list is specifically as follows: Different weights are assigned to data pages according to their sources in the pre-read list, and historical access frequencies are weighted according to the weights. Data pages with weighted frequencies greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area.
6. An e-commerce database data page pre-reading system, characterized in that: The system includes the following modules: A first pre-read data page determination module is used to obtain access records to all data pages in the data table to which the data page belongs, find the session that includes the access to the data page, determine the access mode to which the data page belongs based on the access records in the session, and determine the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and add it to the pre-read list; A second pre-read data page determination module is used to find a session including access to the data page to be pre-read from the access record when a preset condition is met, find a data page most relevant to the data page to be pre-read in the session and add it to a pre-read list; The pre-reading module is used to determine the position of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-reading list.
7. The system according to claim 6, characterized in that The access mode to which the data page belongs is determined based on the access record in the session, specifically: Extracting data page access records within a preset range starting from the data page in the session, and determining an access mode of the data page in each session based on the data page access records within the preset range, wherein the access mode includes sequential access and random access; An access mode is determined for each of all sessions containing the data page, the probability of sequential access is calculated, and the access mode to which the data page belongs is determined based on the probability, wherein the access mode includes a sequential mode, a random mode, and a mixed mode.
8. The system according to claim 6, characterized in that The method of determining the data page to be pre-read according to the access mode and the access frequency to the data table to which the data page belongs and adding the data page to the pre-read list is specifically as follows: Determining the preset number based on the access frequency to the data table to which the data page belongs; If the access mode is a sequential mode, a preset number of data pages are determined from subsequent data pages of the data page according to the data page number as data pages to be pre-read and added to the pre-read list; If the access mode is a random mode, all sessions including accesses to the data page are obtained, the probability of each data page being accessed next by the data page in all sessions is counted, and a preset number of data pages are determined as data pages to be pre-read in descending order of the probabilities and added to a pre-read list; If the access mode is a mixed mode, obtain the ratio of sequential access and random access to the data page in all sessions that access the data page, determine the first value and the second value according to the ratio and the preset number, determine the data pages with the first value according to the sequential access mode and add them to the pre-read list, and determine the data pages with the second value according to the random mode and add them to the pre-read list.
9. The system according to claim 6, characterized in that The step of finding the data page most relevant to the data page to be pre-read in the session and adding it to the pre-read list is specifically as follows: The probability of the next accessed data page after the data page to be pre-read is accessed in the session is counted, and the next accessed data page with the highest probability is used as the most relevant data page of the data page to be pre-read and added to the pre-read list.
10. The system according to claim 6, characterized in that The step of determining the location of pre-reading the pre-read data page to the buffer pool according to the source of the data page in the pre-read list is specifically as follows: Different weights are assigned to data pages according to their sources in the pre-read list, and historical access frequencies are weighted according to the weights. Data pages with weighted frequencies greater than a threshold are pre-read to the young area, otherwise the data pages are pre-read to the old area.
