Data preheating method and device, storage medium and computer device

By acquiring a list of hot data and configuring the preheating time and concurrency parameters based on the popularity level and historical query information, the problem of low data preheating efficiency during database switching or restart is solved, achieving fast response and efficient data preheating.

CN115757480BActive Publication Date: 2026-05-08PING AN PAY ELECTRONIC PAYMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN PAY ELECTRONIC PAYMENT CO LTD
Filing Date
2022-11-15
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, data warm-up efficiency is low when switching or restarting a database, resulting in low data hit rate, affecting business response speed and increasing disk consumption.

Method used

By obtaining a list of hot data, and configuring strategies based on popularity level, historical query information, and preheating time parameters, the preheating time and concurrency parameters are determined. Data is stored in the cache space using a multi-threaded concurrent query approach, and different preheating times and concurrency parameters are used for data queries based on different popularity levels.

Benefits of technology

It improves the accuracy and efficiency of data preheating, reduces memory resource consumption, and ensures fast response of database access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757480B_ABST
    Figure CN115757480B_ABST
Patent Text Reader

Abstract

The application discloses a data preheating method and device, a storage medium and computer equipment, relates to the technical field of computers, and mainly aims to solve the problem of low success rate of data preheating. Mainly includes in response to medical service database adjustment instruction, obtains the hot data list; according to the heat level, the historical hot data query information, and preheat time parameter configuration strategy determines the preheat time parameter of the hot data, and according to the preheat time parameter, the heat level, the preheat and concurrent parameter configuration strategy determines the preheat and concurrent parameter; according to the preheat and concurrent parameter, the preheat time parameter, the hot data attribute information is read from the target medical service database, and the target medical service data is stored to the cache space, to complete the database preheating. Mainly used for the preheating of database data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a data preheating method and apparatus, storage medium, and computer equipment. Background Technology

[0002] Database access requires reading data from disk into memory before it can be accessed. However, memory access speeds are in the nanosecond range (10⁻⁹), while disk access speeds are in the millisecond range (10⁻³), a difference of several orders of magnitude. Therefore, data from the hard drive needs to be pre-stored in memory to meet access requirements. However, when switching databases or restarting, the data in the database is forcibly flushed to disk. When applications connect to the database, they cannot retrieve the required data from memory, resulting in a very low data hit rate. This impacts business response speed and can even increase disk consumption, potentially causing catastrophic consequences.

[0003] To ensure database access hit rate and business response speed, when a database switch or restart occurs, all data on the disk is continuously queried to keep the data in memory and maintain its readiness. However, due to the large volume of data to be preheated and the long query time, the time interval between two queries is often too long, causing the data to be flushed from memory, resulting in low data preheating efficiency. Summary of the Invention

[0004] In view of this, the present invention provides a method and apparatus, the main purpose of which is to address the problem of low data preheating efficiency in existing systems.

[0005] According to one aspect of the present invention, a data preheating method is provided, comprising:

[0006] In response to the medical service database adjustment instruction, a hot data list is obtained, which includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information;

[0007] The preheating time parameters of the hot data are determined based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, and the preheating concurrency parameters are determined based on the preheating time parameters, the heat level, and the preheating concurrency parameter configuration strategy.

[0008] According to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, the target medical service data is read from the target medical service database and stored in the cache space to complete the database preheating.

[0009] Further, determining the preheating time parameter of the hot data based on the popularity level, the historical hot data query information, and the preheating time parameter configuration strategy includes:

[0010] The query time distribution of each hot data is calculated based on the historical hot data query information, and at least one time period in the query time distribution where the number of queries is greater than a preset query volume threshold is determined as the initial warm-up time parameter of the hot data.

[0011] The target preheating time configuration coefficient corresponding to the heat level is matched from the preheating time configuration coefficient mapping relationship set, which includes preheating time configuration coefficients corresponding to different heat levels;

[0012] The preheating time parameters are calculated based on the target preheating time configuration coefficient and the initial preheating time parameters.

[0013] Further, determining the preheating concurrency parameters based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy includes:

[0014] The hotspot data is divided based on the preheating time parameter to obtain at least one hotspot data group;

[0015] Based on the aforementioned popularity level, each of the hot data groups is divided into subgroups corresponding to different popularity levels;

[0016] According to the preset weight coefficients corresponding to different popularity levels, different concurrency numbers are assigned to each subgroup, and the preheating concurrency parameters of the hot data are calculated based on the concurrency numbers.

[0017] Furthermore, before obtaining the hot data list in response to the medical service database adjustment instruction, the method further includes:

[0018] Obtain initial hotspot data information, historical query frequency information of expected medical service data, preset business types, and expected medical service data attribute information;

[0019] Based on the trained popularity prediction model, the initial hot data information, the historical query frequency information, and the preset business type are predicted to obtain the popularity level of the medical service data.

[0020] The medical service data whose popularity level meets the preset popularity level restriction conditions are identified as hot data, and a hot data list is constructed based on the popularity level of the hot data and the expected medical service data attribute information.

[0021] Furthermore, before the method performs prediction processing on the initial hotspot data information, the historical query frequency information, and the preset business type based on the trained heat prediction model to obtain the heat level of the medical service data, the method further includes:

[0022] An initial popularity prediction model was constructed, and a training sample set was built based on historical hot data information, historical query frequency information of global medical service data, and preset business types.

[0023] The initial popularity prediction model is trained using the training sample set to obtain a completed popularity prediction model.

[0024] Furthermore, before reading the target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hotspot data attribute information, the method further includes:

[0025] Obtain operational performance information, which includes at least one of interface performance, response latency performance, and processing speed;

[0026] The concurrent query volume distribution is calculated based on the historical hot data query information, and the maximum concurrent query volume is configured based on the maximum value in the concurrent query volume distribution;

[0027] The thread configuration information is determined based on the maximum concurrent query volume and the running performance, and a thread pool for reading target medical service data is created based on the thread configuration information.

[0028] Furthermore, after storing the target medical service data in memory, the method further includes:

[0029] The validity of the target medical service data is verified based on the preset medical service data. If the validity verification result is that the verification fails, the concurrent query of the target medical service data is stopped, and an early warning message is generated to indicate that the data is not warmed up.

[0030] According to another aspect of the present invention, a data preheating device is provided, comprising:

[0031] The acquisition module is used to acquire a list of hot data in response to an adjustment instruction from the medical service database. The list of hot data includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information.

[0032] The determination module is used to determine the preheating time parameter of the hot data based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, and to determine the preheating concurrency parameter based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy;

[0033] The preheating module is used to read target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and store the target medical service data in the cache space to complete the database preheating.

[0034] Furthermore, the determining module includes:

[0035] The first calculation unit is used to calculate the query time distribution of each hot data based on the historical hot data query information, and to determine at least one time period in the query time distribution where the number of queries is greater than a preset query volume threshold as the initial warm-up time parameter of the hot data.

[0036] A matching unit is used to match the target preheating time configuration coefficient corresponding to the heat level from the preheating time configuration coefficient mapping relationship set, wherein the preheating time configuration coefficient mapping relationship set includes preheating time configuration coefficients corresponding to different heat levels;

[0037] The second calculation unit is used to calculate the preheating time parameters based on the target preheating time configuration coefficient and the initial preheating time parameters.

[0038] Further, the determining unit includes:

[0039] The first partitioning unit is used to partition the hotspot data based on the preheating time parameter to obtain at least one hotspot data group.

[0040] The second division unit is used to divide each of the hot data groups according to the heat level to obtain subgroups corresponding to different heat levels;

[0041] The third calculation unit is used to allocate different concurrency levels to each of the subgroups according to preset weight coefficients corresponding to different heat levels, and to calculate the preheating concurrency parameters of the hot data based on the concurrency levels.

[0042] Furthermore, the device also includes:

[0043] The acquisition module is also used to acquire initial hotspot data information, historical query frequency information of expected medical service data, preset business types, and expected medical service data attribute information;

[0044] The prediction module is used to perform prediction processing on the initial hot data information, the historical query frequency information, and the preset business type based on the trained heat prediction model to obtain the heat level of the medical service data.

[0045] The first construction module is used to identify medical service data whose popularity level meets the preset popularity level restriction conditions as hot data, and to construct a hot data list based on the popularity level of the hot data and the expected medical service data attribute information.

[0046] Furthermore, the device also includes:

[0047] The second construction module is used to build an initial popularity prediction model and construct a training sample set based on historical hot data information, historical query frequency information of global medical service data, and preset business types.

[0048] The training module is used to train the initial popularity prediction model using the training sample set to obtain a trained popularity prediction model.

[0049] Furthermore, the device also includes:

[0050] The acquisition module is also used to acquire runtime performance information, which includes at least one of interface performance, response latency performance, and processing speed.

[0051] The configuration module is used to calculate the time distribution of data query volume based on the historical hot data query information, and configure the maximum concurrent query volume according to the maximum value in the concurrent query volume distribution;

[0052] A creation module is used to determine thread configuration information based on the maximum concurrent query volume and the running performance, and to create a thread pool for reading target medical service data based on the thread configuration information.

[0053] Furthermore, the device also includes:

[0054] The verification module is used to verify the validity of the target medical service data based on preset medical service data. If the result of the validity verification is that the verification fails, the concurrent query of the target medical service data is stopped, and an early warning message is generated to indicate that the data is not ready.

[0055] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored therein, the executable instruction causing a processor to perform an operation corresponding to the data warm-up method described above.

[0056] According to another aspect of the present invention, a computer device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0057] The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the above data warm-up method.

[0058] By employing the above-described technical solutions, the technical solutions provided by the embodiments of the present invention have at least the following advantages:

[0059] This invention provides a data preheating method, apparatus, storage medium, and computer equipment. In embodiments of this invention, in response to an adjustment command from a medical service database, a list of hot data is obtained. This list includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information. Preheating time parameters for the hot data are determined based on the heat level, the historical hot data query information, and a preheating time parameter configuration strategy. Preheating concurrency parameters are also determined based on the preheating time parameters, the heat level, and the preheating concurrency parameter configuration strategy. Target medical service data is read from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and the target medical service data is stored in a cache space to complete database preheating. Different preheating time parameters and preheating concurrency parameters are used for data queries based on different heat levels of hot data, thereby preheating the data and significantly reducing memory resource consumption. Simultaneously, targeted data preheating is achieved, effectively improving the accuracy and efficiency of data preheating.

[0060] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0061] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0062] Figure 1 A flowchart of a data preheating method provided by an embodiment of the present invention is shown;

[0063] Figure 2A flowchart of another data preheating method provided by an embodiment of the present invention is shown;

[0064] Figure 3 A flowchart of another data preheating method provided by an embodiment of the present invention is shown;

[0065] Figure 4 This diagram illustrates a data preheating device according to an embodiment of the present invention.

[0066] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation

[0067] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0068] To address the low efficiency of existing data preheating methods, this invention provides a data preheating method, such as... Figure 1 As shown, the method includes:

[0069] 101. Respond to the medical service database adjustment instruction and obtain a list of hot data.

[0070] In this embodiment of the invention, the target data for preheating is medical service data. The medical service database adjustment instruction is used to indicate the quality of restarting or switching the current medical service database. During the daily operation of the medical service database, problems such as the server hosting the database stopping or malfunctioning, and database corruption may occur, requiring a database restart or switching to another database. With the database restart or switch, the corresponding data originally stored in memory is flushed out of memory, thus affecting the response speed of database queries. To ensure a fast response to database access, when a restart or switch is detected, the data in the database is preheated. However, the amount of data in the database is very large, and not all data is expected to be accessed. Therefore, it is necessary to obtain a pre-constructed list of hot data, where hot data is data with a high probability of being queried. By obtaining the list of hot data, it is possible to identify which data is important for preheating from all the data in the database, thereby achieving the effect of extracting key data from the global database data.

[0071] It should be noted that the hot data list includes the popularity level corresponding to the hot data, historical hot data query information, and hot data attribute information. The popularity level is used to characterize the importance and urgency of the corresponding hot data requiring pre-heating. The popularity level can be set such that a higher popularity level indicates greater pre-heating importance, or it can be customized according to specific application scenarios; this embodiment of the invention does not impose specific limitations. The historical hot data query information is the time information of when the hot data was queried before the database switch. The historical time range can be customized according to specific application needs, such as the previous natural day, the previous week, etc.; this embodiment of the invention does not impose specific limitations. The hot data attribute information is information used to characterize the attributes of the hot data, such as information indicating the hot data storage location, resource search, and file records.

[0072] 102. Determine the preheating time parameter of the hot data based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, and determine the preheating concurrency parameter based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy.

[0073] In this embodiment of the invention, since the services corresponding to hot data differ, the corresponding query time periods will also vary. To avoid blindly preheating hot data for the entire time period, a preheating time parameter configuration strategy is used to configure corresponding preheating time parameters for hot data with different popularity levels and different historical hot data query information. The preheating time parameter includes at least one preheating time period, each with a preheating start time and a preheating end time. The preheating time parameter configuration strategy is based on historical data preheating experience and includes at least one rule for configuring the preheating time parameters. For example, different configuration rules for preheating time parameters are set for hot data with different popularity levels.

[0074] After obtaining the warm-up time parameter, a multi-threaded concurrent query approach is adopted to further improve data query efficiency and prevent data from being moved out of memory. To further improve the accuracy of thread configuration, warm-up concurrency parameter configuration strategies are implemented based on the warm-up time parameter and popularity level, configuring warm-up concurrency parameters for corresponding hot data. The warm-up concurrency parameter represents the number of concurrent queries from disk for hot data. The warm-up concurrency parameter configuration strategy is set based on concurrent query speed and historical concurrent query data, and includes at least one rule for configuring the warm-up concurrency parameters. For example, different concurrency levels are allocated to hot data corresponding to different popularity levels within a certain warm-up time period, with higher-popularity-level hot data configured with a larger concurrency level.

[0075] It should be noted that configuring preheating time parameters for hot data using a preheating time parameter configuration strategy significantly improves the accuracy of preheating time settings, avoids ineffective preheating, thereby reducing resource consumption during data preheating and enhancing its effectiveness. Simultaneously, configuring corresponding preheating concurrency parameters for hot data using a preheating concurrency parameter configuration strategy allows for more targeted concurrency parameter configuration, leading to higher data query frequencies for important data and better preheating results, thus effectively improving the accuracy and efficiency of data preheating.

[0076] 103. Read target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and store the target medical service data in the cache space to complete the database preheating.

[0077] In this embodiment of the invention, the target medical service database is a restarted medical service database or a switched medical service database. Based on the preheating time parameter and the data query concurrency parameter corresponding to each hot data point, the corresponding hot data is read from the target medical service database according to the hot data attribute information. The read hot data is then stored in the cache space to complete the data preheating. By reading different hot data according to the corresponding preheating time and concurrency parameters, the amount of data read can be greatly reduced while increasing the data read speed, thereby effectively improving the data preheating efficiency.

[0078] For further explanation and limitation, such as Figure 2 As shown, step 102, which involves determining the preheating time parameter of the hot data based on the popularity level, the historical hot data query information, and the preheating time parameter configuration strategy, includes:

[0079] 201. Calculate the query time distribution of each hot data based on the historical hot data query information, and determine at least one time period in the query time distribution where the number of queries is greater than a preset query volume threshold as the initial warm-up time parameter of the hot data.

[0080] 202. Match the target preheating time configuration coefficient corresponding to the heat level from the preheating time configuration coefficient mapping relationship set.

[0081] 203. The preheating time parameters are calculated based on the target preheating time configuration coefficient and the initial preheating time parameters.

[0082] In this embodiment of the invention, to achieve accurate preheating of hot data, statistical analysis is performed on historical hot data query information for different hot data to obtain the query time distribution of different hot data, that is, the distribution of the number of queries for hot data in different time periods. Based on a preset query volume threshold, time periods with relatively concentrated queries are filtered out to obtain initial preheating time parameters. For example, if the number of queries for pharmacy dispensing data is 100 times between 8:00-8:30 and 2 times between 19:00-20:00, and the preset query volume threshold is 10 times, then 8:00-8:30 is selected as one time period in the initial preheating time parameters. The preset query volume threshold can be customized according to specific application needs, and this embodiment of the invention does not impose specific limitations.

[0083] Because data query times fluctuate, to improve the compatibility of data warm-up times, after obtaining the initial warm-up time parameters, the initial warm-up time parameters are used as the base time period. This base time period is then expanded based on the target warm-up time configuration coefficient to broaden the coverage of the warm-up time. Specifically, the length of the time period in the initial warm-up time parameters is multiplied by the target warm-up time configuration coefficient to obtain the final warm-up time period, i.e., the warm-up time parameter. For example, if the base warm-up time period in the initial warm-up time parameters is 8:00-9:00 and the target warm-up time configuration coefficient is 1.5, then the warm-up time period in the obtained warm-up time parameter will be 7:45-9:15.

[0084] It should be noted that the target preheating time configuration coefficient is matched from the preheating time configuration coefficient mapping relationship set according to the corresponding popularity level. The preheating time configuration coefficient mapping relationship set includes preheating time configuration coefficients corresponding to different popularity levels. The greater the importance of the hot data represented by the popularity level, the larger the corresponding target preheating time configuration coefficient. The size of the target preheating time configuration coefficient can be customized according to specific application needs, and this embodiment of the invention does not impose specific limitations. By statistically analyzing historical query times to obtain initial preheating time parameters that can describe the query time pattern of hot data, and expanding the initial preheating time parameters based on the target preheating time configuration coefficients corresponding to different popularity levels, it is possible to accurately extract effective data preheating time information while ensuring the coverage of preheating time and giving important data a longer preheating time, thereby effectively improving the preheating accuracy of data preheating.

[0085] For further explanation and limitation, such as Figure 3 As shown, step 102, which involves determining the preheating concurrency parameters based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy, includes:

[0086] 301. Based on the preheating time parameter, the hotspot data is divided to obtain at least one hotspot data group.

[0087] 302. Based on the heat level, each hot data group is divided into subgroups corresponding to different heat levels.

[0088] 303. According to the preset weight coefficients corresponding to different heat levels, allocate different concurrency numbers to each of the subgroups, and calculate the preheating concurrency parameters of the hot data based on the concurrency numbers.

[0089] In this embodiment of the invention, a concurrent query method is used to query hot data to shorten the data query time and ensure the data preheating effect. Considering that the preheating time corresponding to multiple hot data overlaps, and multiple hot data of different popularity levels are simultaneously executed concurrently, the hot data with overlapping preheating time periods are first divided into groups, resulting in multiple hot data groups. The hot data in each hot data group share the total number of concurrent threads. Further, each hot data group is divided into subgroups corresponding to different popularity levels according to the popularity level of the hot data, and the hot data in each subgroup have the same popularity level. Then, in order to ensure that important hot data has a better preheating effect, concurrent threads are allocated based on preset weight coefficients corresponding to different popularity levels. The higher the popularity level, the larger the preset weight coefficient. For example, the popularity levels include a first popularity level, a second popularity level, and a third popularity level, ranked from high to low. The subgroup of the first popularity level has a preset weight coefficient of 0.5, the subgroup of the second popularity level has a preset weight coefficient of 0.3, and the subgroup of the third popularity level has a preset weight coefficient of 0.2. After determining the concurrency level for each subgroup, the concurrency level is evenly distributed among each hot data point to determine the preheating concurrency level for each hot data point, i.e., the preheating concurrency parameter. The preset weighting coefficient can be customized according to specific application requirements; this embodiment of the invention does not impose specific limitations. By grouping hot data and configuring concurrency weights based on popularity levels, reasonable allocation of concurrency resources can be achieved, thereby effectively improving the preheating efficiency of data preheating.

[0090] For further explanation and limitation, before obtaining the hotspot data list in response to the medical service database adjustment instruction in step 102, the method further includes:

[0091] Obtain the initial hot data list, historical query frequency information of expected medical service data, preset business types, and hot data attribute information.

[0092] Based on the trained popularity prediction model, the initial hot data list, the historical query frequency information, and the preset business type are used to predict the popularity level of the expected medical service data.

[0093] The medical service data whose popularity level meets the preset popularity level restriction conditions are identified as hot data, and a hot data list is constructed based on the popularity level of the hot data and the expected medical service data attribute information.

[0094] In this embodiment of the invention, the initial hotspot data information includes information on pre-warmed data in the previous database before database adjustments. The expected medical service data refers to the medical service data in the current database after the database adjustments. The preset business type is pre-defined for the business corresponding to the medical service data, used to characterize the importance of the business and the frequency of its execution. To determine the popularity level of the medical service data, a pre-trained popularity prediction model is used to predict the initial hotspot data information, historical query frequency information of the medical service data, and the preset business type of the medical service data to obtain the popularity level of the medical service data. After obtaining the popularity level, hotspot data is identified from the medical service data based on preset popularity level constraints. For example, if the popularity levels of medical service data include first to fifth popularity levels, and the preset popularity level constraint is that the popularity level is greater than or equal to the third popularity level, then medical service data with a popularity level greater than or equal to the third popularity level is identified as hotspot data. By predicting the popularity level of medical service data based on a popularity prediction model and filtering the medical service data based on preset popularity level restrictions, it is possible to accurately extract hot data with high query frequency and high business level from the medical service data, thereby effectively improving the accuracy of data preheating.

[0095] For further explanation and limitation, before the method performs prediction processing on the initial hotspot data information, the historical query frequency information, and the preset business type based on the trained heat prediction model to obtain the heat level of the medical service data, the method further includes:

[0096] An initial popularity prediction model was constructed, and a training sample set was built based on historical hot data, historical query frequency information of global medical service data, and preset business types.

[0097] The initial popularity prediction model is trained using the training sample set to obtain a completed popularity prediction model.

[0098] In this embodiment of the invention, historical hotspot data information refers to the information of hotspot data that has been used as preheating targets within a preset historical time interval. The preset historical time interval can be customized according to actual application needs, and this embodiment of the invention does not impose a specific limitation. Global medical service data refers to all medical service data within the medical service system. To accurately assess the popularity level of medical service data, an initial popularity prediction model is pre-constructed. This initial model can be a long short-term memory neural network model, or other prediction network models, and this embodiment of the invention does not impose a specific limitation.

[0099] It should be noted that by constructing training samples based on historical hotspot data, query data of global medical service data, and business level data, the importance of data can be evaluated from multiple aspects such as historical preheating objects, data query frequency, and business importance, making the training sample data more comprehensive and reliable, thereby improving the accuracy of the heat prediction model.

[0100] For further explanation and limitation, before reading the target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hotspot data attribute information, the method further includes:

[0101] Obtain operational performance information, which includes at least one of interface performance, response latency performance, and processing speed.

[0102] The time distribution of data query volume is calculated based on the historical data query information, and the maximum concurrent query volume is configured based on the maximum value in the concurrent query volume distribution.

[0103] The thread configuration information is determined based on the maximum concurrent query volume and the running performance, and a thread pool for reading target medical service data is created based on the thread configuration information.

[0104] In this embodiment of the invention, data is queried concurrently. To meet concurrency requirements, the maximum concurrent query volume of the expected number of queries is pre-assessed, i.e., the concurrent query volume required for the possible peak of data queries. Based on the current execution server's operating capacity and experience in thread configuration for servers with different operating capacities to handle different concurrent query volumes, a thread pool that meets the maximum concurrent query volume is configured.

[0105] For further explanation and limitation, after storing the target medical service data in memory space, the method further includes:

[0106] The validity of the target medical service data is verified based on the preset medical service data. If the validity verification result is that the verification fails, the concurrent query of the target medical service data is stopped, and an early warning message is generated to indicate that the data is not warmed up.

[0107] In this embodiment of the invention, considering that errors in hot data attribute information or interface calls may occur during data querying and reading, resulting in discrepancies between the actual preheated hot data values ​​and the values ​​of the hot data to be preheated in the hot data list, thus rendering the preheating ineffective, a `preRES` method is used to compare the queried values ​​with preset correct values ​​to verify the validity of the target medical service data. If the verification is successful, preheating continues; if the verification fails, preheating stops, and an early warning message is issued to prompt developers to investigate and intervene, thereby avoiding preheated data errors and effectively improving the accuracy of data preheating.

[0108] This invention provides a data preheating method. In an embodiment of this invention, in response to an adjustment command from a medical service database, a list of hot data is obtained. This list includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information. A preheating time parameter is determined for the hot data based on the heat level, the historical hot data query information, and a preheating time parameter configuration strategy. A preheating concurrency parameter is also determined based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy. Target medical service data is read from the target medical service database according to the preheating concurrency parameter, the preheating time parameter, and the hot data attribute information, and the target medical service data is stored in a cache space to complete database preheating. Different preheating time parameters and preheating concurrency parameters are used for data queries based on different heat levels of hot data, thereby preheating the data and significantly reducing memory resource consumption. Simultaneously, targeted data preheating is achieved, effectively improving the accuracy and efficiency of data preheating.

[0109] Furthermore, as a response to the above Figure 1 To implement the method shown, this embodiment of the invention provides a data preheating device, such as... Figure 4 As shown, the device includes:

[0110] The acquisition module 41 is used to acquire a list of hot data in response to an adjustment instruction from the medical service database. The list of hot data includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information.

[0111] The determination module 42 is used to determine the preheating time parameter of the hot data based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, and to determine the preheating concurrency parameter based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy.

[0112] The preheating module 43 is used to read target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and store the target medical service data in the cache space to complete the database preheating.

[0113] Furthermore, the determining module 42 includes:

[0114] The first calculation unit is used to calculate the query time distribution of each hot data based on the historical hot data query information, and to determine at least one time period in the query time distribution where the number of queries is greater than a preset query volume threshold as the initial warm-up time parameter of the hot data.

[0115] A matching unit is used to match the target preheating time configuration coefficient corresponding to the heat level from the preheating time configuration coefficient mapping relationship set, wherein the preheating time configuration coefficient mapping relationship set includes preheating time configuration coefficients corresponding to different heat levels;

[0116] The second calculation unit is used to calculate the preheating time parameters based on the target preheating time configuration coefficient and the initial preheating time parameters.

[0117] Further, the determining unit 42 includes:

[0118] The first partitioning unit is used to partition the hotspot data based on the preheating time parameter to obtain at least one hotspot data group.

[0119] The second division unit is used to divide each of the hot data groups according to the heat level to obtain subgroups corresponding to different heat levels;

[0120] The third calculation unit is used to allocate different concurrency levels to each of the subgroups according to preset weight coefficients corresponding to different heat levels, and to calculate the preheating concurrency parameters of the hot data based on the concurrency levels.

[0121] Furthermore, the device also includes:

[0122] The acquisition module 41 is also used to acquire initial hotspot data information, historical query frequency information of expected medical service data, preset business types, and expected medical service data attribute information;

[0123] The prediction module is used to perform prediction processing on the initial hot data information, the historical query frequency information, and the preset business type based on the trained heat prediction model to obtain the heat level of the medical service data.

[0124] The first construction module is used to identify medical service data whose popularity level meets the preset popularity level restriction conditions as hot data, and to construct a hot data list based on the popularity level of the hot data and the expected medical service data attribute information.

[0125] Furthermore, the device also includes:

[0126] The second construction module is used to build an initial popularity prediction model and construct a training sample set based on historical hot data information, historical query frequency information of global medical service data, and preset business types.

[0127] The training module is used to train the initial popularity prediction model using the training sample set to obtain a trained popularity prediction model.

[0128] Furthermore, the device also includes:

[0129] The acquisition module 41 is also used to acquire operating performance information, which includes at least one of interface performance, response latency performance, and processing speed.

[0130] The configuration module is used to calculate the time distribution of data query volume based on the historical hot data query information, and configure the maximum concurrent query volume according to the maximum value in the concurrent query volume distribution;

[0131] A creation module is used to determine thread configuration information based on the maximum concurrent query volume and the running performance, and to create a thread pool for reading target medical service data based on the thread configuration information.

[0132] Furthermore, the device also includes:

[0133] The verification module is used to verify the validity of the target medical service data based on preset medical service data. If the result of the validity verification is that the verification fails, the concurrent query of the target medical service data is stopped, and an early warning message is generated to indicate that the data is not ready.

[0134] This invention provides a data preheating device. In embodiments of this invention, in response to an adjustment command from a medical service database, a list of hot data is obtained. This list includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information. A preheating time parameter is determined for the hot data based on the heat level, the historical hot data query information, and a preheating time parameter configuration strategy. A preheating concurrency parameter is also determined based on the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy. Target medical service data is read from the target medical service database according to the preheating concurrency parameter, the preheating time parameter, and the hot data attribute information, and the target medical service data is stored in a cache space to complete database preheating. Different preheating time parameters and preheating concurrency parameters are used for data queries based on different heat levels of hot data, thereby preheating the data and significantly reducing memory resource consumption. Simultaneously, targeted data preheating is achieved, effectively improving the accuracy and efficiency of data preheating.

[0135] According to one embodiment of the present invention, a storage medium is provided, the storage medium storing at least one executable instruction, the computer-executable instruction being capable of executing the data preheating method in any of the above method embodiments.

[0136] Figure 5 The diagram illustrates a structural schematic of a computer device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.

[0137] like Figure 5 As shown, the computer device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.

[0138] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.

[0139] Communication interface 504 is used to communicate with other network elements such as clients or other servers.

[0140] The processor 502 is used to execute program 510, which can specifically execute the relevant steps in the above-described data preheating method embodiment.

[0141] Specifically, program 510 may include program code that includes computer operation instructions.

[0142] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0143] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0144] Specifically, program 510 can be used to cause processor 502 to perform the following operations:

[0145] In response to the medical service database adjustment instruction, a hot data list is obtained, which includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information;

[0146] The preheating time parameters of the hot data are determined based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, and the preheating concurrency parameters are determined based on the preheating time parameters, the heat level, and the preheating concurrency parameter configuration strategy.

[0147] The target medical service data is read from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and the target medical service data is stored in the cache space to complete the database preheating.

[0148] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.

[0149] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A data preheating method, characterized in that, include: In response to the medical service database adjustment instruction, a hot data list is obtained, which includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information; The preheating time parameters of the hot data are determined based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, wherein the preheating time parameters include at least one preheating time period; and different concurrency numbers are allocated to hot data corresponding to different heat levels within any preheating time period according to the preheating time parameters, the heat level, and the preheating concurrency parameter configuration strategy to obtain the preheating concurrency parameters. The step of determining the preheating time parameter of the hot data based on the popularity level, the historical hot data query information, and the preheating time parameter configuration strategy includes: calculating the query time distribution of each hot data based on the historical hot data query information, and determining at least one time period in the query time distribution where the number of queries is greater than a preset query volume threshold as the initial preheating time parameter of the hot data; matching the target preheating time configuration coefficient corresponding to the popularity level from the preheating time configuration coefficient mapping relationship set, wherein the preheating time configuration coefficient mapping relationship set includes preheating time configuration coefficients corresponding to different popularity levels; and calculating the preheating time parameter based on the target preheating time configuration coefficient and the initial preheating time parameter. Specifically, the preheating concurrency parameter is obtained by allocating different concurrency levels to hot data corresponding to different popularity levels within any preheating time period based on the preheating time parameter, the popularity level, and the preheating concurrency parameter configuration strategy. This includes: dividing the hot data based on the preheating time parameter to obtain at least one hot data group; dividing each hot data group based on the popularity level to obtain subgroups corresponding to different popularity levels; allocating different concurrency levels to each subgroup according to preset weight coefficients corresponding to different popularity levels; and calculating the preheating concurrency parameter of the hot data based on the concurrency level. According to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, the target medical service data is read from the target medical service database and stored in the cache space to complete the database preheating.

2. The method according to claim 1, characterized in that, Before obtaining the hot data list in response to the medical service database adjustment instruction, the method further includes: Obtain initial hotspot data information, historical query frequency information of expected medical service data, preset business types, and expected medical service data attribute information; Based on the trained popularity prediction model, the initial hot data information, the historical query frequency information, and the preset business type are predicted to obtain the popularity level of the medical service data. The medical service data whose popularity level meets the preset popularity level restriction conditions are identified as hot data, and a hot data list is constructed based on the popularity level of the hot data and the expected medical service data attribute information.

3. The method according to claim 2, characterized in that, Before the method performs prediction processing on the initial hotspot data information, the historical query frequency information, and the preset business type based on the trained heat prediction model to obtain the heat level of the medical service data, the method further includes: An initial popularity prediction model was constructed, and a training sample set was built based on historical hot data information, historical query frequency information of global medical service data, and preset business types. The initial popularity prediction model is trained using the training sample set to obtain a completed popularity prediction model.

4. The method according to claim 1, characterized in that, Before reading target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hotspot data attribute information, the method further includes: Obtain operational performance information, which includes at least one of interface performance, response latency performance, and processing speed; The concurrent query volume distribution is calculated based on the historical hot data query information, and the maximum concurrent query volume is configured based on the maximum value in the concurrent query volume distribution; The thread configuration information is determined based on the maximum concurrent query volume and the running performance, and a thread pool for reading target medical service data is created based on the thread configuration information.

5. The method according to claim 1, characterized in that, After storing the target medical service data in the cache space, the method further includes: The validity of the target medical service data is verified based on the preset medical service data. If the validity verification result is that the verification fails, the concurrent query of the target medical service data is stopped, and an early warning message is generated to indicate that the data is not warmed up.

6. A data preheating device, characterized in that, The apparatus is used to perform the operations corresponding to the data preheating method as described in any one of claims 1-5, including: The acquisition module is used to acquire a list of hot data in response to an adjustment instruction from the medical service database. The list of hot data includes the heat level corresponding to the hot data, historical hot data query information, and hot data attribute information. The determination module is used to determine the preheating time parameter of the hot data based on the heat level, the historical hot data query information, and the preheating time parameter configuration strategy, wherein the preheating time parameter includes at least one preheating time period; and to allocate different concurrency numbers to hot data corresponding to different heat levels within any preheating time period according to the preheating time parameter, the heat level, and the preheating concurrency parameter configuration strategy, thereby obtaining the preheating concurrency parameter. The preheating module is used to read target medical service data from the target medical service database according to the preheating concurrency parameters, the preheating time parameters, and the hot data attribute information, and store the target medical service data in the cache space to complete the database preheating.

7. A storage medium storing at least one executable instruction that causes a processor to perform an operation corresponding to the data warm-up method as described in any one of claims 1-5.

8. A computer device, comprising: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction, which causes the processor to perform the operation corresponding to the data warm-up method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data preheating method and device, server and storage medium

    CN109933544A

  • Cache preheating method and device, computer equipment and storage medium

    CN113849532A