Request processing method and device

By considering the period condition during data acquisition request processing, judging the timeliness of the cache data, and obtaining the corresponding data from the data source, the problem of insufficient data timeliness in the existing technology has been solved, and more efficient data support and cache management have been achieved.

CN119376623AActive Publication Date: 2025-01-28CHINA CONSTRUCTION BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411432271.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-01-28
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

The prior art fails to effectively consider the timeliness of data when processing data acquisition requests, resulting in errors in the business functions of the application.

Method used

Get the request for receiving data and determine its period condition to determine whether the target data or the cache time meets the period condition in the cache. If it is not satisfied, obtain the corresponding second target data from the data source, and save it in the cache, and determine its cache retention time according to the term information of the associated application.

Benefits of technology

Effectively reduce the situation of errors in application business functions, ensure that the timeliness of data meets the application requirements, and reasonably manage the cache data through cache retaining time to improve data support capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376623A_ABST
    Figure CN119376623A_ABST
Patent Text Reader

Abstract

The invention discloses a request processing method and device, and relates to the technical field of big data processing. A specific embodiment of the method comprises the steps of receiving a data acquisition request, and determining a deadline condition corresponding to the data acquisition request; determining whether first target data corresponding to the data acquisition request exists in a cache or not; in response to the situation that the first target data does not exist in the cache or the cache time of the first target data in the cache does not meet a deadline condition, obtaining second target data corresponding to the data request from the data source, and returning the second target data; determining at least one associated application corresponding to the second target data, and determining cache retention time corresponding to the second target data according to deadline information of each associated application; and storing the second target data in the cache, and performing life cycle management on the second target data in the cache according to the cache retention time. According to the embodiment, the situation that the business function of the application has faults can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data processing, and in particular to a request processing method and device. Background Art

[0002] Cache refers to a storage device that can exchange data at high speed. It exchanges data with the CPU before the memory, so the speed is very fast. After receiving a data acquisition request, the target data corresponding to the data acquisition request is usually searched in the cache first. If the target data is found in the cache, the target data is directly returned to the application. Since the application has time-limited requirements for cached data, this method may cause errors in the business functions of the application. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a request processing method and apparatus, which can reduce the possibility of errors in the business functions of an application by considering the deadline conditions of a data acquisition request.

[0004] In a first aspect, an embodiment of the present invention provides a request processing method, including:

[0005] receiving a data acquisition request, and determining a time limit condition corresponding to the data acquisition request;

[0006] Determine whether the first target data corresponding to the data acquisition request exists in the cache;

[0007] In response to the first target data not existing in the cache, or the cache time of the first target data in the cache not satisfying the time limit condition, obtaining the second target data corresponding to the data request from the data source, and returning the second target data;

[0008] Determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application;

[0009] The second target data is stored in a cache, and life cycle management is performed on the second target data in the cache according to the cache retention time.

[0010] Optionally, after determining whether the first target data corresponding to the data acquisition request exists in the cache, the method further includes:

[0011] In response to the first target data existing in the cache, determining whether a cache time of the first target data in the cache satisfies the time limit condition;

[0012] In response to the cache time of the first target data in the cache satisfying the time limit condition, the first target data is acquired from the cache and returned.

[0013] Optionally, the determining whether the cache time of the first target data in the cache satisfies the time limit condition includes:

[0014] Determining a cache time of the first target data;

[0015] Determining a time difference between a current time and the cached time;

[0016] According to the time difference, it is determined whether the cache time of the first target data meets the deadline condition.

[0017] Optionally, the determining at least one associated application corresponding to the second target data includes:

[0018] Determining a data type corresponding to the second target data;

[0019] At least one associated application corresponding to the second target data is determined according to the type mapping information.

[0020] Optionally, determining a time limit condition corresponding to the data acquisition request includes:

[0021] Determine the authorization code corresponding to the data acquisition request, and determine the target application corresponding to the authorization code;

[0022] The deadline condition corresponding to the target application is determined as the deadline condition corresponding to the data acquisition request.

[0023] Optionally, performing lifecycle management on the second target data in the cache according to the cache retention time includes:

[0024] Saving the cache time of the second target data;

[0025] In response to a time difference between the current time and the cache time being greater than the cache retention time, deleting the second target data in the cache.

[0026] Optionally, the cache includes: a first-level cache and a second-level cache;

[0027] The storing the second target data in the cache and performing lifecycle management on the second target data in the cache according to the cache retention time includes:

[0028] Storing the second target data in the first-level cache, and recording the cache time corresponding to the second target data;

[0029] In response to a time difference between the current time and the cache time being greater than the cache retention time, deleting the second target data from the first-level cache and storing the second target data in the second-level cache.

[0030] In a second aspect, an embodiment of the present invention provides a request processing device, including:

[0031] A condition determination module, used for receiving a data acquisition request and determining a time limit condition corresponding to the data acquisition request;

[0032] A data determination module, used to determine whether the first target data corresponding to the data acquisition request exists in the cache;

[0033] a data returning module, configured to, in response to the first target data not existing in the cache or the cache time of the first target data in the cache not satisfying the time limit condition, obtain the second target data corresponding to the data request from the data source and return the second target data;

[0034] a time determination module, configured to determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application;

[0035] The data management module is used to store the second target data in a cache and perform life cycle management on the second target data in the cache according to the cache retention time.

[0036] Optionally, the data returning module is further used for:

[0037] In response to the first target data existing in the cache, determining whether a cache time of the first target data in the cache satisfies the time limit condition;

[0038] In response to the cache time of the first target data in the cache satisfying the time limit condition, the first target data is acquired from the cache and returned.

[0039] Optionally, the data returning module is further used for:

[0040] Determining a cache time of the first target data;

[0041] Determining a time difference between a current time and the cached time;

[0042] According to the time difference, it is determined whether the cache time of the first target data meets the deadline condition.

[0043] Optionally, the time determination module is specifically used to:

[0044] Determining a data type corresponding to the second target data;

[0045] At least one associated application corresponding to the second target data is determined according to the type mapping information.

[0046] Optionally, the condition determination module is specifically used to:

[0047] Determine the authorization code corresponding to the data acquisition request, and determine the target application corresponding to the authorization code;

[0048] The deadline condition corresponding to the target application is determined as the deadline condition corresponding to the data acquisition request.

[0049] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0050] one or more processors;

[0051] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0052] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the above embodiments.

[0053] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed by a processor.

[0054] An embodiment of the above invention has the following advantages or beneficial effects: after receiving a data acquisition request, if the first target data does not exist in the cache, or the cache time of the first target data in the cache does not meet the deadline condition, the second target data corresponding to the data request is acquired from the data source and returned. By considering the deadline condition of the data acquisition request, the situation where the business function of the application fails can be reduced.

[0055] In addition, after the second target data is obtained from the data source, the second target data is stored in the cache, at least one associated application corresponding to the second target data is determined, and the cache retention time corresponding to the second target data is determined according to the expiration information of each associated application. Therefore, the solution of the embodiment of the present invention can also use the cache retention time to reasonably manage the life cycle of the second target data in the cache, and better provide data support for each associated application.

[0056] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0058] Figure 1 is a flowchart of a request processing method provided by the first embodiment of the present invention;

[0059] Figure 2 is a flowchart of a request processing method provided by the second embodiment of the present invention;

[0060] Figure 3 is a flowchart of a request processing method provided by the third embodiment of the present invention;

[0061] Figure 4 is a structural diagram of a request processing device provided by an embodiment of the present invention;

[0062] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0064] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0065] Figure 1 is a flowchart of a request processing method provided by the first embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0066] Step 101: Receive a data acquisition request and determine a time limit condition corresponding to the data acquisition request.

[0067] The deadline condition is used to characterize the timeliness of the target application corresponding to the data acquisition request. The deadline condition can be set according to the business requirements of the target application. The deadline condition can be less than 1 hour, less than 3 days, no more than 1 month, etc.

[0068] Different applications have different requirements for the timeliness of data. For example, the time limit condition for the "Enterprise Query" application is less than 7 days. For applications such as "Inter-industry Operation Platform" and "Customer Management and Maintenance" that do not have high requirements for data timeliness, the time limit condition can be less than 15 days, etc. The solution of the embodiment of the present invention can solve the problem that cached data cannot meet the different timeliness requirements of multiple applications.

[0069] In one possible embodiment of the present invention, determining the time limit condition corresponding to the data acquisition request includes: determining the authorization code corresponding to the data acquisition request, and determining the target application corresponding to the authorization code; and determining the time limit condition corresponding to the target application as the time limit condition corresponding to the data acquisition request.

[0070] Different applications have different deadlines. When an application obtains data, it must apply for an authorization code, which is used to mark the application and the timeliness requirements for cached data. The target application generates a data acquisition request with an authorization code. The target application is determined by the authorization code, thereby determining the deadline corresponding to the data acquisition request. The deadline of the target application is determined by the deadline information of the target application. If the deadline information of the target application is 1 day, the deadline corresponding to the target application can be less than 1 day, or not more than 1 day, etc.

[0071] Step 102: Determine whether there is first target data corresponding to the data acquisition request in the cache.

[0072] According to the request information corresponding to the data acquisition request, the first target data corresponding to the data acquisition request is searched in the cache. The request information can be set according to business requirements, such as user identification, time information, business identification, etc.

[0073] Step 103: In response to the first target data not existing in the cache, or the cache time of the first target data in the cache not satisfying the expiration condition, obtain the second target data corresponding to the data request from the data source, and return the second target data.

[0074] If the first target data does not exist in the cache, the second target data corresponding to the data request is obtained from a data source, and the data source is used to store real-time data corresponding to the data acquisition request.

[0075] If the first target data exists in the cache and the cache time of the first target data in the cache does not meet the time limit condition, the second target data corresponding to the data request is obtained from the data source. The cache time of the first target data is the time point when the first target data is stored in the cache.

[0076] For example, the time limit condition corresponding to the data acquisition request is less than 1 day, and the cache time of the first target data in the cache is 3 days ago. The first target data is stored in the cache for more than 1 day and does not meet the time limit condition. The first target data is expired and it is necessary to re-acquire the second target data corresponding to the data request from the data source.

[0077] Step 104: Determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application.

[0078] The second target data includes data characteristic information, which can be set according to business requirements, such as user identification, time information, business identification, etc.

[0079] The second target data corresponds to at least one associated application. The associated application sends a data acquisition request. If the request information of the data acquisition request matches the data feature information of the second target data, and the cache time of the second target data meets the time limit condition of the data acquisition request, the second target data can be returned to the associated application.

[0080] In one possible embodiment of the present invention, determining at least one associated application corresponding to the second target data includes: determining a data type corresponding to the second target data; and determining at least one associated application corresponding to the second target data according to type mapping information.

[0081] The data type corresponding to the second target data can be determined according to the request type of the data acquisition request. For example, the second target data corresponding to the data acquisition request of the first request type is of the first type, etc. The data type corresponding to the second target data can also be determined according to the data feature information or data source of the second target data. For example, the data feature information of the second target data includes: user identification and time information, then the data type corresponding to the second target data is of the second type. The data type corresponding to the second target data from the first data source is of the third type, etc.

[0082] The system pre-stores type mapping information, which is used to store the association relationship between the data type and each application. According to the association relationship and the data type of the second target data, at least one associated application corresponding to the second target data is determined.

[0083] Different expiration information is set for different applications according to business needs. The expiration information can be 1 hour, 3 days, 1 month, etc. Based on the expiration information of each associated application, the cache retention time corresponding to the second target data is determined. For example, the statistical value of the expiration information of each associated application can be determined as the cache retention time corresponding to the second target data. The statistical value can be: maximum value, minimum value, average value. In one embodiment of the present invention, the weighted sum of the expiration information of each associated application is determined as the cache retention time corresponding to the second target data. The weight corresponding to the associated application is determined by the frequency with which the associated application sends a data acquisition request.

[0084] If it costs money to obtain data from the data source, the cache retention time can also be determined by comprehensively considering factors such as the billing rules and cost budget of the outbound data source. Specifically, the term information, frequency, billing rules, cost budget, etc. of each associated application can be input into the cache evaluation model, and the cache retention time corresponding to the second target data can be determined based on the output result of the cache evaluation model.

[0085] Step 105: Save the second target data in the cache, and perform lifecycle management on the second target data in the cache according to the cache retention time.

[0086] Lifecycle management is used to perform full-cycle data management on the second target data. Lifecycle management may include: data preservation processing, data deletion processing, data transfer processing, data downgrade processing, etc. For example, if the cache time of the second target data is greater than the cache retention time, the second target data is deleted, transferred, or downgraded.

[0087] After the second target data is saved in the cache, if the first target data exists in the cache, the first target data is deleted. The second target data is updated data of the first target data, and the second target data can provide more real-time data support for each associated application.

[0088] In the solution of the embodiment of the present invention, when a data acquisition request is received, if the first target data does not exist in the cache, or the cache time of the first target data in the cache does not meet the deadline condition, the second target data corresponding to the data request is acquired from the data source and returned. By considering the deadline condition of the data acquisition request, the situation where the business function of the application fails can be reduced.

[0089] In addition, after the second target data is obtained from the data source, the second target data is stored in the cache, at least one associated application corresponding to the second target data is determined, and the cache retention time corresponding to the second target data is determined according to the expiration information of each associated application. Therefore, the solution of the embodiment of the present invention can also use the cache retention time to reasonably manage the life cycle of the second target data in the cache, and better provide data support for each associated application.

[0090] The solution of the embodiment of the present invention can improve application performance, reduce server load, speed up response speed, etc. through interface caching. In the scenario where it costs money to obtain data from an external data source, the solution of the embodiment of this aspect can also save costs. Caching is a key optimization method. The solution of the embodiment of the present invention is suitable for services where data changes infrequently or a certain degree of data delay is allowed, and can provide efficient and reasonable data support for multiple applications with different timeliness requirements.

[0091] Figure 2 is a flowchart of a request processing method provided by the second embodiment of the present invention, such as Figure 2 As shown, the method includes:

[0092] Step 201: Receive a data acquisition request and determine a time limit condition corresponding to the data acquisition request.

[0093] Step 202: Determine whether there is first target data corresponding to the data acquisition request in the cache.

[0094] If the first target data exists in the cache, execute step 203. If the first target data does not exist in the cache, execute step 205.

[0095] Step 203: Determine whether the cache time of the first target data in the cache satisfies a time limit condition.

[0096] If the cache time of the first target data in the cache meets the deadline condition, the first target data can meet the timeliness requirement of the data acquisition request, and step 204 is executed. If the cache time of the first target data in the cache does not meet the deadline condition, the first target data cannot meet the timeliness requirement of the data acquisition request, and step 205 is executed.

[0097] In one possible embodiment of the present invention, determining whether the cache time of the first target data in the cache meets the deadline condition includes: determining the cache time of the first target data; determining the time difference between the current time and the cache time; and determining whether the cache time of the first target data meets the deadline condition based on the time difference.

[0098] If the time difference is not greater than the deadline condition, it is determined that the cache time of the first target data meets the deadline condition. If the time difference is greater than the deadline condition, it is determined that the cache time of the first target data does not meet the deadline condition.

[0099] For example, the deadline condition corresponding to the data acquisition request is less than 3 hours, and the cache time of the first target data in the cache is 1:30. If the current time is 2:35, the time difference between the current time and the cache time is 1 hour and 5 minutes, which meets the deadline condition. If the current time is 6:00, the time difference between the current time and the cache time is 4 hours and 30 minutes, which does not meet the deadline condition. The first target data is expired, and the second target data corresponding to the data request needs to be obtained from the data source again.

[0100] Step 204: Acquire and return the first target data from the cache.

[0101] Step 205: Obtain second target data corresponding to the data request from the data source, and return the second target data.

[0102] Step 206: Determine at least one associated application corresponding to the second target data, and determine the cache retention time corresponding to the second target data according to the expiration information of each associated application.

[0103] Step 207: Save the second target data in the cache, and perform lifecycle management on the second target data in the cache according to the cache retention time.

[0104] In the scheme of the embodiment of the present invention, after receiving a data acquisition request, it is determined whether the first target data corresponding to the data acquisition request exists in the cache, whether the cache time of the first target data meets the time limit condition, etc., to determine how to acquire the target data corresponding to the data acquisition request, thereby ensuring data accuracy and improving data return efficiency.

[0105] Figure 3 is a flowchart of a request processing method provided by the third embodiment of the present invention, such as Figure 3 As shown, the method includes:

[0106] Step 301: Receive a data acquisition request and determine a time limit condition corresponding to the data acquisition request.

[0107] Step 302: Determine whether there is first target data corresponding to the data acquisition request in the cache.

[0108] Step 303: In response to the first target data not existing in the cache, or the cache time of the first target data in the cache not satisfying the expiration condition, obtain the second target data corresponding to the data request from the data source, and return the second target data.

[0109] Step 304: Determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application.

[0110] Step 305: Save the second target data in the cache, and save the cache time of the second target data.

[0111] The cache time of the second target data is the time point when the second target data is stored in the cache. How to manage the second target data is determined by the cache time of the second target data.

[0112] Step 306: Perform lifecycle management on the second target data in the cache according to the comparison result of the time difference between the current time and the cache time.

[0113] The time difference between the current time and the cache time is the storage time of the second target data in the cache. The policy for lifecycle management of the second target data in the cache can be set according to business needs. For example, if the time difference corresponding to the second target data is greater than the cache retention time, the second target data is deleted, transferred, or downgraded.

[0114] In one embodiment of the present invention, lifecycle management is performed on the second target data in the cache, including: in response to the time difference between the current time and the cache time being greater than the cache retention time, the second target data in the cache is deleted. For cache data whose time difference between the current time and the cache time is greater than the cache retention time, the cache data has expired and cannot provide accurate data support for the associated application, and the cache data is deleted from the cache. While reducing the storage pressure of the cache, more storage space can be provided for updated cache data.

[0115] In one embodiment of the present invention, the cache includes: a first-level cache and a second-level cache; life cycle management is performed on the second target data in the cache, including: storing the second target data in the first-level cache, and recording the cache time corresponding to the second target data; in response to the time difference between the current time and the cache time being greater than the cache retention time, deleting the second target data from the first-level cache, and storing the second target data in the second-level cache.

[0116] The response speed of the first-level cache is faster than that of the second-level cache. The storage space of the first-level cache is smaller than that of the second-level cache. The cache data is deleted from the first-level cache, stored in the second-level cache, and the cache data is downgraded. Through downgrading, the latest cache data with better timeliness is stored in the first-level cache, and the cache data with poor timeliness is stored in the second-level cache. By setting up multi-level cache, the timeliness and accuracy of the returned data can be effectively improved.

[0117] In the solution of the embodiment of the present invention, after obtaining the second target data corresponding to the data request from the data source, the cache retention time corresponding to the second target data is determined according to the expiration information of each associated application. Then, according to the comparison result of the time difference between the current time and the cache time of the second target data, the life cycle management of the second target data in the cache is performed. While reducing the required cache resources, the data return efficiency can also be improved.

[0118] Figure 4 is a schematic diagram of a request processing device provided by an embodiment of the present invention. Figure 4 As shown, the device comprises:

[0119] The condition determination module 401 is used to receive a data acquisition request and determine a time limit condition corresponding to the data acquisition request;

[0120] A data determination module 402 is used to determine whether there is first target data corresponding to the data acquisition request in the cache;

[0121] The data return module 403 is used to obtain the second target data corresponding to the data request from the data source in response to the first target data not existing in the cache or the cache time of the first target data in the cache not satisfying the time limit condition, and return the second target data;

[0122] The time determination module 404 is used to determine at least one associated application corresponding to the second target data, and determine the cache retention time corresponding to the second target data according to the expiration information of each associated application;

[0123] The data management module 405 is used to store the second target data in the cache and perform life cycle management on the second target data in the cache according to the cache retention time.

[0124] Optionally, the data returning module 403 is further used for:

[0125] In response to the first target data existing in the cache, determining whether a cache time of the first target data in the cache satisfies a time limit condition;

[0126] In response to the cache time of the first target data in the cache satisfying the expiration condition, the first target data is acquired from the cache and returned.

[0127] Optionally, the data returning module 403 is further used for:

[0128] Determining a cache time of the first target data;

[0129] Determine the time difference between the current time and the cached time;

[0130] It is determined whether the cache time of the first target data meets the time limit condition according to the time difference.

[0131] Optionally, the time determination module 404 is specifically configured to:

[0132] Determine the data type corresponding to the second target data;

[0133] At least one associated application corresponding to the second target data is determined according to the type mapping information.

[0134] Optionally, the condition determination module 401 is specifically used for:

[0135] Determine the authorization code corresponding to the data acquisition request and determine the target application corresponding to the authorization code;

[0136] The deadline condition corresponding to the target application is determined as the deadline condition corresponding to the data acquisition request.

[0137] Optionally, the data management module 405 is specifically used for:

[0138] The cache time for saving the second target data;

[0139] In response to a time difference between the current time and the cache time being greater than the cache retention time, the second target data in the cache is deleted.

[0140] Optionally, the cache includes: a first-level cache and a second-level cache;

[0141] The data management module 405 is specifically used for:

[0142] Storing the second target data in the first-level cache and recording the cache time corresponding to the second target data;

[0143] In response to a time difference between the current time and the cache time being greater than the cache retention time, the second target data is deleted from the first-level cache and the second target data is stored in the second-level cache.

[0144] An embodiment of the present invention provides an electronic device, including:

[0145] one or more processors;

[0146] The storage device is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the method of any of the above embodiments.

[0147] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the request processing method in the embodiment of the present invention is implemented.

[0148] Reference below Figure 5, which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0149] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0150] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0151] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0152] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0154] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: a condition determination module, a data determination module, a data return module, a time determination module, and a data management module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the condition determination module may also be described as "a module that receives a data acquisition request and determines a time limit condition corresponding to the data acquisition request."

[0155] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0156] receiving a data acquisition request, and determining a time limit condition corresponding to the data acquisition request;

[0157] Determine whether the first target data corresponding to the data acquisition request exists in the cache;

[0158] In response to the first target data not existing in the cache, or the cache time of the first target data in the cache not satisfying the time limit condition, obtaining the second target data corresponding to the data request from the data source, and returning the second target data;

[0159] Determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application;

[0160] The second target data is stored in a cache, and life cycle management is performed on the second target data in the cache according to the cache retention time.

[0161] According to the technical solution of the embodiment of the present invention, when a data acquisition request is received, if the first target data does not exist in the cache, or the cache time of the first target data in the cache does not meet the deadline condition, the second target data corresponding to the data request is acquired from the data source and returned. By considering the deadline condition of the data acquisition request, the situation where the business function of the application fails can be reduced.

[0162] In addition, after the second target data is obtained from the data source, the second target data is stored in the cache, at least one associated application corresponding to the second target data is determined, and the cache retention time corresponding to the second target data is determined according to the expiration information of each associated application. Therefore, the solution of the embodiment of the present invention can also use the cache retention time to reasonably manage the life cycle of the second target data in the cache, and better provide data support for each associated application.

[0163] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A request processing method, characterized in that: include: receiving a data acquisition request, and determining a time limit condition corresponding to the data acquisition request; Determine whether the first target data corresponding to the data acquisition request exists in the cache; In response to the first target data not existing in the cache, or the cache time of the first target data in the cache not satisfying the time limit condition, obtaining the second target data corresponding to the data request from the data source, and returning the second target data; Determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application; The second target data is stored in a cache, and life cycle management is performed on the second target data in the cache according to the cache retention time.

2. The method according to claim 1, characterized in that After determining whether the first target data corresponding to the data acquisition request exists in the cache, the method further includes: In response to the first target data existing in the cache, determining whether a cache time of the first target data in the cache satisfies the time limit condition; In response to the cache time of the first target data in the cache satisfying the time limit condition, the first target data is acquired from the cache and returned.

3. The method according to claim 2, characterized in that The determining whether the cache time of the first target data in the cache satisfies the time limit condition includes: Determining a cache time of the first target data; Determining a time difference between a current time and the cached time; According to the time difference, it is determined whether the cache time of the first target data meets the deadline condition.

4. The method according to claim 1, characterized in that: The determining at least one associated application corresponding to the second target data includes: Determining a data type corresponding to the second target data; At least one associated application corresponding to the second target data is determined according to the type mapping information.

5. The method according to claim 1, characterized in that The determining of the time limit condition corresponding to the data acquisition request includes: Determine the authorization code corresponding to the data acquisition request, and determine the target application corresponding to the authorization code; The deadline condition corresponding to the target application is determined as the deadline condition corresponding to the data acquisition request.

6. The method according to claim 1, characterized in that The performing lifecycle management on the second target data in the cache according to the cache retention time includes: Saving the cache time of the second target data; In response to a time difference between the current time and the cache time being greater than the cache retention time, deleting the second target data in the cache.

7. The method according to claim 1, characterized in that The cache includes: a first-level cache and a second-level cache; The storing the second target data in the cache and performing lifecycle management on the second target data in the cache according to the cache retention time includes: Storing the second target data in the first-level cache, and recording the cache time corresponding to the second target data; In response to a time difference between the current time and the cache time being greater than the cache retention time, deleting the second target data from the first-level cache and storing the second target data in the second-level cache.

8. A request processing device, characterized in that: include: A condition determination module, used for receiving a data acquisition request and determining a time limit condition corresponding to the data acquisition request; A data determination module, used to determine whether the first target data corresponding to the data acquisition request exists in the cache; a data returning module, configured to, in response to the first target data not existing in the cache or the cache time of the first target data in the cache not satisfying the time limit condition, obtain the second target data corresponding to the data request from the data source and return the second target data; a time determination module, configured to determine at least one associated application corresponding to the second target data, and determine a cache retention time corresponding to the second target data according to the expiration information of each associated application; The data management module is used to store the second target data in a cache and perform life cycle management on the second target data in the cache according to the cache retention time.

9. The device according to claim 8, characterized in that The data return module is also used for: In response to the first target data existing in the cache, determining whether a cache time of the first target data in the cache satisfies the time limit condition; In response to the cache time of the first target data in the cache satisfying the time limit condition, the first target data is acquired from the cache and returned.

10. The device according to claim 9, characterized in that The data return module is also used for: Determining a cache time of the first target data; Determining a time difference between a current time and the cached time; According to the time difference, it is determined whether the cache time of the first target data meets the deadline condition.

11. The device according to claim 8, characterized in that The time determination module is specifically used for: Determining a data type corresponding to the second target data; At least one associated application corresponding to the second target data is determined according to the type mapping information.

12. The device according to claim 8, characterized in that The condition determination module is specifically used for: Determine the authorization code corresponding to the data acquisition request, and determine the target application corresponding to the authorization code; The deadline condition corresponding to the target application is determined as the deadline condition corresponding to the data acquisition request.

13. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

14. A computer readable medium having a computer program stored thereon, characterized in that When the program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data caching method, apparatus, computer device, and storage medium

    CN109240613A

  • Data calling method and device, computer equipment and storage medium

    CN118051284A

  • Client voting-inclusive in-memory data grid (IMDG) cache management

    US20160378666A1