A data caching method, device, equipment, medium and product

By building a multi-level knowledge base collaborative matching architecture and pre-trained model to generate data cache strategies, the problem of inefficient data cache efficiency in edge computing systems when load characteristics change is solved, and adapting to new loads and fast data acquisition is achieved.

CN120179411BActive Publication Date: 2025-08-01JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510608687.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-01
Estimated Expiration
2045-05-13

AI Technical Summary

Technical Problem

When the load characteristics change greatly, the data cache effectiveness and hit rate are low. The traditional LRU method has limited effects in scenarios with strong time locality, while the method based on load characteristics prediction depends on the existing load type and cannot cope with new load types.

Method used

Build a multi-level knowledge base collaborative matching architecture, obtain the current load characteristics through edge device nodes, retrieve the knowledge bases of local, adjacent edge servers and cloud data centers, use pre-trained models to generate data cache policies, optimize data storage locations, and combine RAG and fine-tuning mode to generate cache policies to adapt to different load types.

Benefits of technology

Improve data caching efficiency, can cope with multiple load types, reduce data transmission delay, rationally allocate storage resources, avoid waste, and ensure that edge devices quickly obtain required data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179411B_ABST
    Figure CN120179411B_ABST
Patent Text Reader

Abstract

The present application discloses a data caching method, apparatus, device, medium and product, which relates to the field of caching technology and is applied to an edge server, and includes: obtaining the current load characteristics and the current data request sent by an edge device node; the load characteristics are obtained by the node extracting from the received task request, and the data request is a request for obtaining the data resources required to execute the task request; matching the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result; the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center; inputting the matching result into a pre-trained model to generate a data caching policy, and obtaining data resources from the target location based on the data caching policy, and storing the data resources in the local cache and / or the edge device node; the target location is one or more locations among the local cache, the adjacent edge server, and the cloud data center.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of caching technologies, and particularly to a data caching method, apparatus, device, medium and product. Background Art

[0002] With the rapid development of Internet of Things technologies, the importance of edge computing in data processing and real-time response has become increasingly prominent. By bringing computing and storage resources closer to terminal devices, edge computing systems effectively reduce data transmission latency, improve the real-time performance and reliability of the systems, and are widely applied in many fields such as intelligent transportation, industrial Internet of Things, and smart home.

[0003] In edge computing systems, data caching is a key link to improve system performance. Currently, edge computing systems usually adopt a hierarchical storage architecture, which consists of a cloud data center, edge servers, and edge device nodes. The data caching methods mainly include the traditional LRU (Least Recently Used) method and the data prefetching method based on load characteristic prediction. Among them, the LRU method caches the recently accessed data on edge servers or terminal devices. This method has a certain effect in scenarios with strong temporal locality. However, when the load characteristics change greatly, the effectiveness and hit rate of data caching are relatively low. The data prefetching method based on load characteristic prediction combines means such as machine learning and hotspot analysis, and can preload the required data in advance according to the prediction results to reduce request latency. However, this method depends on the stored load characteristic knowledge and is only effective for existing load types. Once a new load type appears, due to the lack of corresponding historical data and model training, the prefetching method often fails.

[0004] In summary, how to improve data caching efficiency under limited storage resources is a problem to be solved currently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a data caching method, apparatus, device, medium and product, which can improve data caching efficiency under limited storage resources. The specific solutions are as follows:

[0006] In a first aspect, the present application discloses a data caching method applied to an edge server, including:

[0007] Obtaining the current load characteristics and the current data request sent by an edge device node; wherein, the current load characteristics are extracted by the edge device node from the received task requests, and the current data request is a request for obtaining the data resources required to execute the task request;

[0008] Match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center;

[0009] Input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, obtain the data resource from the target location based on the data caching policy, and store the data resource in the local cache and / or edge device nodes; the target location is one or more locations among the local cache, adjacent edge servers, and cloud data centers.

[0010] Optionally, matching the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result includes:

[0011] Match the current load characteristics with the historical load characteristics stored in the local knowledge base to obtain a first matching result;

[0012] If the first matching result indicates that there is no historical load characteristic in the local knowledge base that matches the current load characteristic, then send the current load characteristics to the knowledge bases in the adjacent edge servers and the cloud knowledge base for matching to obtain a second matching result.

[0013] Optionally, inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource includes:

[0014] If the first matching result indicates that there is a historical load characteristic in the local knowledge base that matches the current load characteristic, then input the first matching result into the pre-trained model so that the pre-trained model outputs a data caching policy corresponding to the data resource based on the retrieval-enhanced generation mode; wherein, the first matching result includes a cache policy template corresponding to the historical load characteristic that matches the current load characteristic.

[0015] Optionally, inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource includes:

[0016] If the second matching result indicates that there is a historical load characteristic in the knowledge base in the adjacent edge server that matches the current load characteristic or there is a historical load characteristic in the cloud knowledge base that matches the current load characteristic, then input the second matching result into the pre-trained model so that the pre-trained model outputs a data caching policy corresponding to the data resource based on the retrieval-enhanced generation mode and fine-tuning instructions; wherein, the second matching result includes a cache policy template corresponding to the historical load characteristic that matches the current load characteristic.

[0017] Optionally, inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource includes:

[0018] If the second matching result indicates that there is no historical load feature matching the current load feature in the knowledge bases of adjacent edge servers and there is no historical load feature matching the current load feature in the cloud knowledge base, the current load feature is input into the pre-trained model so that the pre-trained model predicts the data caching policy corresponding to the data resource based on the fine-tuning instruction.

[0019] Optionally, after inputting the current load feature into the pre-trained model so that the pre-trained model predicts the data caching policy corresponding to the data resource based on the fine-tuning instruction, it further includes:

[0020] Storing the current load feature and the corresponding data caching policy into the local knowledge base.

[0021] Optionally, matching the current load feature with the historical load features stored in the target knowledge base to obtain a matching result, including:

[0022] Encoding the current load feature according to a preset encoding method to generate a first feature vector;

[0023] Calculating the similarity between the first feature vector and each second feature vector stored in the target knowledge base, and obtaining a matching result based on the similarity calculation result; wherein, each second feature vector is a feature vector obtained by encoding the historical load feature according to the preset encoding method in advance.

[0024] Optionally, calculating the similarity between the first feature vector and each second feature vector stored in the target knowledge base includes:

[0025] Calculating the Euclidean distance between the first feature vector and each second feature vector stored in the target knowledge base to determine the similarity based on the Euclidean distance; wherein, the similarity has a negative correlation with the Euclidean distance.

[0026] Optionally, obtaining a matching result based on the similarity calculation result includes:

[0027] Determining the minimum Euclidean distance from each Euclidean distance, and determining whether the minimum Euclidean distance is less than a preset distance threshold;

[0028] If the minimum Euclidean distance is less than the preset distance threshold, the second feature vector corresponding to the minimum Euclidean distance in the target knowledge base is used as the feature vector matching the first feature vector, and a matching result indicating successful matching is obtained;

[0029] If the minimum Euclidean distance is not less than the preset distance threshold, it is determined that there is no feature vector in the target knowledge base matching the first feature vector, and a matching result indicating failed matching is obtained.

[0030] Optionally, input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, including:

[0031] Input the matching result and the current system state of the edge server into a pre-trained model to generate a data caching policy corresponding to the data resource; wherein, the current system state includes the remaining storage space, network bandwidth, and CPU utilization rate.

[0032] Optionally, the process of the edge device node sending the current load characteristics and the current data request after receiving a task request includes:

[0033] After the edge device node receives a task request, determine whether there is a data resource required to execute the task request locally;

[0034] Based on the judgment result, determine whether to send the current load characteristics and the current data request to the edge server.

[0035] Optionally, determining whether to send the current load characteristics and the current data request to the edge server based on the judgment result includes:

[0036] If the judgment result indicates that there is a data resource locally at the edge device node, then execute the task processing process corresponding to the task request based on the data resource, and cache the processing result locally after the task processing process is completed, and send the request type corresponding to the task request to the edge server, so that the edge server can pre-locate and store the data corresponding to the request type;

[0037] If the judgment result indicates that there is no data resource locally at the edge device node, then extract the current load characteristics from the task request and send the current load characteristics and the current data request to the edge server.

[0038] Optionally, the load characteristics include a computing mode, a task parallelism degree, a data access mode, a resource occupancy situation, and a task scheduling characteristic; wherein, the computing mode includes compute-intensive, memory-intensive, I / O-intensive, and network-intensive; the task parallelism degree includes parallel and serial; the data access mode includes data locality, access order, concurrency, and access frequency; the resource occupancy situation includes the utilization rates of CPU, memory bandwidth, disk I / O, and network bandwidth; the task scheduling characteristic includes a task deadline, a task processing method, and a task priority.

[0039] Optionally, the data caching method of this application further includes:

[0040] Monitor the size of the space used by the local cache;

[0041] When the space size reaches a preset space threshold, determine the target data resource from the local cache and perform a clearing process on the target data resource.

[0042] Optionally, determining the target data resource from the local cache includes:

[0043] Counting the number of successful matches of each historical load feature in the local knowledge base, and determining the heat value of each historical load feature based on the number of successful matches; wherein, the heat value is positively correlated with the number of successful matches;

[0044] Determining the target historical load feature corresponding to the lowest heat value, and determining the target data resource corresponding to the target historical load feature from the local cache.

[0045] Optionally, determining the heat value of each historical load feature based on the number of successful matches includes:

[0046] Calculating the heat value of each historical load feature based on the number of successful matches and the time decay factor; wherein, the time decay factor is calculated based on the target time interval and the preset decay coefficient, and the target time interval is the difference between the current time and the time when the historical load feature was successfully matched last time.

[0047] In a second aspect, the present application discloses a data caching device, which is applied to an edge server and includes:

[0048] An acquisition module, configured to acquire the current load feature and the current data request sent by the edge device node; wherein, the current load feature is extracted by the edge device node from the received task request, and the current data request is a request for acquiring the data resource required to execute the task request;

[0049] A matching module, configured to match the current load feature with the historical load features stored in the target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of the local knowledge base, the knowledge base in the adjacent edge server, and the cloud knowledge base in the cloud data center;

[0050] A data caching module, configured to input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, and acquire the data resource from the target location based on the data caching policy, and store the data resource in the local cache and / or the edge device node; the target location is one or more of the local cache, the adjacent edge server, and the cloud data center.

[0051] In a third aspect, the present application discloses an electronic device, including:

[0052] A memory, configured to store a computer program;

[0053] A processor, configured to execute the computer program to implement the steps of the foregoing disclosed data caching method.

[0054] Fourthly, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed data caching method are implemented.

[0055] Fifthly, the present application discloses a computer program product, including a computer program / instructions, when the computer program / instructions are executed by a processor, the steps of the aforementioned disclosed data caching method are implemented.

[0056] It can be seen that the present application obtains the current load characteristics and the current data request sent by the edge device node through the edge server; wherein, the current load characteristics are extracted from the received task requests by the edge device node, and the current data request is a request for obtaining the data resources required for executing the task request; matching the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of the local knowledge base, the knowledge base in the adjacent edge server, and the cloud knowledge base in the cloud data center; inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources, and obtaining the data resources from the target location based on the data caching policy, and storing the data resources in the local cache and / or the edge device node; the target location is one or more locations among the local cache, the adjacent edge server, and the cloud data center.

[0057] Beneficial effects: When receiving a task request, an edge device node can extract the current load characteristics therefrom and determine the data resources required to obtain the execution task request, while the edge server can obtain the current load characteristics sent by the edge device nodes covered by it and the current data requests for obtaining data resources. For the obtained current load characteristics, the edge server can retrieve the target knowledge base to match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result, and further input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources. Among them, the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center, that is, the present application constructs a multi-level knowledge base collaborative matching architecture, and through retrieval and matching in different knowledge bases, a suitable caching policy can be found, which can achieve a high coverage rate of load characteristic matching and enable the system to handle various different load types. Even when a new load type appears, if the local knowledge base fails to match successfully, relevant load characteristic model information can still be obtained by online retrieving the knowledge bases of adjacent edge servers or the cloud data center, realizing the adaptation to new loads. Finally, the edge server obtains the corresponding data resources from the most suitable target location based on the data caching policy, and stores the obtained data resources in the local cache and / or edge device nodes according to the data caching policy to reasonably allocate the data storage location, make full use of the storage resources of the edge server and edge device nodes, avoid unnecessary data transmission and storage waste, and also enable the edge device nodes to quickly obtain the corresponding data resources to execute the corresponding task requests, reducing data transmission latency. Among them, the target location refers to one or more locations among the local cache, adjacent edge servers, and cloud data centers. Description of the Drawings

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0059] Figure 1 It is an edge computing system architecture diagram disclosed in the present application;

[0060] Figure 2 It is a flowchart of a data caching method disclosed in the present application;

[0061] Figure 3 It is a schematic diagram of a load characteristic matching process disclosed in the present application;

[0062] Figure 4Schematic diagram of a data caching strategy generated according to a matching result disclosed in this application;

[0063] Figure 5 Flowchart of a specific data caching method disclosed in this application;

[0064] Figure 6 Schematic diagram of the structure of a storage model disclosed in this application;

[0065] Figure 7 Schematic diagram of the structure of a data caching device disclosed in this application;

[0066] Figure 8 Structure diagram of an electronic device disclosed in this application. Specific embodiments

[0067] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0068] In an edge computing system, data caching is a key link to improve system performance. Currently, edge computing systems usually adopt a hierarchical storage architecture, which consists of a cloud data center, edge servers, and edge device nodes. The data caching methods mainly include the traditional LRU method and the data prefetching method based on load characteristic prediction. Among them, the LRU method caches the recently accessed data on the edge server or terminal device. This method has a certain effect in scenarios with strong temporal locality. However, when the load characteristics change greatly, the effectiveness and hit rate of data caching are relatively low. The data prefetching method based on load characteristic prediction combines means such as machine learning and hotspot analysis, and can preload the required data in advance according to the prediction results to reduce request latency. However, this method depends on the stored load characteristic knowledge and is only effective for existing load types. Once a new load type appears, due to the lack of corresponding historical data and model training, the prefetching method often fails.

[0069] Therefore, the embodiments of this application disclose a data caching method, device, device, and medium, which can improve data caching efficiency under limited storage resources.

[0070] In the data caching solution of this application, the adopted edge computing system architecture is as Figure 1As shown, there are a total of n edge device nodes, 1 edge server, and 1 cloud data center. Among them, the type of edge device node can be a computing node or a storage node. The edge device nodes are connected to the edge server and the cloud data center through a network (such as Ethernet, Internet, local area network, or wide area network, etc.). The data of this edge computing system is transmitted and stored among the cloud data center, the edge server, and the edge device nodes.

[0071] See Figure 2 As shown, an embodiment of this application discloses a data caching method, which is applied to an edge server. The method includes:

[0072] Step S11: Obtain the current load characteristics and the current data request sent by the edge device node; where the current load characteristics are extracted by the edge device node from the received task request, and the current data request is a request for obtaining the data resources required to execute the task request.

[0073] In this embodiment, when the edge device node receives a task request, it can extract the current load characteristics therefrom and determine the data resources required to execute the task request, while the edge server can obtain the current load characteristics and the current data request for obtaining data resources sent by the edge device nodes it covers.

[0074] Among them, the process of the edge device node sending the current load characteristics and the current data request after receiving the task request can specifically include: when the edge device node receives the task request, it determines whether there are data resources required to execute the task request locally; based on the determination result, it determines whether to send the current load characteristics and the current data request to the edge server. It can be understood that relevant data resources can also be stored in the local cache of the edge device node. Therefore, when the edge device node receives the task request, it first determines whether there are data resources required to execute the task request locally, so as to determine whether to send the current load characteristics and the current data request to the edge server according to the determination result.

[0075] Specifically, the determination of whether to send the current load characteristics and the current data request to the edge server based on the determination result includes: if the determination result indicates that there are data resources locally in the edge device node, then execute the task processing process corresponding to the task request based on the data resources, cache the processing result locally after the task processing process is completed, and send the request type corresponding to the task request to the edge server so that the edge server can pre-lookup and store the data corresponding to the request type; if the determination result indicates that there are no data resources locally in the edge device node, then extract the current load characteristics from the task request and send the current load characteristics and the current data request to the edge server.

[0076] That is to say, according to the judgment result, it is mainly divided into two cases:

[0077] In a specific embodiment, if the data resources required to execute the task request exist locally at the edge device node, the edge device node can directly execute the task processing flow corresponding to the task request based on the data resources, and cache the processing result locally after the execution of the task processing flow is completed, and send the request type corresponding to the task request to the edge server, so that the edge server can know in advance the type of task being executed by the edge device node, and then pre-search and store the data corresponding to the request type. That is to say, by sending the request type to the edge server, the edge server can actively load the data resources that may be requested in the future from its local knowledge base, the knowledge bases in adjacent edge servers, or the cloud knowledge base in the cloud data center, so that when the edge device node needs these data resources subsequently, the edge server can provide them quickly, reduce the latency of data acquisition, shorten the response time, and thus improve the overall execution efficiency of the computing task. For example, if the edge device node is performing a real-time analysis task of weather forecast data, after receiving the request type of "real-time analysis of weather forecast data", the edge server will obtain in advance the meteorological model data, historical meteorological data, etc. that may be used in subsequent analysis from the data center or other storage locations.

[0078] It should also be noted that when the data resources required to execute the task request exist locally at the edge device node, the request type and load characteristics of such task requests can be reported to the edge server regularly, such as at fixed intervals (such as every 5 seconds) or event-triggered (such as a sudden 10% increase in resource occupancy). For example, in a continuous computing task, although the data in the current stage is local, as the task progresses, other related data may be needed. By informing the edge server of the task type in advance, the edge server can prepare these potentially needed data according to past experience and understanding of the load characteristics, thereby reducing the subsequent waiting time for data and improving the execution efficiency of the entire computing task.

[0079] In another specific embodiment, if the data resources required to execute the task request do not exist locally at the edge device node, the edge device node extracts the current load characteristics from the task request and sends the current load characteristics and the current data request to the edge server, so that the edge server can prepare the data resources required by the edge device node. That is, the edge server obtains the data resources required by the edge device node from the cloud data center or other edge servers according to the load characteristics, and uses the load characteristics to optimize the data acquisition and transmission strategies, such as selecting appropriate cache locations, data transmission methods, etc. according to different load characteristics. Among them, when sending the current load characteristics and the current data request to the edge server, a regular sending mechanism can be adopted, or it can be sent immediately after it is determined that there are no data resources locally.

[0080] It should be noted that the load characteristics include but are not limited to computing mode, task parallelism, data access mode, resource occupancy, and task scheduling characteristics; among them, the computing mode includes but is not limited to compute-intensive, memory-intensive, I / O-intensive, and network-intensive; task parallelism includes parallel and serial; the data access mode includes but is not limited to data locality, access order, concurrency, and access frequency; resource occupancy includes but is not limited to the utilization rates of CPU, memory bandwidth, disk I / O, and network bandwidth; task scheduling characteristics include but are not limited to task deadlines, task processing methods, and task priorities. That is to say, the load characteristics are mainly quantitative indicators used to describe the dynamic behavior during task execution, reflecting the occupancy patterns of resources such as computing, storage, and network.

[0081] It also should be noted that different load characteristics determine the need for different types of data support during the execution of computing tasks. For compute-intensive loads, a large amount of algorithm model data, intermediate calculation result data, etc. are usually required. In deep learning model training tasks, the parameter data of the model and the gradient data generated during the training process are necessary for computing; while for I / O-intensive loads, such as file transfer and database read / write tasks, storage devices need to be frequently accessed, so the required data resources are mainly file data, database records, etc. stored on disks or other storage media. The load characteristics also affect the selection of the storage location for the data resources required for computing. If the load has strong data locality, that is, the task often accesses data in a specific area, then this data is more suitable to be stored in the local storage near the edge device node to reduce data transmission latency and improve computing efficiency. In addition, the load characteristics also determine the timing of obtaining the data resources required for computing. For loads with obvious temporal locality, that is, data accessed recently is likely to be accessed again, relevant data can be cached in advance to the edge server or edge device node to quickly respond to the user's next request. For some sudden and unpredictable loads, it may be necessary to obtain data from other storage locations in a timely manner according to the load characteristics when the task request arrives.

[0082] Step S12: Match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result; where the target knowledge base is one or more of the local knowledge base, the knowledge base in the adjacent edge server, and the cloud knowledge base in the cloud data center.

[0083] In this embodiment, for the obtained current load characteristics, the edge server can retrieve the target knowledge base to match the current load characteristics with the historical load characteristics stored in the target knowledge base, thereby obtaining a matching result. The target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center. That is, this application constructs an architecture for collaborative matching of multi-level knowledge bases. By retrieving and matching in different knowledge bases, a suitable caching policy can be found, which can achieve a high coverage rate of load characteristic matching and enable the system to handle various different load types.

[0084] In a specific implementation, the above-mentioned matching of the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result includes: matching the current load characteristics with the historical load characteristics stored in the local knowledge base to obtain a first matching result; if the first matching result indicates that there is no historical load characteristic in the local knowledge base that matches the current load characteristic, then send the current load characteristics to the knowledge bases in the adjacent edge servers and the cloud knowledge base for matching to obtain a second matching result.

[0085] That is, after obtaining the current load characteristics, first match the current load characteristics with the historical load characteristics stored in the local knowledge base of the edge server to obtain a first matching result. It can be understood that the local knowledge base can specifically store the historical load characteristics of each edge device node covered by the edge server. If the first matching result indicates that there is no historical load characteristic in the local knowledge base of the edge server that matches the current load characteristic, then the edge server sends the current load characteristics to the knowledge bases in the adjacent edge servers and the cloud knowledge base for matching to obtain a second matching result. It can be seen that, as Figure 3 shown, when the edge server performs feature matching, it includes local matching and online matching. Local matching refers to matching in the local knowledge base, and online matching includes matching in the knowledge bases of adjacent edge servers and matching in the cloud knowledge base of the cloud data center, thereby obtaining the final matching result.

[0086] In this way, even when a new load characteristic type appears, if the local knowledge base fails to match successfully, relevant load characteristic information can still be obtained by online retrieving the knowledge bases of adjacent edge servers or the cloud data center, realizing the adaptation to new types of loads.

[0087] Step S13: Input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, obtain the data resource from the target location based on the data caching policy, and store the data resource in the local cache and / or edge device nodes; the target location is one or more of the local cache, adjacent edge servers, and cloud data centers.

[0088] In this embodiment, the matching result is input into a pre-trained model to generate a data caching policy corresponding to the data resource. Specifically, the pre-trained model can be an LLM (Large Language Model).

[0089] Finally, the edge server obtains the corresponding data resource from the most suitable target location based on the data caching policy, and stores the obtained data resource in the local cache and / or edge device nodes according to the data caching policy, so as to reasonably allocate the data storage location, make full use of the storage resources of the edge server and edge device nodes, avoid unnecessary data transmission and storage waste, and enable the edge device nodes to quickly obtain the corresponding data resources to execute the corresponding task requests, reducing the data transmission delay. Among them, the target location refers to one or more locations among the local cache, adjacent edge servers, and cloud data centers.

[0090] Specifically, see Figure 4 As shown, according to whether the current load feature matches the historical load feature stored in the target knowledge base, it specifically includes the following situations:

[0091] In the first specific implementation manner, inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource includes: if the first matching result indicates that there is a historical load feature in the local knowledge base that matches the current load feature, then input the first matching result into the pre-trained model, so that the pre-trained model outputs a data caching policy corresponding to the data resource based on the retrieval-augmented generation mode; among them, the first matching result includes a cache policy template corresponding to the historical load feature that matches the current load feature. That is, if the matching is successful in the local knowledge base, the cache policy template corresponding to the historical load feature that matches the current load feature is input into the LLM model, so that the LLM model outputs a data caching policy corresponding to the data resource based on the Retrieval-Augmented Generation (RAG) mode. Among them, RAG is a technical framework that combines information retrieval and generation models. Its core idea is: first retrieve relevant knowledge, and then generate a response based on the retrieval result, rather than relying only on the internal memory of the model. In the edge computing scenario, RAG enhances the accuracy and adaptability of the LLM model to generate policies by querying local or cloud knowledge bases.

[0092] In the second specific implementation, the matching result is input into a pre-trained model to generate a data caching policy corresponding to the data resource, including: if the second matching result indicates that there is a historical load feature matching the current load feature in the knowledge base of the adjacent edge server or there is a historical load feature matching the current load feature in the cloud knowledge base, the second matching result is input into the pre-trained model, so that the pre-trained model outputs a data caching policy corresponding to the data resource based on the retrieval-augmented generation mode and the fine-tuning instruction; where the second matching result includes a caching policy template corresponding to the historical load feature matching the current load feature. That is, if the matching fails in the local knowledge base but succeeds in the knowledge base of the adjacent edge server or the cloud knowledge base, the caching policy template corresponding to the historical load feature matching the current load feature in the adjacent edge server or the cloud data center is input into the pre-trained model, and the difference feature between the current load feature and the matched caching policy template is quantified, and a data caching policy corresponding to the data resource is output in combination with the RAG mode and the fine-tuning instruction. For example, the attention layer of the LLM model is fine-tuned based on the difference feature, and then the data caching policy is output by the fine-tuned LLM model.

[0093] In the third specific implementation, the matching result is input into a pre-trained model to generate a data caching policy corresponding to the data resource, including: if the second matching result indicates that there is no historical load feature matching the current load feature in the knowledge base of the adjacent edge server and there is no historical load feature matching the current load feature in the cloud knowledge base, the current load feature is input into the pre-trained model, so that the pre-trained model predicts a data caching policy corresponding to the data resource based on the fine-tuning instruction. That is, if the local knowledge base, the knowledge base of the adjacent edge server, and the cloud knowledge base all fail to match, the current load feature is input into the pre-trained model, so that the pre-trained model predicts a data caching policy corresponding to the data resource based on the fine-tuning instruction. For example, models such as random forest are used to learn the relationship between the load feature and the caching policy from scratch, and all parameters of the LLM model are fine-tuned, and then the data caching policy is output by the fine-tuned LLM model.

[0094] Further, after the current load feature is input into the pre-trained model so that the pre-trained model predicts a data caching policy corresponding to the data resource based on the fine-tuning instruction, it further includes: storing the current load feature and the corresponding data caching policy in the local knowledge base.

[0095] That is to say, the embodiments of the present application innovatively combine two model working modes of RAG and fine-tuning, which are specifically divided into three modes. For the payloads successfully matched in the local knowledge base, the working mode of RAG is adopted. For the payloads that are not successfully matched in the local knowledge base but are successfully matched through online retrieval, the working mode of RAG + fine-tuning is adopted; for the payloads that are not successfully matched, only the fine-tuning method is used to learn their payload characteristics, predict their data cache requirements, then formulate a cache strategy, and update their payload characteristics to the local knowledge base.

[0096] In addition, as Figure 4 shown, the above-mentioned inputting the matching result into the pre-trained model to generate a data cache strategy corresponding to the data resource includes: inputting the matching result and the current system state of the edge server into the pre-trained model to generate a data cache strategy corresponding to the data resource; wherein, the current system state includes the remaining storage space, network bandwidth, and CPU utilization rate. That is to say, in addition to taking the matching result of the current payload characteristics and the target knowledge base as the input of the LLM model, the current system state of the edge server also needs to be considered. That is, the LLM model mainly generates a data cache strategy based on the matching result of the payload characteristics and the current system state. The specific matching result and system state will jointly construct a prompt word Prompt, and the input text or instruction is provided to the LLM model through the Prompt to guide the model to generate a specific type of response. Among them, the current system state can specifically include, but is not limited to, the remaining storage space, network bandwidth, and CPU utilization rate. It should be noted that in addition to referring to the current system state of the edge server, the LLM model can also consider the state of the entire edge computing system, such as the real-time state of edge device nodes, network topology state, etc.

[0097] It can be seen that when the edge device node receives a task request, it can extract the current load characteristics therefrom and determine the data resources required to obtain the execution task request, while the edge server can obtain the current load characteristics sent by the edge device nodes covered by it and the current data request for obtaining data resources. For the obtained current load characteristics, the edge server can retrieve the target knowledge base to match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result, and further input the matching result into the pre-trained model to generate a data caching policy corresponding to the data resources. Among them, the target knowledge base is one or more of the local knowledge base, the knowledge base in the adjacent edge server, and the cloud knowledge base in the cloud data center. That is, this application constructs an architecture for collaborative matching of multi-level knowledge bases. By retrieving and matching in different knowledge bases, a suitable caching policy can be found, which can achieve a high coverage rate of load characteristic matching and enable the system to handle various different load types. Even when a new load type appears, if the local knowledge base fails to match successfully, relevant load characteristic model information can still be obtained by online retrieving the knowledge bases of adjacent edge servers or cloud data centers, realizing the adaptation to new loads. Finally, the edge server obtains the corresponding data resources from the most suitable target location based on the data caching policy, and stores the obtained data resources in the local cache and / or edge device nodes according to the data caching policy to reasonably allocate the data storage location, make full use of the storage resources of the edge server and edge device nodes, avoid unnecessary data transmission and storage waste, and enable the edge device nodes to quickly obtain the corresponding data resources to execute the corresponding task requests, reducing data transmission latency. Among them, the target location refers to one or more locations among the local cache, adjacent edge servers, and cloud data centers.

[0098] See Figure 5 As shown, this embodiment of the application discloses a specific data caching method. Compared with the previous embodiment, this embodiment further describes and optimizes the technical solution. Specifically, it includes:

[0099] Step S21: Obtain the current load characteristics and the current data request sent by the edge device node; wherein, the current load characteristics are extracted by the edge device node from the received task request, and the current data request is a request for obtaining the data resources required to execute the task request.

[0100] Step S22: Encode the current load characteristics according to a preset encoding method to generate a first feature vector.

[0101] In this embodiment, the extracted current load characteristics are encoded according to a preset encoding method and converted into a vector form in a multi-dimensional space to obtain a first feature vector. Among them, the preset encoding method can be encoding using the BERT model.

[0102] Step S23: Calculate the similarity between the first feature vector and each second feature vector stored in the target knowledge base, and obtain a matching result based on the similarity calculation result; wherein, each second feature vector is a feature vector obtained by encoding historical load features in advance according to a preset encoding method; the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center.

[0103] In this embodiment, the historical load features stored in the target knowledge base are also encoded according to the same preset encoding method to obtain corresponding second feature vectors, so as to ensure that all feature vectors are in the same dimensional space, which is convenient for subsequent calculations. Then, the similarity between the first feature vector and each second feature vector stored in the target knowledge base can be calculated, and a matching result can be obtained based on the similarity calculation result.

[0104] In a specific implementation manner, calculating the similarity between the first feature vector and each second feature vector stored in the target knowledge base includes: calculating the Euclidean distance between the first feature vector and each second feature vector stored in the target knowledge base, so as to determine the similarity based on the Euclidean distance; wherein, the similarity is negatively correlated with the Euclidean distance. In this embodiment, the Euclidean distance between the first feature vector and all second feature vectors in the target knowledge base is calculated in sequence, so as to determine the similarity according to the Euclidean distance.

[0105] In a specific implementation manner, obtaining a matching result based on the similarity calculation result includes: determining the minimum Euclidean distance from each Euclidean distance, and determining whether the minimum Euclidean distance is less than a preset distance threshold; if the minimum Euclidean distance is less than the preset distance threshold, then use the second feature vector corresponding to the minimum Euclidean distance in the target knowledge base as the feature vector matching the first feature vector, and obtain a matching result indicating successful matching; if the minimum Euclidean distance is not less than the preset distance threshold, then determine that there is no feature vector in the target knowledge base that matches the first feature vector, and obtain a matching result indicating failed matching.

[0106] That is, compare the calculated Euclidean distances and determine the minimum Euclidean distance. Further, in this application, the second feature vector corresponding to the minimum Euclidean distance is not directly used as the feature vector matching the first feature vector, but it is also necessary to determine whether the minimum Euclidean distance is less than the preset distance threshold; if the minimum Euclidean distance is less than the preset distance threshold, then use the second feature vector corresponding to the minimum Euclidean distance in the target knowledge base as the feature vector matching the first feature vector, and obtain a matching result indicating successful matching. In addition, if the minimum Euclidean distance is not less than the preset distance threshold, then determine that there is no feature vector in the target knowledge base that matches the first feature vector, and obtain a matching result indicating failed matching.

[0107] Step S24: Input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, obtain the data resource from a target location based on the data caching policy, and store the data resource in the local cache and / or the edge device node; the target location is one or more of the local cache, the adjacent edge server, and the cloud data center.

[0108] It should be noted that as the edge server continuously caches data for the edge device node, the limited storage resources of the edge server become strained. Therefore, it is necessary to manage the storage space of the edge server. Thus, the method of this application further includes: monitoring the size of the space already used in the local cache; when the size reaches a preset space threshold, determining target data resources from the local cache and performing a clearing process on the target data resources. That is, this application needs to monitor in real time the size of the space already used in the local cache of the edge server. After the size of the space already used reaches the set preset space threshold, target data resources are determined from the local cache and the target data resources are cleared to improve the utilization rate of the storage space of the edge server, thereby ensuring the normal operation of the edge server.

[0109] In a specific implementation, determining target data resources from the local cache includes: counting the number of successful matches of each historical load feature in the local knowledge base and determining the heat value of each historical load feature based on the number of successful matches; where the heat value is positively correlated with the number of successful matches; determining the target historical load feature corresponding to the lowest heat value and determining the target data resources corresponding to the target historical load feature from the local cache. That is, this application discloses a space release method measured by the load heat value. By counting the number of successful matches of each historical load feature in the local knowledge base to determine the heat value of each historical load feature, where the heat value is positively correlated with the number of successful matches. Then, the target historical load feature corresponding to the lowest heat value is determined, and the target data resources corresponding to the target historical load feature are determined from the local cache. That is, this application manages the storage space of the edge server by releasing the data related to the smallest load heat, alleviating the problem of insufficient storage resources of the edge server.

[0110] Among them, determining the heat value of each historical load feature based on the number of successful matches includes: calculating the heat value of each historical load feature based on the number of successful matches and a time decay factor; wherein, the time decay factor is calculated based on a target time interval and a preset decay coefficient, and the target time interval is the difference between the current time and the time when the historical load feature was successfully matched last time. It can be understood that this application specifically calculates the heat value of each historical load feature based on the number of successful matches and the time decay factor, and the actual decay factor is calculated using an exponential decay model and is calculated based on the target time interval and the preset decay coefficient. The target time interval is specifically the difference between the current time and the time when the historical load feature was successfully matched last time.

[0111] From the foregoing content, it can be seen that this application can be understood as constructing a storage model in an edge server, specifically as Figure 6 shown. The storage model mainly consists of an agent module, an LLM module, a knowledge base module, a feature matching module, and a cache module. The goal of this storage model is to generate a data caching policy and cache relevant data according to the policy. Among them, the agent module is mainly responsible for the work scheduling of other modules of the storage model; the LLM module mainly generates a data caching policy based on the matching result of the load feature and the current system state; the knowledge base module is responsible for storing historical load feature information; the feature matching module is responsible for comparing the current load feature of the request with the existing historical load feature information in the knowledge base; the cache module is responsible for executing the data caching policy output by the LLM, that is, collecting and caching load-related data.

[0112] Among them, for the more specific processing procedures of the above steps S21 and S24, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated here.

[0113] It can be seen that this application combines a natural language processing model and an edge computing system, and discloses a data storage method based on an adaptive storage model. By constructing a storage model, building a knowledge base of load characteristics, matching the load characteristics of task requests with the knowledge base, and adopting an LLM to generate a caching strategy for the data required by task requests; and designing a data release method measured by load popularity, the management of the storage space of edge servers is realized. That is to say, this application perceives changes in load characteristics by constructing a storage model, and adjusts the content of cached data in edge servers in real time to adapt to the computing requirements of edge device nodes and improve data caching efficiency. Compared with the traditional LRU-based data caching method, the method based on the adaptive storage model provided by this application can better adapt to the switching between different loads and the scenario of mixed loads; in addition, using the method of this application enables the edge computing system to have strong adaptability to new loads; and this application also discloses a data release method in units of the popularity value matched by load characteristics, which can effectively solve the problem of insufficient edge storage resources.

[0114] Taking the real-time traffic condition analysis scenario in an intelligent transportation edge computing system as an example, the solution of this application will be described in detail. This system consists of the following parts:

[0115] Edge device nodes: Deployed at traffic intersections, directly connected to cameras, and execute real-time analysis tasks;

[0116] Edge servers: Located in the regional data center, coordinating the computing tasks of multiple intersections;

[0117] Cloud data center: Stores all traffic data and trains global models.

[0118] 1. Task request: An edge device node is responsible for monitoring the traffic flow of a section of road. The task request it receives is to analyze the congestion situation of this section every 5 minutes and predict the traffic trend in the next 15 minutes.

[0119] 2. The data resources required to execute the task request are:

[0120] Real-time traffic data: Includes information such as the current traffic volume, vehicle speed, and vehicle type on this section of road. These data are collected in real time by sensors deployed on the road;

[0121] Historical traffic data: Traffic volume, congestion situation, etc. data of this section of road during the same time period in the past, used to analyze traffic patterns and trends;

[0122] Map data: Map information of this section of road and its surrounding areas, including road layout, intersection information, etc., used to assist in analyzing the location and impact range of traffic congestion.

[0123] 3. Determine whether the data resource is local to the edge device node, including two situations:

[0124] Local Data: If the edge device node has previously cached some historical traffic data and map data, and real-time traffic data is being acquired in real time via local sensors, it will begin calculating congestion conditions, comparing and analyzing the current real-time traffic data with the locally cached historical data to determine the current congestion index. Simultaneously, the request type (real-time traffic analysis) is sent to the edge server, allowing it to prepare any data that may be needed later.

[0125] Data is not local: If the edge node does not have historical traffic data and map data locally, the current data request (including the specific requirements of the required historical traffic data and map data) and the current load characteristics (real-time traffic analysis, data-intensive computing mode, serial task parallelism, and data access mode with a certain degree of locality) will be sent to the edge server.

[0126] 4. Three matching situations and caching strategies of edge servers:

[0127] Successful local knowledge base match: After receiving the request, the edge server finds a historical load signature in the local knowledge base that matches the current load signature. In this case, the RAG mode is used, using LLM to retrieve relevant historical traffic data and map data from the cloud data center. A data caching strategy is then generated: the latest historical traffic data and map data are cached to the edge server and the edge device node that initiated the request for subsequent computation.

[0128] If the local knowledge base fails to match, but the online search succeeds: If the edge server's local knowledge base fails to match historical load characteristics, an online search (from other edge servers or a cloud knowledge base) will find a match. In this case, the RAG+ fine-tuning approach is used. The LLM fine-tunes the generated data caching strategy based on the retrieved information. This strategy not only caches historical traffic and map data obtained from the cloud data center but also optimizes the cached data based on the specific conditions of the road section (such as recent road construction information). For example, it prioritizes caching map and traffic data near construction sites, while also updating the local knowledge base with new load characteristics.

[0129] Unsuccessful Matches: If neither the local knowledge base nor the online search results match, a traditional random forest approach is used to learn the current load characteristics. Based on the learning results, data caching requirements are predicted and a data caching strategy is developed: basic map data and historical traffic data for a certain period of time are first cached to the edge server. The current load characteristics are then saved to the local knowledge base for subsequent optimization of the caching strategy.

[0130] 5. Release less popular data:

[0131] As the edge server continuously caches traffic data for each edge device node, the storage space gradually becomes tight. The edge server calculates the heat value by counting the number of successful matches of various load characteristics (such as real-time traffic condition analysis tasks for different road sections). When the size of the space already used in the local cache reaches the preset space threshold, a number of relevant data with the lowest heat values are released. For example, the load heat of the real-time traffic condition analysis task corresponding to a road with less traffic flow is relatively low, and some of its relevant historical traffic data and map data may be released, thereby improving the storage space utilization rate of the edge server and ensuring the normal operation of the system.

[0132] See Figure 7 As shown, an embodiment of the present application discloses a data caching device applied to an edge server. The device includes:

[0133] An acquisition module 11, configured to acquire the current load characteristic and the current data request sent by the edge device node; wherein, the current load characteristic is extracted by the edge device node from the received task request, and the current data request is a request for obtaining the data resources required to execute the task request;

[0134] A matching module 12, configured to match the current load characteristic with the historical load characteristics stored in the target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center;

[0135] A data caching module 13, configured to input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources, and based on the data caching policy, obtain the data resources from the target location, and store the data resources in the local cache and / or the edge device node; the target location is one or more locations among the local cache, the adjacent edge server, and the cloud data center.

[0136] It can be seen that when the edge device node receives a task request, it can extract the current load characteristics therefrom and determine the data resources required to obtain the execution task request. The edge server can obtain the current load characteristics sent by the edge device nodes covered by it and the current data request for obtaining data resources. For the obtained current load characteristics, the edge server can retrieve the target knowledge base to match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result, and further input the matching result into the pre-trained model to generate a data caching policy corresponding to the data resources. Among them, the target knowledge base is one or more of the local knowledge base, the knowledge base in the adjacent edge server, and the cloud knowledge base in the cloud data center. That is, the present application constructs an architecture for collaborative matching of multi-level knowledge bases. By retrieving and matching in different knowledge bases, a suitable caching policy can be found, which can achieve a high coverage rate of load characteristic matching and enable the system to handle various different load types. Even when a new load type appears, if the local knowledge base fails to match successfully, relevant load characteristic model information can still be obtained by online retrieving the knowledge bases of adjacent edge servers or cloud data centers, realizing the adaptation to new loads. Finally, the edge server obtains the corresponding data resources from the most suitable target location based on the data caching policy, and stores the obtained data resources in the local cache and / or edge device nodes according to the data caching policy, so as to reasonably allocate the data storage location, make full use of the storage resources of the edge server and edge device nodes, avoid unnecessary data transmission and storage waste, and enable the edge device nodes to quickly obtain the corresponding data resources to execute the corresponding task requests, reducing data transmission latency. Among them, the target location refers to one or more locations among the local cache, adjacent edge servers, and cloud data centers.

[0137] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part are described with reference to the embodiments of the above method part and will not be repeated here.

[0138] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the data caching method executed by the electronic device disclosed in any of the foregoing embodiments.

[0139] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0140] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one of the hardware forms of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

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

[0142] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the data caching method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by the external device received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0143] Furthermore, the embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the data caching method disclosed in any of the foregoing embodiments are implemented.

[0144] The embodiment of the present invention also discloses a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the data caching method disclosed in any of the foregoing embodiments are implemented.

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

[0146] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0147] The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be implemented directly by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, compact disc read-only memory (CD-ROM), or any other form of storage medium well known in the technical field.

[0148] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0149] The above has introduced in detail a data caching method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A data caching method, characterized in that, Applied to an edge server, including: Obtain the current load characteristics and the current data request sent by the edge device node; wherein, the current load characteristics are extracted by the edge device node from the received task requests, and the current data request is a request for obtaining the data resources required to execute the task requests; Match the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center; Input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources, obtain the data resources from the target location based on the data caching policy, and store the data resources in the local cache and / or the edge device node; the target location is one or more locations among the local cache, the adjacent edge server, and the cloud data center; Wherein, the matching the current load characteristics with the historical load characteristics stored in the target knowledge base to obtain a matching result includes: Match the current load characteristics with the historical load characteristics stored in the local knowledge base to obtain a first matching result; If the first matching result indicates that there is no historical load characteristic matching the current load characteristic in the local knowledge base, then send the current load characteristics to the knowledge bases in the adjacent edge servers and the cloud knowledge base for matching to obtain a second matching result; The inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources includes: If the second matching result indicates that there is no historical load characteristic matching the current load characteristic in the knowledge base of the adjacent edge server and there is no historical load characteristic matching the current load characteristic in the cloud knowledge base, then input the current load characteristics into the pre-trained model so that the pre-trained model predicts a data caching policy corresponding to the data resources based on the fine-tuning instruction.

2. The data caching method according to claim 1, wherein The inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources includes: If the first matching result indicates that there is a historical load characteristic matching the current load characteristic in the local knowledge base, then input the first matching result into the pre-trained model so that the pre-trained model outputs a data caching policy corresponding to the data resources based on the retrieval-augmented generation mode; wherein, the first matching result includes a cache policy template corresponding to the historical load characteristic matching the current load characteristic.

3. The data caching method according to claim 1, wherein The inputting the matching result into a pre-trained model to generate a data caching policy corresponding to the data resources includes: If the second matching result indicates that there is a historical load feature matching the current load feature in the knowledge base of the adjacent edge server or there is a historical load feature matching the current load feature in the cloud knowledge base, the second matching result is input into a pre-trained model, so that the pre-trained model outputs a data caching policy corresponding to the data resource based on the retrieval-enhanced generation mode and the fine-tuning instruction; wherein, the second matching result includes a caching policy template corresponding to the historical load feature matching the current load feature.

4. The data caching method according to claim 1, wherein After inputting the current load feature into the pre-trained model so that the pre-trained model predicts a data caching policy corresponding to the data resource based on the fine-tuning instruction, it further includes: Storing the current load feature and the corresponding data caching policy into the local knowledge base.

5. The data caching method according to claim 1, wherein The matching of the current load feature with the historical load features stored in the target knowledge base to obtain a matching result includes: Encoding the current load feature according to a preset encoding method to generate a first feature vector; Calculating the similarity between the first feature vector and each second feature vector stored in the target knowledge base, and obtaining a matching result based on the similarity calculation result; wherein, each of the second feature vectors is a feature vector obtained by encoding the historical load feature according to the preset encoding method in advance.

6. The data caching method according to claim 5, wherein The calculating the similarity between the first feature vector and each second feature vector stored in the target knowledge base includes: Calculating the Euclidean distance between the first feature vector and each second feature vector stored in the target knowledge base to determine the similarity based on the Euclidean distance; wherein, the similarity has a negative correlation with the Euclidean distance.

7. The data caching method according to claim 6, wherein The obtaining a matching result based on the similarity calculation result includes: Determining the minimum Euclidean distance from each of the Euclidean distances, and judging whether the minimum Euclidean distance is less than a preset distance threshold; If the minimum Euclidean distance is less than the preset distance threshold, taking the second feature vector corresponding to the minimum Euclidean distance in the target knowledge base as the feature vector matching the first feature vector, and obtaining a matching result indicating successful matching; If the minimum Euclidean distance is not less than the preset distance threshold, determining that there is no feature vector in the target knowledge base matching the first feature vector, and obtaining a matching result indicating failed matching.

8. The data caching method according to claim 1, wherein The inputting the matching result into the pre-trained model to generate a data caching policy corresponding to the data resource includes: Inputting the matching result and the current system state of the edge server into the pre-trained model to generate a data caching policy corresponding to the data resource; wherein, the current system state includes the remaining storage space, network bandwidth, and CPU utilization rate.

9. The data caching method according to claim 1, wherein The process of the edge device node sending the current load feature and the current data request after receiving a task request includes: When the edge device node receives a task request, judging whether there is a data resource required for executing the task request locally; Determine whether to send the current load characteristics and the current data request to the edge server based on the judgment result.

10. The data caching method according to claim 9, wherein The determining whether to send the current load characteristics and the current data request to the edge server based on the judgment result includes: If the judgment result indicates that the data resource exists locally at the edge device node, execute the task processing flow corresponding to the task request based on the data resource, cache the processing result locally after the execution of the task processing flow is completed, and send the request type corresponding to the task request to the edge server, so that the edge server can pre-locate and store the data corresponding to the request type. If the judgment result indicates that the data resource does not exist locally at the edge device node, extract the current load characteristics from the task request, and send the current load characteristics and the current data request to the edge server.

11. The data caching method according to claim 1, wherein The load characteristics include computing mode, task parallelism, data access mode, resource occupancy, and task scheduling characteristics; among them, the computing mode includes compute-intensive, memory-intensive, I / O-intensive, and network-intensive; the task parallelism includes parallel and serial; the data access mode includes data locality, access order, concurrency, and access frequency; the resource occupancy includes the utilization rates of CPU, memory bandwidth, disk I / O, and network bandwidth; the task scheduling characteristics include task deadlines, task processing methods, and task priorities.

12. The data caching method according to claim 1, wherein It further includes: Monitor the size of the space used in the local cache. When the size of the space reaches a preset space threshold, determine the target data resource from the local cache and perform a clearing process on the target data resource.

13. The data caching method according to claim 12, wherein The determining the target data resource from the local cache includes: Count the number of successful matches of each historical load characteristic in the local knowledge base, and determine the heat value of each historical load characteristic based on the number of successful matches; where the heat value is positively correlated with the number of successful matches. Determine the target historical load characteristic corresponding to the lowest heat value, and determine the target data resource corresponding to the target historical load characteristic from the local cache.

14. The data caching method according to claim 13, wherein The determining the heat value of each historical load characteristic based on the number of successful matches includes: Calculate the heat value of each historical load characteristic based on the number of successful matches and a time decay factor; where the time decay factor is calculated based on a target time interval and a preset decay coefficient, and the target time interval is the difference between the current time and the time when the historical load characteristic was successfully matched last time.

15. A data caching device, characterized in that, When applied to an edge server, it includes: An acquisition module, configured to acquire the current load characteristics and the current data request sent by the edge device node; where the current load characteristics are extracted by the edge device node from the received task request, and the current data request is a request for obtaining the data resource required to execute the task request. A matching module, configured to match the current load feature with historical load features stored in a target knowledge base to obtain a matching result; wherein, the target knowledge base is one or more of a local knowledge base, a knowledge base in an adjacent edge server, and a cloud knowledge base in a cloud data center; A data caching module, configured to input the matching result into a pre-trained model to generate a data caching policy corresponding to the data resource, and obtain the data resource from a target location based on the data caching policy, and store the data resource in a local cache and / or the edge device node; the target location is one or more locations among the local cache, the adjacent edge server, and the cloud data center; Wherein, the matching module is specifically configured to match the current load feature with historical load features stored in the local knowledge base to obtain a first matching result; if the first matching result indicates that there is no historical load feature matching the current load feature in the local knowledge base, the current load feature is sent to the knowledge base in the adjacent edge server and the cloud knowledge base for matching to obtain a second matching result; The data caching module is specifically configured to, if the second matching result indicates that there is no historical load feature matching the current load feature in the knowledge base in the adjacent edge server and there is no historical load feature matching the current load feature in the cloud knowledge base, input the current load feature into the pre-trained model, so that the pre-trained model predicts a data caching policy corresponding to the data resource based on a fine-tuning instruction.

16. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the data caching method according to any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by a processor, the steps of the data caching method according to any one of claims 1 to 14 are implemented.

18. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the steps of the data caching method according to any one of claims 1 to 14 are implemented.

Citation Information

Patent Citations

  • Database caching strategy adjusting method, device and equipment

    CN118796896A

  • Intelligent information input method and system, electronic equipment and storage medium

    CN119066187A