A Dynamic Caching Method, Device and Medium for Supply Chain Finance Factoring Orders
The dynamic caching method for supply chain financial factoring orders addresses inefficiencies in data caching by segregating data based on query frequency, enhancing query speeds and system performance through strategic storage tiering.
Patent Information
- Application Number
- CN202411391993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-09-30
AI Technical Summary
When the data caching technology is large, the query efficiency is low and cannot expand the storage capacity by increasing memory, resulting in slow query speed.
The dynamic cache method of supply chain financial factoring orders is adopted to analyze the probability distribution of query data through a time series model, and the infrequently queried data is stored in the physical medium layer of hierarchical cache, and the frequently queried data is dynamically cached, and the hierarchical cache system is used to improve query efficiency.
Through dynamic caching method, the efficiency of data query is improved, the load pressure on the database is reduced, and the system performance is improved.
Smart Images

Figure CN119357085B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data caching, and particularly to a dynamic caching method, device and medium for supply chain finance factoring orders. Background Art
[0002] As time and business requirements change, the access pattern and importance of data may change. Moreover, when the amount of data to be queried is large and the amount of data corresponding to the query request is large, it will lead to slow data query. However, the slow query response is likely caused by unreasonable data storage. Therefore, it is necessary to optimize the data storage method.
[0003] The existing data caching technology refers to storing data in memory. In practical applications, storing a large amount of data in memory may be limited by capacity and cannot store all data. When the amount of data increases, it is impossible to simply expand the storage capacity of the system by increasing memory, resulting in slow query data speed and low efficiency when querying data. Summary of the Invention
[0004] The present invention provides a dynamic caching method, device and medium for supply chain finance factoring orders, and its main purpose is to solve the problem of low efficiency when querying data.
[0005] To achieve the above object, a dynamic caching method for supply chain finance factoring orders provided by the present invention includes:
[0006] Extracting the queried order data in the historical query records on the factoring repayment page;
[0007] Using a preset time series model to statistically analyze the probability distribution of the queried order data being queried at different time points;
[0008] When the highest probability value in the probability distribution corresponding to each queried order data is less than a preset probability threshold, collecting the queried order data corresponding to the highest probability value as the first factoring order data, and storing the first factoring order data in the physical medium layer of the hierarchical cache;
[0009] When the highest probability value in the probability distribution corresponding to each queried order data is greater than or equal to the preset probability threshold, collecting the queried order data corresponding to the highest probability value as the second factoring order data, and dynamically caching the second factoring order data according to the distribution change of the highest probability value in the probability distribution.
[0010] Optionally, the extracting the queried order data in the historical query records on the factoring repayment page includes:
[0011] Classify the historical query records according to a preset time interval.
[0012] Classify different types of query data in the historical query records after time classification.
[0013] Aggregate the classified different types of query data into the queried order data.
[0014] Optionally, the using a preset time series model to statistically analyze the probability distribution of the queried order data being queried at different time points includes:
[0015] Statistically analyze the first probability distribution of the queried order data being queried at historical time points within a preset time interval.
[0016] Generate time series data of the queried order data according to the query time points corresponding to the queried order data.
[0017] Statistically analyze the error terms in the time series data according to a preset lag order.
[0018] Use a preset time series model and the error terms to calculate the observed value of the query times of the queried order data at a target time point.
[0019] Statistically analyze the second probability distribution of the queried order data at the target time point according to the observed value of the query times.
[0020] Fit the first curve corresponding to the first probability distribution and the second curve corresponding to the second probability distribution into the probability distribution of the queried order data being queried at different time points.
[0021] Optionally, the using a preset time series model and the error terms to calculate the observed value of the query times of the queried order data at a target time point includes:
[0022] Use the time series data to fit a preset time series model and determine the model constant term and lag order of the fitted time series model.
[0023] Calculate the observed value of the query times of the queried order data at the target time point according to the model constant term, the lag order and the error terms, where the calculation formula for the observed value of the query times is:
[0024]
[0025] where, X t is the observed value of the query times at the target time point t, c is the model constant term, θ i is the i-th fitted model parameter, ε t-i is the (t - i)-th error term, and q is the lag order.
[0026] Optionally, the collecting the queried order data corresponding to the highest probability value into the first factoring order data includes:
[0027] Counting the data quantity of the queried order data corresponding to the highest probability value in each probability distribution;
[0028] When the data quantity is greater than a preset quantity threshold, randomly selecting the queried order data corresponding to the highest probability value as the target queried order data, and collecting the target queried order data into the first factoring order data;
[0029] When the data quantity is equal to the preset quantity threshold, taking the queried order data corresponding to the highest probability value as the target queried order data, and collecting the target queried order data into the first factoring order data.
[0030] Optionally, before storing the first factoring order data into the physical medium layer of the hierarchical cache, the method further includes:
[0031] Dividing it into a high-level cache structure and a low-level cache structure in the order from top to bottom;
[0032] Taking the high-level cache structure as the cache layer and the low-level cache structure as the physical medium layer;
[0033] Constructing the cache layer and the physical medium layer into a hierarchical cache in the order from top to bottom.
[0034] Optionally, storing the first factoring order data into the physical medium layer of the hierarchical cache includes:
[0035] Taking the first factoring order data as cold query data, and obtaining the storage address of the cold query data;
[0036] Allocating the cold query data to the physical medium layer of the hierarchical cache according to the storage address;
[0037] Calculating the real-time probability distribution of the queried order data according to the preset time change;
[0038] Updating the first factoring order data according to the real-time probability distribution, and returning to the step of taking the first factoring order data as cold query data until a preset cut-off time is reached.
[0039] Optionally, dynamically caching the second factoring order data according to the distribution change of the highest probability value in the probability distribution includes:
[0040] Determine the cache priority of each queried order data according to the highest probability value in the probability distribution;
[0041] Store the queried order data with the highest cache priority into the cache layer in the hierarchical cache;
[0042] Extract the probability change of the highest probability value corresponding to each queried order data in the distribution change;
[0043] Update the highest probability value in the probability distribution according to the probability change;
[0044] Update the cache priority corresponding to each queried order data according to the updated highest probability value, and return to the step of storing the queried order data with the highest cache priority into the cache layer in the hierarchical cache until all the queried order data are stored.
[0045] To solve the above problems, the present invention also provides an electronic device, which includes:
[0046] At least one processor; and,
[0047] A memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned dynamic caching method for supply chain finance factoring orders.
[0049] To solve the above problems, the present invention also provides a computer-readable storage medium, which stores at least one computer program, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned dynamic caching method for supply chain finance factoring orders.
[0050] The embodiment of the present invention performs big data analysis based on the historical query records of the factoring repayment page, combines with a time series model to confirm the probability distribution of different types of data being queried in different periods, and then stores the factoring data in layers according to the probability distribution, stores the data that is not frequently queried at the bottom layer, and dynamically caches the data that is frequently queried according to its distribution time series according to the different time series distributions to improve the overall query efficiency of the data. Therefore, the dynamic caching method, device and medium for supply chain finance factoring orders proposed by the present invention can solve the problem of low efficiency in data query. Description of the Drawings
[0051] Figure 1Schematic flowchart of the dynamic caching method for supply chain finance factoring orders provided by an embodiment of the present invention;
[0052] Figure 2 Schematic flowchart of the process for calculating probability distribution provided by an embodiment of the present invention;
[0053] Figure 3 Schematic flowchart of the process for collecting first factoring order data provided by an embodiment of the present invention;
[0054] Figure 4 Schematic structural diagram of an electronic device for implementing the dynamic caching method of the supply chain finance factoring order provided by an embodiment of the present invention.
[0055] The realization, functional features and advantages of the objectives of the present invention will be further described in conjunction with embodiments with reference to the accompanying drawings. Detailed implementation manners
[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0057] The embodiments of the present application provide a dynamic caching method for supply chain finance factoring orders. The execution subjects of the dynamic caching method for supply chain finance factoring orders include, but are not limited to, at least one of electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiments of the present application. In other words, the dynamic caching method for supply chain finance factoring orders can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0058] Refer to Figure 1 As shown, it is a schematic flowchart of the dynamic caching method for supply chain finance factoring orders provided by an embodiment of the present invention. In this embodiment, the dynamic caching method for supply chain finance factoring orders includes:
[0059] S1. Extract the queried order data of the historical query records in the factoring repayment page.
[0060] In an embodiment of the present invention, the queried order data refers to the data that has been queried on the factoring repayment page, that is, the historical record data queried on the factoring repayment page, including but not limited to the query records of user's repayment situation, bill status and other information.
[0061] In an embodiment of the present invention, the extraction of the queried order data of the historical query records in the factoring repayment page includes:
[0062] Perform time classification on the historical query records according to a preset time interval;
[0063] Classify different types of query data in the time-classified historical query records;
[0064] Pool the classified different types of query data into the queried order data.
[0065] Specifically, obtain the data of the historical query records from the factoring repayment page, and then perform time classification on the historical query records according to a preset time interval, that is, filter out the query records that fall within the specified time range. For example, if the set time interval is from one week ago to the current time, then it is necessary to filter out the records within this week from the historical query records, and then perform type classification on the time-classified query records, that is, classify the specific query records according to their types. For example, the query records can be classified into different types such as bill query, repayment status query, interest rate query, etc.; finally, pool the classified different types of query data together to form a summary of the queried order data, and store the classified data in a data structure such as a dictionary or a list for subsequent use or display.
[0066] Furthermore, since the amount of data to be queried is large, when the amount of data corresponding to the query request is large, it will cause slow data query, so it is necessary to analyze the query frequency of the queried order data to efficiently optimize the data storage method.
[0067] S2. Use a preset time series model to statistically analyze the probability distribution of the queried order data being queried at different time points.
[0068] In one actual application scenario of the present invention, users of the supply chain finance platform need to frequently query the status and details of factoring orders. During the peak order query period, a large number of users querying order information simultaneously may cause the performance of the system to decline and response delay. By statistically analyzing the probability distribution of the queried order data being queried at different time points, the popular order data can be cached in memory, reducing direct access to the database and reducing the load pressure on the database.
[0069] In an embodiment of the present invention, the probability distribution refers to the probability of the order data to be queried at different times, and the query probability corresponding to each order data to be queried will be statistically calculated within a specified time.
[0070] In an embodiment of the present invention, with reference to Figure 2 as shown, the method for statistically calculating the probability distribution of the order data to be queried at different time points by using a preset time series model includes:
[0071] S21. Statistically calculate the first probability distribution of the order data to be queried at historical time points within a preset time interval;
[0072] S22. Generate time series data of the order data to be queried according to the query time points corresponding to the order data to be queried;
[0073] S23. Statistically calculate the error terms in the time series data according to a preset lag order;
[0074] S24. Calculate the observed value of the query times of the order data to be queried at the target time point by using a preset time series model and the error terms;
[0075] S25. Statistically calculate the second probability distribution of the order data to be queried at the target time point according to the observed value of the query times;
[0076] S26. Fit the first curve corresponding to the first probability distribution and the second curve corresponding to the second probability distribution into the probability distribution of the order data to be queried at different time points.
[0077] Specifically, based on the historical query data, sort them in ascending order according to the time points. For each time point, calculate the query times of the order data to be queried and normalize them into probabilities, that is, divide the query times of each order data to be queried by the total query times to obtain its relative frequency, that is, probability, ensuring that the sum of all probabilities is 1. Each probability can be divided by the sum of the total probabilities to obtain the first probability distribution of the order data to be queried at different time points, where the first probability distribution refers to the probability distribution generated by statistically calculating the query times of the historical order data to be queried based on the historical query data; and according to the query time points corresponding to the order data to be queried, construct time series data, then the time series data is a simple time series, and each time point corresponds to the query times of the order data to be queried; in addition, based on a pre-set lag order, fit the time series data through a time series model (such as an ARIMA model) and obtain the residuals (error terms), and then use the time series model and the extracted error terms to predict the query times at the target time point.
[0078] Specifically, the observed query count refers to the actual number of queries observed at a specific time point or time period, that is, the number of occurrences of a certain event or behavior at different time points is recorded.
[0079] In the embodiment of the present invention, calculating the observed query count of the order data to be queried at the target time point by using the preset time series model and the error term includes:
[0080] Fitting the preset time series model with the time series data, and determining the model constant term and the lag order of the fitted time series model;
[0081] Calculating the observed query count of the order data to be queried at the target time point according to the model constant term, the lag order and the error term, where the calculation formula of the observed query count is:
[0082]
[0083] where X t is the observed query count at the target time point t, c is the model constant term, θ i is the i-th fitted model parameter, ε t-i is the (t - i)-th error term, and q is the lag order.
[0084] Specifically, the time series data is used to fit the preset time series model (autoregressive moving average model). The autoregressive moving average model is a model used to describe the autocorrelation and lag effect of time series data. It combines autoregression (AR) and moving average (MA). The autoregressive part (AR) uses past observations to predict the current value, where p represents the order of the autoregressive term, and the moving average part (MA) uses past white noise errors to predict the current value, where q represents the order of the moving average term. That is, based on the time points and the observed query counts corresponding to the time points in the time series data, the time series model is fitted by the least squares method. Then the time series model includes the model constant term c, the fitted model parameter θ i and the preset lag order q. The fitted time series model will provide the constant term and the lag order of the model, and the constant term and the lag order will be used for subsequent calculations. Using the fitted model constant term, lag order and error term, the observed query count at the target time point can be calculated.
[0085] Specifically, according to the observed value of the predicted number of queries, calculate the second probability distribution of the queried order data at the target time point, where the second probability distribution refers to the probability distribution obtained by counting the number of real-time generated queried order data at the real-time time point; then use a fitting method (such as the least squares method) to fit the first probability distribution and the second probability distribution into curves to obtain the probability distribution of the queried order data at different time points, that is, select a normal distribution function as the fitting function, perform curve fitting on the first probability distribution, perform curve fitting on the second probability distribution, and then fit the curves of the first probability distribution and the second probability distribution after fitting to obtain the distribution curve corresponding to the probability distribution of the queried order data at different time points.
[0086] Furthermore, according to the probability distribution corresponding to each queried order data, the access frequency of each queried order data can be analyzed, and the storage of the queried order data can be optimized based on the access frequency.
[0087] S3. When the highest probability value in the probability distribution corresponding to each queried order data is less than the preset probability threshold, collect the queried order data corresponding to the highest probability value as the first factoring order data, and store the first factoring order data in the physical medium layer of the hierarchical cache.
[0088] In the embodiment of the present invention, the highest probability value in the probability distribution corresponding to each queried order data is statistically calculated. For example, the highest probability value in the probability distribution corresponding to the queried order data A is 0.4, and the highest probability value in the probability distribution corresponding to the queried order data B is 0.5. The preset probability threshold is 0.6. Then, the highest probability values of the queried order data A and the queried order data B are both less than the probability threshold. Then, the queried order data A and the queried order data B are statistically calculated as the queried order data in the first factoring order data set, where the first factoring order data refers to the data whose highest probability value corresponding to the queried order data is less than the preset probability threshold. The queried order data corresponds to the query data involved in the debt payment repaid by the debtor in the factoring business.
[0089] In the embodiment of the present invention, with reference to Figure 3 As shown, the step of collecting the queried order data corresponding to the highest probability value as the first factoring order data includes:
[0090] S31. Statistically calculate the data quantity of the queried order data corresponding to the highest probability value in each probability distribution;
[0091] S32. When the quantity of the data is greater than a preset quantity threshold, arbitrarily select the queried order data corresponding to the highest probability value as the target queried order data, and collect the target queried order data as the first factoring order data;
[0092] S33. When the quantity of the data is equal to the preset quantity threshold, take the queried order data corresponding to the highest probability value as the target queried order data, and collect the target queried order data as the first factoring order data.
[0093] Specifically, first, it is necessary to traverse each probability distribution, find the data corresponding to the highest probability value therein, and count its quantity. According to the preset quantity threshold, judge the quantity of the data corresponding to the highest probability value. If the quantity is greater than the threshold, arbitrarily select one of them as the target queried order data; if the quantity is equal to the threshold, directly select this data as the target queried order data, and add the selected target queried order data to the first factoring order data set, which ensures that appropriate data is selected as the first factoring order data in each probability distribution.
[0094] Exemplarily, there are three probability distributions, each distribution corresponding to different queried order data. The preset quantity threshold is 1. Then the probability distribution corresponding to data 1 is [0.1, 0.6, 0.6], the probability distribution corresponding to data 2 is [0.2, 0.3, 0.5], and the probability distribution corresponding to data 3 is [0.3, 0.3, 0.4]. Then it is necessary to count the quantity of the queried order data corresponding to the highest probability value in each probability distribution. For data 1, the highest probability value is 0.6, and the quantity threshold of the corresponding queried order data is 2; for data 2, the highest probability value is 0.5, and the quantity threshold of the corresponding queried order data is 1; for data 3, the highest probability value is 0.4, and the quantity threshold of the corresponding queried order data is 1. Then there are two time points in data 1 that both have the same maximum probability value, and only any one of the data corresponding to the two time points needs to be selected, and the data corresponding to the two time points are both data 1; when there is only one time point with the maximum probability value, directly select data 2 as the target queried order data. Then the first factoring order data is data 1, data 2, and data 3, which respectively correspond to the queried order data corresponding to the highest probability value in different probability distributions.
[0095] In one actual application scenario of the present invention, since the amount of data to be queried is large, when the amount of data corresponding to a query request is large, it will cause slow data query, but the slow query response is very likely caused by unreasonable data storage. Therefore, it is necessary to optimize the data storage method.
[0096] In the embodiments of the present invention, the hierarchical cache refers to combining storage media with different speeds and capacities to improve the performance and efficiency of the system. Generally, a hierarchical cache system consists of multiple levels, and each level uses storage media with different speeds and capacities.
[0097] In the embodiments of the present invention, before storing the first factoring order data into the physical media layer of the hierarchical cache, the method further includes:
[0098] Dividing it into a high-level cache structure and a low-level cache structure in the order from top to bottom;
[0099] Regarding the high-level cache structure as the cache layer and the low-level cache structure as the physical media layer;
[0100] Constructing the cache layer and the physical media layer into a hierarchical cache in the order from top to bottom.
[0101] Specifically, the high-level cache structure is a cache layer with a relatively fast speed, used to store frequently accessed data to improve the access speed, usually using relatively fast storage media such as memory or solid-state drives; the low-level cache structure is a cache layer with a larger capacity but a slower access speed, used to store less frequently accessed data, usually using relatively slower but larger-capacity storage media such as mechanical hard drives or network storage; then regarding the high-level cache structure as the cache layer for quickly accessing and storing data, and the low-level cache structure as the physical media layer for persistently storing data, constructing the cache layer and the physical media layer into a hierarchical cache in order from top to bottom, indicating that the cache layer is at the top and the physical media layer is at the bottom to form a hierarchical structure. The hierarchical cache structure can balance the requirements of access speed and storage capacity. The cache layer provides fast access, while the physical media layer provides a larger storage capacity and the ability to persistently store data.
[0102] Furthermore, the first factoring order data refers to data with fewer access times and needs to be stored at the bottom layer of the hierarchical cache, which can release the resources of the high-level cache, enabling the cache layer to be used to store more frequently accessed data and improving the overall performance of the query.
[0103] In the embodiments of the present invention, the physical media layer refers to a cache layer with a larger capacity but a slower access speed, used to store less frequently accessed data, such as a hard drive.
[0104] In the embodiments of the present invention, storing the first factoring order data into the physical media layer of the hierarchical cache includes:
[0105] Regarding the first factoring order data as query cold data and obtaining the storage address of the query cold data;
[0106] Allocate the queried cold data to the physical media layer in the hierarchical cache according to the storage address.
[0107] Calculate the real-time probability distribution of the queried order data according to the preset time change.
[0108] Update the first factoring order data according to the real-time probability distribution, and return to the step of using the first factoring order data as the queried cold data until the preset cut-off time is reached.
[0109] Specifically, the first factoring order data refers to the data with fewer access times. Then, the first factoring order data is used as the queried cold data. The queried cold data refers to the data with fewer access times. A corresponding storage address is allocated to each queried cold data. Then, according to the obtained storage address, the queried cold data is stored in the corresponding storage address in the physical media layer of the hierarchical cache.
[0110] Specifically, monitor the access situation of the queried cold data, and calculate the real-time probability distribution of the queried order data according to the historical access pattern and other factors, that is, continuously calculate the real-time probability distribution of the queried order data at different time points by using the time series model according to the change of time points. According to the real-time probability distribution, update the first factoring order data regularly or as needed to ensure the timeliness and accuracy of the data, and re-allocate the updated data to the physical media layer, and determine the preset cut-off time to ensure that the data update and management are completed within the specified time range.
[0111] Exemplarily, the maximum probability value of the queried order data A at time point t1 is 0.3. As time increases, the maximum probability value of the queried order data A at time point t2 is 0.7, and the probability threshold is 0.6. At this time, the maximum probability value of the queried order data A is greater than the probability threshold. Then, the queried order data A needs to be screened out from the first factoring order data and no longer used as the first factoring order data. Then, the first factoring order data needs to be updated again, and the updated data is re-allocated to the physical media layer.
[0112] Furthermore, after analyzing the situation where the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold, it is also necessary to analyze the situation where the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold to ensure that all data is cached.
[0113] S4. When the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold, pool the queried order data corresponding to the highest probability value into the second factoring order data, and perform dynamic caching on the second factoring order data according to the distribution change of the highest probability value in the probability distribution.
[0114] In an embodiment of the present invention, the highest probability value in the probability distribution corresponding to each queried order data is statistically calculated. For example, the highest probability value in the probability distribution corresponding to the queried order data A is 0.7, and the highest probability value in the probability distribution corresponding to the queried order data B is 0.8. Given that the preset probability threshold is 0.6, since the highest probability values of both the queried order data A and the queried order data B are greater than the probability threshold, the queried order data A and the queried order data B are statistically regarded as the queried order data in the second factoring order data set, where the second factoring order data refers to the data whose highest probability value corresponding to the queried order data is greater than or equal to the preset probability threshold.
[0115] Specifically, the step of aggregating the queried order data corresponding to the highest probability value into the second factoring order data is the same as the step of aggregating the queried order data corresponding to the highest probability value into the first factoring order data in S3, which will not be elaborated here.
[0116] Furthermore, the cache policy of the first factoring order data is adjusted in real time according to the change of the probability distribution, and the data that is more likely to be accessed is placed in the cache, thereby reducing the cache miss situation, decreasing the number of accesses to the underlying storage, and improving the data query efficiency.
[0117] In one practical application scenario of the present invention, suppliers in the supply chain usually conduct transactions with multiple buyers, and each buyer may adopt different factoring schemes. Through dynamic caching, the cache policy of the data can be dynamically adjusted according to the access patterns of the factoring orders corresponding to different buyers, improving the access efficiency of the suppliers' factoring orders, ensuring that the supply chain managers can obtain the latest factoring orders faster and conduct real-time data analysis to support decision-making and business optimization. Moreover, the supply chain managers can respond to customers' inquiries and demands faster, improving the efficiency and satisfaction of customer service. Customers can obtain the required factoring orders faster, strengthening the communication and cooperation relationship with the supply chain managers, optimizing the supply chain management and operation efficiency. On the supply chain finance platform, dynamic caching can be used to display order data and monitor order status. For example, financial institutions can monitor the fund flow situation and transaction progress in real time through the cached order information, facilitating timely decision-making and management.
[0118] In an embodiment of the present invention, the dynamic caching of the second factoring order data according to the distribution change of the highest probability value in the probability distribution includes:
[0119] Determining the cache priority of each queried order data according to the highest probability value in the probability distribution;
[0120] Store the queried order data with the highest cache priority into the high-speed cache layer in the hierarchical cache;
[0121] Extract the probability change of the highest probability value corresponding to each queried order data in the distribution change;
[0122] Update the highest probability value in the probability distribution according to the probability change;
[0123] Update the cache priority corresponding to each queried order data according to the updated highest probability value, and return to the step of storing the queried order data with the highest cache priority into the high-speed cache layer in the hierarchical cache until all the queried order data are stored.
[0124] Specifically, according to the highest probability value in the probability distribution, determine the cache priority of each queried order data. The higher the probability value, the higher its cache priority; store the queried order data with the highest cache priority into the high-speed cache layer in the hierarchical cache. The data in the high-speed cache layer is determined according to the highest probability value in the probability distribution and is the data most likely to be frequently accessed.
[0125] Specifically, extract the probability change of the highest probability value corresponding to each queried order data from the real-time updated probability distribution change. The probability change reflects the change of the data access pattern, which can affect the cache priority of the data. Update the highest probability value in the probability distribution according to the probability change, which can reflect the latest data access pattern to adjust the cache policy; update the cache priority corresponding to each queried order data according to the updated highest probability value, adjust the storage location of the data in the cache, ensure that the most frequently accessed data is still in the high-speed cache layer, and loop through each queried order data until all the queried order data are stored, which can continuously adjust the cache policy according to the change of the data access pattern to improve the data query efficiency.
[0126] Furthermore, through dynamic caching, the data in the cache can be dynamically adjusted according to the real-time query pattern and data access situation. Place the most frequently accessed data in the high-speed cache and place the data with lower access frequency in the physical medium layer, which can make more effective use of the cache resources.
[0127] In an embodiment of the present invention, big data analysis is performed based on the historical query records of the factoring repayment page, and combined with a time series model to confirm the probability distribution of different types of data being queried in different periods. Furthermore, according to the probability distribution, the factoring data is stored in layers, with the data that is not frequently queried stored at the bottom layer, and according to the different time series distributions, the data that is frequently queried is dynamically cached according to its distribution time series to improve the overall query efficiency of the data. Therefore, the dynamic caching method, device, and medium for supply chain finance factoring orders proposed by the present invention can solve the problem of low efficiency in data querying.
[0128] As Figure 4 shown, it is a schematic structural diagram of an electronic device for implementing the dynamic caching method of supply chain finance factoring orders provided by an embodiment of the present invention.
[0129] The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a dynamic caching program for supply chain finance factoring orders.
[0130] Among them, the processor 10 may be composed of integrated circuits in some embodiments. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions packaged, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting various components of the entire electronic device through various interfaces and lines, and by running or executing programs or modules stored in the memory 11 (such as executing a dynamic caching program for supply chain finance factoring orders, etc.), and calling data stored in the memory 11 to perform various functions of the electronic device and process data.
[0131] The memory 11 at least includes one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. The memory 11 can be an internal storage unit of the electronic device in some embodiments, such as the mobile hard disk of the electronic device. The memory 11 can also be an external storage device of the electronic device in some other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device. Further, the memory 11 can also include both the internal storage unit and the external storage device of the electronic device. The memory 11 can be used not only to store application software installed in the electronic device and various types of data, such as the code of the dynamic cache program of the supply chain finance factoring order, etc., but also to temporarily store the data that has been output or will be output.
[0132] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to implement the connection and communication between the memory 11 and at least one processor 10, etc.
[0133] The communication interface 13 is used for the communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is generally used to establish a communication connection between this electronic device and other electronic devices. The user interface can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface can also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. Among them, the display can also be appropriately referred to as a display screen or a display unit, and is used to display the information processed in the electronic device and to display a visual user interface.
[0134] Only an electronic device with components is shown in the figure. Those skilled in the art can understand that the structure shown in the figure does not constitute a limitation on the electronic device, and it may include fewer or more components than those shown, or combine certain components, or have different component arrangements.
[0135] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering each component. Preferably, the power source can be logically connected to the at least one processor 10 through a power management device, so as to implement functions such as charging management, discharging management, and power consumption management through the power management device. The power source may also include any components such as one or more DC or AC power sources, a recharge device, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device may also include various sensors, a Bluetooth module, a Wi-Fi module, etc., which will not be elaborated here.
[0136] It should be understood that the above embodiments are only for illustrative purposes and are not limited by this structure in the scope of the patent application.
[0137] The dynamic caching program of the supply chain finance factoring order stored in the memory 11 in the electronic device is a combination of multiple instructions. When running in the processor 10, it can implement:
[0138] Extract the queried order data of the historical query records in the factoring repayment page;
[0139] Use a preset time series model to statistically analyze the probability distribution of the queried order data queried at different time points;
[0140] When the highest probability value in the probability distribution corresponding to each queried order data is less than a preset probability threshold, collect the queried order data corresponding to the highest probability value as the first factoring order data, and store the first factoring order data in the physical medium layer of the hierarchical cache;
[0141] When the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold, collect the queried order data corresponding to the highest probability value as the second factoring order data, and perform dynamic caching on the second factoring order data according to the distribution change of the highest probability value in the probability distribution.
[0142] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiments of the attached drawings, which will not be elaborated here.
[0143] Further, if the modules / units integrated in the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory).
[0144] The present invention also provides a computer-readable storage medium storing a computer program, which when executed by a processor of an electronic device, can implement:
[0145] Extracting the queried order data of the historical query records in the factoring repayment page;
[0146] Using a preset time series model to statistically analyze the probability distribution of the queried order data being queried at different time points;
[0147] When the highest probability value in the probability distribution corresponding to each queried order data is less than a preset probability threshold, pooling the queried order data corresponding to the highest probability value into first factoring order data and storing the first factoring order data in the physical medium layer of the hierarchical cache;
[0148] When the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold, pooling the queried order data corresponding to the highest probability value into second factoring order data and dynamically caching the second factoring order data according to the distribution change of the highest probability value in the probability distribution.
[0149] In several embodiments provided by the present invention, it should be understood that the disclosed device, medium, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation.
[0150] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, in each embodiment of the present invention, each functional module can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional modules.
[0152] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms.
[0153] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is not limited only by the above description. Therefore, it is intended to include all changes within the meaning and scope of equivalent elements falling within the protection scope of the present invention.
[0154] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology, and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0155] In addition, obviously, the term "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system can also be implemented by one unit or device through software or hardware. Terms such as first and second are used to represent names and do not indicate any specific order.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A dynamic caching method for supply chain finance factoring orders, characterized in that, The method includes: Extracting the queried order data of the historical query records in the factoring repayment page; Using a preset time series model to statistically analyze the probability distribution of the queried order data queried at different time points; When the highest probability value in the probability distribution corresponding to each queried order data is less than the preset probability threshold, pooling the queried order data corresponding to the highest probability value as the first factoring order data, and storing the first factoring order data in the physical medium layer of the hierarchical cache; When the highest probability value corresponding to each queried order data is greater than or equal to the preset probability threshold, pooling the queried order data corresponding to the highest probability value as the second factoring order data, and dynamically caching the second factoring order data according to the distribution change of the highest probability value in the probability distribution; Among them, the using a preset time series model to statistically analyze the probability distribution of the queried order data queried at different time points includes: Statistically analyzing the first probability distribution of the queried order data queried at historical time points within a preset time interval; Generating time series data of the queried order data according to the query time point corresponding to the queried order data; Statistically analyzing the error terms in the time series data according to a preset lag order; Using the preset time series model and the error terms to calculate the observed value of the query times of the queried order data at the target time point; Statistically analyzing the second probability distribution of the queried order data at the target time point according to the observed value of the query times; Fitting the first curve corresponding to the first probability distribution and the second curve corresponding to the second probability distribution into the probability distribution of the queried order data queried at different time points.
2. The dynamic caching method for supply chain finance factoring orders according to claim 1, wherein The extracting the queried order data of the historical query records in the factoring repayment page includes: Classifying the historical query records according to a preset time interval segment; Classifying different types of query data in the historically classified query records; Pooling the classified different types of query data as the queried order data.
3. The dynamic caching method for supply chain finance factoring orders as described in claim 1, wherein The using the preset time series model and the error terms to calculate the observed value of the query times of the queried order data at the target time point includes: Fitting the preset time series model using the time series data, and determining the model constant term and the lag order of the fitted time series model; Calculating the observed value of the query times of the queried order data at the target time point according to the model constant term, the lag order and the error terms, where the calculation formula for the observed value of the query times is: wherein, is the observation value of the query times at the target time point, is the model constant term, is the th fitting model parameter, is the th error term, is the lag order.
4. The dynamic caching method for supply chain finance factoring orders as described in claim 1, wherein, The pooling the queried order data corresponding to the highest probability value as the first factoring order data includes: Statistically analyzing the data quantity of the queried order data corresponding to the highest probability value in each probability distribution; When the data quantity is greater than the preset quantity threshold, arbitrarily selecting the queried order data corresponding to the highest probability value as the target queried order data, and pooling the target queried order data as the first factoring order data; When the quantity of the data is equal to a preset quantity threshold, use the queried order data corresponding to the highest probability value as the target queried order data, and collect the target queried order data as the first factoring order data.
5. The dynamic caching method for supply chain finance factoring orders according to claim 1, wherein Before storing the first factoring order data into the physical medium layer of the hierarchical cache, the method further includes: Dividing it into a high-level cache structure and a low-level cache structure in the order from top to bottom; Using the high-level cache structure as the cache layer and the low-level cache structure as the physical medium layer; Constructing the cache layer and the physical medium layer into a hierarchical cache in the order from top to bottom.
6. The dynamic caching method for supply chain finance factoring orders as described in claim 5, characterized in that, Storing the first factoring order data into the physical medium layer of the hierarchical cache includes: Regarding the first factoring order data as cold query data and obtaining the storage address of the cold query data; Allocating the cold query data to the physical medium layer of the hierarchical cache according to the storage address; Calculating the real-time probability distribution of the queried order data according to the preset time change; Updating the first factoring order data according to the real-time probability distribution and returning to the step of regarding the first factoring order data as cold query data until a preset deadline is reached.
7. The dynamic caching method for supply chain finance factoring orders according to claim 1, characterized in that, Dynamically caching the second factoring order data according to the distribution change of the highest probability value in the probability distribution includes: Determining the cache priority of each queried order data according to the highest probability value in the probability distribution; Storing the queried order data with the highest cache priority into the cache layer of the hierarchical cache; Extracting the probability change of the highest probability value corresponding to each queried order data in the distribution change; Updating the highest probability value in the probability distribution according to the probability change; Updating the cache priority corresponding to each queried order data according to the updated highest probability value and returning to the step of storing the queried order data with the highest cache priority into the cache layer of the hierarchical cache until all the queried order data are stored.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor can execute the dynamic caching method of the supply chain finance factoring order as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the dynamic caching method of the supply chain finance factoring order as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Business data cache processing method and device, computer equipment and storage medium
CN115952194A