Data caching method, device, equipment and readable storage medium
By calculating the weighted access popularity of data in the edge server, deleting data with lower access popularity and cacheing data with higher access popularity, the problem of insufficient accuracy of cached data by edge servers is solved, and more efficient data caching is achieved.
Patent Information
- Application Number
- CN202310267898.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In the prior art, the base station requests data from different edge servers, resulting in low accuracy of data access cached by edge servers, resulting in insufficient accuracy of cached data.
By determining the access popularity of the data cached in the first edge server in the local and adjacent edge servers, calculating the weighted access popularity, deleting the data with lower access popularity and cacheing the data with higher access popularity, and updating the cached data with default models.
Improve the accuracy of cached data in edge servers, ensure that the access popularity of cached data is more accurate, and improve the effectiveness of data cache.
Smart Images

Figure CN116321303B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data technology, and in particular to a data caching method, apparatus, device, and readable storage medium. Background Art
[0002] A base station has its own corresponding edge server, which can cache data. After receiving a data request from a user device, the base station can retrieve the data from its corresponding edge server or an edge server corresponding to a neighboring base station and send the data to the user device.
[0003] In the prior art, in order to cache highly accessed data in an edge server, the cached data in the edge server can be updated separately. For example, for any edge server, the access popularity of each cached data in the edge server can be obtained, and cached data with lower access popularity can be deleted in the edge server, while data with higher access popularity can be added to the edge server. However, because the base station can request data from different edge servers, the accuracy of the access popularity of cached data determined according to the above method is low, so that data with lower access popularity may exist in the data cached by the edge server, resulting in low accuracy of the cached data in the first edge server. Summary of the Invention
[0004] The present application provides a data caching method, apparatus, device, and readable storage medium to solve the problem of low accuracy of cached data in a first edge server.
[0005] In a first aspect, the present application provides a data caching method, applied to a first base station, the method comprising:
[0006] Determine a plurality of first data cached in a first edge server corresponding to the first base station;
[0007] Determining a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in at least one second edge server, where the second edge server is an edge server corresponding to a base station adjacent to the first base station;
[0008] determining first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server;
[0009] determining second target data from a plurality of second data that are not cached in the first edge server;
[0010] The first target data is deleted in the first edge server, and the second target data is stored in the first edge server.
[0011] In one possible implementation, determining first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server includes:
[0012] determining a weighted access popularity of each first data item according to a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in the at least one second edge server;
[0013] The first target data is determined from the plurality of first data according to the weighted access popularity of each first data.
[0014] In one possible implementation, for any first data, determining a weighted access popularity of the first data based on a first access popularity of the first data in the first edge server and a second access popularity of the first data in the at least one second edge server includes:
[0015] Determine a first delay ratio weight of the first edge server, where the first delay weight is a reduction ratio of the first delay relative to the second delay, the first delay is a delay for the first base station to obtain data from the first edge server, and the second delay is a delay for the first base station to obtain data from the cloud server;
[0016] Determine a second delay ratio weight for each second edge server, where the first delay weight is a reduction ratio of a third delay relative to the second delay, and the third delay is a delay for the first base station to obtain data from the second edge server;
[0017] A weighted access popularity of the first data is determined according to the first access popularity, the second access popularity, the first delay ratio weight, and the second delay ratio weight.
[0018] In a possible implementation, determining the first target data from the plurality of first data according to the weighted access popularity of each first data includes:
[0019] Determine the number N to be deleted, where N is a positive integer;
[0020] Sorting the plurality of first data according to the weighted access popularity from high to low to obtain a plurality of sorted first data;
[0021] The last N first data among the sorted plurality of first data are determined as the first target data.
[0022] In a possible implementation, for any first data, determining a first access popularity of the first data in the first edge server includes:
[0023] Determine a first data access volume of the first data in the first edge server within a first historical period;
[0024] Determining a total amount of data access received by the first edge server during the first historical period;
[0025] The ratio of the first data access volume to the total data access volume is determined as the first access popularity.
[0026] In a possible implementation, for any second edge server, determining a second access popularity of each first data item in the second edge server includes:
[0027] Requesting from the cloud server to obtain the second access popularity of each first data in the second edge server; or
[0028] A request is made from the second edge server to obtain a second access popularity of each first data item in the second edge server.
[0029] In a possible implementation, determining the second target data from the plurality of second data not cached in the first edge server includes:
[0030] determining the plurality of second data;
[0031] Obtaining access popularity of the plurality of second data in a second historical period;
[0032] The N second data with the highest access popularity among the plurality of second data are determined as the second target data, where N is a positive integer and is the number of the first target data.
[0033] In a second aspect, the present application provides a data caching device, applied to a first base station, wherein the method includes a first determination module, a second determination module, a third determination module, a fourth determination module, a deletion module, and a storage module:
[0034] The first determining module is configured to determine a plurality of first data cached in a first edge server corresponding to the first base station;
[0035] The second determining module is configured to determine a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in at least one second edge server, where the second edge server is an edge server corresponding to a base station adjacent to the first base station;
[0036] The third determining module is configured to determine a first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server;
[0037] The fourth determining module is configured to determine the second target data from the plurality of second data that are not cached in the first edge server;
[0038] The deletion module is configured to delete the first target data in the first edge server.
[0039] The storage module is configured to store the second target data in the first edge server.
[0040] In a possible implementation manner, the second determining module is specifically configured to:
[0041] determining a weighted access popularity of each first data item according to a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in the at least one second edge server;
[0042] The first target data is determined from the plurality of first data according to the weighted access popularity of each first data.
[0043] In a possible implementation manner, for any first data, the second determining module is specifically configured to:
[0044] Determine a first delay ratio weight of the first edge server, where the first delay weight is a reduction ratio of the first delay relative to the second delay, the first delay is a delay for the first base station to obtain data from the first edge server, and the second delay is a delay for the first base station to obtain data from the cloud server;
[0045] Determine a second delay ratio weight for each second edge server, where the first delay weight is a reduction ratio of a third delay relative to the second delay, and the third delay is a delay for the first base station to obtain data from the second edge server;
[0046] A weighted access popularity of the first data is determined according to the first access popularity, the second access popularity, the first delay ratio weight, and the second delay ratio weight.
[0047] In a possible implementation manner, the second determining module is specifically configured to:
[0048] Determine the number N to be deleted, where N is a positive integer;
[0049] Sorting the plurality of first data according to the weighted access popularity from high to low to obtain a plurality of sorted first data;
[0050] The last N first data among the sorted plurality of first data are determined as the first target data.
[0051] In a possible implementation manner, for any first data, the second determining module is specifically configured to:
[0052] Determine a first data access volume of the first data in the first edge server within a first historical period;
[0053] Determining a total amount of data access received by the first edge server during the first historical period;
[0054] The ratio of the first data access volume to the total data access volume is determined as the first access popularity.
[0055] In a possible implementation, for any second edge server, the second determining module is specifically configured to:
[0056] Requesting from the cloud server to obtain the second access popularity of each first data in the second edge server; or
[0057] A request is made from the second edge server to obtain a second access popularity of each first data item in the second edge server.
[0058] In a possible implementation, the fourth determining module is specifically configured to:
[0059] determining the plurality of second data;
[0060] Obtaining access popularity of the plurality of second data in a second historical period;
[0061] The N second data with the highest access popularity among the plurality of second data are determined as the second target data, where N is a positive integer and is the number of the first target data.
[0062] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor,
[0063] The memory stores computer-executable instructions;
[0064] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the data caching method described in any one of the first aspects.
[0065] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data caching method described in any one of the first aspects.
[0066] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the data caching method described in any one of the first aspects.
[0067] The data caching method, apparatus, device, and readable storage medium provided in the present application determine multiple first data cached in a first edge server corresponding to a first base station, determine first target data among the multiple first data based on the first access popularity of each first data in the first edge server and the second access popularity of each first data in at least one second edge server, determine second target data among the multiple second data not cached in the first edge server, delete the first target data in the first edge server, and store the second target data in the first edge server. Based on the first access popularity of the first data and at least one second access popularity, the target data cached in the first base station is determined, so that the accuracy of the access popularity of the determined cached data is improved, thereby improving the accuracy of the cached data in the first edge server. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0069] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0070] Figure 2 A flowchart of a data caching method provided in an embodiment of the present application;
[0071] Figure 3 A flowchart of another data caching method provided in an embodiment of the present application;
[0072] Figure 4 A schematic diagram of the structure of a preset model according to an embodiment of the present application;
[0073] Figure 5 A schematic diagram of the data cache architecture provided in an embodiment of the present application;
[0074] Figure 6A schematic diagram of the structure of a data cache device provided in an embodiment of the present application;
[0075] Figure 7 A structural diagram of an electronic device is provided for an embodiment of the present application.
[0076] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0077] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0078] Figure 1 This is a schematic diagram of the application scenario provided by the embodiment of this application. Figure 1 , including multiple base stations 101, multiple edge servers 102, and a cloud server 103.
[0079] Base station 101 can receive data requests. Each base station 101 has a corresponding edge server 102. Edge server 102 has a preset cache space. Edge server 102 can determine target data cached in edge server 102 based on the first access popularity of cached first data and the second access popularity of its neighboring base stations. Cloud server 101 can store all data. Edge server 102 can obtain data from multiple edge servers 102 and cloud server 103 based on the data request. The latency for base station 101 to obtain data from multiple edge servers 102 and cloud server 103 varies.
[0080] After receiving the data request, base station 101 retrieves the data from the multiple first data caches of edge server 102 corresponding to base station 101 if the requested data exists. If the requested data does not exist in the cache of edge server 102 corresponding to base station 101, but exists in the caches of edge servers 102 corresponding to multiple neighboring base stations, the data may be retrieved from edge servers 102 corresponding to the neighboring base stations. If the requested data does not exist in the caches of edge server 102 corresponding to base station 101 or in the caches of edge servers 102 corresponding to multiple neighboring base stations, the data may be retrieved from cloud server 103.
[0081] In the prior art, in order to cache highly accessed data in an edge server, the cached data in the edge server can be updated separately. For example, for any edge server, the access popularity of each cached data in the edge server can be obtained, and cached data with lower access popularity can be deleted in the edge server, while data with higher access popularity can be added to the edge server. However, because the base station can request data from different edge servers, the accuracy of the access popularity of cached data determined according to the above method is low, so that data with lower access popularity may exist in the data cached by the edge server, resulting in low accuracy of the cached data in the first edge server.
[0082] In an embodiment of the present application, multiple first data cached in a first edge server corresponding to a first base station are determined, and based on the first access popularity of each first data in the first edge server and the second access popularity of each first data in at least one second edge server, first target data is determined from the multiple first data, and second target data is determined from the multiple second data not cached in the first edge server. The first target data is deleted in the first edge server, and the second target data is stored in the first edge server. In the above process, the target data cached in the first base station is determined based on the first access popularity of the first data and at least one second access popularity, so that the accuracy of the access popularity of the determined cached data is improved, thereby improving the accuracy of the cached data in the first edge server.
[0083] The method of the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeated in different embodiments.
[0084] Figure 2 This is a flow chart of a data caching method provided in an embodiment of the present application. Figure 2 , the method may include:
[0085] S201: Determine a plurality of first data cached in a first edge server corresponding to a first base station.
[0086] The execution subject of the embodiment of the present application can be an edge server, or a data cache device set in the edge server. The data cache device can be implemented by software, or by a combination of software and hardware.
[0087] The multiple first data are data cached by the first edge server within a first historical period, where the first historical period is a period before the current moment.
[0088] S202: Determine a first access popularity of each first data item in a first edge server and a second access popularity of each first data item in at least one second edge server.
[0089] The second edge server is an edge server corresponding to a neighboring base station of the first base station, and the first base station has at least one neighboring base station.
[0090] The first access heat is used to determine the data access heat of the first data in the first base station. The higher the data access heat, the larger the value of the first access heat. The first access heat is greater than or equal to 0 and less than or equal to 1.
[0091] The second access heat is used to determine the data access heat of the first data in the second base station. The higher the data access heat, the larger the value of the second access heat. The second access heat is greater than or equal to 0 and less than or equal to 1.
[0092] The second base station is a neighboring base station of the first base station, and the first base station has at least one neighboring base station.
[0093] For any first data, the first access popularity can be determined according to the following method: determine the first data access volume of the first data in the first edge server within the first historical period; determine the total data access volume received by the first edge server within the first historical period; and determine the ratio of the first data access volume to the total data access volume as the first access popularity.
[0094] For example, assuming that there are 3 first data in the first edge server corresponding to the first base, the first data access volume of the first data in the first edge server can be as shown in Table 1. The first data access volume of the first data 1 is 5, the first data access volume of the first data 2 is 8, and the first data access volume of the first data 3 is 7. Then it can be determined that the first access heat corresponding to the first data 1 is 0.25, the first access heat of the first data 2 is 0.4, and the first access heat of the first data 3 is 0.35.
[0095] Table 1
[0096] First Data First data access First visit popularity First Data 1 5 0.25 First Data 2 8 0.4 First Data 3 7 0.35
[0097] For any first data, the second access popularity can be determined as follows: requesting the cloud server to obtain the second access popularity of each first data in the second edge server; or requesting the second access popularity of each first data in the second edge server from the second edge server.
[0098] Among them, if the first data exists in the cache of the second edge server or cloud server, the second access heat of the first data can be obtained; if the first data does not exist in the cache of the second edge server or cloud server, the second access heat of the second data is 0.
[0099] For example, assuming that there are three first data in the first edge server corresponding to the first base station, the first base station has two adjacent base stations, and the second edge servers corresponding to the adjacent base stations are second edge server 1 and second edge server 2 respectively, the second access popularity can be as shown in Table 2.
[0100] Table 2
[0101]
[0102] S203 : Determine first target data from a plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in at least one second edge server.
[0103] The first target data can be determined in the following manner: determining the weighted access popularity of each first data according to the first access popularity of each first data in the first edge server and the second access popularity of each first data in at least one second edge server; and determining the first target data among multiple first data according to the weighted access popularity of each first data.
[0104] Determining the first target data by the weighted access popularity of the first data can make the determined first target data more accurate.
[0105] S204: Determine second target data from the plurality of second data that are not cached in the first edge server.
[0106] The second target data can be determined in the following manner: determine multiple second data; obtain the access popularity of the multiple second data in the second historical period; determine the N second data with the highest access popularity among the multiple second data as the second target data, where N is a positive integer and N is the number of first target data.
[0107] The first base station may receive multiple data requests, where the data requested in the multiple data requests may include first data and second data, wherein the first data is cached to the first edge server, and the second data is not cached.
[0108] S205: Delete the first target data in the first edge server, and store the second target data in the first edge server.
[0109] The data cached in the first edge server may be updated by deleting the first target data in the first edge server and storing the second target data in the first edge server.
[0110] The data caching method provided in an embodiment of the present application determines multiple first data cached in a first edge server corresponding to a first base station, determines first target data from the multiple first data based on a first access popularity of each first data and a second access popularity of each first data, determines second target data from multiple second data that are not cached in the first edge server, deletes the first target data in the first edge server, and stores the second target data in the first edge server, so that the accuracy of the determined target data is improved, thereby improving the accuracy of the data cached in the first edge server.
[0111] Figure 3 This is a flow chart of another data caching method provided in an embodiment of the present application. Figure 3 , the method may include:
[0112] S301: Determine a plurality of first data cached in a first edge server corresponding to a first base station.
[0113] S302: Determine a first access popularity of each first data item in a first edge server and a second access popularity of each first data item in at least one second edge server.
[0114] The execution process of S301-S302 can refer to the execution process of S201-S202, which will not be repeated here.
[0115] S303: Determine a first delay ratio weight of the first edge server.
[0116] The first delay ratio weight may be a reduction ratio of the first delay relative to the second delay.
[0117] The first delay may be the delay for the first base station to obtain data from the first edge server, and the second delay may be the delay for the first base station to obtain data from the cloud server.
[0118] For example, assuming that the first delay for the first base station to obtain the first data in the first edge server is 2, and the second delay for obtaining the first data in the cloud server is 10, it can be determined that the first delay ratio weight of the first base station is 0.2.
[0119] S304: Determine a second delay ratio weight of each second edge server.
[0120] The second delay ratio weight may be a reduction ratio of the third delay relative to the second delay, and the third delay may be a delay for the first base station to obtain data from the second edge server.
[0121] For example, assuming that the third delay for the first base station to obtain the first data in the second edge server is 5, and the second delay for obtaining the first data in the cloud server is 10, it can be determined that the second delay ratio weight of the second base station 1 is 0.5.
[0122] S305: Determine the weighted access popularity of the first data according to the first access popularity, the second access popularity, the first delay ratio weight, and the second delay ratio weight.
[0123] For any first data, the weighted access popularity of the first data can be obtained by multiplying the first delay ratio weight by the first access popularity of the first data and adding the cumulative sum of the second delay ratio weight multiplied by the second access popularity.
[0124] For example, assuming that there are 3 first data in the first base station, the first base station can obtain data in the cache of the second edge server 1 and the second edge server 2. Assuming that the first access heat and the second access heat of the first data in the first edge server corresponding to the first base station can be as shown in Table 1 and Table 2, the first delay ratio weight and the second delay ratio weight can be as shown in Table 3, then the weighted access heat of the first data 1 can be obtained as 0.6, the weighted access heat of the first data 2 is 0.29, and the weighted access heat of the first data 3 is 0.51, which can be shown in Table 4.
[0125] Table 3
[0126]
[0127] Table 4
[0128] First Data Weighted visit popularity First Data 1 0.6 First Data 2 0.29 First Data 3 0.51
[0129] S306: Determine the number N to be deleted, where N is a positive integer.
[0130] The number N to be deleted can be determined as follows: based on multiple first data, the first access popularity corresponding to each first data, and the second access popularity corresponding to each first data, determine the environmental state in the first historical period; use the environmental state as the input of the preset model to obtain the number N to be deleted.
[0131] For example, the preset model may be a deep Q-network (DQN) algorithm, and the preset model may include an evaluation model and a target model.
[0132] S307 , sorting the plurality of first data in descending order of weighted access popularity to obtain the sorted plurality of first data.
[0133] For example, assuming that the first edge server corresponding to the first base station caches the first data 1, the first data 2, and the second data 3, the weighted access heat of the first data 1 is 0.6, the weighted access heat of the first data 2 is 0.29, and the weighted access heat of the first data 3 is 0.51, then the sorted first data can be obtained as: first data 1, first data 3, and first data 2.
[0134] S308 : Determine the last N first data among the sorted plurality of first data as the first target data.
[0135] For example, assuming that N is 1, and the sorted first data are: first data 1, first data 3, and first data 2, then it can be determined that first data 2 is the first target data.
[0136] S309: Determine a plurality of second data.
[0137] The data that is not cached in the first edge server may be determined as the second data.
[0138] S310: Obtain access popularity of multiple second data in a second historical period.
[0139] The access popularity of the second historical period can be obtained in the second edge server or the cloud server, where the second historical period is a period before the first historical period.
[0140] S311 : Determine N second data with the highest access popularity among the plurality of second data as second target data.
[0141] N is a positive integer, and N is the number of first target data.
[0142] For example, assuming that the access popularity of the second data 1 is 0.3, the access popularity of the second data 2 is 0.2, and the access popularity of the second data 3 is 0.6, and assuming that N is 1, it can be determined that the second data 3 is the second target data.
[0143] S312: Delete the first target data in the first edge server, and store the second target data in the first edge server.
[0144] The total amount of first requests from the first base station within the target time period and the total amount of multiple second requests from multiple second base stations within the target time period can be obtained, and the total amount of first requests, the total amount of multiple second requests, the first delay ratio weight, and the second delay ratio weight corresponding to each second base station are processed to obtain updated parameters, which are used to update the preset model.
[0145] The target time period may be the next time period after the current moment.
[0146] The first total request amount may refer to the total number of data requests from the first base station within the target period, and the second total request amount may refer to the total number of data requests from the corresponding second base station within the target period.
[0147] The updated parameter can be obtained by adding the product of the first request total amount and the first delay ratio weight to the cumulative sum of the second delay ratio weight multiplied by the corresponding second request total amount.
[0148] For example, assuming that the neighboring base stations of the first base station are the second base station 1 and the second base station 2, assuming that the total first request of the first base station is 15, the total second request of the second base station 1 is 20, the total second request of the second base station 2 is 10, the first delay ratio weight is 0.2, the second delay ratio weight of the second base station 1 is 0.5, and the second delay ratio weight of the second base station 2 is 0.7, then the update parameter can be determined to be 20.
[0149] The environmental status during the first historical period, the number N to be deleted, the updated parameters, and the environmental status during the target period can be stored in a historical database. After a preset period, the target model can be updated using the evaluation model. The preset period can include multiple periods. During any period, the evaluation model and the target model can obtain historical data to determine the loss function, and the loss function can be used to update the evaluation model.
[0150] In the process of updating the target model through historical data, the weighted popularity can be processed through the evaluation model to obtain the target data of the first base station within the target time, so that the preset model updating process and the target data determination process do not affect each other.
[0151] In order to facilitate the understanding of the embodiments of this application, Figure 4 , further explains the updating process of the preset model.
[0152] Figure 4 This is a schematic diagram of the structure of the preset model of an embodiment of the present application. The preset model includes an evaluation model and a target model. After obtaining the environmental status within the first historical period, the replacement value, that is, the number N to be deleted, can be determined by the evaluation model, and the environmental status within the first historical period, the number N to be deleted, the update parameters, and the environmental status within the target period are stored in a historical database. The evaluation model and the target model can obtain historical data from the historical database, and the evaluation network and the target network determine the loss function based on the historical data, and the evaluation model is updated using the loss function. After a preset period of time, the evaluation function is updated to the target function.
[0153] The data caching method provided in the embodiment of the present application can determine the weighted access heat of the first data after determining the first access heat, the second access heat, the first delay ratio weight, and the second delay ratio weight of each first data, sort the multiple first data in descending order of the weighted access heat, determine the last N first data among the sorted multiple first data as the first target data, determine the N second data with the highest access heat among the multiple second data as the second target data, delete the first target data in the first edge server, and store the second target data in the first edge server, thereby improving the accuracy of cached data in the first edge server.
[0154] Figure 5 This is a schematic diagram of the data cache architecture provided in this application embodiment. Figure 5 , users can send data requests to the base station through their user devices. The base station then receives the data and sends it to the user device. The base station can obtain data and the corresponding access popularity from multiple adjacent base stations or cloud servers, update the base station's cached data based on the access popularity and a preset model, and can also store the data and access popularity on the cloud server.
[0155] Figure 6 This is a structural diagram of a data cache device provided in an embodiment of the present application. Figure 6 The data caching device includes a first determining module 11, a second determining module 12, a third determining module 13, a fourth determining module 14, a deleting module 15 and a storing module 16:
[0156] The first determining module 11 is used to determine a plurality of first data cached in a first edge server corresponding to a first base station;
[0157] The second determining module 12 is configured to determine a first access popularity of each first data item in a first edge server and a second access popularity of each first data item in at least one second edge server, where the second edge server is an edge server corresponding to a base station adjacent to the first base station;
[0158] The third determining module 13 is configured to determine a first target data from a plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in at least one second edge server;
[0159] The fourth determining module 14 is configured to determine the second target data from the plurality of second data that are not cached in the first edge server;
[0160] The deleting module 15 is configured to delete the first target data in the first edge server.
[0161] The storage module 16 is configured to store the second target data in the first edge server.
[0162] In a possible implementation, the second determining module 12 is specifically configured to:
[0163] Determine a weighted access popularity of each first data item according to a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in at least one second edge server;
[0164] First target data is determined from a plurality of first data according to the weighted access popularity of each first data.
[0165] In a possible implementation, for any first data, the second determination module is specifically configured to:
[0166] Determine a first delay ratio weight for the first edge server, where the first delay weight is a reduction ratio of the first delay relative to the second delay, the first delay is a delay for the first base station to obtain data from the first edge server, and the second delay is a delay for the first base station to obtain data from the cloud server;
[0167] Determine a second delay ratio weight for each second edge server, where the first delay weight is a reduction ratio of the third delay relative to the second delay, and the third delay is a delay for the first base station to obtain data from the second edge server;
[0168] The weighted access popularity of the first data is determined according to the first access popularity, the second access popularity, the first delay ratio weight, and the second delay ratio weight.
[0169] In a possible implementation, the second determining module 12 is specifically configured to:
[0170] Determine the number N to be deleted, where N is a positive integer;
[0171] Sorting the plurality of first data according to the weighted access popularity from high to low to obtain the sorted plurality of first data;
[0172] The last N first data among the sorted plurality of first data are determined as the first target data.
[0173] In a possible implementation, for any first data, the second determination module is specifically configured to:
[0174] Determine a first data access count of the first data in the first edge server within a first historical period;
[0175] Determining a total amount of data access received by the first edge server during a first historical period;
[0176] The ratio of the first data access volume to the total data access volume is determined as the first access popularity.
[0177] In a possible implementation, for any second edge server, the second determining module is specifically configured to:
[0178] Requesting from the cloud server to obtain the second access popularity of each first data in the second edge server; or
[0179] A request is made from the second edge server to obtain the second access popularity of each first data in the second edge server.
[0180] In a possible implementation, the fourth determining module 14 is specifically configured to:
[0181] determining a plurality of second data;
[0182] Obtaining access popularity of multiple second data in a second historical period;
[0183] N second data with the highest access popularity among the plurality of second data are determined as second target data, where N is a positive integer and N is the number of first target data.
[0184] The data cache device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0185] Figure 7 This application provides a schematic diagram of the structure of an electronic device, see Figure 7 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.
[0186] The memory 22 stores computer-executable instructions;
[0187] The processor 21 executes the computer-executable instructions stored in the memory 22 , so that the processor 21 executes the data caching method shown in the above method embodiment.
[0188] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the data caching method of the above method embodiment.
[0189] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, may implement the data caching method shown in the above method embodiment.
[0190] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0191] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0192] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0194] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0195] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0196] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0197] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user data and other information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0198] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0199] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A data caching method, characterized in that: Applied to a first base station, the method includes: Determine a plurality of first data cached in a first edge server corresponding to the first base station; Determining a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in at least one second edge server, where the second edge server is an edge server corresponding to a base station adjacent to the first base station; determining first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server; determining second target data from a plurality of second data that are not cached in the first edge server; The first target data is deleted in the first edge server, and the second target data is stored in the first edge server.
2. The method according to claim 1, characterized in that Determining first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server includes: determining a weighted access popularity of each first data item according to a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in the at least one second edge server; The first target data is determined from the plurality of first data according to the weighted access popularity of each first data.
3. The method according to claim 2, characterized in that For any first data, determining a weighted access popularity of the first data according to a first access popularity of the first data in the first edge server and a second access popularity of the first data in the at least one second edge server includes: Determining a first delay ratio weight of the first edge server, where the first delay ratio weight is a reduction ratio of the first delay relative to the second delay, the first delay being a delay for the first base station to obtain data from the first edge server, and the second delay being a delay for the first base station to obtain data from the cloud server; Determine a second delay ratio weight for each second edge server, where the second delay ratio weight is a reduction ratio of a third delay relative to the second delay, where the third delay is a delay for the first base station to obtain data from the second edge server; A weighted access popularity of the first data is determined according to the first access popularity, the second access popularity, the first delay ratio weight, and the second delay ratio weight.
4. The method according to claim 2 or 3, characterized in that Determining the first target data from the plurality of first data according to the weighted access popularity of each first data includes: Determine the number N to be deleted, where N is a positive integer; Sorting the plurality of first data according to the weighted access popularity from high to low to obtain a plurality of sorted first data; The last N first data among the sorted plurality of first data are determined as the first target data.
5. The method according to any one of claims 1 to 4, characterized in that For any first data, determining a first access popularity of the first data in the first edge server includes: Determine a first data access volume of the first data in the first edge server within a first historical period; Determining a total amount of data access received by the first edge server during the first historical period; The ratio of the first data access volume to the total data access volume is determined as the first access popularity.
6. The method according to any one of claims 1 to 5, characterized in that For any second edge server; Determining a second access popularity of each first data in the second edge server includes: Requesting from the cloud server to obtain the second access popularity of each first data in the second edge server; or, A request is made from the second edge server to obtain a second access popularity of each first data item in the second edge server.
7. The method according to any one of claims 1 to 6, characterized in that Determining second target data from a plurality of second data that are not cached in the first edge server includes: determining the plurality of second data; Obtaining access popularity of the plurality of second data in a second historical period; The N second data with the highest access popularity among the plurality of second data are determined as the second target data, where N is a positive integer and is the number of the first target data.
8. A data cache device, characterized in that: Applied to a first base station, the apparatus includes a first determination module, a second determination module, a third determination module, a fourth determination module, a deletion module, and a storage module: The first determining module is configured to determine a plurality of first data cached in a first edge server corresponding to the first base station; The second determining module is configured to determine a first access popularity of each first data item in the first edge server and a second access popularity of each first data item in at least one second edge server, where the second edge server is an edge server corresponding to a base station adjacent to the first base station; The third determining module is configured to determine a first target data from the plurality of first data according to a first access popularity of each first data in the first edge server and a second access popularity of each first data in the at least one second edge server; The fourth determining module is configured to determine the second target data from the plurality of second data that are not cached in the first edge server; The deletion module is used to delete the first target data in the first edge server; The storage module is configured to store the second target data in the first edge server.
9. An electronic device, characterized in that: include: memory and processor, The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the data caching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the data caching method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the data caching method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Access request processing method and device
CN109597915A
Data Access Method And Apparatus
US20200028933A1