Method and device for extending cache data expiration, electronic device and storage medium

By obtaining and debugging parameters from the cloud configuration center, adjusting the cache parameters of non-relational databases, and delaying processing of expiration timestamps of access requests, the database crash problem caused by Redis cache breakdown is solved, and the success of preventing database cache breakdown is improved. Rate.

CN117873919BActive Publication Date: 2024-11-12FOSHAN GAOMING ANHUA CERAMIC SANITARY WARE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410023002.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-05
Publication Date
2024-11-12
Estimated Expiration
2044-01-05

AI Technical Summary

Technical Problem

When dealing with Redis cache breakdown, the existing technology is prone to failure to prevent cache breakdown due to improper setting of expiration timeout parameters and expiration renewal time parameters, resulting in database crashes. How to improve the success rate of preventing database cache breakdown has become an urgent problem. question.

Method used

By obtaining and debugging the expiration timeout parameters and expiration renewal parameters from the cloud configuration center, filtering out the target parameter configuration based on the processor performance data, adjusting the cache parameters of non-relational databases, and delaying processing of the expiration time stamp of the access request, ensuring that the high Avoid cache breakdown in concurrent traffic environments.

Benefits of technology

It improves the success rate of preventing database cache breakdown, avoids the problem of non-relational data expiration under high concurrent traffic, and ensures the security of the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117873919B_ABST
    Figure CN117873919B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method and device for extending the expiration of cached data, an electronic device, and a storage medium, and belong to the field of artificial intelligence technology. The method includes: debugging the cloud expiration timeout parameters and cloud expiration continuation parameters of the cloud configuration center to obtain a parameter configuration set; according to the parameter configuration set, filtering the target performance data with the smallest resource occupancy rate; searching the cloud target parameter configuration corresponding to the target performance data from the parameter configuration set; according to the cloud target parameter configuration, changing the parameters in the preset non-relational database to obtain the target cache parameters; when a preset number of access requests are received, obtaining the remaining expiration time of the request data in the preset non-relational database; delaying the expiration of the request data whose remaining expiration time is less than or equal to the expiration time. The embodiments of the present application can improve the success rate of preventing database cache breakdown.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method and device for extending the expiration of cached data, an electronic device, and a storage medium. Background Art

[0002] At present, when dealing with the Redis cache breakdown problem, most companies use the method of extending the expiration time of cached data. However, when extending the expiration time of cached data, it is easy to cause the failure of anti-cache breakdown due to the setting problems of expiration timeout time parameters and expiration renewal time parameters, causing database crash. Therefore, how to improve the success rate of preventing database cache breakdown has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a method and device for extending the expiration of cache data, an electronic device and a storage medium, aiming to improve the success rate of preventing database cache breakdown.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for extending cache data expiration, the method comprising:

[0005] Obtain cloud expiration timeout parameters and cloud expiration continuation parameters from the cloud configuration center;

[0006] Debugging the cloud expiration timeout parameter and the cloud expiration continuation parameter to obtain a parameter configuration set, wherein the parameter configuration set includes an expiration timeout debugging parameter and an expiration continuation debugging parameter;

[0007] Acquiring processor performance data in a central processing unit according to the parameter configuration set;

[0008] Filtering target performance data from the processor performance data based on a preset resource occupancy rate, wherein the preset resource occupancy rate is a system resource occupancy ratio represented by the processor performance data, and the target performance data has the smallest resource occupancy rate;

[0009] Searching the parameter configuration of the target performance data from the parameter configuration set to obtain a cloud target parameter configuration, wherein the cloud target parameter configuration includes an expiration timeout target parameter and an expiration continuation target parameter;

[0010] According to the cloud target parameter configuration, the cache parameter configuration in the preset non-relational database is changed to obtain the target cache parameters, wherein the preset non-relational database is a database based on the remote dictionary service, and the target cache parameters include a target cache expiration timeout value and a target cache expiration continuation value;

[0011] When a preset number of access requests are received, obtaining an expiration timestamp of the requested data in the preset non-relational database, wherein the requested data is the data requested by the access request to the preset non-relational database;

[0012] According to the expiration timestamp, confirm the remaining expiration time of the request data, wherein the expiration timestamp is the time when the request data expires;

[0013] If the remaining expiration time is less than or equal to the target cache expiration timeout value, the expiration timestamp is delayed according to the target cache expiration continuation value to obtain a delayed timestamp of the request data;

[0014] The request data is deferred according to the delay timestamp.

[0015] In some embodiments, before changing the cache parameter configuration in the preset non-relational database according to the cloud target parameter configuration to obtain the target cache parameter, the method further includes:

[0016] Acquire specific event data, wherein the specific event data refers to the action of changes in the cloud expiration timeout parameter and the cloud expiration continuation parameter;

[0017] According to the specific event data, a function is generated for the cloud configuration center to obtain a hook function, wherein the initial hook function is a code for processing the specific event data.

[0018] In some embodiments, if the remaining expiration time is less than or equal to the target cache expiration timeout value, delay processing is performed on the expiration timestamp according to the target cache expiration continuation value to obtain the delayed timestamp of the request data, including:

[0019] The expiration timestamp and the target cache expiration duration value are summed to obtain a preliminary delay timestamp;

[0020] A random time value is added to the preliminary delay timestamp to obtain a delay timestamp, wherein the random time value is any time value within one second.

[0021] In some embodiments, confirming the remaining expiration time of the request data according to the expiration timestamp includes:

[0022] Obtaining system time, and generating a current timestamp according to the system time, wherein the system time refers to the time of the computer to which the preset non-relational database belongs;

[0023] The expiration timestamp and the current timestamp are calculated to obtain the remaining expiration time.

[0024] In some embodiments, after confirming the remaining expiration time of the request data according to the expiration timestamp, the method further includes:

[0025] If the remaining expiration time is not a positive number, passing the access request to a preset relational database, wherein the preset relational database is a database based on a relational model;

[0026] If the remaining expiration time is a positive number, the remaining expiration time is compared with the target cache expiration timeout value;

[0027] If the remaining expiration time is greater than the target cache expiration timeout value, respond to the access request corresponding to the requested data.

[0028] In some embodiments, the debugging of the cloud expiration timeout parameter and the cloud expiration continuation parameter to obtain a parameter configuration set includes:

[0029] Acquiring pressure environment data, wherein the pressure environment data is simulated high concurrent flow environment data;

[0030] According to the pressure environment data, the cloud expiration timeout parameter and the cloud expiration continuation parameter are modified to obtain an expiration timeout debugging parameter and an expiration continuation debugging parameter;

[0031] Combining the expiration timeout debugging parameter with the expiration continuation debugging parameter to obtain a parameter configuration;

[0032] The parameter configurations are arranged and combined in the order of modification time to obtain a parameter configuration set.

[0033] In some embodiments, the step of changing the cache parameter configuration in the non-relational database according to the cloud target parameter configuration to obtain the target cache parameter configuration includes:

[0034] Generate a configuration change notification according to the cloud target parameter configuration and the hook function, wherein the configuration change notification includes the cloud target parameter configuration;

[0035] Sending the configuration change notification to the preset non-relational database;

[0036] If the preset non-relational database successfully receives the configuration change notification, the cache parameter configuration in the preset non-relational database is modified according to the configuration change notification to obtain the target cache parameter configuration.

[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a device for extending cache data expiration, the device comprising:

[0038] A cloud parameter configuration module is used to obtain a cloud expiration timeout parameter and a cloud expiration continuation parameter from a cloud configuration center, debug the cloud expiration timeout parameter and the cloud expiration continuation parameter to obtain a parameter configuration set, wherein the parameter configuration set includes an expiration timeout debugging parameter and an expiration continuation debugging parameter, obtain processor performance data in a central processor according to the parameter configuration set, and select target performance data from the processor performance data based on a preset resource occupancy rate, wherein the resource occupancy rate is a system resource occupancy ratio represented by the processor performance data, and the target performance data has the smallest resource occupancy rate, search the parameter configuration of the target performance data from the parameter configuration set to obtain a cloud target parameter configuration, wherein the cloud target parameter configuration includes an expiration timeout target parameter and an expiration continuation target parameter;

[0039] A cache database parameter configuration module, used to modify the cache parameter configuration in the preset non-relational database according to the cloud target parameter configuration to obtain target cache parameters, wherein the preset non-relational database is a database based on a remote dictionary service, and the target cache parameters include a target cache expiration timeout value and a target cache expiration continuation value;

[0040] A request data query module, configured to, when receiving a preset number of access requests, obtain an expiration timestamp of the request data in the preset non-relational database, wherein the request data is data requested by the access request to the preset non-relational database, and confirm the remaining time of expiration of the request data according to the expiration timestamp, wherein the expiration timestamp is the time when the request data expires;

[0041] The request data delay module is used to delay the expiration timestamp according to the target cache expiration continuation value if the remaining expiration time is less than or equal to the target cache expiration timeout value, obtain the delay timestamp of the request data, and postpone the request data according to the delay timestamp.

[0042] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0043] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0044] The method and device for extending the expiration of cached data, the electronic device and the storage medium proposed in the present application adjust the cloud expiration timeout parameter and the cloud expiration continuation parameter of the cloud configuration center to the expiration timeout target parameter and the expiration continuation target parameter that meet the preset target, and change the cache parameter configuration in the preset non-relational database to the target cache expiration timeout value and the target cache expiration continuation value according to the expiration timeout target parameter and the expiration continuation target parameter. Furthermore, when a preset number of access requests are received, the request data accessed by the access request is delayed and expired according to the target cache expiration timeout value and the target cache expiration continuation value, thereby avoiding the problem of a large number of request data expiration of non-relational data in a high concurrent traffic environment, and improving the success rate of preventing database cache breakdown. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a flow chart of a method for extending cache data expiration provided by an embodiment of the present application;

[0046] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0047] Figure 3 yes Figure 1 Flow chart of step S105 in FIG.

[0048] Figure 4 yes Figure 3 Flow chart of step S302 in FIG.

[0049] Figure 5 yes Figure 3 Flow chart of step S304 in FIG.

[0050] Figure 6 yes Figure 5 Flow chart of step S502 in FIG.

[0051] Figure 7 yes Figure 1 Flow chart of step S106 in FIG.

[0052] Figure 8 It is a structural diagram of a device for extending cache data expiration provided in an embodiment of the present application;

[0053] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0057] First, some nouns involved in this application are analyzed:

[0058] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0059] At present, most companies use the method of extending the expiration time of cache data when dealing with the problem of cache breakdown in non-relational databases. However, when extending the expiration time of cache data, there is no accurate setting standard for the expiration timeout parameter and the expiration renewal time parameter. Therefore, when setting the expiration timeout parameter and the expiration renewal time parameter, it is easy for the expiration timeout parameter and the expiration renewal time parameter settings to be inconsistent with the upcoming high-concurrency traffic environment, resulting in failure to prevent cache breakdown and causing database crashes. Therefore, how to improve the success rate of preventing database cache breakdown has become a technical problem that needs to be solved urgently.

[0060] Based on this, the embodiments of the present application provide a method and device for extending the expiration of cached data, an electronic device, and a storage medium, aiming to improve the success rate of preventing database cache breakdown.

[0061] The method and device for extending the expiration of cached data, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the method for extending the expiration of cached data in the embodiments of the present application is described.

[0062] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0063] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0064] The method for extending the expiration of cached data provided in the embodiment of the present application relates to the field of artificial intelligence technology. The method for extending the expiration of cached data provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the method for extending the expiration of cached data, etc., but is not limited to the above forms.

[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0066] Figure 1 is an optional flowchart of a method for extending cache data expiration provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S110.

[0067] Step S101, obtaining cloud expiration timeout parameters and cloud expiration continuation parameters from a cloud configuration center;

[0068] Step S102, debugging the cloud expiration timeout parameter and the cloud expiration renewal parameter to obtain a parameter configuration set, wherein the parameter configuration set includes the expiration timeout debugging parameter and the expiration renewal debugging parameter;

[0069] Step S103, obtaining processor performance data in the central processing unit according to the parameter configuration set;

[0070] Step S104, based on a preset resource occupancy rate, target performance data is screened out from the processor performance data, wherein the preset resource occupancy rate is the system resource occupancy ratio represented by the processor performance data, and the resource occupancy rate of the target performance data is the smallest;

[0071] Step S105, searching the parameter configuration of the target performance data from the parameter configuration set to obtain the cloud target parameter configuration, wherein the cloud target parameter configuration includes an expiration timeout target parameter and an expiration continuation target parameter;

[0072] Step S106, according to the cloud target parameter configuration, modify the cache parameter configuration in the preset non-relational database to obtain the target cache parameters, wherein the preset non-relational database is a database based on the remote dictionary service, and the target cache parameters include the target cache expiration timeout value and the target cache expiration continuation value;

[0073] Step S107, when a preset number of access requests are received, obtaining an expiration timestamp of the requested data in the preset non-relational database, wherein the requested data is the data requested by the access request to the preset non-relational database;

[0074] Step S108, confirming the remaining expiration time of the request data according to the expiration timestamp, wherein the expiration timestamp is the time when the request data expires;

[0075] Step S109, if the remaining expiration time is less than or equal to the target cache expiration timeout value, the expiration timestamp is delayed according to the target cache expiration continuation value to obtain a delayed timestamp of the requested data;

[0076] Step S110, delaying the request data according to the delay timestamp.

[0077] In steps S101 to S110 shown in the embodiment of the present application, when obtaining the cloud expiration timeout parameter and the cloud expiration renewal parameter by searching the parameter list of the cloud configuration center, the cloud expiration timeout parameter and the cloud expiration renewal parameter are changed, and the changed expiration timeout debugging parameter and the expiration renewal debugging parameter are combined into a parameter configuration set, and further, the processor performance data of the central processor corresponding to each group of expiration timeout debugging parameters and expiration renewal debugging parameters in the parameter configuration set are checked, the processor performance data are calculated to obtain the resource occupancy rate of each group of processor performance data, and the target performance data with the smallest resource occupancy rate is screened out from the processor performance data, and according to the one-to-one correspondence between the processor performance data and the parameter configuration in the parameter configuration set, the parameter configuration corresponding to the target performance data is searched from the parameter configuration set to obtain the expiration timeout target parameter. and expiration renewal target parameters, and according to the expiration timeout target parameters and the expiration renewal target parameters, modify the cache parameter configuration in the preset non-relational database to obtain the target cache expiration timeout value and the target cache expiration renewal value. Secondly, when a preset number of access requests are received, if the data requested by the access request is stored in the preset non-relational database, search for the corresponding request data from the preset non-relational database, check the expiration timestamp of the request data, convert the expiration timestamp into the remaining expiration time of the request data, compare the remaining expiration time with the target cache expiration timeout value, and when the remaining expiration time is less than or equal to the target cache expiration timeout value, extend the expiration timestamp of the request data to obtain the delayed timestamp of the request data. Finally, according to the time corresponding to the delayed timestamp, extend the expiration time of the request data in the preset non-relational database.

[0078] In step S106 of some embodiments, the behavior of changing the cache parameter configuration may be triggered by a hook function of a cloud configuration center, or by a script file, but is not limited thereto.

[0079] In one application scenario, taking an e-commerce shopping platform during a shopping festival as an example, when the shopping festival arrives, the e-commerce shopping platform will face a long period of high concurrent traffic data, which will cause the cache database to be penetrated, thereby causing the platform to be paralyzed. Before the shopping festival is about to arrive, a stress test can be performed in the cloud configuration center to set a target cache expiration timeout value and a target cache expiration renewal value that can adapt to the high concurrent traffic data environment. When the e-commerce shopping platform is in a high concurrent traffic data environment, the request data of the client access request is delayed and expired according to the target cache expiration timeout value and the target cache expiration renewal value, thereby ensuring the security of the database.

[0080] In step S101 of some embodiments, when it is necessary to operate the cloud expiration timeout parameters and cloud expiration renewal parameters of the cloud configuration center, the cloud expiration timeout parameters and cloud expiration renewal parameters can be obtained by searching the configuration parameter list of the cloud configuration center.

[0081] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S205:

[0082] Step S201, obtaining pressure environment data, wherein the pressure environment data is simulated high concurrent flow environment data;

[0083] Step S202, modifying the cloud expiration timeout parameter and the cloud expiration renewal parameter according to the pressure environment data to obtain the expiration timeout debugging parameter and the expiration renewal debugging parameter;

[0084] Step S203, combining the expiration timeout debugging parameter with the expiration continuation debugging parameter to obtain a parameter configuration;

[0085] Step S204: Arrange and combine the parameter configurations in the order of modification time to obtain a parameter configuration set.

[0086] In step S201 of some embodiments, when debugging the cloud expiration timeout parameters and the cloud expiration continuation parameters, it is necessary to obtain pressure environment data for simulating a high concurrent traffic data scenario.

[0087] In step S202 of some embodiments, a virtual pressure environment is constructed based on the pressure environment data, the cloud configuration center system is placed in the virtual pressure environment, and the cloud expiration timeout parameters and the cloud expiration renewal parameters are modified to obtain the expiration timeout debugging parameters and the expiration renewal debugging parameters.

[0088] In step S203 of some embodiments, when the cloud expiration timeout parameter is modified, the expiration timeout debugging parameter and the cloud expiration continuation parameter at the same time are recorded, and the expiration timeout debugging parameter and the cloud expiration continuation parameter at the same time are combined to obtain the parameter configuration. In addition, when the cloud expiration continuation parameter is modified, the expiration continuation debugging parameter and the cloud expiration timeout parameter at the same time are recorded, and the expiration continuation debugging parameter and the cloud expiration timeout parameter at the same time are combined to obtain the parameter configuration.

[0089] In step S204 of some embodiments, each group of parameter configurations is sorted according to the modification time, and the sorted parameter configurations are combined to obtain a parameter configuration set.

[0090] In steps S201 to S204 shown in the embodiment of the present application, the cloud expiration timeout parameters and the cloud expiration renewal parameters under the virtual pressure environment are modified to obtain the expiration timeout debugging parameters and the expiration renewal debugging parameters, and the expiration timeout debugging parameters and the expiration renewal debugging parameters are arranged and combined according to the modification time to obtain a parameter configuration set, thereby ensuring that the preset non-relational database under the virtual pressure environment will not have cache breakdown, thereby protecting the security of the preset relational database.

[0091] In step S103 of some embodiments, the parameter configurations in each set of parameter configuration sets can prevent the preset non-relational database cache breakdown phenomenon from occurring in the virtual pressure environment. When the parameter configurations in each set of parameter configuration sets are running, the processor performance data of the corresponding central processing unit is different. Therefore, it is necessary to record and obtain the corresponding processor performance in the central processing unit according to each set of parameter configurations in the parameter configuration set. It should be noted that the processor performance data includes the CPU usage, memory usage, virtual memory size and memory size occupied by the central processing unit in the current state.

[0092] In step S104 of some embodiments, each set of processor performance data corresponds to a different resource occupancy rate. In order to minimize the occupancy of system resources, each set of processor performance data is compared to select target performance data with the lowest resource occupancy rate.

[0093] In step S105 of some embodiments, after obtaining the target performance data, the expiration timeout target parameters and the expiration renewal target parameters corresponding to the target performance data are searched in the parameter configuration set, so that the expiration timeout target parameters and the expiration renewal target parameters with the minimum resource occupancy rate based on preventing the preset non-relational database cache from being penetrated can be obtained.

[0094] See also Figure 3 In some embodiments, before step S106, the following steps may also be performed, but are not limited to, steps S301 to S304:

[0095] Step S301, obtaining specific event data, wherein the specific event data refers to the action of changes in cloud expiration timeout parameters and cloud expiration continuation parameters;

[0096] Step S302, based on the specific event data, a function is generated for the cloud configuration center to obtain a hook function, wherein the initial hook function is a code for processing the specific event data.

[0097] In steps S301 and S302 of some embodiments, before obtaining the modification parameters of the cloud expiration timeout parameters and the cloud expiration renewal parameters, it is also necessary to monitor the cloud expiration timeout parameters and the cloud expiration renewal parameters. Once the cloud expiration timeout parameters and the cloud expiration renewal parameters change, the corresponding program steps will be executed according to the set hook function.

[0098] In steps S301 to S302 shown in the embodiment of the present application, specific event data is set in advance, and functions are generated for the cloud configuration center according to the specific event data to obtain a hook function, so that when the cloud expiration timeout parameters and the cloud expiration renewal parameters are changed, subsequent system steps can be executed according to the hook function in the first place, thereby ensuring the timeliness of the transmission of the cloud expiration timeout parameters and the cloud expiration renewal parameters change messages.

[0099] See also Figure 4 In some embodiments, step S106 may include but is not limited to steps S401 to S403:

[0100] Step S401, generating a configuration change notification according to the cloud target parameter configuration and the hook function, wherein the configuration change notification includes the cloud target parameter configuration;

[0101] Step S402, sending a configuration change notification to a preset non-relational database;

[0102] Step S403: if the preset non-relational database successfully receives the configuration change notification, the cache parameter configuration in the preset non-relational database is modified according to the configuration change notification to obtain a parameter configuration set.

[0103] In step S401 of some embodiments, the cloud target parameter configuration is packaged according to the processing steps set by the hook function, and the packaged cloud target parameter configuration is combined with a pre-set message notification framework to obtain a configuration change notification.

[0104] In step S402 of some embodiments, the configuration change notification is delivered to the preset non-relational database according to the interface of the preset non-relational database.

[0105] In step S403 of some embodiments, when the preset non-relational database successfully receives the configuration change notification, the cache parameter configuration in the preset non-relational database is modified according to the cloud target parameter configuration in the configuration change notification to obtain the target cache parameter configuration. It should be noted that when the preset non-relational database fails to receive the configuration change notification, the administrator is notified by email according to the processing steps pre-set by the hook function.

[0106] In steps S401 to S403 shown in the embodiment of the present application, when the cloud target parameter configuration is screened out, the cloud target parameter configuration is sent to the preset non-relational database according to the processing steps set by the hook function, and the cache parameter configuration in the non-relational database is changed to obtain the target cache parameter configuration, thereby enhancing the strength of the non-relational database to prevent cache breakdown when facing a preset number of access requests.

[0107] In step S107 of some embodiments, when a preset number of access requests are received, the request data in a preset non-relational database is queried according to the access requirements of the access requests to obtain an expiration timestamp of the request data.

[0108] See also Figure 5 In some embodiments, step S108 may also include but is not limited to steps S501 to S502:

[0109] Step S501, obtaining system time, and generating a current timestamp according to the system time, wherein the system time refers to the system time of the computer to which the preset non-relational database belongs, and converting the system time into timestamp data to obtain the current timestamp;

[0110] Step S502, calculating the expiration timestamp and the current timestamp to obtain the remaining expiration time.

[0111] In step S501 of some embodiments, the time of the computer to which the preset non-relational database belongs is queried to obtain the system time, and the system time is converted into timestamp data to obtain the current timestamp.

[0112] In step S502 of some embodiments, the expiration time remaining is obtained by subtracting the current timestamp from the expiration timestamp.

[0113] Steps S501 to S502 shown in the embodiment of the present application calculate the difference between the expiration timestamp and the current timestamp corresponding to the system time to obtain the remaining expiration time, and can determine the current status of the requested data. It should be noted that the current status of the requested data includes expired, to be expired, and not expired.

[0114] See also Figure 6In some embodiments, step S108 further includes but is not limited to steps S601 to S602:

[0115] Step S601: if the remaining time after expiration is not a positive number, the access request is transmitted to a preset relational database, wherein the preset relational database is a database based on a relational model;

[0116] Step S602, if the remaining time to expiration is a positive number, the remaining time to expiration is compared with the target cache expiration timeout value;

[0117] Step S603: If the remaining expiration time is greater than the target cache expiration timeout value, respond to the access request corresponding to the requested data.

[0118] In step S601 of some embodiments, after obtaining the remaining expiration time of the requested data, the positive or negative value of the timestamp of the remaining expiration time is judged. If the remaining expiration time is not a positive number, the requested data has expired in the preset non-relational database, and the access request needs to be passed to the preset relational database for processing.

[0119] In step S602 of some embodiments, when the remaining expiration time of the requested data is obtained, the positive or negative value of the timestamp of the remaining expiration time is judged. If the remaining expiration time is a positive number, the size of the remaining expiration time is further judged, and the remaining expiration time is compared with the target cache expiration timeout value.

[0120] In step S603 of some embodiments, after the comparison result of the remaining expiration time and the target cache expiration timeout value is obtained, if the remaining expiration time is greater than the target cache expiration timeout value, a successful response is made to the access request corresponding to the requested data.

[0121] Steps S601 to S603 shown in the embodiment of the present application determine whether the requested data is expired by judging the positive and negative values ​​of the timestamp of the remaining expiration time. Furthermore, the remaining expiration time of the non-expired requested data is compared with the target cache expiration timeout value, which can further clarify the current state of the requested data, thereby extending the request for different times according to different states, preventing cache breakdown of the preset non-relational data and improving the security of the preset relational database.

[0122] See also Figure 7 In some embodiments, step S109 may include but is not limited to steps S701 to S702:

[0123] Step S701, summing the expiration timestamp and the target cache expiration duration value to obtain a preliminary delay timestamp;

[0124] Step S702, adding a random time value to the preliminary delay timestamp to obtain a delay timestamp, wherein the random time value is any time value within one second.

[0125] In step S701 of some embodiments, when the remaining expiration time is less than or equal to the target cache expiration timeout value, the request data is in a pending expiration state. To avoid the request data from expiring during high-concurrency traffic data access, the expiration timestamp of the request data in the pending expiration state is summed with the target cache expiration timeout value to obtain a preliminary delay timestamp.

[0126] In step S702 of some embodiments, a random time value within one second generated by the system is obtained, and the random time value is merged with the preliminary delay timestamp to obtain the delay timestamp. It should be noted that the random time value of the preliminary delay timestamp is used to prevent the request data from expiring and executing the key deletion operation at the same time after the number of access requests drops, which may cause temporary excessive pressure on the server.

[0127] In steps S701 to S702 shown in the embodiment of the present application, a delay timestamp is obtained by adding a target cache expiration continuation value and a random time value to the expiration timestamp, thereby ensuring that the request data will not be expired when a preset number of access requests access the preset non-relational data, thereby reducing the pressure of accessing the preset relational database and reducing the probability of cache breakdown in the preset non-relational database.

[0128] In step S110 of some embodiments, the expiration time of the requested data in the preset non-relational database is extended according to the time corresponding to the delay timestamp, thereby ensuring the security of the preset relational data in a high concurrent traffic environment and improving the success rate of preventing database cache breakdown.

[0129] The embodiment of the present application adjusts the cloud expiration timeout parameter and the cloud expiration renewal parameter of the cloud configuration center to the expiration timeout target parameter and the expiration renewal target parameter that meet the preset targets, and changes the cache parameter configuration in the preset non-relational database to the target cache expiration timeout value and the target cache expiration renewal value according to the expiration timeout target parameter and the expiration renewal target parameter. Furthermore, when a preset number of access requests are received, the request data accessed by the access request is delayed and expired according to the target cache expiration timeout value and the target cache expiration renewal value, thereby avoiding the problem of a large number of request data expiration of non-relational data in a high concurrent traffic environment, and improving the success rate of preventing database cache breakdown.

[0130] See also Figure 8 The embodiment of the present application further provides a device for extending the expiration of cached data, which can implement the above-mentioned method for extending the expiration of cached data, and the device includes:

[0131] The cloud parameter configuration module 801 is used to obtain a cloud expiration timeout parameter and a cloud expiration continuation parameter from a cloud configuration center, debug the cloud expiration timeout parameter and the cloud expiration continuation parameter to obtain a parameter configuration set, wherein the parameter configuration set includes an expiration timeout debugging parameter and an expiration continuation debugging parameter, obtain processor performance data in a central processor according to the parameter configuration set, and select target performance data from the processor performance data based on a preset resource occupancy rate, wherein the resource occupancy rate is a system resource occupancy ratio represented by the processor performance data, and the resource occupancy rate of the target performance data is the smallest, search the parameter configuration of the target performance data from the parameter configuration set to obtain a cloud target parameter configuration, wherein the cloud target parameter configuration includes an expiration timeout target parameter and an expiration continuation target parameter;

[0132] The cache database parameter configuration module 802 is used to modify the cache parameter configuration in the preset non-relational database according to the cloud target parameter configuration to obtain target cache parameters, wherein the preset non-relational database is a database based on a remote dictionary service, and the target cache parameters include a target cache expiration timeout value and a target cache expiration continuation value;

[0133] The request data query module 803 is used to obtain the expiration timestamp of the request data in the preset non-relational database when receiving a preset number of access requests, wherein the request data is the data requested by the access request to the preset non-relational database, and confirm the remaining expiration time of the request data according to the expiration timestamp, wherein the expiration timestamp is the time when the request data expires;

[0134] The request data delay module 804 is used to delay the expiration timestamp according to the target cache expiration continuation value if the remaining expiration time is less than or equal to the target cache expiration timeout value, obtain the delay timestamp of the request data, and delay the request data according to the delay timestamp.

[0135] The specific implementation of the device for extending the cache data expiration date is substantially the same as the specific implementation of the method for extending the cache data expiration date described above, and will not be described in detail herein.

[0136] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned method for extending the expiration of cached data when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0137] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0138] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0139] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the method for extending the expiration of cache data in the embodiment of this application;

[0140] Input / output interface 903, used to implement information input and output;

[0141] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0142] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0143] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0144] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned method for extending the expiration of cached data is implemented.

[0145] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0146] The method for extending the expiration of cache data, the device for extending the expiration of cache data, the electronic device and the storage medium provided in the embodiment of the present application adjust the cloud expiration timeout parameter and the cloud expiration continuation parameter of the cloud configuration center to the expiration timeout target parameter and the expiration continuation target parameter that meet the preset target, and change the cache parameter configuration in the preset non-relational database to the target cache expiration timeout value and the target cache expiration continuation value according to the expiration timeout target parameter and the expiration continuation target parameter. Further, when a preset number of access requests are received, the request data accessed by the access request is delayed and expired according to the target cache expiration timeout value and the target cache expiration continuation value, thereby avoiding the problem of a large number of request data expiration in non-relational data under a high concurrent traffic environment, and improving the success rate of preventing database cache breakdown. .

[0147] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0148] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0149] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0150] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0151] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0152] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0153] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0154] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0157] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for extending cache data expiration, characterized in that: The method comprises: Obtaining a cloud expiration timeout parameter and a cloud expiration continuation parameter from a cloud configuration center, wherein the cloud configuration center includes a hook function; Acquiring pressure environment data, wherein the pressure environment data is simulated high concurrent flow environment data; According to the pressure environment data, the cloud expiration timeout parameter and the cloud expiration continuation parameter are modified to obtain an expiration timeout debugging parameter and an expiration continuation debugging parameter; Combining the expiration timeout debugging parameter with the expiration continuation debugging parameter to obtain a parameter configuration; Arrange and combine the parameter configurations in the order of modification time to obtain a parameter configuration set; Acquiring processor performance data in a central processing unit according to the parameter configuration set; Filtering target performance data from the processor performance data based on a preset resource occupancy rate, wherein the preset resource occupancy rate is a system resource occupancy ratio represented by the processor performance data, and the target performance data has the smallest resource occupancy rate; Searching for the parameter configuration of the target performance data from the parameter configuration set to obtain the cloud target parameter configuration; Generate a configuration change notification according to the cloud target parameter configuration and the hook function; Sending the configuration change notification to a preset non-relational database; If the preset non-relational database successfully receives the configuration change notification, modify the cache parameter configuration in the preset non-relational database according to the configuration change notification to obtain target cache parameters, wherein the target cache parameters include a target cache expiration timeout value and a target cache expiration continuation value; When a preset number of access requests are received, obtaining an expiration timestamp of the requested data in the preset non-relational database, wherein the requested data is the data requested by the access request to the preset non-relational database; According to the expiration timestamp, confirm the remaining expiration time of the request data, wherein the expiration timestamp is the time when the request data expires; If the remaining expiration time is less than or equal to the target cache expiration timeout value, the expiration timestamp is delayed according to the target cache expiration continuation value to obtain a delayed timestamp of the request data; The request data is deferred according to the delay timestamp.

2. The method according to claim 1, characterized in that Before changing the cache parameter configuration in the preset non-relational database according to the cloud target parameter configuration to obtain the target cache parameter, the method further includes: Acquire specific event data, wherein the specific event data refers to the action of changes in the cloud expiration timeout parameter and the cloud expiration continuation parameter; According to the specific event data, a function is generated for the cloud configuration center to obtain the hook function, wherein the hook function is a code for processing the specific event data.

3. The method according to claim 1, characterized in that If the remaining expiration time is less than or equal to the target cache expiration timeout value, delay processing is performed on the expiration timestamp according to the target cache expiration continuation value to obtain the delayed timestamp of the request data, including: The expiration timestamp and the target cache expiration duration value are summed to obtain a preliminary delay timestamp; A random time value is obtained, and the preliminary delay timestamp is combined with the random time value to obtain a delay timestamp, wherein the random time value is any time value within one second.

4. The method according to claim 1, characterized in that The step of confirming the remaining expiration time of the request data according to the expiration timestamp includes: Obtaining system time, and generating a current timestamp according to the system time, wherein the system time refers to the time of the computer to which the preset non-relational database belongs; The expiration timestamp and the current timestamp are calculated to obtain the remaining expiration time.

5. The method according to claim 1, characterized in that After confirming the remaining expiration time of the request data according to the expiration timestamp, the method further includes: If the remaining expiration time is not a positive number, passing the access request to a preset relational database, wherein the preset relational database is a database based on a relational model; If the remaining expiration time is a positive number, the remaining expiration time is compared with the target cache expiration timeout value; If the remaining expiration time is greater than the target cache expiration timeout value, respond to the access request corresponding to the requested data.

6. A device for extending cache data expiration, characterized in that: The device comprises: A cloud parameter configuration module, used for obtaining cloud expiration timeout parameters and cloud expiration continuation parameters from a cloud configuration center, wherein the cloud configuration center includes a hook function, obtaining pressure environment data, wherein the pressure environment data is simulated high concurrent traffic environment data, modifying the cloud expiration timeout parameters and the cloud expiration continuation parameters according to the pressure environment data, obtaining expiration timeout debugging parameters and expiration continuation debugging parameters, combining the expiration timeout debugging parameters with the expiration continuation debugging parameters to obtain parameter configuration, arranging and combining the parameter configurations in the order of modification time to obtain a parameter configuration set, obtaining processor performance data in a central processing unit according to the parameter configuration set, filtering target performance data from the processor performance data based on a preset resource occupancy rate, wherein the resource occupancy rate is the system resource occupancy ratio represented by the processor performance data, the resource occupancy rate of the target performance data is the smallest, searching the parameter configuration of the target performance data from the parameter configuration set to obtain the cloud target parameter configuration; A cache database parameter configuration module, used to generate a configuration change notification according to the cloud target parameter configuration and the hook function, and send the configuration change notification to a preset non-relational database. If the preset non-relational database successfully receives the configuration change notification, the cache parameter configuration in the preset non-relational database is modified according to the configuration change notification to obtain target cache parameters, wherein the target cache parameters include a target cache expiration timeout value and a target cache expiration continuation value; A request data query module, configured to, when receiving a preset number of access requests, obtain an expiration timestamp of the request data in the preset non-relational database, wherein the request data is data requested by the access request to the preset non-relational database, and confirm the remaining time of expiration of the request data according to the expiration timestamp, wherein the expiration timestamp is the time when the request data expires; The request data delay module is used to delay the expiration timestamp according to the target cache expiration continuation value if the remaining expiration time is less than or equal to the target cache expiration timeout value, obtain the delay timestamp of the request data, and postpone the request data according to the delay timestamp.

7. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method for extending cache data expiration as described in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for extending cache data expiration according to any one of claims 1 to 5 is implemented.