Interface data preloading method, product, device, equipment and medium

Analyzing historical interface requests through the FP growth algorithm, preloading subsequent item data related to the current interface request into the cache solves the problems of resource waste and performance consumption in the existing technology, and achieves efficient data caching and memory management.

CN118394830BActive Publication Date: 2024-10-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410845364.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-18
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

When existing data caching technology handles a large number of interface data requests and complex business systems, it requires manual analysis to determine the data to be cached, resulting in resource waste and performance consumption. In addition, useless data occupies cache space and increases memory risks.

Method used

The FP growth algorithm is used to analyze historical interface requests, create high-frequency continuous interface necklaces, and preload subsequent item data that is strongly related to the current interface request into the cache to avoid useless data loading, reduce memory consumption, and improve the cache hit rate.

Benefits of technology

There is no need to manually analyze a large amount of business data, saving manpower and time costs, reducing useless data occupation, improving cache hit rate, reducing interface request response time, and avoiding memory resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394830B_ABST
    Figure CN118394830B_ABST
Patent Text Reader

Abstract

The present application discloses an interface data preloading method, product, device, equipment and medium, which relates to the field of data caching, including: matching a current interface request with multiple high-frequency continuous interface item links in an interface data prediction matching library; a high-frequency continuous interface item link is a link obtained by connecting historical interface requests in a high-frequency continuous interface item set in the order of receiving time, and a high-frequency continuous interface item set is a set of at least two and time-continuous interface items in a high-frequency interface item set obtained by analyzing historical interface requests using an FP growth algorithm; if the match is successful, then obtaining a subsequent interface item connected to the current interface request from the successfully matched link; and loading the response data corresponding to the subsequent interface item into the cache, so as to obtain the corresponding target response data from the cache when a new interface request is received. The present application can save cache space, improve the hit rate of cache data, and reduce the response time of interface requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data cache technology, and in particular to an interface data preloading method, product, device, equipment and medium. Background Art

[0002] In current web applications, data caching technology has been widely used as a solution to improve data query efficiency. In order to improve the query efficiency of interface data, especially when the data source has a high response time, data caching technology is usually used to query the data to be queried from the data source (such as database, data file, third-party interface, etc.) in advance, and put the queried data into the application cache or third-party cache component (such as redis, etc.) to avoid the problem of slow data request caused by the long response time of the data source when receiving the data request, thereby improving the user experience of the application system.

[0003] However, for scenarios with a large number of interface data requests and complex business systems, the current caching technology has the following shortcomings: before loading the data to be cached into the cache, it is necessary to first determine the data to be loaded, which requires judgment and classification based on the business situation, analyzing the hot data in advance, and then loading the analyzed hot data into the cache through manual loading, scheduled tasks, delayed loading, etc., so as to achieve the purpose of data preloading. However, since the data to be cached is strongly related to the business, it is necessary to have rich prior business logic knowledge to accurately determine the cache data to be loaded, and a large amount of analysis of the business data is required; and, too much preloaded data leads to tight memory. For example, when loading the cached data, the scheduled loading method will result in more cached data being loaded at the same time, and it is not considered whether the loaded data will actually have a data request, resulting in useless data occupying too much cache space. In addition, when a large amount of data is loaded, a large amount of server memory will be occupied, resulting in a waste of memory, which in turn leads to the risk of application crashes, and scheduled queries also bring high performance consumption. Summary of the invention

[0004] In view of this, the purpose of this application is to provide an interface data preloading method, product, device, equipment and medium, which can decouple the loading of data cache from business data, and do not need to manually analyze a large amount of business data in advance, thereby saving labor costs and time costs, and avoiding loading too much useless data, thereby saving cache space, improving the hit rate of cache data, reducing the response time of interface requests, and at the same time, avoiding the consumption of memory resources by loading too much data. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses an interface data preloading method, comprising:

[0006] When an interface request is received, the current interface request is matched with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting historical interface requests in a high-frequency continuous interface item set in order of receiving time, the high-frequency continuous interface item set is at least two time-continuous interface item sets in a high-frequency interface item set obtained by analyzing the collected historical interface requests using an FP growth algorithm, and the high-frequency interface item set is an interface item set whose appearance frequency of the interface item set is greater than a first preset threshold;

[0007] If the match is successful, obtaining a subsequent interface item connected to the current interface request from the high-frequency continuous interface item link that has successfully matched;

[0008] The response data corresponding to the subsequent interface item is loaded into a cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.

[0009] Optionally, the interface data preloading method further includes:

[0010] Collect historical interface requests received within a preset time range;

[0011] Dividing the historical interface requests to obtain a plurality of persistent interface item sets, and recording the plurality of persistent interface item sets into a preset database;

[0012] The preset database is analyzed by using an FP growth algorithm to respectively calculate the interface item set occurrence frequency of each of the continuous interface item sets in the preset database, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding continuous interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set;

[0013] The historical interface requests in the high-frequency continuous interface item set are connected respectively in order of receiving time to obtain multiple high-frequency continuous interface item links, and an interface data prediction matching library is created based on the multiple high-frequency continuous interface item links.

[0014] Optionally, the historical interface requests are divided to obtain a plurality of persistent interface item sets, including:

[0015] Sorting the historical interface requests in order of receiving time to obtain sorted interface requests;

[0016] sequentially determining whether two adjacent historical interface requests in the sorted interface requests are within a preset time interval; the preset time interval is greater than a preset average interface request response time;

[0017] If two adjacent historical interface requests are within the preset time interval, the two adjacent historical interface requests are divided into the same interface item set to obtain a plurality of continuous interface item sets.

[0018] Optionally, the interface data preloading method further includes:

[0019] The current interface request is recorded in the preset database in order of receiving time.

[0020] Optionally, recording the current interface request into the preset database in order of receiving time includes:

[0021] Obtaining the time interval between the current interface request and the last interface request to obtain a target time interval;

[0022] Determining whether the target time interval exceeds the preset time interval;

[0023] If the target time interval does not exceed the preset time interval, the current interface request is recorded in the preset database in the order of reception time into the continuous interface item set that is closest to the reception time of the current interface request.

[0024] Optionally, the interface data preloading method further includes:

[0025] If the target time interval exceeds the preset time interval, a new persistent interface item set is created in the preset database, and the current interface request is recorded in the new persistent interface item set.

[0026] Optionally, recording the current interface request into a persistent interface item set in the preset database that is closest to the reception time of the current interface request includes:

[0027] Determine whether there is an interface request identical to the current interface request in the continuous interface item set that is closest to the reception time of the current interface request;

[0028] If there is no interface request identical to the current interface request in the persistent interface item set closest to the reception time of the current interface request, the current interface request is recorded in the persistent interface item set closest to the reception time of the current interface request in the preset database.

[0029] Optionally, the preset database is analyzed by using an FP growth algorithm to respectively calculate the interface item set occurrence frequency of each of the continuous interface item sets in the preset database, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value, if so, the corresponding continuous interface item set is determined as a high-frequency interface item set, and at least two time-continuous interface item sets are determined from the high-frequency interface item sets to obtain a high-frequency continuous interface item set, including:

[0030] Respectively counting the frequencies of occurrence of each of the historical interface requests in the preset database in the plurality of continuous interface item sets, to obtain a target frequency corresponding to each of the historical interface requests;

[0031] Sorting the historical interface requests in descending order of frequency, and creating an interface item frequency statistics table based on the sorted interface requests and the corresponding target frequencies;

[0032] Sorting the historical interface requests in each of the continuous interface item sets in the preset database according to the order of the sorted interface requests in the interface item frequency statistics table to obtain a sorted interface item set;

[0033] On the basis of the interface item frequency statistics table, constructing an FP tree based on the sorted interface item set to obtain a target FP tree;

[0034] The target FP tree is analyzed to find the interface item set occurrence frequency of multiple sorted interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold. If so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set.

[0035] Optionally, the step of constructing an FP tree based on the sorted interface item set on the basis of the interface item frequency statistics table to obtain a target FP tree includes:

[0036] Eliminate the historical interface requests whose target frequency is less than a second preset threshold and the corresponding target frequency in the interface item frequency statistics table and the sorted interface item set, and obtain a eliminated frequency statistics table and an eliminated interface item set;

[0037] On the basis of the post-elimination frequency statistics table, an FP tree is constructed based on the post-elimination interface item set to obtain a target FP tree.

[0038] Optionally, on the basis of the post-elimination frequency statistics table, constructing an FP tree based on the post-elimination interface item set to obtain a target FP tree includes:

[0039] On the basis of the post-elimination frequency statistics table, each historical interface request in each post-elimination interface item set is respectively inserted into the FP tree in the order of frequency from large to small, so as to obtain a target FP tree.

[0040] Optionally, in the process of constructing the target FP tree, the following steps are further included:

[0041] During the insertion process, determine whether the different nodes currently inserted have the same parent node;

[0042] If they have the same parent node, the count value of the corresponding parent node is increased by 1;

[0043] If they do not have the same parent node, determine whether the currently inserted node is a new node;

[0044] If it is a new node, the corresponding historical interface request in the removed frequency statistics table is used as a node pointer to point to the new node;

[0045] If it is an old node, the node pointer of the previous node with the same interface item is pointed to the old node.

[0046] Optionally, the target FP tree is analyzed to find the interface item set occurrence frequency of the plurality of sorted interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value, if so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item sets to obtain a high-frequency continuous interface item set, including:

[0047] The target FP tree is analyzed in reverse order according to the order of frequency from low to high in the frequency statistics table after elimination, so as to find the interface item set occurrence frequency of multiple interface item sets after elimination in the target FP tree, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding interface item set after elimination is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set.

[0048] Optionally, searching for the interface item set occurrence frequencies of the plurality of eliminated interface item sets in the target FP tree, and determining whether the interface item set occurrence frequencies are greater than a first preset threshold, and if so, determining the corresponding eliminated interface item set as a high-frequency interface item set, comprises:

[0049] Based on the node pointer, searching the target FP tree for branch trees containing each historical interface request in the frequency statistics table after elimination, to obtain an FP subtree;

[0050] According to the number of leaf nodes under the node and the count value of each node in the FP subtree, a frequent subtree of the node is obtained;

[0051] Constructing a continuous interface itemset based on each branch of the node frequent subtree to obtain a new continuous itemset;

[0052] Performing statistics on historical interface requests in the new continuous item set to obtain a new frequency statistics table, and constructing an FP tree based on the new continuous item set on the basis of the new frequency statistics table to obtain a new FP tree;

[0053] The interface item set occurrence frequency of the new continuous item set in the new FP tree is searched, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding new continuous item set is determined as a high-frequency interface item set.

[0054] Optionally, the creating an interface data prediction matching library based on a plurality of high-frequency continuous interface item links comprises:

[0055] Dividing the plurality of high-frequency continuous interface item links in order from high to low frequency to obtain a plurality of divided interface item links;

[0056] An interface data prediction matching library is created based on the multiple divided interface item links.

[0057] Optionally, the creating an interface data prediction matching library based on the multiple divided interface item links includes:

[0058] Determining whether the length of each of the divided interface item links exceeds a preset length;

[0059] If the length of the interface item link after division exceeds the preset length, the part of the interface item link after division that exceeds the preset length is deleted to obtain the deleted interface item link, and an interface data prediction matching library is created based on the deleted interface item link and the interface item link after division that does not exceed the preset length.

[0060] Optionally, the interface data preloading method further includes:

[0061] The data in the cache is cleared according to a preset timed clearing cycle; the timed clearing cycle is greater than the preset time interval.

[0062] In a second aspect, the present application discloses an interface data preloading device, comprising:

[0063] A matching module is used for matching the current interface request with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library when an interface request is received; the high-frequency continuous interface item links are links obtained by connecting historical interface requests in a high-frequency continuous interface item set in order of receiving time, and the high-frequency continuous interface item set is at least two time-continuous interface item sets in a high-frequency interface item set obtained by analyzing the collected historical interface requests using an FP growth algorithm, and the interface item set occurrence frequency is greater than a first preset threshold;

[0064] An acquisition module, configured to acquire, if the match is successful, a subsequent interface item connected to the current interface request from the high-frequency continuous interface item link that has been successfully matched;

[0065] The preloading module is used to load the response data corresponding to the subsequent interface item into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.

[0066] In a third aspect, the present application discloses a computer program product, including a computer program / instruction, which implements the aforementioned interface data preloading method when executed by a processor.

[0067] In a fourth aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned interface data preloading method when executing a computer program stored in the memory.

[0068] In a fifth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned interface data preloading method is implemented.

[0069] It can be seen that when the present application receives an interface request, the current interface request is matched with multiple high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting the historical interface requests in the high-frequency continuous interface item set in order of reception time, and the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained by analyzing the collected historical interface requests using the FP growth algorithm, and the high-frequency interface item set is an interface item set in which the frequency of occurrence of the interface item set is greater than the first preset threshold; if the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link; the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request can be directly obtained from the cache. The present application pre-creates an interface data prediction matching library containing multiple high-frequency continuous interface item links, wherein the high-frequency continuous interface item link is a link obtained by connecting historical interface requests in the high-frequency continuous interface item set in the order of request reception time, that is, the high-frequency continuous interface item link is a link sorted in the order of reception time, and the high-frequency continuous interface item set is a set of at least two time-continuous interface items in the high-frequency interface item set whose occurrence frequency is greater than a first preset threshold obtained by analyzing a large number of historical interface requests collected using the FP growth algorithm. In this way, when an interface request is received, the current interface request can be directly matched with multiple high-frequency continuous interface item links in the pre-created interface data prediction matching library. If the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link, and then the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.The FP growth algorithm is used to dig out a high-frequency continuous interface item set in a large amount of historical interface request data, and based on the high-frequency continuous interface item set, subsequent interface requests that are strongly related to the current interface request are predicted, so that the response data corresponding to the subsequent interface request is loaded into the cache, so that the corresponding response data can be directly obtained when a new interface request is received. It can be seen that the present application decouples the loading of the data cache from the business data, so there is no need to manually analyze a large amount of business data in advance, thereby saving manpower and time costs. In addition, the preloaded data in the present application is the data corresponding to the subsequent interface items in the high-frequency continuous interface item link obtained by the FP growth algorithm, that is, the preloaded data is the data obtained after data mining that is strongly related to the current interface request, that is, it is considered whether the preloaded data is the response data of the data request that will actually occur, so it can avoid loading too much useless data, thereby saving cache space, and improving the hit rate of cached data, reducing the response time of interface requests, and at the same time, avoiding the consumption of memory resources by loading too much data. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0071] Figure 1 This is a flow chart of an interface data preloading method disclosed in this application;

[0072] Figure 2 A specific continuous interface item set statistical schematic diagram disclosed in this application;

[0073] Figure 3 A schematic diagram of a specific persistent interface item set disclosed in this application;

[0074] Figure 4 A schematic diagram of a specific persistent interface item set disclosed in this application;

[0075] Figure 5 A schematic diagram of a specific persistent interface item set disclosed in this application;

[0076] Figure 6 A specific FP tree schematic diagram disclosed in this application;

[0077] Figure 7 A specific FP tree schematic diagram disclosed in this application;

[0078] Figure 8A schematic diagram of a specific node frequent subtree disclosed in this application;

[0079] Fig. 9 A schematic diagram of a specific node frequent subtree disclosed in this application;

[0080] Fig.10 A schematic diagram of a specific persistent interface item set disclosed in this application;

[0081] Fig.11 A specific FP tree schematic diagram disclosed in this application;

[0082] Fig.12 A specific continuous interface item set statistical schematic diagram disclosed in this application;

[0083] Fig.13 A specific continuous interface item set statistical schematic diagram disclosed in this application;

[0084] Fig.14 A flowchart of a specific interface data preloading method disclosed in this application;

[0085] Fig.15 A schematic diagram of a specific high-frequency continuous interface link disclosed in this application;

[0086] Fig.16 A schematic diagram of a specific high-frequency continuous interface link disclosed in this application;

[0087] Fig.17 This is a schematic diagram of the structure of an interface data preloading device disclosed in this application;

[0088] Fig.18 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0089] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0090] The present application embodiment discloses a method for preloading interface data. Figure 1 As shown, the method includes:

[0091] Step S11: When an interface request is received, the current interface request is matched with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting the historical interface requests in the high-frequency continuous interface item set in the order of receiving time, the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained by analyzing the collected historical interface requests using the FP growth algorithm, and the high-frequency interface item set is an interface item set whose occurrence frequency of the interface item set is greater than a first preset threshold.

[0092] It should be pointed out that the interface data preloading scheme proposed in the present application can be specifically applied to the field of web applications, and the present application pre-creates an interface data prediction matching library, which contains multiple high-frequency continuous interface item links; wherein the high-frequency continuous interface item links are links obtained by connecting historical interface requests in the high-frequency continuous interface item set in order of reception time, and the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained after data mining a large number of historical interface requests collected using the FP growth (Frequent Pattern-growth) algorithm, and the high-frequency interface item set is an interface item set whose occurrence frequency of the interface item set is greater than a first preset threshold.

[0093] In this embodiment, in order to better describe the preloading process of interface data, several concepts are first introduced: interface item (i.e., a single interface request recorded, interfaces with the same name are the same interface items, and interfaces with different names represent different interface items), interface item set (i.e., a set of multiple interface items recorded), continuous interface item set (a set of interface items of continuously occurring requests recorded within a preset time range, i.e., a set of interface items within a certain time range), high-frequency interface item set (an interface item set whose frequency of appearance is greater than a certain threshold), maximum high-frequency interface item set (an interface item set with the most subsets in all high-frequency interface item sets), and high-frequency continuous interface item set (any two or more interface item sets sorted by request time contained in a high-frequency interface set).

[0094] In this embodiment, after the above-mentioned interface data prediction matching library is created in advance, when an interface request (ie, interface item) is received, the current interface request can be directly matched with multiple high-frequency continuous interface item links in the above-mentioned interface data prediction matching library.

[0095] In this embodiment, the process of creating the interface data prediction and matching library may specifically include: collecting historical interface requests received within a preset time range; dividing the historical interface requests to obtain multiple continuous interface item sets, and recording the multiple continuous interface item sets into a preset database; using the FP growth algorithm to analyze the preset database to respectively calculate the interface item set occurrence frequency of each continuous interface item set in the preset database, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value, if so, determine the corresponding continuous interface item set as a high-frequency interface item set, and determine at least two and time-continuous interface item sets from the high-frequency interface item set to obtain a high-frequency continuous interface item set; respectively connect the historical interface requests in the high-frequency continuous interface item set in the order of receiving time to obtain multiple high-frequency continuous interface item links, and create an interface data prediction and matching library based on the multiple high-frequency continuous interface item links. In this embodiment, when creating an interface data prediction and matching library, a large number of historical interface requests received within a preset time range may be collected first, and then the collected large number of historical interface requests may be divided to obtain a plurality of time-continuous continuous interface item sets, and the plurality of continuous interface item sets may be recorded in a preset database, and then the FP growth algorithm may be used to analyze the large number of continuous interface item sets recorded in the preset database, thereby respectively calculating the interface item set occurrence frequency of each continuous interface item set in the preset database, and then determining whether the interface item set occurrence frequency is greater than a first preset threshold value, and if so, determining the corresponding continuous interface item set as a high-frequency interface item set, and then determining at least two (i.e., two or more) and time-continuous interface item sets from the determined high-frequency interface item sets, to obtain a corresponding high-frequency continuous interface item set, and further, connecting each historical interface request in the high-frequency continuous interface item set according to the order of request reception time (i.e., the order of request time), thereby obtaining a plurality of high-frequency continuous interface item links, and finally creating an interface data prediction and matching library based on the plurality of high-frequency continuous interface item links. This solution uses the FP growth algorithm to analyze the collected historical interface requests to obtain a high-frequency interface item set, and obtains at least two time-continuous interface item sets from the high-frequency interface item set, and then obtains a high-frequency continuous interface item link. Based on this link, when an interface request is obtained, subsequent interface items that are strongly associated with the current interface request can be directly obtained from the link, and the corresponding response data can be preloaded. It can be seen that this solution decouples the loading of the data cache from the business data. By analyzing a large number of historical interface request records, the pattern of interface requests can be found, thereby predicting the user's next operation and the data they want to obtain, and putting the predicted user data into the cache in advance for user queries. This not only reduces the cache loading amount, but also improves the hit rate of cached data and reduces the response time of interface requests.

[0096] Specifically, the division of the historical interface requests to obtain multiple continuous interface item sets may include: sorting the historical interface requests in order of reception time to obtain sorted interface requests; determining in turn whether two adjacent historical interface requests in the sorted interface requests are within a preset time interval; the preset time interval is greater than a preset average interface request response time; if two adjacent historical interface requests are within the preset time interval, then dividing the two adjacent historical interface requests into the same interface item set to obtain multiple continuous interface item sets. In this embodiment, a large number of collected historical interface requests can be sorted according to the order of the reception time of the interface requests to obtain the sorted interface requests, and then it is determined in turn whether two adjacent historical interface requests in the sorted interface requests are within a preset time interval (such as 10 minutes); wherein, the preset time interval needs to be much larger than the preset average interface request response time, and the preset average interface request response time can be determined based on the response time of most single interface requests. The preset time interval can be selected based on the actual application situation, and can also be smaller than the cache time of subsequent pre-query interface requests, but it cannot be too short. If it is too short, it will result in fewer interface items in the continuous interface item set. If two adjacent historical interface requests are within the preset time interval (such as 10 minutes), the two adjacent historical interface requests can be directly divided into the same interface item set. When the time between a certain interface request and the last received interface request exceeds the preset time interval (such as 10 minutes), it is recorded in a new continuous interface item set, thereby obtaining multiple continuous interface item sets.

[0097] In addition, it should be noted that the same persistent interface item set does not record the same interface request. That is, when the same interface request exists in the same persistent interface item set, only one is recorded without duplication, thereby ensuring that all interface items in the same persistent interface item set are unique. For example, see Figure 2 As shown, when recording an interface request, first determine whether the interface request belongs to the current continuous interface item set (i.e., the continuous interface set). If so, further determine whether the interface request has been recorded. If it has been recorded, there is no need to record it again. If it has not been recorded, record it in the continuous interface set with ID P_SET_02. In addition, interface item 01, interface item 02, interface item 03, ..., interface item n in the continuous interface set with ID P_SET_01 are all within a preset time interval (e.g., 10 minutes).

[0098] It should be noted that the preset database can also continuously record the current interface request and can also continuously accumulate new interface requests. Specifically, the current interface request can be recorded in the preset database in the order of receiving time. For example, see Figure 2As shown, the current interface request can be recorded in the persistent interface set data with the persistent interface set ID P_SET_02 located in the preset database in the order of receiving time, and encoded into interface item 02 in the order of time.

[0099] Specifically, recording the current interface request into the preset database in the order of receiving time may include: obtaining the time interval between the current interface request and the last interface request to obtain a target time interval; determining whether the target time interval exceeds the preset time interval; if the target time interval does not exceed the preset time interval, recording the current interface request into the preset database in the order of receiving time, in the continuous interface item set closest to the receiving time of the current interface request. In this embodiment, when recording the current interface request into the preset database, the time interval between the current interface request and the last interface request (such as 10 minutes) may be obtained first to obtain the corresponding target time interval, and then determine whether the target time interval exceeds the preset time interval (such as 10 minutes). If not, the current interface request may be directly recorded into the continuous interface item set closest to the receiving time of the current interface request in the preset database, for example, see Figure 2 As shown, the current interface request (ie, interface item 02 in P_SET_02) is recorded in the persistent interface item set P_SET_02 that is closest to the reception time of the current interface request.

[0100] In another specific implementation, if the target time interval exceeds the preset time interval, a new persistent interface item set is created in the preset database, and the current interface request is recorded in the new persistent interface item set. Figure 2 As shown, if the time interval between the current interface request and the previous interface request exceeds the preset time interval, P_SET_03 is created and the current interface request is recorded in P_SET_03, that is, interface item 01 is recorded in the first element of P_SET_03.

[0101] In this embodiment, the recording of the current interface request into the continuous interface item set in the preset database that is closest to the reception time of the current interface request may specifically include: determining whether there is an interface request identical to the current interface request in the continuous interface item set that is closest to the reception time of the current interface request; if there is no interface request identical to the current interface request in the continuous interface item set that is closest to the reception time of the current interface request, then recording the current interface request into the continuous interface item set in the preset database that is closest to the reception time of the current interface request. That is, determining whether there is an interface request identical to the current interface request in the continuous interface item set that is closest to the reception time of the current interface request, if not, then recording the current interface request, specifically recording it in the continuous interface item set that is closest to the current moment, and through this determination mechanism, the uniqueness of the interface items in the same continuous interface item set can be ensured.

[0102] In this embodiment, the FP growth algorithm is used to analyze the preset database to respectively calculate the interface item set appearance frequency of each of the continuous interface item sets in the preset database, and determine whether the interface item set appearance frequency is greater than a first preset threshold value. If so, the corresponding continuous interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set. Specifically, it may include: respectively counting the appearance frequency of each of the historical interface requests in the preset database in multiple continuous interface item sets to obtain a target frequency corresponding to each of the historical interface requests; sorting each of the historical interface requests in order of frequency from large to small, and based on the sorted interface requests and the corresponding Create an interface item frequency statistics table according to the target frequency; sort the historical interface requests in each continuous interface item set in the preset database according to the order of the sorted interface requests in the interface item frequency statistics table to obtain a sorted interface item set; build an FP tree based on the sorted interface item set on the basis of the interface item frequency statistics table to obtain a target FP tree; analyze the target FP tree to find the interface item set appearance frequency of multiple sorted interface item sets in the target FP tree, and determine whether the interface item set appearance frequency is greater than a first preset threshold value, if so, determine the corresponding sorted interface item set as a high-frequency interface item set, and determine at least two and time-continuous interface item sets from the high-frequency interface item set to obtain a high-frequency continuous interface item set. For example, see Figure 3 and Figure 4 As shown, statistics are Figure 3 The frequency of each historical interface request (i.e., A, B, C, D, E, F, G, H, L, M, N, Y) in the preset database in all continuous interface item sets is obtained as follows Figure 4The frequencies corresponding to the historical interface requests shown in FIG. 1 are as follows; among them, the frequency corresponding to interface item C is 7, the frequency corresponding to interface items A and G is 6, the frequency corresponding to interface items B and D is 5, the frequency corresponding to interface items E and F is 4, the frequency corresponding to interface item H is 3, and the frequency corresponding to interface items L, M, N, and Y is 1. Then, the historical interface requests are sorted in descending order of frequency (i.e., in the order of 7, 6, 5, 4, 3, and 1) to obtain the sorted interface requests, as shown in FIG. Figure 4 C, A, G, B, D, E, F, H, L, M, N, Y in , then, create an interface item frequency statistics table based on the sorted interface requests and the corresponding target frequencies, such as Figure 4 The interface item frequency statistics table containing interface items and corresponding frequencies is then used to sort the historical interface requests in each continuous interface item set in the preset database according to the order of the sorted interface requests in the interface item frequency statistics table to obtain the sorted interface item set, such as Figure 4 The sorted continuous interface item set corresponding to the continuous interface set ID of 1 is C→A→G→B→F→H. Further, based on the above interface item frequency statistics table, an FP tree is constructed based on the sorted interface item set to obtain a target FP tree, and the target FP tree is analyzed to find out the interface item set occurrence frequency of multiple sorted interface item sets in the target FP tree, and then determine whether the interface item set occurrence frequency is greater than the first preset threshold. If so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and finally at least two and time-continuous interface item sets are determined from all high-frequency interface item sets to obtain a high-frequency continuous interface item set. For example, when the first preset threshold is 5, Figure 4 A high-frequency continuous interface item set in the continuous interface item set with the continuous interface set ID of 1 is C→A→G.

[0103] Specifically, based on the interface item frequency statistics table, constructing an FP tree based on the sorted interface item set to obtain a target FP tree may include: eliminating historical interface requests whose target frequency is less than a second preset threshold and the corresponding target frequency in the interface item frequency statistics table and the sorted interface item set to obtain a eliminated frequency statistics table and an eliminated interface item set; based on the eliminated frequency statistics table, constructing an FP tree based on the eliminated interface item set to obtain a target FP tree. It can be understood that the purpose of this application is to find out the interface item set with higher frequency, and then find the subsequent interface items with higher correlation with the current interface request, and the frequency of a subset must be higher than the frequency of its parent subset, that is, if a certain interface item appears less frequently in the continuous interface item set, then the subset of all continuous interface item sets containing the interface item must appear less than or equal to the number of times the interface item appears in the continuous interface item set. Therefore, when the amount of data in the continuous interface item set is large, such data can be eliminated, thereby significantly reducing the interface items with lower frequency in the continuous interface item set. Therefore, in order to reduce the amount of data for subsequent analysis, the interface item frequency statistics table and the historical interface requests (i.e., interface items) and the corresponding frequencies in the sorted interface item set whose frequency is less than the second preset threshold can be directly eliminated. For example, Figure 4 The number of times interface item M appears in all persistent interface item sets is 1, and the number of times interface item M appears in all persistent interface item sets in which interface item M is located, namely, the number of times interface item M appears in all persistent interface item sets is 1, which is equal to the number of times interface item M appears in all persistent interface item sets. At this time, interface items with a frequency less than the second preset threshold (such as a frequency threshold of 2) can be removed from the set. Figure 4 The interface item frequency statistics table in and the interface items after sorting are concentrated and eliminated, for example, see Figure 5 As shown, L, M, N, and Y with frequencies less than 2 are removed from the statistical table and the corresponding sorted interface item set; then, based on the above-mentioned removed frequency statistical table, an FP tree can be constructed based on the removed interface item set.

[0104] Specifically, the FP tree is constructed based on the post-elimination interface item set on the basis of the post-elimination frequency statistics table to obtain the target FP tree, which may include: on the basis of the post-elimination frequency statistics table, each historical interface request in each post-elimination interface item set is inserted into the FP tree in descending order of frequency to obtain the target FP tree. In this embodiment, on the basis of the post-elimination frequency statistics table, each historical interface request (i.e., interface item) in each post-elimination interface item set can be inserted into the FP tree one by one in descending order of frequency. For example, see Figure 6 As shown, in Figure 5 Based on the frequency statistics table after elimination, the interface items in the continuous interface item set with ID 1 are inserted into the FP tree in sequence according to the order of frequency from large to small (i.e., the order of C→A→G→B→F→H). Then, the interface items in the continuous interface item set with ID 2 are inserted into the above FP tree in sequence according to the order of frequency from large to small (i.e., the order of C→G→E→F). The following is obtained: Figure 7 The FP tree shown is repeated in this way until each interface item in the persistent interface item set with ID 10 is inserted into the FP tree, and finally a complete target FP tree is obtained.

[0105] It should be pointed out that in the process of constructing the target FP tree, it specifically also includes: during the insertion process, determining whether the different nodes currently inserted have the same parent node; if they have the same parent node, then adding 1 to the count value of the corresponding parent node; if they do not have the same parent node, then determining whether the node currently inserted is a new node; if it is a new node, then using the corresponding historical interface request in the frequency statistics table after elimination as a node pointer to point to the new node; if it is an old node, then using the node pointer of the previous node of the same interface item to point to the old node. In this embodiment, in the process of inserting all the interface items in the continuous interface item set into the FP tree in turn, the front one is the parent node and the back one is the child node, and it is necessary to determine whether the different nodes currently inserted have the same parent node. If they have the same parent node, then adding 1 to the count value of the corresponding parent node. For example, Figure 7 If the interface item G has the same parent node C, the count value of the parent node C is increased by 1; if it does not have the same parent node, it is further determined whether the currently inserted node is a new node; if it is a new node, the corresponding historical interface request (i.e., interface item) in the frequency statistics table after elimination is used as a node pointer to point to the new node, for example, Figure 7 Interface item E in ; if it is an old node, the node pointer of the previous node with the same interface item is pointed to the old node, such as Figure 7 Node pointer between two interface items F in .

[0106] In this embodiment, the target FP tree is analyzed to find the interface item set occurrence frequency of multiple sorted interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set. Specifically, it may include: performing a reverse analysis on the target FP tree according to the order of frequency from low to high in the frequency statistics table after elimination to find the interface item set occurrence frequency of multiple eliminated interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding eliminated interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set. In this embodiment, the target FP tree can be analyzed in reverse order according to the order of frequency from low to high in the frequency statistics table after elimination, that is, the interface items at the bottom of the statistics table are analyzed upward in sequence (that is, reverse analysis is performed from interface item H to interface item C), so as to find out the frequency of occurrence of interface item sets of multiple eliminated interface item sets in the target FP tree, and then determine whether the frequency of occurrence of the interface item set is greater than a first preset threshold. If greater, the corresponding eliminated interface item set is determined as a high-frequency interface item set, and then at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a corresponding high-frequency continuous interface item set.

[0107] Specifically, the step of searching for the appearance frequency of interface item sets of the multiple eliminated interface item sets in the target FP tree, and determining whether the appearance frequency of the interface item sets is greater than a first preset threshold value, and if so, determining the corresponding eliminated interface item set as a high-frequency interface item set, may include: based on the node pointer, searching the branch trees containing each historical interface request in the eliminated frequency statistics table from the target FP tree to obtain an FP subtree; resetting the number of leaf nodes under the node and the count value of each node in the FP subtree to obtain a node frequent subtree; constructing a continuous interface item set based on each branch of the node frequent subtree to obtain a new continuous item set; counting the historical interface requests in the new continuous item set to obtain a new frequency statistics table, and constructing an FP tree based on the new continuous item set on the basis of the new frequency statistics table to obtain a new FP tree; searching for the appearance frequency of interface item sets of the new continuous item set in the new FP tree, and determining whether the appearance frequency of the interface item set is greater than a first preset threshold value, and if so, determining the corresponding new continuous item set as a high-frequency interface item set. For example, see Figure 8As shown in FIG. 1 , based on the node pointer, the interface item H is analyzed upward in sequence. There are three branch trees containing the interface item H in the target FP tree, and three FP subtrees are obtained. Then, the count value of each node in the above three FP subtrees is set to the sum of the number of leaf nodes under the node, thereby forming the following: Fig. 9 The node frequent subtree shown, the count value of the node on each branch of the node frequent subtree represents the frequency of the node interface item and the last interface item node appearing together.

[0108] Next, we construct continuous interface item sets based on each branch of the node frequent subtree and obtain new continuous item sets, such as Fig. 9 The new continuous item set 1 (C, A, G, B, F, H), the new continuous item set 2 (C, G, B, D, F, H) and the new continuous item set 3 (A, G, B, E, H) in the new continuous item set are counted, and the historical interface requests in the new continuous item set are obtained as follows Fig.10 The new frequency statistics table shown in the figure is used, and the three new continuous item sets are sorted in descending order of frequency. It should be noted that the interface item H node is not included in the statistics and sorting. Then, based on the new frequency statistics table, the interface items whose frequency is less than the preset threshold (such as the frequency threshold is 2, and the selection of this threshold can make the node frequent subtree have only one branch) in the new continuous item set are deleted, and the FP tree is constructed based on the deleted continuous item set, and the following is obtained: Fig.11 Finally, the interface item set occurrence frequency of the new continuous item set in the new FP tree can be found, and it can be determined whether the interface item set occurrence frequency is greater than the first preset threshold (such as the frequency threshold is 3). If so, the corresponding new continuous item set is determined as a high-frequency interface item set. For example, Fig.11 The two nodes (G and H) with only one branch left in the tree are combined with node H to obtain the set [{H}:3,{G,H}:3,{B,H}:3,{G,B,H}:3] containing H, where the number 3 represents the frequency. It can be seen that the maximum high-frequency interface item set containing H and greater than the first preset threshold (the frequency threshold is 2) is {G,B,H}, and the frequency is 3 times. According to the above high-frequency interface item set search method, continue to search for other interface items in the interface item frequency statistics table in reverse order, so as to find the high-frequency interface item sets containing the corresponding interface item nodes in the target FP tree, and obtain the following: Fig.12 All high-frequency interface item sets in the target FP tree are shown.

[0109] It should be pointed out that in the process of creating the target FP tree, the historical interface requests in each continuous interface item set are sorted according to the frequency, that is, the original call time order is disrupted. Therefore, in order to predict the subsequent interface items with high relevance according to the current interface request, after finding the high-frequency interface item set, each high-frequency interface item set needs to be sorted according to the original time order, that is, the original time order is restored. For details, see Fig.13 As shown, Fig.13 To sort by frequency and number of interface items Fig.12 The statistical results after re-statisticing the high-frequency interface item sets in , where a higher frequency threshold indicates a higher correlation with the current interface request.

[0110] In this embodiment, the interface data prediction matching library is created based on the multiple high-frequency continuous interface item links, which may specifically include: dividing the multiple high-frequency continuous interface item links in order from high to low frequency to obtain multiple divided interface item links; and creating the interface data prediction matching library based on the multiple divided interface item links. In this embodiment, the multiple high-frequency continuous interface item links may be divided in order of the same frequency and time sequence. Fig.13 Connect the high-frequency continuous interface item sets in Fig.14 The high frequency continuous interface link shown in the figure can be further Fig.14 All high-frequency continuous interface item links are recorded in the interface data prediction matching library.

[0111] In a specific implementation, the creation of an interface data prediction matching library based on multiple post-division interface item links may specifically include: determining whether the length of each post-division interface item link exceeds a preset length; if the length of the post-division interface item link exceeds the preset length, deleting the portion of the post-division interface item link that exceeds the preset length to obtain a deleted interface item link, and creating an interface data prediction matching library based on the deleted interface item link and the post-division interface item link that does not exceed the preset length. In this embodiment, the interface data prediction matching library may also be created according to the preset length. Fig.14 The high-frequency continuous interface item links in the are further screened, and the parts exceeding the preset length (such as the preset length is 2) are deleted to obtain the following Fig.15 The high-frequency continuous interface item links only contain 2 item sets, and then all high-frequency continuous interface item links containing only 2 item sets are recorded in the interface data prediction matching library. By setting the preset length, subsequent interface items that are strongly related to the current interface request can be obtained more specifically, avoiding the subsequent loading of too much response data with less relevance to the current interface request, thereby further saving memory space and improving the hit rate of cached data.

[0112] Step S12: If the match is successful, then the subsequent interface item connected to the current interface request is obtained from the high-frequency continuous interface item link that has been successfully matched.

[0113] In this embodiment, if the current interface request successfully matches multiple high-frequency continuous interface item links in the interface data prediction matching library, the subsequent interface item connected to the current interface request is directly obtained from the successfully matched high-frequency continuous interface item link. For example, when the current interface request A makes a request, by matching multiple high-frequency continuous interface item links in the interface data prediction matching library, A→C, A→G, A→D, A→E links that successfully match the current interface request A are obtained, and the subsequent interface items connected to the current interface request A are C, G, D, and E.

[0114] In another specific implementation, if the match fails, a data acquisition request may be directly sent to the source database to acquire corresponding response data from the source database.

[0115] Step S13: Load the response data corresponding to the subsequent interface item into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.

[0116] In this embodiment, after obtaining subsequent interface items C, G, D, and E connected to the current interface request A from the successfully matched high-frequency continuous interface item links (A→C, A→G, A→D, A→E), the response data corresponding to the subsequent interface items C, G, D, and E can be loaded into the cache. In this way, when a new interface request is received, the target response data corresponding to the new interface request can be directly obtained from the above cache. For example, when the new interface request is G, the target response data corresponding to G can be directly obtained from the cache.

[0117] It can be seen that when an interface request is received in the embodiment of the present application, the current interface request is matched with multiple high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting the historical interface requests in the high-frequency continuous interface item set in order of reception time, and the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained by analyzing the collected historical interface requests using the FP growth algorithm, and the high-frequency interface item set is an interface item set in which the frequency of occurrence of the interface item set is greater than the first preset threshold; if the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link; the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache. The embodiment of the present application pre-creates an interface data prediction matching library containing multiple high-frequency continuous interface item links, wherein the high-frequency continuous interface item link is a link obtained by connecting historical interface requests in the high-frequency continuous interface item set in the order of request reception time, that is, the high-frequency continuous interface item link is a link sorted in the order of reception time, and the high-frequency continuous interface item set is a set of at least two time-continuous interface items in the high-frequency interface item set whose occurrence frequency is greater than a first preset threshold obtained by analyzing a large number of historical interface requests collected using the FP growth algorithm. In this way, when an interface request is received, the current interface request can be directly matched with multiple high-frequency continuous interface item links in the pre-created interface data prediction matching library. If the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link, and then the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.A high-frequency continuous interface item set in a large amount of historical interface request data is mined through the FP growth algorithm, and a subsequent interface request that is strongly related to the current interface request is predicted based on the high-frequency continuous interface item set, so that the response data corresponding to the subsequent interface request is loaded into the cache, so that the corresponding response data can be directly obtained when a new interface request is received. It can be seen that the embodiment of the present application decouples the loading of the data cache from the business data, so there is no need to manually analyze a large amount of business data in advance, thereby saving manpower and time costs. In addition, the preloaded data in the present application is the data corresponding to the subsequent interface items in the high-frequency continuous interface item link obtained by the FP growth algorithm, that is, the preloaded data is the data obtained after data mining that is strongly related to the current interface request, that is, it is considered whether the preloaded data is the response data of the data request that will actually occur, so it is possible to avoid loading too much useless data, thereby saving cache space, and improving the hit rate of cached data, reducing the response time of interface requests, and at the same time, avoiding the consumption of memory resources by loading too much data.

[0118] The present application embodiment discloses a specific method for preloading interface data. Fig.16 As shown, the method includes:

[0119] Step S21: When an interface request is received, the current interface request is matched with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting the historical interface requests in the high-frequency continuous interface item set in the order of receiving time, the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained by analyzing the collected historical interface requests using the FP growth algorithm, and the high-frequency interface item set is an interface item set whose occurrence frequency of the interface item set is greater than a first preset threshold.

[0120] Step S22: If the match is successful, then the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link.

[0121] Step S23: Load the response data corresponding to the subsequent interface item into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.

[0122] Step S24: clearing the data in the cache according to a preset timed clearing cycle; the timed clearing cycle is greater than a preset time interval, and the preset time interval is greater than a preset average interface request response time.

[0123] In this embodiment, the data in the cache can be cleared by timed clearing. Specifically, the data in the cache can be cleared according to a preset timed clearing cycle. It should be noted that the timed clearing cycle is greater than the preset time interval, and the preset time interval is greater than the preset average interface request response time, that is, the timed clearing cycle is greater than the preset average interface request response time. In this way, it is possible to prevent cache breakdown after the cache is cleared during continuous interface requests, and it is possible to avoid cache avalanche caused by clearing a large number of caches at the same time. Among them, the cache breakdown phenomenon refers to when the hot data in the cache expires or fails unexpectedly, a large number of concurrent requests access the data at the same time, but due to cache misses, these requests will directly query the data from the database, resulting in excessive database pressure or even crash; the cache avalanche phenomenon refers to a large number of data in the cache that reach the expiration time at the same time, resulting in a huge amount of query data, causing excessive database pressure or even downtime.

[0124] For more specific processing procedures of the above steps S21 to S23, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.

[0125] It can be seen that when an interface request is received in the embodiment of the present application, the current interface request is matched with multiple high-frequency continuous interface item links in the pre-created interface data prediction matching library. If the match is successful, the subsequent interface item connected to the current interface request is obtained from the high-frequency continuous interface item link that is successfully matched, and the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache, and the data in the cache can be cleared according to a preset timing clearing cycle; the timing clearing cycle is greater than the preset time interval, and the preset time interval is greater than the preset average interface request response time. By adopting a method of regularly clearing cache data and setting a timing clearing cycle greater than the preset average interface request response time to clear cache data, it is possible to prevent the cache breakdown phenomenon that occurs after the cache is cleared during continuous interface requests, and avoid the cache avalanche phenomenon caused by clearing a large number of caches at the same time. In addition, for scenarios with a large number of interface requests and complex business systems, the present application avoids early querying to occupy memory, and avoids the waste of memory caused by the data queried during the timing query not being used in the end, as well as the performance consumption caused by the timing query.

[0126] Correspondingly, the embodiment of the present application also discloses an interface data preloading device, see Fig.17 As shown, the device comprises:

[0127] The matching module 11 is used for matching the current interface request with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library when an interface request is received; the high-frequency continuous interface item links are links obtained by connecting historical interface requests in a high-frequency continuous interface item set in order of receiving time, and the high-frequency continuous interface item set is at least two time-continuous interface item sets in a high-frequency interface item set obtained by analyzing the collected historical interface requests using an FP growth algorithm, and the interface item set occurrence frequency is greater than a first preset threshold;

[0128] The acquisition module 12 is used to acquire the subsequent interface item connected to the current interface request from the high-frequency continuous interface item link that has been successfully matched if the match is successful;

[0129] The preloading module 13 is used to load the response data corresponding to the subsequent interface item into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.

[0130] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0131] It can be seen that in an embodiment of the present application, when an interface request is received, the current interface request is matched with multiple high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting the historical interface requests in the high-frequency continuous interface item set in order of reception time, and the high-frequency continuous interface item set is at least two and time-continuous interface item sets in the high-frequency interface item set obtained by analyzing the collected historical interface requests using the FP growth algorithm, and the high-frequency interface item set is an interface item set in which the frequency of occurrence of the interface item set is greater than a first preset threshold; if the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link; the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache. The embodiment of the present application pre-creates an interface data prediction matching library containing multiple high-frequency continuous interface item links, wherein the high-frequency continuous interface item link is a link obtained by connecting historical interface requests in the high-frequency continuous interface item set in the order of request reception time, that is, the high-frequency continuous interface item link is a link sorted in the order of reception time, and the high-frequency continuous interface item set is a set of at least two time-continuous interface items in the high-frequency interface item set whose occurrence frequency is greater than a first preset threshold obtained by analyzing a large number of historical interface requests collected using the FP growth algorithm. In this way, when an interface request is received, the current interface request can be directly matched with multiple high-frequency continuous interface item links in the pre-created interface data prediction matching library. If the match is successful, the subsequent interface item connected to the current interface request is obtained from the successfully matched high-frequency continuous interface item link, and then the response data corresponding to the subsequent interface item is loaded into the cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache.A high-frequency continuous interface item set in a large amount of historical interface request data is mined through the FP growth algorithm, and a subsequent interface request that is strongly related to the current interface request is predicted based on the high-frequency continuous interface item set, so that the response data corresponding to the subsequent interface request is loaded into the cache, so that the corresponding response data can be directly obtained when a new interface request is received. It can be seen that the embodiment of the present application decouples the loading of the data cache from the business data, so there is no need to manually analyze a large amount of business data in advance, thereby saving manpower and time costs. In addition, the preloaded data in the embodiment of the present application is the data corresponding to the subsequent interface items in the high-frequency continuous interface item link obtained by the FP growth algorithm, that is, the preloaded data is the data obtained after data mining that is strongly related to the current interface request, that is, it is considered whether the preloaded data is the response data of the data request that will actually occur, so it is possible to avoid loading too much useless data, thereby saving cache space, and improving the hit rate of cached data, reducing the response time of interface requests, and at the same time, avoiding the consumption of memory resources by loading too much data.

[0132] Furthermore, the present application also discloses an electronic device. Fig.18 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0133] Fig.18 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the interface data preloading method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0134] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0135] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0136] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the interface data preloading method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0137] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the interface data preloading method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.

[0138] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the interface data preloading method disclosed above.

[0139] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0140] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0141] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0143] The above is a detailed introduction to an interface data preloading method, product, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for preloading interface data, characterized in that: include: When an interface request is received, the current interface request is matched with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library; the high-frequency continuous interface item link is a link obtained by connecting historical interface requests in a high-frequency continuous interface item set in order of receiving time, the high-frequency continuous interface item set is at least two time-continuous interface item sets in a high-frequency interface item set obtained by analyzing the collected historical interface requests using an FP growth algorithm, and the high-frequency interface item set is an interface item set whose appearance frequency of the interface item set is greater than a first preset threshold; If the match is successful, obtaining a subsequent interface item connected to the current interface request from the high-frequency continuous interface item link that has successfully matched; Loading the response data corresponding to the subsequent interface item into a cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache; The method also includes: collecting historical interface requests received within a preset time range; dividing the historical interface requests to obtain multiple continuous interface item sets, and recording the multiple continuous interface item sets in a preset database; using the FP growth algorithm to analyze the preset database to respectively calculate the interface item set appearance frequency of each continuous interface item set in the preset database, and determine whether the interface item set appearance frequency is greater than a first preset threshold value, if so, determine the corresponding continuous interface item set as a high-frequency interface item set, and determine at least two and time-continuous interface item sets from the high-frequency interface item set to obtain a high-frequency continuous interface item set; respectively connect the historical interface requests in the high-frequency continuous interface item set in the order of receiving time to obtain multiple high-frequency continuous interface item links, and create an interface data prediction matching library based on the multiple high-frequency continuous interface item links.

2. The interface data preloading method according to claim 1, characterized in that: The historical interface requests are divided to obtain a plurality of persistent interface item sets, including: Sorting the historical interface requests in order of receiving time to obtain sorted interface requests; sequentially determining whether two adjacent historical interface requests in the sorted interface requests are within a preset time interval; the preset time interval is greater than a preset average interface request response time; If two adjacent historical interface requests are within the preset time interval, the two adjacent historical interface requests are divided into the same interface item set to obtain a plurality of continuous interface item sets.

3. The interface data preloading method according to claim 2, characterized in that: Also includes: The current interface request is recorded in the preset database in the order of receiving time.

4. The interface data preloading method according to claim 3, characterized in that: The recording of the current interface request into the preset database in order of receiving time includes: Obtaining the time interval between the current interface request and the last interface request to obtain a target time interval; Determining whether the target time interval exceeds the preset time interval; If the target time interval does not exceed the preset time interval, the current interface request is recorded in the preset database in the order of reception time into the continuous interface item set that is closest to the reception time of the current interface request.

5. The interface data preloading method according to claim 4, characterized in that: Also includes: If the target time interval exceeds the preset time interval, a new persistent interface item set is created in the preset database, and the current interface request is recorded in the new persistent interface item set.

6. The interface data preloading method according to claim 4, characterized in that: The step of recording the current interface request into a persistent interface item set in the preset database that is closest to the reception time of the current interface request includes: Determine whether there is an interface request identical to the current interface request in the continuous interface item set that is closest to the reception time of the current interface request; If there is no interface request identical to the current interface request in the persistent interface item set closest to the reception time of the current interface request, the current interface request is recorded in the persistent interface item set closest to the reception time of the current interface request in the preset database.

7. The interface data preloading method according to claim 2, characterized in that: The method of analyzing the preset database by using the FP growth algorithm to respectively calculate the interface item set occurrence frequency of each of the continuous interface item sets in the preset database, and determining whether the interface item set occurrence frequency is greater than a first preset threshold, and if so, determining the corresponding continuous interface item set as a high-frequency interface item set, and determining at least two time-continuous interface item sets from the high-frequency interface item set to obtain a high-frequency continuous interface item set, includes: Respectively counting the frequencies of occurrence of each of the historical interface requests in the preset database in the plurality of continuous interface item sets, to obtain a target frequency corresponding to each of the historical interface requests; Sorting the historical interface requests in descending order of frequency, and creating an interface item frequency statistics table based on the sorted interface requests and the corresponding target frequencies; Sorting the historical interface requests in each of the continuous interface item sets in the preset database according to the order of the sorted interface requests in the interface item frequency statistics table to obtain a sorted interface item set; On the basis of the interface item frequency statistics table, constructing an FP tree based on the sorted interface item set to obtain a target FP tree; The target FP tree is analyzed to find the interface item set occurrence frequency of multiple sorted interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold. If so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set.

8. The interface data preloading method according to claim 7, characterized in that: The step of constructing a FP tree based on the sorted interface item set on the basis of the interface item frequency statistics table to obtain a target FP tree includes: Eliminate the historical interface requests whose target frequency is less than a second preset threshold and the corresponding target frequency in the interface item frequency statistics table and the sorted interface item set, and obtain a eliminated frequency statistics table and an eliminated interface item set; On the basis of the post-elimination frequency statistics table, an FP tree is constructed based on the post-elimination interface item set to obtain a target FP tree.

9. The interface data preloading method according to claim 8, characterized in that: The step of constructing an FP tree based on the eliminated interface item set on the basis of the eliminated frequency statistics table to obtain a target FP tree includes: On the basis of the post-elimination frequency statistics table, each historical interface request in each post-elimination interface item set is respectively inserted into the FP tree in descending order of frequency to obtain a target FP tree.

10. The interface data preloading method according to claim 9, characterized in that: The process of constructing the target FP tree also includes: During the insertion process, determine whether the different nodes currently inserted have the same parent node; If they have the same parent node, the count value of the corresponding parent node is increased by 1; If they do not have the same parent node, determine whether the currently inserted node is a new node; If it is a new node, the corresponding historical interface request in the removed frequency statistics table is used as a node pointer to point to the new node; If it is an old node, the node pointer of the previous node with the same interface item is pointed to the old node.

11. The interface data preloading method according to claim 10, characterized in that: The target FP tree is analyzed to find the interface item set occurrence frequency of the plurality of the sorted interface item sets in the target FP tree, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value, if so, the corresponding sorted interface item set is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set, including: The target FP tree is analyzed in reverse order according to the order of frequency from low to high in the frequency statistics table after elimination, so as to find the interface item set occurrence frequency of multiple interface item sets after elimination in the target FP tree, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding interface item set after elimination is determined as a high-frequency interface item set, and at least two and time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set.

12. The interface data preloading method according to claim 11, characterized in that: The step of searching for the interface item set occurrence frequencies of the plurality of eliminated interface item sets in the target FP tree and determining whether the interface item set occurrence frequencies are greater than a first preset threshold, and if so, determining the corresponding eliminated interface item set as a high-frequency interface item set, comprises: Based on the node pointer, searching the target FP tree for branch trees containing each historical interface request in the eliminated frequency statistics table respectively to obtain an FP subtree; According to the number of leaf nodes under the node and the count value of each node in the FP subtree, a frequent subtree of the node is obtained; Building a continuous interface itemset based on each branch of the node frequent subtree to obtain a new continuous itemset; Performing statistics on historical interface requests in the new continuous item set to obtain a new frequency statistics table, and constructing an FP tree based on the new continuous item set on the basis of the new frequency statistics table to obtain a new FP tree; The interface item set occurrence frequency of the new continuous item set in the new FP tree is searched, and it is determined whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding new continuous item set is determined as a high-frequency interface item set.

13. The interface data preloading method according to claim 7, characterized in that: The creating an interface data prediction matching library based on a plurality of high-frequency continuous interface item links comprises: Dividing the plurality of high-frequency continuous interface item links in order from high to low frequency to obtain a plurality of divided interface item links; An interface data prediction matching library is created based on a plurality of the divided interface item links.

14. The interface data preloading method according to claim 13, characterized in that: The creating an interface data prediction matching library based on the multiple divided interface item links comprises: Determining whether the length of each of the divided interface item links exceeds a preset length; If the length of the interface item link after division exceeds the preset length, the part of the interface item link after division that exceeds the preset length is deleted to obtain the deleted interface item link, and an interface data prediction matching library is created based on the deleted interface item link and the interface item link after division that does not exceed the preset length.

15. The interface data preloading method according to any one of claims 2 to 14, characterized in that: Also includes: Clearing the data in the cache according to a preset timed clearing cycle; The scheduled clearing period is greater than the preset time interval.

16. An interface data preloading device, characterized in that: include: A matching module is used for matching the current interface request with a plurality of high-frequency continuous interface item links in a pre-created interface data prediction matching library when an interface request is received; the high-frequency continuous interface item links are links obtained by connecting historical interface requests in a high-frequency continuous interface item set in order of receiving time, and the high-frequency continuous interface item set is at least two time-continuous interface item sets in a high-frequency interface item set obtained by analyzing the collected historical interface requests using an FP growth algorithm, and the interface item set occurrence frequency is greater than a first preset threshold; An acquisition module, configured to acquire, if the match is successful, a subsequent interface item connected to the current interface request from the high-frequency continuous interface item link that has been successfully matched; A preloading module, used to load the response data corresponding to the subsequent interface item into a cache, so that when a new interface request is received, the target response data corresponding to the new interface request is directly obtained from the cache; The device is further used to collect historical interface requests received within a preset time range; divide the historical interface requests to obtain multiple continuous interface item sets, and record the multiple continuous interface item sets into a preset database; The preset database is analyzed by using an FP growth algorithm to respectively calculate the interface item set occurrence frequency of each of the continuous interface item sets in the preset database, and determine whether the interface item set occurrence frequency is greater than a first preset threshold value. If so, the corresponding continuous interface item set is determined to be a high-frequency interface item set, and at least two time-continuous interface item sets are determined from the high-frequency interface item set to obtain a high-frequency continuous interface item set; historical interface requests in the high-frequency continuous interface item set are respectively connected in order of receiving time to obtain multiple high-frequency continuous interface item links, and an interface data prediction matching library is created based on the multiple high-frequency continuous interface item links.

17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the interface data preloading method according to any one of claims 1 to 15 is implemented.

18. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the interface data preloading method as described in any one of claims 1 to 15 is implemented.

19. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the interface data preloading method according to any one of claims 1 to 15 is implemented.

Citation Information

Patent Citations

  • Local data caching method and device and related equipment

    CN111563216A

  • Interface control method and device and computer equipment

    CN116708245A