Data caching method and device of server, storage medium and electronic equipment
By detecting cache priority and caching task data in the server based on the history, transmission and popularity information of task data, the problem of low server efficiency in executing service tasks is solved, and the cache hit rate and transmission efficiency of task data are improved.
Patent Information
- Application Number
- CN202410903047.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-08
AI Technical Summary
In a multi-server environment, the efficiency of the server in executing service tasks is low, mainly due to the low efficiency of searching and transmitting task data, resulting in a high delay for users to obtain task data.
A server data caching method is adopted to receive the task execution request initiated by the target account through multiple servers in the topological connection structure, extract the first task data and the second task data, and use the historical information and network transmission information of the task data to and popularity information to detect the target cache priority, and cache task data in the target server according to the priority.
It improves the efficiency of the server in executing service tasks, reduces the process of obtaining data from other servers, improves the data cache hit rate and transmission efficiency, and reduces latency.
Smart Images

Figure CN118747129A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the computer field, and more specifically, to a data caching method, device, storage medium and electronic device for a server. Background Art
[0002] Currently, in a multi-server environment, after receiving a request from a user through a target account, the server will first search the local cache for the task data required to execute the request. If the cache hits, the task data is directly returned to the user through the target account; otherwise, the server requests the task data from other cooperating servers or cloud servers and caches the requested task data locally. However, due to the low efficiency of task data search and transmission, the user has a high delay in obtaining task data through the target account, which reduces the efficiency of the server in executing service tasks.
[0003] In view of the problem that the server has low efficiency in executing service tasks in the related technology, no effective solution has been proposed yet. Summary of the invention
[0004] The present application provides a method, device, storage medium and electronic device for caching data of a server, so as to at least solve the problem of low efficiency of executing service tasks by the server in the related art.
[0005] According to an embodiment of the present application, a method for caching data of a server is provided. The server system includes multiple servers having a topological connection structure. The method is applied to a target server among the multiple servers. The method includes:
[0006] Receiving a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task;
[0007] In response to the task execution request, extracting first task data from a reference server in the topological connection structure, and extracting second task data from the server system, to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute a reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, predicted based on the account information of the target account;
[0008] Detecting the target cache priority of the target task data in the task data set according to the historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between the servers that the target server does not extract the task data, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server;
[0009] The corresponding target task data is cached in the target server according to the target cache priority.
[0010] In an exemplary implementation, the target cache priority of the target task data in the task data set is detected based on the historical usage information, network transmission information and popularity information of the task data, including: detecting the historical access frequency, transmission delay and popularity parameter of the target task data, wherein the historical usage information includes the historical access frequency, the network transmission information includes the transmission delay, the popularity information includes the popularity parameter, the historical access frequency is used to indicate the frequency of the target task data being accessed within the historical time period between the historical time and the current time, and the transmission delay is used to indicate that the target server does not extract the target task data. The network delay between the servers of the target task data, and the popularity parameter is used to indicate the probability that the task data will be used after the current time; the current information weights corresponding to the historical usage information, the network transmission information and the popularity information are obtained, wherein the current information weight is used to indicate the influence of the corresponding information dimension on the cache priority of the task data; the current information weight is used to calculate the weighted sum of the historical access frequency, the transmission delay and the popularity parameter to obtain the target cache priority of the target task data, wherein the higher the target cache priority of the target task data, the greater the probability that the target task data is cached in the target server.
[0011] In an exemplary implementation, the obtaining of the current information weights respectively corresponding to the historical usage information, the network transmission information and the popularity information includes: detecting the cache hit rate of the task data cached on the target server, and the system network information of the server system, wherein the cache hit rate is used to indicate the probability that the task data cached on the target server is used to perform the service task, and the system network information is used to indicate the current network transmission status of the server system; adjusting the historical information weights respectively corresponding to the historical usage information, the network transmission information and the popularity information according to the cache hit rate and the system network information to obtain the current information weight.
[0012] In an exemplary implementation, caching the corresponding target task data in the target server according to the target cache priority includes: extracting the target task data from the task data set according to the target cache priority from high to low; detecting whether the currently extracted target task data has been cached on the target server; in the case where it is detected that the currently extracted target task data has been cached on the target server, updating the cache priority currently corresponding to the target task data to the target cache priority; in the case where it is detected that the currently extracted target task data has not been cached on the target server, detecting the remaining cache space on the target server. The remaining amount of data allowed to be stored; when the remaining amount of data is greater than or equal to the amount of data of the target task data, the target task data is cached to the remaining cache space, and the target cache priority corresponding to the target task data is recorded; when the remaining amount of data is less than the amount of data of the target task data, the cached task data is deleted from the cache space of the target server according to the cache priority from low to high, until the remaining amount of data is greater than or equal to the amount of data of the target task data, and the target cache space is obtained; the target task data is cached to the target cache space, and the target cache priority corresponding to the target task data is recorded.
[0013] In an exemplary implementation, extracting the second task data from the server system includes: predicting the candidate task data to be extracted by the target account after the target account executes the target service task based on the account information of the target account; querying the server storing the candidate task data from the server system based on the data distribution information of the server system to obtain candidate servers and candidate task data with corresponding relationships; extracting the corresponding candidate task data from each of the candidate servers to obtain the second task data.
[0014] In an exemplary implementation, predicting candidate task data to be extracted by the target account after the target account executes the target service task based on the account information of the target account includes: inputting the account information of the target account and the behavior information of the target account into a popularity prediction model, wherein the behavior information is used to indicate that the target account has executed the target service task, the popularity prediction model is obtained by training an initial network model using account information samples of account samples and behavior information samples of account samples, and the popularity prediction model is used to predict the probability of task data in the server system being used after the current time based on the input data; obtaining the corresponding task data and popularity parameters output by the popularity prediction model; and determining the task data whose corresponding popularity parameters are higher than a parameter threshold as the candidate task data.
[0015] In an exemplary implementation, extracting the first task data from the reference server in the topological connection structure includes: querying the reference server where the first task data is located according to data distribution information of the server system; obtaining a server set in the topological connection structure that allows the target server to perform routing; searching for the reference server from the server set; in the case where the reference server is found from the server set, sending a first extraction request to the reference server, wherein the first extraction request is used to request to extract the first task data from the reference server; receiving the first task data returned by the reference server in response to the first extraction request; in the case where the reference server is not found from the server set, querying the server set for an alternative server that is closest to the reference server; sending a second extraction request to the alternative server, wherein the second extraction request is used to request the alternative server to forward the second extraction request to the reference server and forward the task data returned by the reference server in response to the second extraction request to the target server, and the second extraction request is also used to request to extract the first task data from the reference server; receiving the first task data returned by the alternative server in response to the second extraction request.
[0016] According to another embodiment of the present application, a data cache device of a server is provided, wherein the server system includes a plurality of servers having a topological connection structure, and the device is applied to a target server among the plurality of servers, and the device includes:
[0017] A receiving module, configured to receive a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task;
[0018] an extraction module, configured to respond to the task execution request, extract first task data from a reference server in the topological connection structure, and extract second task data from the server system, to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute a reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, predicted based on the account information of the target account;
[0019] A detection module, used for detecting the target cache priority of the target task data in the task data set according to the historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between the servers from which the target server does not extract the task data, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server;
[0020] A cache module is used to cache the corresponding target task data in the target server according to the target cache priority.
[0021] According to another embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0022] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0023] According to another embodiment of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0024] Through this application, a task execution request initiated by a target account is received; in response to the task execution request, the first task data is extracted from the reference server in the topological connection structure, and the second task data is extracted from the server system to obtain a task data set; the target cache priority of the target task data in the task data set is detected according to the historical usage information, network transmission information and popularity information of the task data; and the corresponding target task data is cached in the target server according to the target cache priority. That is to say, in the process of responding to a task execution request once, the target server not only obtains the data required to execute the target service task, but also obtains in advance the second task data required to be used for the service task to be executed by the target account after executing the target service task, which is predicted based on the account information of the target account. Therefore, the data required to be used in other task execution requests initiated by the target account subsequently received has a greater probability of being stored on the target server, reducing the process of the target server obtaining data from other servers. Therefore, the problem of low efficiency of the server in executing service tasks can be solved, and the efficiency of the server in executing service tasks can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a hardware structure block diagram of a server device of a data caching method of a server in an embodiment of the present application;
[0026] Figure 2 is a flow chart of a data caching method of a server according to an embodiment of the present application;
[0027] Figure 3 is a schematic diagram of a process of obtaining first task data according to an embodiment of the present application;
[0028] Figure 4 is a flow chart of a working process of a target server according to an embodiment of the present application;
[0029] Figure 5 is a structural block diagram of a data cache device of a server according to an embodiment of the present application;
[0030] Figure 6 1 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will describe the embodiments of the present application in detail with reference to the accompanying drawings and in combination with embodiments.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0033] The method implementation examples provided in the implementation examples of this application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 FIG. 1 is a hardware structure diagram of a server device of a data caching method of a server in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 The server device may include a processor 102 (only one is shown in the figure) (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above-mentioned server device. Figure 1 More or fewer components than shown, or with different Figure 1 Different configurations are shown.
[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data caching method of the server in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
[0036] In this embodiment, a method for caching data of a server is provided. The server system includes a plurality of servers having a topological connection structure. The method is applied to a target server among the plurality of servers. Figure 2 is a flow chart of a data caching method of a server according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0037] Step S202, receiving a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task;
[0038] Step S204, in response to the task execution request, extracting first task data from the reference server in the topological connection structure, and extracting second task data from the server system, to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute the reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, which is predicted based on the account information of the target account;
[0039] Step S206, detecting the target cache priority of the target task data in the task data set according to the historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between the servers that the target server does not extract the task data, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server;
[0040] Step S208: caching the corresponding target task data in the target server according to the target cache priority.
[0041] Through the above steps, a task execution request initiated by a target account is received; in response to the task execution request, the first task data is extracted from the reference server in the topological connection structure, and the second task data is extracted from the server system to obtain a task data set; the target cache priority of the target task data in the task data set is detected according to the historical usage information, network transmission information and popularity information of the task data; and the corresponding target task data is cached in the target server according to the target cache priority. That is to say, in the process of responding to a task execution request once, the target server not only obtains the data required to execute the target service task, but also obtains in advance the second task data required to be used for the service task to be executed by the target account after executing the target service task, which is predicted based on the account information of the target account. Therefore, the data required to be used in other task execution requests initiated by the target account subsequently received has a greater probability of being stored on the target server, which reduces the process of the target server obtaining data from other servers. Therefore, the problem of low efficiency of the server in executing service tasks can be solved, and the efficiency of the server in executing service tasks can be improved.
[0042] Optionally, in this embodiment, the server system may include, but is not limited to: a distributed computing system, cluster computing, grid computing, an edge server system, etc. In the following embodiment, the server system is taken as an edge server system as an example to illustrate the data caching method of the server, but the specific usage scenario is not limited. Any system composed of multiple servers with a topological connection structure can use the data caching method of the server proposed in this application.
[0043] Optionally, in this embodiment, a server device among the multiple servers included in the server system can be used to receive the request initiated by the user through the target account to obtain the target server. Alternatively, the server where the user uses the target account can be used as the target server, and the user can log in to the target server through the target account, and use the target account to initiate a task execution request on the target server.
[0044] In the technical solution provided in the above step S202, the target account can be but is not limited to being used to initiate a task execution request, and request the target server to execute the target service task through the task execution request. The target service task can be but is not limited to being used to request to obtain task data from the target server, or request to perform modification operations on the task data, or other operations that need to be performed through task data, etc.
[0045] In the technical solution provided in the above step S204, the target server can be but is not limited to being used to respond to the task execution request to execute the corresponding target service task, for example: when the target service task is used to request to return task data to the target account, the target server obtains the corresponding task data and sends it to the target account; when the target service task is used to request to perform a modification operation on the task data, the target server searches for the corresponding task data and performs the modification operation on the task data; when the target service task is used to request to perform other operations that need to be performed through task data, the target server obtains the corresponding task data and performs the corresponding operation based on the obtained task data, etc.
[0046] Optionally, in this embodiment, the target server can obtain the data required to perform the reference service task in the following manner but is not limited to: the target server searches its cache to see whether the data required to perform the reference service task exists; if the data required to perform the reference service task exists in the target server cache, the data required to perform the reference service task is read from the cache, and the second task data is extracted from the server system; if the data required to perform the reference service task does not exist in the target server cache, the first task data is extracted from the reference server in the topological connection structure, and the second task data is extracted from the server system.
[0047] Optionally, in this embodiment, the server storing the first task data can be determined as a reference server but is not limited to being allowed to perform routing with one or more servers in the topological connection structure, and when the reference server is a server that allows routing with the target server, the target server can be, but is not limited to directly interacting with the reference server for data; or, when the reference server is a server that does not allow routing with the target server, the target server can be, but is not limited to, interacting with the reference server for data through other servers that allow routing with the target server.
[0048] Optionally, in this embodiment, the second task data is data required for the target server to execute the service task that the target account may perform in the future after performing the target service task, which is predicted based on the account information of the target account. It can be stored in the server system, for example, in the target server, in other servers except the target server, in the cloud server, etc., but is not limited to it.
[0049] In an exemplary implementation, the first task data can be extracted from the reference server in the topological connection structure in the following manner, but is not limited to: query the reference server where the first task data is located according to the data distribution information of the server system; obtain a server set in the topological connection structure that allows the target server to perform routing; search for the reference server from the server set; when the reference server is found from the server set, send a first extraction request to the reference server, wherein the first extraction request is used to request to extract the first task data from the reference server; receive a response from the reference server to the first extraction request; the first task data returned by the reference server in response to the second extraction request; when the reference server is not found in the server set, querying the server set for an alternative server that is closest to the reference server; sending a second extraction request to the alternative server, wherein the second extraction request is used to request the alternative server to forward the second extraction request to the reference server and forward the task data returned by the reference server in response to the second extraction request to the target server, and the second extraction request is also used to request to extract the first task data from the reference server; receiving the first task data returned by the alternative server in response to the second extraction request.
[0050] Optionally, in this embodiment, the data distribution information may include but is not limited to storing the corresponding relationship between the task data and the server. The data distribution information may include but is not limited to: DHT (Distributed Hash Table), consistent hashing, Riak (a distributed key-value storage system that uses consistent hashing to manage the distribution and replication of data), etc. Among them, DHT is a distributed storage system that can quickly find and locate data stored on different nodes (i.e., servers in this application). Each node maintains a part of the hash table, and the storage location of the data is calculated by the hash function. When the target server receives a task execution request and the local cache of the target server does not hit, the use of DHT can quickly determine which collaborative nodes in the topological connection structure may cache the requested data, and forward the request to these nodes. Through DHT, data positioning can be completed within O (logN) time complexity (where N is the number of nodes in the network), which greatly improves the response speed of data requests.
[0051] Optionally, in this embodiment, the server storing the first task data may be used as a reference server, but is not limited thereto. The reference server may be a server that routes to the target server, or may be a server that does not allow the target server to route to the target server. In the case where the reference server does not allow the target server to route to the target server, the server that is closest to the reference server is determined as the candidate server.
[0052] In an exemplary implementation, an example of a process of obtaining first task data is provided. Taking the server system including servers 1 to 5, with server 1 being the target server as an example, Figure 3 is a schematic diagram of a process of obtaining first task data according to an embodiment of the present application, such as Figure 3 As shown, the server set that allows the target server to perform routing in the topological connection structure includes server 2 and server 3, and the first task data can be obtained by, but is not limited to, the following method:
[0053] Taking server 3 as an example, the reference server where the first task data is located is queried based on the data distribution information of the server system, and the server set is searched to allow server 3 to route without server 1. Server 1 sends a first extraction request to server 3, and receives the first task data returned by server 3 in response to the first extraction request.
[0054] Taking server 5 as an example, the reference server where the first task data is located is queried based on the data distribution information of the server system. Server 5 is not found in the server set, so the alternative server closest to server 5 in the server set is server 2. While allowing server 2 and server 5 to be routed, server 1 sends a second extraction request to server 2. When server 2 receives the second extraction request, it responds to the second extraction request and forwards the second extraction request to server 5. Server 1 receives the first task data returned by server 5 in response to the first extraction request.
[0055] When routing is not allowed between Server 2 and Server 5, and there is no routing path between Server 2 and Server 5, Server 1 searches for a server 3 that has a routing path between Server 5 and is closest to Server 1, and sends a second extraction request to Server 3. When Server 3 receives the second extraction request, it responds to the second extraction request and forwards the second extraction request to Server 4. When Server 4 receives the second extraction request, it responds to the second extraction request and forwards the second extraction request to Server 5. Server 1 receives the first task data returned by Server 5 in response to the first extraction request.
[0056] It should be noted that the use of data distribution information can quickly find and locate data distributed on different nodes, ensuring the efficiency and reliability of data transmission. Furthermore, the candidate server and the reference server can, but are not limited to, perform data transmission through an adaptive transmission protocol to better adapt to different network conditions and provide low-latency and high-throughput transmission performance. The above-mentioned adaptive transmission protocol can, but is not limited to, include QUIC (Quick UDP Internet Connections) protocol, TCP (Transmission Control Protocol), etc.
[0057] Take the use of QUIC protocol to transmit data as an example: QUIC combines the transport layer and application layer handshake processes to reduce the connection establishment time, and QUIC supports multi-stream transmission on a single connection, avoiding the overall performance degradation caused by single stream blocking in TCP. QUIC can also dynamically adjust the transmission rate to adapt to the current network conditions and reduce packet loss and retransmission times. In actual applications, after receiving the request, if the target server does not hit the local address and finds the reference server cached by DHT, the QUIC protocol is used to transmit data from the collaborative node. This not only ensures the high efficiency of data transmission, but also reduces the load on the central cloud server.
[0058] In an exemplary implementation, the second task data can be extracted from the server system in the following manner but is not limited to: predicting the candidate task data to be extracted by the target account after the target account executes the target service task based on the account information of the target account; querying the server storing the candidate task data from the server system based on the data distribution information of the server system to obtain candidate servers and candidate task data with corresponding relationships; extracting the corresponding candidate task data from each of the candidate servers to obtain the second task data.
[0059] Optionally, in this embodiment, the candidate task data to be extracted by the target account after executing the target service task can be predicted based on the account information of the target account in a variety of ways, including but not limited to: inputting the account information of the target account into a pre-trained large model to obtain the account information of the target account output by the large model; using Bayes' theorem to predict the candidate task data; calculating the correlation function between the account information of the target account and the task data, and predicting the candidate task data based on the correlation function, etc.
[0060] Optionally, in this embodiment, a server storing candidate task data is used as a candidate server. The candidate server may be, but is not limited to, a server that allows routing to the non-target server, or may be a server that does not allow routing to the non-target server. In the case where the candidate server is a server that allows routing to the non-target server, the target server may, but is not limited to, directly interact with the candidate server to obtain the candidate task data from the candidate server; or, in the case where the candidate server is a server that does not allow routing to the non-target server, the target server may, but is not limited to, interact with a server that does not allow routing to the candidate server to obtain the candidate task data from the candidate server.
[0061] Optionally, in this embodiment, the candidate task data may be, but is not limited to, one or more task data, and the second task data may be obtained by acquiring the candidate task data from a candidate server corresponding to each candidate task data, but is not limited to.
[0062] In an exemplary implementation, the candidate task data to be extracted by the target account after executing the target service task can be predicted based on the account information of the target account, but is not limited to, in the following manner: the account information of the target account and the behavior information of the target account are input into a popularity prediction model, wherein the behavior information is used to indicate that the target account has executed the target service task, the popularity prediction model is obtained by training an initial network model using account information samples of account samples and behavior information samples of account samples, and the popularity prediction model is used to predict the probability of task data in the server system being used after the current time based on the input data; task data and popularity parameters with corresponding relationships output by the popularity prediction model are obtained; and task data whose corresponding popularity parameters are higher than a parameter threshold are determined as the candidate task data.
[0063] Optionally, in this example, a model that is good at processing time series data and can capture the time dependency of the behavior initiated by the user through the target account can be selected as the above-mentioned initial network model, such as: LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), etc.
[0064] Optionally, in this example, the popularity prediction model can be obtained by training the initial network model using the account information samples of the account samples and the behavior information samples of the account samples in the following manner, but not limited to:
[0065] Step 1: Data preprocessing:
[0066] (1) Data collection: collecting target account request data (account information samples) and historical access records (behavior information samples) from server systems including edge nodes and central cloud servers, which may include but are not limited to the time, location, device type, and content characteristics of the target account request;
[0067] (2) Data cleaning: cleaning the collected data to remove noise and invalid data, which may include but is not limited to removing duplicate records and filling missing values;
[0068] (3) Feature extraction: extracting features from the cleaned data. The features may include, but are not limited to, time features such as request time and request frequency, spatial features such as the geographic location and movement trajectory of the user requesting through the target account, device features such as the type of device where the target account is located, operating system, browser, etc., and content features such as the type, size, popularity, etc. of the content.
[0069] (4) Data storage: storing the processed feature data in the database to provide data support for subsequent model training and prediction.
[0070] Step 2: Model training is not optimized. In order to improve the accuracy of content popularity prediction, transfer learning technology can be used, but is not limited to, to combine the behavior data and content features of users through the target account to train the popularity prediction model to capture the temporal relationship in the data and improve the prediction effect:
[0071] (1) Model selection: Choose a model that is good at processing time series data, such as LSTM (Long Short-Term Memory) or GRU (Gated Recurrent Unit);
[0072] (2) Data division: the collected feature data is divided into a training set, a validation set, and a test set. The training set is used for model training, the validation set is used for model parameter adjustment, and the test set is used to evaluate model performance.
[0073] (3) Model training: using the training set data to train the popularity prediction model, the model parameters may be adjusted through, but not limited to, a back propagation algorithm so that the model can accurately predict the popularity of the content;
[0074] (4) Model optimization: by adjusting the parameters of the validation set data, optimizing the model structure and parameters, which may include but is not limited to using cross-validation methods, to prevent model overfitting and improve generalization ability;
[0075] (5) Model evaluation: Use the test set data to evaluate the predictive performance of the model, and further adjust and optimize the model based on the evaluation results. The evaluation indicators may include but are not limited to accuracy, recall rate, F1 score, etc.
[0076] So far, a trained popularity prediction model has been obtained. However, in the subsequent use of the popularity prediction model, the popularity prediction model can be further optimized through the method in step 3, so that it can predict the popularity of content in the future in real time. According to the prediction results, the cache strategy is adjusted to give priority to caching high-popularity content, thereby improving system performance and user experience:
[0077] Step 3: Popularity prediction without cache optimization:
[0078] (1) Popularity prediction: Use the trained model to predict real-time data. The model inputs the behavior data of users in the current time period through the target account and outputs the popularity prediction value (popularity parameter) of the task data in the future period.
[0079] (2) Cache strategy adjustment: Based on the prediction results, the cache strategy of the edge node is adjusted, including: Cache high-popularity content first: Based on the predicted popularity value, high-popularity content is cached to the edge node first to improve the cache hit rate; Dynamically adjust the cache space: According to the changes in content popularity, dynamically adjust the allocation of cache space to ensure that popular content can be cached in time;
[0080] (3) Cache update mechanism: Combined with popularity prediction results, a reasonable cache update mechanism is designed;
[0081] (4) System performance optimization: by updating the prediction model and cache strategy in real time, the system performance is continuously optimized, including: Real-time monitoring without feedback: real-time monitoring of system performance indicators, such as cache hit rate, transmission delay, etc. According to the monitoring data, the cache strategy and model parameters are adjusted in time; Online learning: combined with the behavior data of new users executed through the target account, the popularity prediction model is updated online to maintain the high prediction accuracy of the model.
[0082] Optionally, in this embodiment, the parameter threshold may be, but is not limited to, a fixed parameter value for limiting the popularity parameter, such as determining the task data whose popularity parameter is greater than or equal to the parameter threshold as candidate task data. Alternatively, the parameter threshold may also be a parameter value for limiting the number of candidate task data, such as arranging the popularity parameters from large to small, and selecting the task data before the parameter threshold as candidate task data.
[0083] Optionally, in this embodiment, a popularity prediction model is added to the present application. By obtaining the account information of the target account and the behavior information of the target account, the user's behavior and historical data performed through the target account are analyzed to predict the popularity of the content in the future. By combining transfer learning technology and deep learning models, the accuracy of content popularity prediction is improved, and on this basis, the caching strategy is optimized to further improve system performance and user experience.
[0084] In the technical solution provided in the above step S206, the target cache priority of the target task data in the task data set detected according to the historical usage information, network transmission information and popularity information may include but is not limited to: quantifying the historical usage information, network transmission information and popularity information of the target task data to obtain the parameter value corresponding to the historical usage information, network transmission information and popularity information of the target task data, and using the parameter value as the target cache priority of the target task data, that is, the larger the parameter value, the higher the target cache priority of the target task data. Alternatively, quantifying the historical usage information, network transmission information and popularity information of the target task data to obtain the parameter value corresponding to the historical usage information, network transmission information and popularity information of the target task data, and determining the target cache priority of the target task data according to the range within which the parameter value falls, that is, the larger the parameter value, the higher the target cache priority of the target task data, etc.
[0085] Optionally, in this embodiment, the above-mentioned historical usage information may include but is not limited to the historical access frequency of the target task data, or other parameters for indicating the historical usage of the data in the server system.
[0086] Optionally, in this embodiment, the above network transmission information may include but is not limited to the transmission delay of the target task data, or other parameters for indicating the network transmission conditions between the target server and the server that cannot extract the task data.
[0087] Optionally, in this embodiment, the popularity information may include, but is not limited to, a popularity parameter of the target task data, or other parameters indicating the probability of the task data being used after the current time.
[0088] In an exemplary implementation, the target cache priority of the target task data in the task data set can be detected based on the historical usage information, network transmission information and popularity information of the task data in the following manner, but is not limited to: detecting the historical access frequency, transmission delay and popularity parameter of the target task data, wherein the historical usage information includes the historical access frequency, the network transmission information includes the transmission delay, the popularity information includes the popularity parameter, the historical access frequency is used to indicate the frequency with which the target task data is accessed within the historical time period between the historical time and the current time, and the transmission delay is used to indicate that the target server does not extract the target task data. The network delay between servers of the target task data, and the popularity parameter is used to indicate the probability that the task data will be used after the current time; the current information weights corresponding to the historical usage information, the network transmission information and the popularity information are obtained, wherein the current information weight is used to indicate the influence of the corresponding information dimension on the cache priority of the task data; the current information weight is used to calculate the weighted sum of the historical access frequency, the transmission delay and the popularity parameter to obtain the target cache priority of the target task data, wherein the higher the target cache priority of the target task data, the greater the probability that the target task data is cached in the target server.
[0089] Optionally, in this example, the historical access frequency can be detected through the following processes, but not limited to: data collection, the server collects the access records of each task data by monitoring the request logs of the user making requests through the target account; sliding window model, using the sliding window model to record the number of accesses in the last N time periods, the sliding window model can effectively reflect the changes in access patterns in a short period of time, and ensure the real-time nature of the cache strategy; access frequency calculation, according to the access records in the sliding window, calculate the access frequency of each task data. The higher the access frequency, the higher the priority of the task data, and the greater the possibility of cache hit.
[0090] Optionally, in this example, in the edge computing environment, accurate statistics of the access frequency of task data is crucial to the optimization of the cache strategy. The edge node needs to count the historical access frequency of task data requested by users through the target account in real time and update it regularly. The sliding window model can be used, but not limited to, to record the number of accesses in the last N time periods to accurately reflect the historical access frequency. This method can dynamically adapt to changes in user access patterns and improve the adaptability and accuracy of the cache strategy.
[0091] Optionally, in this embodiment, the transmission delay can be detected by, but is not limited to, the following methods, such as: measurement tool selection; data recording, recording the measurement results in the delay table of the edge node, the delay table includes the transmission delay between edge nodes and the transmission delay between the node and the central cloud server; data analysis, regularly analyzing the data in the delay table, identifying node pairs with large transmission delays, and adjusting the cache strategy based on these data to reduce the overall transmission delay.
[0092] Optionally, in this example, in order to optimize the cache strategy, the edge node needs to regularly measure the transmission delay between nodes and between different central cloud servers. You can use, but are not limited to, network measurement tools (such as Ping, Traceroute) to obtain more accurate delay data, and save the delay data in the delay table of the edge node as a basis for adjusting the cache strategy.
[0093] Optionally, in this example, the probability of detecting task data being used after the current time is used as a popularity parameter.
[0094] Optionally, in this embodiment, the current information weights corresponding to the historical usage information, network transmission information, and popularity information may be, but are not limited to, predetermined fixed values, such as: the current information weights corresponding to the historical usage information, network transmission information, and popularity information are α, β, and θ, respectively. Alternatively, the current information weights may also allow for dynamically adjusted parameter values.
[0095] In an exemplary implementation, the current information weights corresponding to the historical usage information, the network transmission information and the popularity information can be obtained by, but not limited to, the following method: detecting the cache hit rate of the task data cached on the target server and the system network information of the server system, wherein the cache hit rate is used to indicate the probability that the task data cached on the target server is used to perform the service task, and the system network information is used to indicate the current network transmission status of the server system; adjusting the historical information weights corresponding to the historical usage information, the network transmission information and the popularity information according to the cache hit rate and the system network information to obtain the current information weight.
[0096] Optionally, in this embodiment, the weight of the historical information can be adjusted according to, but not limited to, the probability that the task data cached on the target server is used to perform the service task, i.e., the cache hit rate, for example, when the cache hit rate is low, the weight of the historical information is reduced. Alternatively, when the cache hit rate is high, the weight of the historical information is increased.
[0097] Optionally, in this embodiment, the weight of the historical information can be adjusted according to, but not limited to, the current network transmission condition of the server system, for example, when the current network transmission condition of the server system is good, the weight of the historical information is reduced. Or, when the current network transmission condition of the server system is poor, the weight of the historical information is increased.
[0098] In the technical solution provided in the above step S208, the corresponding target task data is cached in the target server in descending order of target cache priority.
[0099] In an exemplary implementation, the target task data corresponding to the target server may be cached in accordance with the target cache priority in the following manner, but is not limited to: extracting the target task data from the task data set in descending order according to the target cache priority; detecting whether the currently extracted target task data has been cached on the target server; in the event that the currently extracted target task data has been cached on the target server, updating the cache priority currently corresponding to the target task data to the target cache priority; in the event that the currently extracted target task data has not been cached on the target server, detecting whether the remaining target task data on the target server has been cached. The cache space allows for the storage of remaining data; when the remaining data amount is greater than or equal to the data amount of the target task data, the target task data is cached in the remaining cache space, and the target cache priority corresponding to the target task data is recorded; when the remaining data amount is less than the data amount of the target task data, the cached task data is deleted from the cache space of the target server according to the cache priority from low to high, until the remaining data amount is greater than or equal to the data amount of the target task data, thereby obtaining the target cache space; the target task data is cached in the target cache space, and the target cache priority corresponding to the target task data is recorded.
[0100] In an exemplary implementation, an example of a working process of a target server is provided. Figure 4 FIG. 1 is a flowchart of a working process of a target server according to an embodiment of the present application. Figure 4 As shown, the target server can work in the following ways, but is not limited to:
[0101] Step S402: the target server receives a task execution request initiated by the target account;
[0102] It should be noted that the target can, but is not limited to, initiate a task execution request through the target account, so the full amount of requests initiated by the target account can, but is not limited to, be regarded as requests initiated by the target user through the target account;
[0103] Step S404-1: the target server queries the reference server where the first task data is located according to the data distribution information of the server system;
[0104] It should be noted that the first task data may be, but is not limited to, determined according to the task execution request;
[0105] Step S404-2: the target server extracts the first task data from the reference server;
[0106] It should be noted that the target server may, but is not limited to, store data distribution information and routing relationships between servers. The target server determines the reference server where the first task data is located according to the data distribution information, and extracts the first task data from the reference server according to the routing relationship.
[0107] Step S406-1: inputting the account information of the target account and the behavior information of the target account into the popularity prediction model to obtain the candidate task data output by the popularity prediction model;
[0108] It should be noted that the popularity prediction model can be used, but is not limited to, to output task data and popularity parameters with corresponding relationships, and the target server can filter candidate task data from the task data according to the popularity parameters; or, the popularity prediction model can be trained to filter candidate task data from the task data according to the task data and popularity parameters with corresponding relationships output by the popularity prediction model;
[0109] Step S406-2: extracting corresponding candidate task data from each candidate server to obtain second task data;
[0110] Step S408: Calculate the weighted sum of the historical access frequency, transmission delay and popularity parameters to obtain the target cache priority of the target task data;
[0111] It should be noted that the priority calculation formula may be, but is not limited to, as follows: target cache priority = ɑ×historical access frequency+β×transmission delay+θ×popularity parameter, wherein ɑ, β, and θ are weight parameters used to adjust the influence of historical access frequency, transmission delay, and popularity parameters on cache priority, and the values of ɑ, β, and θ may be obtained by, but is not limited to, pre-training, and then updated during subsequent use;
[0112] Step S410: extracting target task data from the task data set according to the target cache priority from high to low;
[0113] Step S412: Detect whether the target task data has been cached;
[0114] Step S414: when the target task data has been cached on the target server, the cache priority currently corresponding to the target task data is updated to the target cache priority;
[0115] Step S416: if the target task data is not cached on the target server, detecting whether the remaining data volume of the target server is greater than or equal to the data volume of the target task data;
[0116] Step S418: When the remaining data volume is greater than or equal to the data volume of the target task data, cache the target task data into the remaining cache space, and record the target cache priority corresponding to the target task data;
[0117] Step S420: when the remaining data volume is less than the data volume of the target task data, the cached task data is deleted from the cache space of the target server according to the cache priority from low to high, until the remaining data volume is greater than or equal to the data volume of the target task data, thereby obtaining the target cache space;
[0118] It should be noted that when the target server's cache space is insufficient, it is necessary to replace it according to the cache priority, and first eliminate the task data with low priority;
[0119] Step S422: Cache the target task data into the target cache space, and record the target cache priority corresponding to the target task data.
[0120] It should be noted that in the process of caching the corresponding target task data in the target server according to the target cache priority, it is necessary to ensure that the first task data is cached in the target server. Therefore, the target cache priority of the first task data currently to be used can be set to the highest level but is not limited to being updated in subsequent processes.
[0121] Through the above steps, the optimization of the collaborative caching strategy based on transmission delay can be achieved, which effectively improves the cache hit rate, reduces the transmission delay, and improves the user experience. This strategy not only takes into account the access frequency of task data, but also combines the transmission delay factor to fully optimize the utilization efficiency of cache resources, thereby achieving efficient data caching and transmission in a complex mobile edge computing environment.
[0122] The data caching method of the server proposed in this application designs a strategy based on transmission delay, and gives priority to caching task data with high access frequency and large transmission delay, which effectively reduces the average response time of requests initiated by users through the target account, significantly reduces data transmission delay, and thus improves user experience. Using the content popularity prediction model, combined with the behavioral data and historical access records performed by users through the target account, the cache strategy is predicted and dynamically adjusted, and the content that may be popular is cached first, thereby improving the cache hit rate and reducing data requests and transmission loads. The introduction of real-time monitoring and online learning mechanisms enables the system to adjust the prediction model and cache strategy according to real-time data, ensure efficient operation under different network environments and user behaviors, and enhance the adaptability and robustness of the system. The collaborative transmission model and efficient content distribution technology are adopted to enable edge nodes to collaborate efficiently, reduce dependence on the central cloud server, and optimize the utilization of network resources. Combined with the distributed hash table (DHT) and the QUIC protocol, the efficiency of data search and transmission is further improved, and the network load is reduced. The enhanced version of the K algorithm is used to optimize the cache replacement process, intelligently decide the cache replacement of task data, and improve the utilization efficiency of cache resources. The algorithm reduces unnecessary cache replacements and improves system performance by predicting task data access patterns. The technical solution of the present invention is highly flexible and scalable, allowing the weight parameters in the cache priority calculation formula to be adjusted according to application scenarios and requirements, optimizing the cache strategy to adapt to different mobile edge computing environments and meet diverse application requirements.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the methods according to the above implementation examples can be implemented by using software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each implementation example of the present application.
[0124] In this embodiment, a data cache device for a server is provided. The server system includes multiple servers with a topological connection structure. The device is applied to a target server among the multiple servers. The device is used to implement the above-mentioned embodiments and preferred embodiments. The descriptions have been made and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0125] Figure 5 FIG. 1 is a structural block diagram of a data cache device of a server according to an embodiment of the present application. Figure 5 As shown, the device comprises:
[0126] A receiving module 52 is used to receive a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task;
[0127] The extraction module 54 is used to respond to the task execution request, extract the first task data from the reference server in the topological connection structure, and extract the second task data from the server system to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute the reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, which is predicted based on the account information of the target account;
[0128] A detection module 56, configured to detect a target cache priority of target task data in the task data set according to historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between servers from which the target server does not extract the task data, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server;
[0129] The cache module 58 is used to cache the corresponding target task data in the target server according to the target cache priority.
[0130] Through the above device, a task execution request initiated by a target account is received; in response to the task execution request, the first task data is extracted from the reference server in the topological connection structure, and the second task data is extracted from the server system to obtain a task data set; the target cache priority of the target task data in the task data set is detected according to the historical usage information, network transmission information and popularity information of the task data; and the corresponding target task data is cached in the target server according to the target cache priority. That is to say, in the process of responding to a task execution request once, the target server not only obtains the data required to execute the target service task, but also obtains in advance the second task data required to be used for the service task to be executed by the target account after executing the target service task, which is predicted based on the account information of the target account. Therefore, the data required to be used in other task execution requests initiated by the target account subsequently received has a greater probability of being stored on the target server, which reduces the process of the target server obtaining data from other servers. Therefore, the problem of low efficiency of the server in executing service tasks can be solved, and the efficiency of the server in executing service tasks can be improved.
[0131] In an exemplary embodiment, the detection module includes:
[0132] A first detection unit is used to detect the historical access frequency, transmission delay and popularity parameter of the target task data, wherein the historical use information includes the historical access frequency, the network transmission information includes the transmission delay, and the popularity information includes the popularity parameter. The historical access frequency is used to indicate the frequency of the target task data being accessed within the historical time period between the historical time and the current time, the transmission delay is used to indicate the network delay between the target server and the server that does not extract the target task data, and the popularity parameter is used to indicate the probability of the task data being used after the current time;
[0133] A first acquisition unit is used to acquire current information weights corresponding to the historical usage information, the network transmission information, and the popularity information, respectively, wherein the current information weights are used to indicate the influence of the corresponding information dimensions on the cache priority of the task data;
[0134] A calculation unit is used to use the current information weight to calculate the weighted sum of the historical access frequency, the transmission delay and the popularity parameter to obtain the target cache priority of the target task data, wherein the higher the target cache priority of the target task data, the greater the probability that the target task data is cached in the target server.
[0135] In an exemplary implementation, the acquisition unit is further used to: detect the cache hit rate of the task data cached on the target server, and the system network information of the server system, wherein the cache hit rate is used to indicate the probability that the task data cached on the target server is used to perform the service task, and the system network information is used to indicate the current network transmission status of the server system; adjust the historical information weights corresponding to the historical usage information, the network transmission information and the popularity information respectively according to the cache hit rate and the system network information to obtain the current information weight.
[0136] In an exemplary implementation, the cache module includes:
[0137] An extraction unit, configured to extract the target task data from the task data set according to the target cache priority from high to low;
[0138] A second detection unit, used to detect whether the target task data currently extracted has been cached on the target server;
[0139] An updating unit, configured to update the cache priority currently corresponding to the target task data to the target cache priority when detecting that the target task data currently extracted has been cached on the target server;
[0140] A third detection unit is used to detect the amount of remaining data that can be stored in the remaining cache space on the target server when it is detected that the target task data currently extracted is not cached on the target server;
[0141] A first cache unit, configured to cache the target task data to the remaining cache space when the remaining data amount is greater than or equal to the data amount of the target task data, and record the target cache priority corresponding to the target task data;
[0142] A deleting unit is used to delete the cached task data from the cache space of the target server according to the cache priority from low to high when the remaining data amount is less than the data amount of the target task data, until the remaining data amount is greater than or equal to the data amount of the target task data, so as to obtain the target cache space; a second cache unit is used to cache the target task data to the target cache space and record the target cache priority corresponding to the target task data.
[0143] In an exemplary embodiment, the extraction module includes:
[0144] A prediction unit, configured to predict, based on the account information of the target account, candidate task data to be extracted by the target account after the target account executes the target service task;
[0145] A first query unit, configured to query a server storing the candidate task data from the server system according to data distribution information of the server system, and obtain a candidate server and candidate task data having a corresponding relationship;
[0146] The corresponding candidate task data is extracted from each of the candidate servers to obtain the second task data.
[0147] In an exemplary implementation, the prediction unit is further used to: input the account information of the target account and the behavior information of the target account into a popularity prediction model, wherein the behavior information is used to indicate that the target account has performed the target service task, and the popularity prediction model is obtained by training an initial network model using account information samples of account samples and behavior information samples of account samples, and the popularity prediction model is used to predict the probability of task data in the server system being used after the current time based on input data; obtain the corresponding task data and popularity parameters output by the popularity prediction model; and determine the task data whose corresponding popularity parameters are higher than the parameter threshold as the candidate task data.
[0148] In an exemplary embodiment, the extraction module includes:
[0149] A second query unit, configured to query the reference server where the first task data is located according to the data distribution information of the server system;
[0150] A second acquisition unit, configured to acquire a set of servers in the topological connection structure that allow the target server to perform routing;
[0151] A searching unit, configured to search for the reference server from the server set;
[0152] a first sending unit, configured to send a first extraction request to the reference server when the reference server is found from the server set, wherein the first extraction request is used to request to extract the first task data from the reference server; and a first receiving unit, configured to receive the first task data returned by the reference server in response to the first extraction request;
[0153] a third query unit, used to query the alternative server that is closest to the reference server from the server set if the reference server is not found from the server set; a second sending unit, used to send a second extraction request to the alternative server, wherein the second extraction request is used to request the alternative server to forward the second extraction request to the reference server and forward the task data returned by the reference server in response to the second extraction request to the target server, and the second extraction request is also used to request to extract the first task data from the reference server; and a second receiving unit, used to receive the first task data returned by the alternative server in response to the second extraction request.
[0154] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0155] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0156] In an exemplary implementation, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0157] The embodiment of the present application also provides an electronic device, Figure 6 is a structural block diagram of an electronic device according to an embodiment of the present application, such as Figure 6 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method implementation examples.
[0158] In an exemplary implementation, the electronic device may also include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0159] The implementation example of the present application also provides a computer program product, and the above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any one of the above-mentioned method implementation examples are implemented.
[0160] The embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0161] The implementation example of the present application also provides a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method implementation examples.
[0162] The specific examples in this embodiment can refer to the examples described in the above embodiments and exemplary embodiments, and this embodiment will not be repeated here.
[0163] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Likewise, the present application is not limited to any specific combination of hardware and software.
[0164] The above is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data caching method for a server, characterized in that: The server system includes a plurality of servers having a topological connection structure, and the method is applied to a target server among the plurality of servers, and the method includes: Receiving a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task; In response to the task execution request, extracting first task data from a reference server in the topological connection structure, and extracting second task data from the server system, to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute a reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, predicted based on the account information of the target account; Detecting a target cache priority of target task data in the task data set according to historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between the target server and the server from which the task data is extracted, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server; The corresponding target task data is cached in the target server according to the target cache priority.
2. The method according to claim 1, characterized in that The detecting the target cache priority of the target task data in the task data set according to the historical usage information, network transmission information and popularity information of the task data comprises: Detecting the historical access frequency, transmission delay and popularity parameter of the target task data, wherein the historical usage information includes the historical access frequency, the network transmission information includes the transmission delay, and the popularity information includes the popularity parameter. The historical access frequency is used to indicate the frequency of the target task data being accessed in a historical time period between a historical time and a current time, the transmission delay is used to indicate the network delay between the target server and the server that extracts the target task data, and the popularity parameter is used to indicate the probability of the task data being used after the current time. Obtaining current information weights corresponding to the historical usage information, the network transmission information, and the popularity information, respectively, wherein the current information weights are used to indicate the degree of influence of the corresponding information dimension on the cache priority of the task data; The current information weight is used to calculate the weighted sum of the historical access frequency, the transmission delay and the popularity parameter to obtain the target cache priority of the target task data, wherein the higher the target cache priority of the target task data, the greater the probability that the target task data is cached in the target server.
3. The method according to claim 2, characterized in that The obtaining of current information weights respectively corresponding to the historical usage information, the network transmission information, and the popularity information includes: Detecting a cache hit rate of the task data cached on the target server and system network information of the server system, wherein the cache hit rate is used to indicate the probability that the task data cached on the target server is used to perform the service task, and the system network information is used to indicate the current network transmission status of the server system; The historical information weights respectively corresponding to the historical usage information, the network transmission information and the popularity information are adjusted according to the cache hit rate and the system network information to obtain the current information weight.
4. The method according to claim 1, characterized in that: The caching the corresponding target task data in the target server according to the target cache priority includes: Extracting the target task data from the task data set according to the target cache priority from high to low; Detecting whether the currently extracted target task data has been cached on the target server; In the case where it is detected that the target task data currently extracted has been cached on the target server, updating the cache priority currently corresponding to the target task data to the target cache priority; In the case where it is detected that the target task data currently extracted is not cached on the target server, detecting the amount of remaining data that can be stored in the remaining cache space on the target server; When the remaining data amount is greater than or equal to the data amount of the target task data, the target task data is cached into the remaining cache space, and the target cache priority corresponding to the target task data is recorded; When the remaining data volume is less than the data volume of the target task data, the cached task data is deleted from the cache space of the target server according to the cache priority from low to high until the remaining data volume is greater than or equal to the data volume of the target task data, thereby obtaining the target cache space; the target task data is cached to the target cache space, and the target cache priority corresponding to the target task data is recorded.
5. The method according to claim 1, characterized in that The extracting the second task data from the server system comprises: Predicting, based on the account information of the target account, candidate task data to be extracted by the target account after executing the target service task; querying the server storing the candidate task data from the server system according to the data distribution information of the server system to obtain the candidate server and the candidate task data having a corresponding relationship; The corresponding candidate task data is extracted from each of the candidate servers to obtain the second task data.
6. The method according to claim 5, characterized in that The predicting, based on the account information of the target account, the candidate task data to be extracted by the target account after executing the target service task includes: Inputting the account information of the target account and the behavior information of the target account into a popularity prediction model, wherein the behavior information is used to indicate that the target account has executed the target service task, the popularity prediction model is obtained by training an initial network model using the account information samples of the account samples and the behavior information samples of the account samples, and the popularity prediction model is used to predict the probability of the task data in the server system being used after the current time according to the input data; Obtaining task data and popularity parameters having a corresponding relationship output by the popularity prediction model; The task data whose corresponding popularity parameter is higher than the parameter threshold is determined as the candidate task data.
7. The method according to claim 1, characterized in that The extracting the first task data from the reference server in the topological connection structure comprises: Query the reference server where the first task data is located according to the data distribution information of the server system; Acquire a server set in the topological connection structure that allows the target server to perform routing; Find the reference server from the server set; In the case where the reference server is found from the server set, sending a first extraction request to the reference server, wherein the first extraction request is used to request to extract the first task data from the reference server; receiving the first task data returned by the reference server in response to the first extraction request; If the reference server is not found in the server set, query the server set for an alternative server that is closest to the reference server; send a second extraction request to the alternative server, wherein the second extraction request is used to request the alternative server to forward the second extraction request to the reference server and forward the task data returned by the reference server in response to the second extraction request to the target server, and the second extraction request is also used to request to extract the first task data from the reference server; receive the first task data returned by the alternative server in response to the second extraction request.
8. A data cache device for a server, characterized in that: The server system includes a plurality of servers having a topological connection structure, and the device is applied to a target server among the plurality of servers, and the device includes: A receiving module, configured to receive a task execution request initiated by a target account, wherein the task execution request is used to request the target server to execute a target service task; an extraction module, configured to respond to the task execution request, extract first task data from a reference server in the topological connection structure, and extract second task data from the server system, to obtain a task data set, wherein the first task data is data required to execute the target service task but not cached on the target server, and the second task data is data required to execute a reference service task, and the reference service task is a service task to be executed by the target account after executing the target service task, predicted based on the account information of the target account; A detection module, used for detecting a target cache priority of target task data in the task data set according to historical usage information, network transmission information and popularity information of the task data, wherein the historical usage information is used to indicate the historical usage of the data in the server system, the network transmission information is used to indicate the network transmission between the target server and the server from which the task data is extracted, the popularity information is used to indicate the probability of the task data being used after the current time, and the cache priority of the task data is used to indicate the probability of the task data being cached in the target server; A cache module is used to cache the corresponding target task data in the target server according to the target cache priority.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Cache optimization method and device, equipment, storage medium and computer program product
CN119484641A
Method, device and equipment based on cache processing task and storage medium
CN119759522A
Server data caching and accelerating method based on edge computing
CN120763217A
A Server Data Caching and Acceleration Method Based on Edge Computing
CN120763217B
