Data caching method for low-code platform

By dynamically adjusting the expiration time interval of data in low-code platforms, using access frequency and history, the problem of low-code platforms' low-code platforms' low-code platforms' low-code platforms' low-code platforms' low-code platforms' hit rate and application operation efficiency are improved.

CN119179659APending Publication Date: 2024-12-24ZHEJIANG CARD WINNER INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411688757.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Low-code platforms cannot effectively control the expiration time of each data when caching data, resulting in frequent data removal and loading, reducing cache efficiency and application operation efficiency.

Method used

By obtaining the expiration time interval of the target data in the cache area, using access frequency and historical access records, dynamically adjusting the expiration time interval to ensure the hit rate and efficiency of the data in the cache area. The specific steps include obtaining the access frequency of the target data, calculating the equivalent expiration time interval, and predicting a new expiration time interval based on the access frequency and history of the interactive unit.

Benefits of technology

It effectively avoids the long-term use of cache space by data, improves the hit rate and efficiency of the cache area, reduces the frequent removal and loading of data, and improves the operational performance of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179659A_ABST
    Figure CN119179659A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data storage, in particular to a data caching method for a low-code platform, which comprises the following steps: when target data is moved out of a cache region and then accessed again, recording an interaction unit accessing the target data as a target unit; in the historical access record, after the target unit accesses the target data, sequentially obtaining reference units of the target unit; after each interaction unit accesses the target data, the access frequency F of the target data in the expiration time interval is obtained; obtaining a plurality of equivalent expiration time intervals of the access frequency F, wherein the access frequency anomaly rate of the target data in each equivalent expiration time interval is equal to F; and obtaining a new expiration time interval of the target data when the target data is accessed again according to the equivalent expiration time intervals of the target unit and the reference unit. The situation that the target data is frequently moved out of and loaded into the cache region is avoided, and the cache efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data caching method for a low-code platform. Background Art

[0002] Low-code platforms are platforms that develop applications through visual interactions. There is no need to write code. Usually, some interactive units are combined to build business processes, logic and data models. The interactive units refer to some visual, interactive (such as draggable) primitives or view components, such as form components for filling in table data, view components for displaying curve graphs or bar graphs, mathematical model components for data statistics and data analysis (such as algorithm model components that implement functions such as data filtering, time series prediction and data statistics), and view components for reading databases or files. By adding or deleting these interactive components, or by configuring the parameters of these interactive components, these interactive components are connected or associated according to business logic, and ultimately, diversified business needs can be realized without writing code.

[0003] Compared with developing applications directly by writing code, low-code platforms have the advantages of automation and visualization when developing applications. However, low-code platforms use interactive units instead of code writing. When these interactive units are coupled with each other to implement various business logics, they cannot control the caching process of each data (for example, they cannot control or cannot efficiently and accurately control the expiration time of each data in the cache area). As a result, the low-code platform frequently removes and loads data when caching data, resulting in low cache efficiency, affecting the operating efficiency and response time of the application, and even causing the application to freeze and crash. Summary of the invention

[0004] To solve the above problems, the present invention provides a data caching method for a low-code platform.

[0005] A data caching method for a low-code platform of the present invention adopts the following technical solution: An embodiment of the present invention provides a data caching method for a low-code platform, the method comprising the following steps: The application developed by the low-code platform includes several visual interaction units. Any data accessed by any interaction unit is recorded as target data, and the expiration time interval of the target data in the cache area is obtained. The length of the expiration time interval is positively correlated with the frequency of the target data being accessed by all interaction units. When the target data expires, the target data is moved out of the cache area. Then, when the target data is accessed again, the interaction unit accessing the target data is recorded as the target unit, and the time when each interaction unit accesses the target data before the target data is accessed again is obtained and recorded as the historical access record; in the historical access record, after the target unit has accessed the target data, other interaction units accessing the target data are obtained in sequence and recorded as the reference units of the target unit; in the historical access record, after each interaction unit has accessed the target data, the access frequency F of the target data in the expiration time interval is obtained; several equivalent expiration time intervals of the access frequency F are obtained, and the access frequency difference rate of the target data in each equivalent expiration time interval is equal to F; According to the equivalent expiration time intervals of the target unit and the reference unit, a new expiration time interval of the target data is obtained when the target data is accessed again; The reference unit whose equivalent expiration time interval is included in the new expiration time interval is recorded as the first unit, and the time interval between the equivalent expiration time interval corresponding to other reference units other than the first unit and the new expiration time interval is the largest.

[0006] Preferably, the step of obtaining the expiration time interval of the target data in the cache area includes the following specific steps: At the current moment when the interactive unit in the application is running, the number of times the target data is accessed by all the interactive units in the preset time period before the current moment is obtained, and the ratio of the number to the length of the preset time period is recorded as the frequency w of the target data being accessed; Let T = w × t0, t0 is a preset time value, the timing starts from when the target data is loaded into the cache area, and the time period after time T is recorded as the expiration time interval.

[0007] Preferably, the target data expiration means that the target data exists in the cache area for a period exceeding the expiration time interval.

[0008] Preferably, in the historical access record, after the target unit has accessed the target data, other interaction units that have accessed the target data are sequentially obtained and recorded as reference units of the target unit, including the following specific steps: The historical access record includes each interaction unit that accesses the target data and the time of the access; In the historical access records, when the target unit accesses the target data twice consecutively, all the interaction units that access the target data are obtained in sequence to form an interaction unit sequence; in the historical access records, for all the interaction unit sequences obtained when the target unit accesses the target data all times, the average difference of each interaction unit sequence is obtained, and the interaction unit in the interaction unit sequence with the smallest average difference is used as the reference unit of the target unit.

[0009] Preferably, the step of obtaining the average difference of each interaction unit sequence and taking the interaction unit in the interaction unit sequence with the smallest average difference as the reference unit of the target unit comprises the following specific steps: Each interaction unit is assigned a unique ID number, and each interaction unit sequence corresponds to an ID number sequence. The DTW distance between any two ID number sequences is obtained, and the average of the DTW distances between each ID number sequence and all ID number sequences is recorded as the average difference of each ID number sequence. The ID number sequence with the smallest average difference is obtained, and the interaction unit sequence corresponding to the ID number sequence with the smallest average difference is used as the interaction unit sequence with the smallest average difference. The interaction unit in the interaction unit sequence with the smallest average difference is used as the reference unit of the target unit.

[0010] Preferably, the specific steps for obtaining the equivalent expiration time interval are as follows: For any interaction unit in the historical record, in the historical record, a time period is obtained with the moment when the interaction unit accesses the target data as the starting point, and the ratio of the number of accesses to the target data within the time period to the length of the time period is equal to the access frequency F corresponding to the interaction unit; the length of the time period is recorded as the equivalent duration of the interaction unit, and the equivalent expiration time interval is obtained based on the equivalent duration of the interaction unit.

[0011] Preferably, obtaining an equivalent expiration time interval according to the equivalent duration of the interaction unit includes the following specific steps: All equivalent durations of the interaction unit are clustered by K-Means to obtain several categories. The mean of all equivalent durations in each category is recorded as the average duration of each category. The time interval with the length of the average duration is recorded as the equivalent expiration time interval, and the equivalent expiration time intervals corresponding to all categories are used as the equivalent expiration time intervals of the interaction unit.

[0012] Preferably, the step of obtaining a new expiration time interval of the target data when the target data is accessed again according to the equivalent expiration time intervals of the target unit and the reference unit includes the following specific steps: When the target data is moved out of the cache and accessed again by the target unit, the time is recorded as T0; the predicted access time T1 of the reference unit is obtained; For the equivalent expiration time interval of the target unit starting from T0, and for the equivalent expiration time interval of the reference unit starting from T1, any equivalent expiration time interval of the target unit is recorded as the target interval. If the equivalent expiration time interval of the reference unit is completely included in the target interval, the reference unit is recorded as the first unit. If the predicted time of the next access to the target data by other reference units other than the first unit is not within the target interval, then the other reference units other than the first unit are recorded as second units; the equivalent expiration time interval of all second units is recorded as the second interval; Obtain cache loading validity of the target interval according to a time interval between a second interval adjacent to the target interval and the target interval, and a time interval between adjacent second intervals; The equivalent expiration time interval with the greatest cache load effectiveness is used as the new expiration time interval of the target data.

[0013] Preferably, the step of obtaining the predicted access time T1 of the reference unit includes the following specific steps: In the historical records, the time t0 each time each reference unit accesses the target data is obtained, the time when the target data was most recently accessed by the target unit before t0 is recorded as t1, and t0-t1 is recorded as the relative time interval each time each reference unit accesses the target data; in the historical records, the relative time intervals obtained when each reference unit accesses the target data in turn constitute a time series sequence, and the sequence prediction algorithm is used to predict the value Tt of the next relative time interval of the time series, and T0+Tt is recorded as the predicted time for the reference unit to access the target data next time.

[0014] Preferably, the step of obtaining the cache loading validity of the target interval according to the time interval between the second interval adjacent to the target interval and the target interval, and the time interval between the adjacent second intervals, comprises the following specific steps: Any two second intervals among all the second intervals are recorded as A and B. If the intersection and union ratios of B and other second intervals other than A are all smaller than the intersection and union ratios of A and B, then B is attributed to A. The second intervals to which all the second intervals belong are obtained, which are recorded as reference intervals. The time interval between the right endpoint of the target interval and the left endpoint of the reference interval adjacent to the target interval is obtained, which is recorded as the first time interval F1. For two adjacent second intervals, the time interval between the right endpoint of the second interval on the left and the left endpoint of the second interval on the right is recorded as the difference between the two adjacent second intervals, and the average of the differences between all adjacent second intervals is recorded as the second time interval F2; let y×F1+(1-y)×F2 be recorded as the cache loading effectiveness; where y is the preset attention coefficient.

[0015] The beneficial effects of the technical solution of the present invention are: The present invention obtains the expiration time interval of the target data in the cache area, and the length of the expiration time interval is positively correlated with the frequency of the target data being accessed by all interactive units. The expiration time interval of the present invention can not only prevent the target data from occupying the cache space for a long time, but also ensure the hit rate of the target data in the cache area, thereby improving the cache efficiency to a certain extent.

[0016] Furthermore, after each interactive unit accesses the target data, the present invention obtains the access frequency F of the target data within the expiration time interval; obtains several equivalent expiration time intervals of the access frequency F, and the access frequency difference rate of the target data within each equivalent expiration time interval is equal to F. The access frequency F of the present invention represents: when the target data is not expired in the cache area, if each interactive unit subsequently loads the target data into the cache area, the predicted frequency at which the target data may be accessed. The access frequency F refers to the access frequency of the interactive unit when the target data is hit in the cache area, which to a certain extent avoids the interference of the situation where the target data is not accessed by the interactive unit due to being moved out of the cache area (that is, avoids the interference of the situation where the target data is directly accessed from the database or file instead of being hit in the cache area). The equivalent expiration time interval describes: when each interactive unit subsequently reloads the target data into the cache area, the predicted expiration time interval of the target data, which is also related to the frequency of the target data being accessed, and can still avoid the target data from occupying the cache space for a long time, while also ensuring the hit rate of the target data in the cache area, and can improve the cache efficiency to a certain extent.

[0017] Further, according to the equivalent expiration time intervals of the target unit and the reference unit, a new expiration time interval of the target data is obtained when the target data is accessed again; wherein, the reference unit whose equivalent expiration time interval is included in the new expiration time interval is recorded as the first unit, and the time interval between the equivalent expiration time intervals corresponding to other reference units other than the first unit and the new expiration time interval is the largest. The new expiration time interval obtained by the present invention is positively correlated with the access frequency of the target data, and at the same time, other exchange units (i.e., the first unit) that may subsequently access the target data have a higher hit rate when accessing the target data (i.e., the equivalent expiration time interval of the first unit can be included in the new expiration time interval), and at the same time, the equivalent expiration time intervals of other exchange units that may subsequently access the target data have as much as possible sufficient intervals between them (i.e., the time interval between the second interval adjacent to the target interval and the target interval, and the time interval between the adjacent second intervals is the largest), and further, while ensuring the hit rate of the target data, the situation where the target data is frequently moved out and moved into the cache area is avoided, thereby improving the low cache efficiency to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart of the steps of a data caching method for a low-code platform provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the data caching method of a low-code platform proposed by the present invention, its specific implementation method, structure, characteristics and effects are described in detail as follows in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0021] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0022] The following is a detailed description of a specific scheme of a data caching method for a low-code platform provided by the present invention in conjunction with the accompanying drawings.

[0023] See also Figure 1 , which shows a step flow chart of a data caching method for a low-code platform provided by an embodiment of the present invention, the method comprising the following steps: Step S001. The application developed by the low-code platform includes several visual interaction units. Any data accessed by any interaction unit is recorded as target data, and the expiration time interval of the target data in the cache area is obtained. The length of the expiration time interval is positively correlated with the frequency of the target data being accessed by all interaction units.

[0024] The data accessed by the interaction unit refers to: the data that the interaction unit needs to read or change when executing business logic; these data are stored in storage devices such as databases or mechanical hard disks. When the interaction unit accesses these data, it first searches the cache area to see whether the data exists. If so, it reads the data from the cache area or changes the data. If not, it loads the data into the cache area and then reads the data from the cache area or changes the data.

[0025] When the application is running, any data accessed by any interactive unit is recorded as target data. The target data will not always exist in the cache. The timing starts from the time the target data is loaded into the cache. After a certain period of time, the target data needs to be moved out of the cache to avoid the target data occupying the cache space for a long time. The time period from the target data being loaded into the cache to being moved out of the cache is recorded as the expiration time interval of the target data in the cache. After the target data is moved out of the cache, if any interactive unit accesses the target data again, the target data will be loaded into the cache again. After a certain period of time, the target data will be moved out of the cache again.

[0026] In this embodiment, the length of the expiration time interval of the target data is positively correlated with the frequency with which the target data is accessed by all interactive units, that is, the greater the frequency with which the target data is accessed, the longer the target data is stored in the cache area; the less frequent the target data is accessed, the shorter the target data is stored in the cache area, thereby avoiding the target data from occupying the cache space for a long time and ensuring the hit rate of the target data in the cache area (the hit rate refers to the probability that the interactive unit can access the target data from the cache area, which is a well-known concept), thereby improving the cache efficiency to a certain extent.

[0027] As an example, the method for obtaining the expiration time interval is: For the current moment when the interactive unit in the application is running, the number of times the target data is accessed by all interactive units (including the number of reads and modifications) within the preset time period before the current moment (for example, within 120 seconds) is obtained. The ratio of this number to the length of the preset time period (that is, 120 seconds) is recorded as the frequency w of target data access, or the number of times the target data is accessed per second.

[0028] Assume T=w×t0. This embodiment is described by taking t0=5 seconds as an example. When T is greater than 300 seconds, assume T=300 seconds. In other embodiments, the above 120 seconds and 300 seconds may be replaced with other values, which are not specifically limited in this embodiment.

[0029] The time starts from when the target data is loaded into the cache area, and the time period after time T is recorded as the expiration time interval, where T represents the length of the expiration time interval.

[0030] Step S002: When the target data expires, the target data is removed from the cache area. When the target data is accessed again, the interaction unit accessing the target data is recorded as the target unit, and the time when each interaction unit accessed the target data before the target data expires is obtained and recorded as a historical access record. In the historical access record, after the target unit has accessed the target data, other interaction units that accessed the target data in sequence are obtained and recorded as reference units of the target unit.

[0031] The above method obtains the expiration time interval based on the access frequency of the target data. When the existence time of the target data in the cache exceeds the expiration time interval, the target data is judged to be expired. When the target data is accessed again after expiration, it needs to be loaded into the cache again. However, the above method of obtaining the expiration time interval will cause the target data to be repeatedly removed from the cache and loaded into the cache, resulting in the target data caching process still being inefficient.

[0032] In this embodiment, as the application continues to run, the target data is removed from the cache when it expires, and then when the target data is accessed again (this time is regarded as the current moment), the interactive unit accessing the target data is recorded as the target unit, and the target unit needs to load the target data into the cache again. Before the target unit loads the target data into the cache again (that is, before the current moment), the expiration time interval of the target data is first obtained according to the method of step S001 (the length of the expiration time interval is still recorded as T), and the time when each interactive unit accesses the target data is obtained within a certain period of time (for example, within one day), and recorded as a historical access record. The historical access record includes each interactive unit that accesses the target data and the time of access.

[0033] In the historical access record, after the target unit has accessed the target data, other interactive units that access the target data in sequence are recorded as reference units of the target unit.

[0034] As an optional example, a specific method for obtaining the reference unit of the target unit is: In the historical access records, the time period from the last time the target unit accessed the target data to the current moment is obtained, and all interaction units (excluding the target unit) accessing the target data within the time period are obtained in sequence and recorded as reference units of the target unit.

[0035] If the number of reference units of the target unit is zero, then obtain the time period corresponding to the two consecutive times the target unit accessed the target data before the current moment, and obtain all interaction units (excluding the target unit) that access the target data in this time period in sequence, and record them as the reference units of the target unit.

[0036] In addition, if the target unit has not accessed the target data before the current moment, then at the current moment, the target unit loads the target data into the cache area and obtains the expiration time interval of the target data according to the method of step S001.

[0037] As a preferred example, a specific method for obtaining a reference unit of a target unit is as follows: In the historical access records, the target unit accesses the target data multiple times, and the time periods corresponding to the two consecutive accesses of the target unit to the target data are obtained. All the interaction units (excluding the target unit) that access the target data are obtained in sequence within the time period. These interaction units constitute an interaction unit sequence. When the target unit accesses the target data multiple times, multiple interaction unit sequences are obtained. If the length of the interaction unit sequence is 0, the interaction unit sequence is deleted. For the convenience of calculation, each interaction unit is assigned a unique ID number, so each interaction unit sequence is represented as an ID number sequence. The DTW distance between any two ID number sequences is obtained, and the average of the DTW distances between each ID number sequence and all ID number sequences is recorded as the average difference of each ID number sequence. The ID number sequence with the smallest average difference is obtained, and the interaction unit sequence corresponding to the ID number sequence with the smallest average difference is used as the interaction unit sequence with the smallest average difference. The interaction unit in the interaction unit sequence with the smallest average difference is used as the reference unit of the target unit.

[0038] When there is only one ID number sequence, the interactive unit in the interactive unit sequence corresponding to the ID number sequence is used as the reference unit of the target unit. When there are only two ID number sequences, the interactive unit in the interactive unit sequence corresponding to the ID number sequence closest to the current moment is used as the reference unit of the target unit.

[0039] The DTW distance is obtained by the DTW algorithm. The smaller the DTW distance is, the greater the similarity between the two ID number sequences is, that is, the more similar the interaction unit sequences are. The interaction unit sequence corresponding to the ID number sequence with the smallest average difference has the greatest similarity with other interaction unit sequences. The DTW algorithm is a well-known technology and will not be described in detail in this embodiment.

[0040] This preferred example records the access of the interactive units to the target data at all times through comprehensive historical access, so that the reference unit of the obtained target unit can more accurately represent other interactive units that may access the target data after the current time.

[0041] Step S003: in the historical access records, after each interactive unit has accessed the target data, the access frequency F of the target data within the expiration time interval is obtained.

[0042] For any interaction unit in the historical access record, the interaction unit may access the target data multiple times. After each access to the target data in the historical access record, the interaction unit obtains the ratio of the total number of times the target data is accessed to T within the expiration time interval (that is, the subsequent T time period, including the moment when the interaction unit accesses the target data each time), and records it as the initial frequency of each access of the interaction unit. In the historical access record, the average of the initial frequencies of all visits of the interaction unit is taken as the access frequency F of the target data of the interaction unit within the expiration time interval, which is simply referred to as the access frequency F of the interaction unit.

[0043] In other embodiments, the maximum value of the initial frequencies of all visits of the interactive unit may be used as the expired visit frequency F of the interactive unit.

[0044] So far, each interaction unit in the historical access record corresponds to an access frequency F, which represents: when the target data exists in the cache for T time, if each interaction unit subsequently loads the target data into the cache, the predicted frequency at which the target data may be accessed.

[0045] It should be noted that the access frequency F is obtained based on the expiration time interval, and the expiration time interval can not only prevent the target data from occupying the cache space for a long time, but also ensure the hit rate of the target data in the cache area. Therefore, if each interactive unit subsequently loads the target data into the cache area, the predicted frequency F of the target data that may be accessed refers to the access frequency of the interactive unit when the target data is hit in the cache area, which to a certain extent avoids interference from the situation where the target data is not accessed by the interactive unit because it is moved out of the cache area (that is, avoids interference from the situation where the target data is not hit in the cache area, but is directly accessed from the database or file).

[0046] Step S004: obtaining a number of equivalent expiration time intervals of access frequency F, wherein the access frequency variance of the target data in each equivalent expiration time interval is equal to F.

[0047] For any interaction unit in the historical records, in the historical records, a time period is obtained with the time when the interaction unit accesses the target data as the starting point, and the time period satisfies the following conditions: the ratio of the number of accesses to the target data in the time period to the length of the time period is equal to F corresponding to the interaction unit (that is, the access frequency of the target data in the time period is equal to F. In this implementation, when the absolute value of the difference between the access frequency and F and the ratio of the absolute value to F are less than 0.1, the access frequency is considered to be equal to F). The length of the time period that satisfies this condition is recorded as the equivalent duration of the interaction unit. Considering that there are multiple time periods that meet this condition and that the interaction unit may access the target data multiple times in the historical records, there are also multiple equivalent durations of the interaction unit. K-Means clustering is performed on all equivalent durations of the interaction unit, where the K value in the K-Means algorithm is set to 3, and finally K=3 categories are obtained. The equivalent durations in the same category are close, and the equivalent durations in different categories vary greatly. It should be noted that when the number of equivalent durations of the interaction unit is less than K, each equivalent duration is regarded as a category.

[0048] In other embodiments, K may be set to other values, which are not specifically limited in this embodiment.

[0049] The average of all equivalent durations in each category is recorded as the average duration of each category, and the time interval with the length of the average duration is recorded as the equivalent expiration time interval. The equivalent expiration time intervals corresponding to all categories are used as the equivalent expiration time intervals of the interaction unit.

[0050] The equivalent expiration time interval describes: when each subsequent interaction unit reloads the target data into the cache area, the predicted expiration time interval of the target data. The expiration time interval is also positively correlated with the frequency of target data access, which can still prevent the target data from occupying cache space for a long time. At the same time, it also ensures the hit rate of the target data in the cache area, and improves the cache efficiency to a certain extent.

[0051] Step S005: According to the equivalent expiration time intervals of the target unit and the reference unit, a new expiration time interval of the target data is obtained when the target data is accessed again.

[0052] Get the predicted access time T1 of the reference cell.

[0053] As an example, the method for obtaining the predicted access time T1 of the reference unit is as follows: In the historical records, the time t0 when each reference unit accesses the target data each time is obtained, the time when the target data was most recently accessed by the target unit before t0 is recorded as t1, and t0-t1 is recorded as the relative time interval when each reference unit accesses the target data each time. In the historical records, each reference unit may access the target data multiple times, and the relative time intervals obtained when each reference unit accesses the target data in turn constitute a time series sequence. The sequence prediction algorithm is used to predict the value of the next relative time interval of the time series, and the value is used as Tt. The sequence prediction algorithm used in this embodiment is the autoregressive algorithm (AR), and the LSTM neural network model can be used in other embodiments. This embodiment does not specifically limit the prediction algorithm used.

[0054] In other embodiments, the average of the relative time intervals obtained when each reference unit accesses the target data multiple times may be used as Tt, which has the advantages of small calculation amount and fast calculation speed.

[0055] Furthermore, when the target data is moved out of the cache and accessed by the target unit (ie, at the current moment), this moment is recorded as T0, and T1=T0+Tt is recorded as the predicted time when the reference unit accesses the target data next time.

[0056] For the equivalent expiration time interval of the target unit starting from T0 and for the equivalent expiration time interval of the reference unit starting from T1, a new expiration time interval is obtained according to the equivalent expiration time intervals of the target unit and the reference unit.

[0057] As an optional example, the method for obtaining the new expiration time interval includes: For any equivalent expiration time interval of the target unit, it is recorded as the target interval. If the reference unit has an equivalent expiration time interval and the equivalent expiration time interval is completely included in the target interval, then the reference unit is recorded as the first unit.

[0058] Other reference units other than the first unit are recorded as second units; the equivalent expiration time interval of all second units is recorded as the second interval; The time of the right endpoint of the target interval minus the time of the left endpoint of each second interval is recorded as the difference between the target interval and the second interval (that is, the time interval between the target interval and the second interval. If the difference is a negative number, it means that the target interval overlaps with the second interval. If it is a positive number, it means that the target interval is to the left of the second interval). Get the average of the difference between the target interval and all the second intervals and record it as the access time difference between the target unit and the second unit.

[0059] Each equivalent expiration time interval of the target unit corresponds to an access time difference, and the equivalent expiration time interval with the largest access time difference is used as the new expiration time interval of the target unit.

[0060] As a preferred example, the method for obtaining the new expiration time interval includes: For any equivalent expiration time interval of the target unit, it is recorded as the target interval. If the equivalent expiration time interval of the reference unit is completely included in the target interval, the reference unit is recorded as the first unit.

[0061] For other reference units other than the first unit, if the predicted time of the next access to the target data of these reference units is not within the target interval, then these other reference units are recorded as the second unit; The equivalent expiration time interval of all second units is recorded as the second interval; The cache loading validity of the target interval is obtained according to the time interval between the target interval and a second interval adjacent to the target interval, and the time interval between adjacent second intervals.

[0062] At this point, each equivalent expiration time interval of the target unit corresponds to a cache load validity. The cache load validity is used to describe: when the target unit accesses the target data, after the target data is loaded into the cache area, and the expiration time interval is set to the target interval, whether the access process of all interactive units to the target data is efficient (including whether the time the target data exists in the interactive unit can allow all interactive units to hit, and whether the situation where the target data is frequently moved out and loaded into the cache area is avoided to a certain extent).

[0063] The equivalent expiration time interval with the maximum cache loading effectiveness is used as the new expiration time interval of the target data. The new expiration time interval is positively correlated with the access frequency of the target data (that is, the access frequency F of the new expiration time interval is related to the expiration time interval in step S001), and other exchange units (that is, the first unit) that may subsequently access the target data have a higher hit rate when accessing the target data (that is, the equivalent expiration time interval of the first unit can be included in the new expiration time interval), and the equivalent expiration time intervals of other exchange units (that is, the second unit) that may subsequently access the target data have as much spacing as possible between them (that is, the time interval between the second interval adjacent to the target interval and the target interval, and the time interval between adjacent second intervals are the largest), which further avoids the situation where the target data is frequently moved out and into the cache area compared to the above optional example.

[0064] As an example, obtaining cache loading validity of a target interval according to a time interval between a second interval adjacent to the target interval and the target interval, and a time interval between adjacent second intervals, includes a method of: Any two second intervals among all the second intervals are recorded as A and B. If the intersection and union ratios of B and other second intervals other than A are all smaller than the intersection and union ratios of A and B, then B is attributed to A. The second intervals to which all the second intervals belong are obtained and recorded as reference intervals.

[0065] At this point, multiple reference intervals can be obtained.

[0066] It should be noted that if B belongs to the second interval b, and the second interval b belongs to A, then it is determined that B belongs to A.

[0067] The right endpoint of the target interval and the left endpoint of the reference interval adjacent to the target interval are obtained, and the time interval between the two endpoints is recorded as a first time interval F1.

[0068] For two adjacent second intervals, the time interval between the right endpoint of the left second interval and the left endpoint of the right second interval is recorded as the difference between the two adjacent second intervals, and the average of the differences between all adjacent second intervals is recorded as the second time interval F2. Let y×F1+(1-y)×F2 be recorded as cache load effectiveness.

[0069] Wherein y is a preset attention coefficient. This embodiment is described by taking y=0.5 as an example. In other embodiments, y may be set to other values.

[0070] As an example, in some embodiments, the method for obtaining the attention coefficient w is as follows: If the predicted time of the next access to the target data by the reference unit is within the target interval, but the equivalent expiration time interval of the reference unit is not completely included in the target interval, the reference unit is recorded as the third unit.

[0071] All equivalent expiration time intervals of all third units are recorded as third intervals, and the intersection-and-union ratio a1 of each third interval and the target interval is obtained, and the intersection-and-union ratio of the third interval and each second interval is calculated, where the maximum intersection-and-union ratio of the third interval and all second intervals is recorded as a2, and the ratio of a1 to a2 is recorded as the attention coefficient y of the target interval (if a2 is equal to 0, then let y be equal to 0.8, if y is greater than or equal to 0.8, let y be equal to 0.8). The larger the y is, the predicted time of the third unit's next access to the target data is within the target interval, and the target data can be hit in the cache area. At the same time, most of the subsequent interaction units of the third unit can still hit the target data in the cache area. At this time, the target interval is paid more attention. When y is smaller, it means that the predicted time of the third unit's next access to the target data is within the target interval. Although the target data can be hit in the cache area, most of the subsequent interaction units may not be able to hit the target data in the cache area, resulting in the need for the subsequent interaction units to reload the target data into the cache area, increasing the number of times the target data is loaded. At this time, the target interval is not paid attention to.

[0072] The method for obtaining w in the above example further ensures the accuracy and rationality of the cache loading effectiveness, but the amount of calculation is large and the method for obtaining w will also occupy a part of the cache space. Therefore, this method is suitable for scenarios with relatively large cache space.

[0073] It should be noted that if the target data is accessed less than 10 times, the method of step S001 is directly used to obtain the expiration time interval, and the methods of steps S002 to S005 are no longer used to obtain a new expiration time interval.

[0074] After the new expiration time interval of the target data is obtained, the application continues to run. When another data is accessed by any target program, it is determined whether the data exists in the cache. If it exists in the cache, the application continues to run. If it does not exist in the cache (for example, the data is moved out of the cache after exceeding the expiration time interval), the new expiration time interval of the data is obtained according to the method of step S002 to step S005. In addition, when the length of the new expiration time interval is greater than 300 seconds, the length of the new expiration time interval is reduced to 300 seconds. In other embodiments, the 300 seconds mentioned above can be replaced by other times, which is not specifically limited in this embodiment.

[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data caching method for a low-code platform, characterized in that: The method comprises the following steps: The application developed by the low-code platform includes several visual interaction units. Any data accessed by any interaction unit is recorded as target data, and the expiration time interval of the target data in the cache area is obtained. The length of the expiration time interval is positively correlated with the frequency of the target data being accessed by all interaction units. When the target data expires, the target data is moved out of the cache area. Then, when the target data is accessed again, the interaction unit accessing the target data is recorded as the target unit, and the time when each interaction unit accesses the target data before the target data is accessed again is obtained and recorded as the historical access record; in the historical access record, after the target unit has accessed the target data, other interaction units accessing the target data are obtained in sequence and recorded as the reference units of the target unit; in the historical access record, after each interaction unit has accessed the target data, the access frequency F of the target data in the expiration time interval is obtained; several equivalent expiration time intervals of the access frequency F are obtained, and the access frequency difference rate of the target data in each equivalent expiration time interval is equal to F; According to the equivalent expiration time intervals of the target unit and the reference unit, a new expiration time interval of the target data is obtained when the target data is accessed again; The reference unit whose equivalent expiration time interval is included in the new expiration time interval is recorded as the first unit, and the time interval between the equivalent expiration time interval corresponding to other reference units other than the first unit and the new expiration time interval is the largest.

2. According to the data caching method of a low-code platform according to claim 1, it is characterized in that: The specific steps of obtaining the expiration time interval of the target data in the cache area are as follows: At the current moment when the interactive unit in the application is running, the number of times the target data is accessed by all the interactive units in the preset time period before the current moment is obtained, and the ratio of the number to the length of the preset time period is recorded as the frequency w of the target data being accessed; Let T = w × t0, t0 is a preset time value, the timing starts from when the target data is loaded into the cache area, and the time period after time T is recorded as the expiration time interval.

3. According to the data caching method of a low-code platform according to claim 2, it is characterized in that: The target data expiration means that the time the target data exists in the cache area exceeds the expiration time interval.

4. According to the data caching method of a low-code platform as described in claim 1, it is characterized in that: In the historical access record, after the target unit has accessed the target data, other interaction units that have accessed the target data are sequentially obtained and recorded as reference units of the target unit, including the following specific steps: The historical access record includes each interaction unit that accesses the target data and the time of the access; In the historical access records, when the target unit accesses the target data twice consecutively, all the interaction units that access the target data are obtained in sequence to form an interaction unit sequence; in the historical access records, for all the interaction unit sequences obtained when the target unit accesses the target data all times, the average difference of each interaction unit sequence is obtained, and the interaction unit in the interaction unit sequence with the smallest average difference is used as the reference unit of the target unit.

5. According to claim 4, a data caching method for a low-code platform is characterized in that: The step of obtaining the average difference of each interaction unit sequence and taking the interaction unit in the interaction unit sequence with the smallest average difference as the reference unit of the target unit includes the following specific steps: Each interaction unit is assigned a unique ID number, and each interaction unit sequence corresponds to an ID number sequence. The DTW distance between any two ID number sequences is obtained, and the average of the DTW distances between each ID number sequence and all ID number sequences is recorded as the average difference of each ID number sequence. The ID number sequence with the smallest average difference is obtained, and the interaction unit sequence corresponding to the ID number sequence with the smallest average difference is used as the interaction unit sequence with the smallest average difference. The interaction unit in the interaction unit sequence with the smallest average difference is used as the reference unit of the target unit.

6. According to a data caching method of a low-code platform as described in claim 1, it is characterized in that: The specific steps for obtaining the equivalent expiration time interval are as follows: For any interaction unit in the historical record, in the historical record, a time period is obtained with the moment when the interaction unit accesses the target data as the starting point, and the ratio of the number of accesses to the target data within the time period to the length of the time period is equal to the access frequency F corresponding to the interaction unit; the length of the time period is recorded as the equivalent duration of the interaction unit, and the equivalent expiration time interval is obtained based on the equivalent duration of the interaction unit.

7. According to the data caching method of a low-code platform as described in claim 1, it is characterized in that: The equivalent expiration time interval is obtained according to the equivalent duration of the interaction unit, and the specific steps include: All equivalent durations of the interaction unit are clustered by K-Means to obtain several categories. The mean of all equivalent durations in each category is recorded as the average duration of each category. The time interval with the length of the average duration is recorded as the equivalent expiration time interval, and the equivalent expiration time intervals corresponding to all categories are used as the equivalent expiration time intervals of the interaction unit.

8. According to claim 1, a data caching method for a low-code platform is characterized in that: The step of obtaining a new expiration time interval of the target data when the target data is accessed again according to the equivalent expiration time interval of the target unit and the reference unit includes the following specific steps: When the target data is moved out of the cache and accessed again by the target unit, the time is recorded as T0; the predicted access time T1 of the reference unit is obtained; For the equivalent expiration time interval of the target unit starting from T0, and for the equivalent expiration time interval of the reference unit starting from T1, any equivalent expiration time interval of the target unit is recorded as the target interval. If the equivalent expiration time interval of the reference unit is completely included in the target interval, the reference unit is recorded as the first unit. If the predicted time of the next access to the target data by other reference units other than the first unit is not within the target interval, then the other reference units other than the first unit are recorded as second units; the equivalent expiration time interval of all second units is recorded as the second interval; Obtain cache loading validity of the target interval according to a time interval between a second interval adjacent to the target interval and the target interval, and a time interval between adjacent second intervals; The equivalent expiration time interval with the greatest cache load effectiveness is used as the new expiration time interval of the target data.

9. According to the data caching method of a low-code platform as described in claim 8, it is characterized in that: The specific steps of obtaining the predicted access time T1 of the reference unit are as follows: In the historical records, the time t0 each time each reference unit accesses the target data is obtained, the time when the target data was most recently accessed by the target unit before t0 is recorded as t1, and t0-t1 is recorded as the relative time interval each time each reference unit accesses the target data; in the historical records, the relative time intervals obtained when each reference unit accesses the target data in turn constitute a time series sequence, and the sequence prediction algorithm is used to predict the value Tt of the next relative time interval of the time series, and T0+Tt is recorded as the predicted time for the reference unit to access the target data next time.

10. According to the data caching method of a low-code platform as described in claim 8, it is characterized in that: The step of obtaining the cache loading validity of the target interval according to the time interval between the second interval adjacent to the target interval and the target interval, and the time interval between the adjacent second intervals, includes the following specific steps: Any two second intervals among all the second intervals are recorded as A and B. If the intersection and union ratios of B and other second intervals other than A are all smaller than the intersection and union ratios of A and B, then B is attributed to A. The second intervals to which all the second intervals belong are obtained and recorded as reference intervals. Obtaining a time interval between the right endpoint of the target interval and the left endpoint of the reference interval adjacent to the target interval, recorded as a first time interval F1; For two adjacent second intervals, the time interval between the right endpoint of the left second interval and the left endpoint of the right second interval is recorded as the difference between the two adjacent second intervals, and the average of the differences of all adjacent second intervals is recorded as the second time interval F2; Let y×F1+(1-y)×F2 be the cache loading effectiveness; where y is the preset attention coefficient.

Citation Information

Patent Citations

  • Cache data management method and device, equipment and storage medium

    CN112631963A