CN-115757480-B - Data preheating method and device, storage medium and computer equipment
Abstract
The invention 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. The method mainly comprises the steps of responding to a medical service database adjustment instruction to obtain a hot spot data list, determining a preheating time parameter of hot spot data according to the heat level, historical hot spot data query information and a preheating time parameter configuration strategy, determining a preheating concurrency parameter according to the preheating time parameter, the heat level and the preheating concurrency parameter configuration strategy, reading target medical service data from a target medical service database according to the preheating concurrency parameter, the preheating time parameter and the hot spot data attribute information, and storing the target medical service data into a cache space to finish database preheating. The method is mainly used for preheating database data.
Inventors
- WANG JUN
Assignees
- 平安付科技服务有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221115
Claims (8)
- 1. A method of preheating data, comprising: Responding to a medical service database adjustment instruction, and acquiring a hot spot data list, wherein the hot spot data list comprises a heat level corresponding to hot spot data, historical hot spot data query information and hot spot data attribute information; Determining a preheating time parameter of the hot spot data according to the heat level, the historical hot spot data query information and a preheating time parameter configuration strategy, wherein the preheating time parameter comprises at least one preheating time period; different concurrency amounts are distributed for the hot spot data corresponding to different heat levels in any preheating time period according to the preheating time parameter, the heat level and the preheating concurrency parameter configuration policy, so that the preheating concurrency parameter is obtained; The method comprises the steps of determining the preheating time parameters of the hot spot data according to the heat level, historical hot spot data query information and a preheating time parameter configuration strategy, wherein the step of calculating the query time distribution of each hot spot data according to the historical hot spot data query information, and determining at least one time period with the query times larger than a preset query quantity threshold in the query time distribution as an initial preheating time parameter of the hot spot data; The method comprises the steps of distributing different concurrency amounts for hot spot data corresponding to different heat levels in any preheating time period according to the preheating time parameter, the heat level and a preheating concurrency parameter configuration policy to obtain a preheating concurrency parameter, wherein the method comprises the steps of dividing the hot spot data based on the preheating time parameter to obtain at least one hot spot data packet; dividing each hot spot data group based on the heat level to obtain sub-groups corresponding to different heat levels, distributing different concurrency numbers for each sub-group according to preset weight coefficients corresponding to different heat levels, and calculating according to the concurrency numbers to obtain preheating concurrency parameters of the hot spot data; And reading target medical service data from a target medical service database according to the preheating concurrency parameter, the preheating time parameter and the hot spot data attribute information, and storing the target medical service data into a cache space to finish database preheating.
- 2. The method of claim 1, wherein prior to obtaining the list of hotspot data in response to the healthcare database adjustment instruction, the method further comprises: Acquiring initial hot spot data information, historical query frequency information of expected medical service data, preset service types and expected medical service data attribute information; performing prediction processing on the initial hot spot data information, the historical query frequency information and the preset service type based on the trained heat prediction model to obtain the heat level of the medical service data; And determining the medical service data with the heat level meeting the preset heat level limiting condition as hot spot data, and constructing a hot spot data list based on the heat level of the hot spot data and the expected medical service data attribute information.
- 3. The method according to claim 2, wherein the predicting the initial hot spot data information, the historical query frequency information, and the preset service type based on the trained heat prediction model, and before obtaining the heat level of the medical service data, the method further comprises: An initial heat prediction model is built, and a training sample set is built based on historical hot spot data information, historical query frequency information of global medical service data and preset service types; And training the initial heat prediction model by using the training sample set to obtain a heat prediction model after training.
- 4. The method of claim 1, wherein prior to reading the target healthcare data from the target healthcare database in accordance with the preheat concurrency parameter, the preheat time parameter, and the hotspot data attribute information, the method further comprises: Acquiring operation performance information, wherein the operation performance information at least comprises one of interface performance, response delay performance and processing speed; Calculating to obtain concurrent query volume distribution according to the historical hotspot data query information, and configuring the maximum concurrent query volume according to the maximum value in the concurrent query volume distribution; and determining thread configuration information according to the maximum concurrency query quantity and the running performance, and creating a thread pool for reading target medical service data according to the thread configuration information.
- 5. The method of claim 1, wherein after storing the target healthcare data to a cache space, the method further comprises: and carrying out validity check on the target medical service data based on preset medical service data, and if the result of the validity check is that the verification fails, stopping carrying out concurrent query on the target medical service data and generating early warning information for prompting data preheating errors.
- 6. A data preheating apparatus, wherein the apparatus is configured to perform operations corresponding to the data preheating method according to any one of claims 1 to 5, and the apparatus comprises: The acquisition module is used for responding to the medical service database adjustment instruction and acquiring a hot spot data list, wherein the hot spot data list comprises a heat level corresponding to hot spot data, historical hot spot data query information and hot spot data attribute information; The system comprises a determining module, a preheating time parameter configuration module and a preheating concurrency parameter configuration module, wherein the determining module is used for determining the preheating time parameter of the hot spot data according to the heat level, the historical hot spot data query information and the preheating time parameter configuration strategy, wherein the preheating time parameter comprises at least one preheating time period; And the preheating module is used for reading target medical service data from a target medical service database according to the preheating concurrency parameter, the preheating time parameter and the hot spot data attribute information, and storing the target medical service data into a cache space so as to finish database preheating.
- 7. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the data pre-heating method of any one of claims 1-5.
- 8. A computer device comprising a processor, a memory, a communication interface and a communication bus, said processor, said memory and said communication interface completing communication with each other through said communication bus; The memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the operations corresponding to the data preheating method according to any one of claims 1 to 5.
Description
Data preheating method and device, storage medium and computer equipment Technical Field The present invention relates to the field of computer technologies, and in particular, to a data preheating method and apparatus, a storage medium, and a computer device. Background The access of the database needs to be read from the disk to the memory to provide access, but the access speed of the memory is nanosecond (10 to the power of-9), the access speed of the disk is millisecond (10 to the power of-3) and is different by several orders of magnitude, and the data in the hard disk needs to be stored in the memory in advance to meet the access requirement. However, when the database is switched or restarted, the data in the database can be forcedly refreshed to the disk, and when an application program is connected to the database, the required data cannot be obtained from the memory, so that the hit rate of the data is very low, the response speed of the service is influenced, the consumption of the disk is even increased, and the bad effect of avalanche type is caused. In order to ensure the hit rate of database access and the service response speed, when database switching or database restarting occurs, all data in a disk are continuously inquired so as to keep the data in a memory, thereby maintaining the heat of the data. However, since the data amount of the preheating data is large, the data inquiry time is long, and the time interval between two data inquiries is too long, so that the data is brushed out from the memory, and the data preheating efficiency is low. Disclosure of Invention In view of the above, the present invention provides a method and apparatus for preheating data, which mainly aims at solving the problem of low efficiency of preheating data. According to one aspect of the present invention, there is provided a data preheating method including: Responding to a medical service database adjustment instruction, and acquiring a hot spot data list, wherein the hot spot data list comprises a heat level corresponding to hot spot data, historical hot spot data query information and hot spot data attribute information; determining a preheating time parameter of the hot spot data according to the heat level, the historical hot spot data query information and a preheating time parameter configuration strategy, and determining a preheating concurrency parameter according to the preheating time parameter, the heat level and the preheating concurrency parameter configuration strategy; And reading target medical service data from a target medical service database according to the preheating concurrency parameter, the preheating time parameter and the hot spot data attribute information, and storing the target medical service data into a cache space to finish database preheating. Further, the determining the warm-up time parameter of the hot spot data according to the heat level, the historical hot spot data query information, and the warm-up time parameter configuration policy includes: Calculating according to the historical hot spot data query information to obtain query time distribution of each hot spot data, and determining at least one time period with the query times larger than a preset query quantity threshold in the query time distribution as an initial preheating time parameter of the hot spot data; Matching target preheating time configuration coefficients corresponding to the heat levels from a preheating time configuration coefficient mapping relation set, wherein the preheating time configuration coefficient mapping relation set comprises preheating time configuration coefficients corresponding to different heat levels; and calculating the preheating time parameter according to the target preheating time configuration coefficient and the initial preheating time parameter. Further, the determining the preheating concurrency parameter according to the preheating time parameter, the heat level and the preheating concurrency parameter configuration policy includes: dividing the hot spot data based on the preheating time parameter to obtain at least one hot spot data packet; Dividing each hot spot data packet based on the heat level to obtain sub-packets corresponding to different heat levels; and according to preset weight coefficients respectively corresponding to different heat levels, different concurrency numbers are allocated to each sub-group, and preheating concurrency parameters of the hot spot data are obtained through calculation according to the concurrency numbers. Further, before the obtaining of the hot spot data list in response to the medical service database adjustment instruction, the method further includes: Acquiring initial hot spot data information, historical query frequency information of expected medical service data, preset service types and expected medical service data attribute information; performing prediction processing on the initial hot spot data information,