Model caching methods, devices, media, and equipment based on mobile edge computing
By selecting a cache model based on the application's cache value and edge server capacity in mobile edge computing, and optimizing the cache space configuration, the problem of unreasonable cache space configuration of MEC servers is solved, reducing operating costs and improving operating benefits.
Patent Information
- Application Number
- CN202111299664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-11-04
AI Technical Summary
The existing mobile edge computing (MEC) technology ignores the operator's operating costs, resulting in unreasonable configuration of MEC server cache space and increasing operating costs.
By selecting the application with the greatest cache value from multiple applications based on the data amount of the to-cache model of each application and the remaining capacity of the edge server, optimizing the cache space configuration, and updating the to-cache model of the remaining applications through the shared model, ensuring that Rational use of cache space.
It effectively saves server computing resources, improves data processing speed, reduces the operating costs of MEC operators, and increases operating income.
Smart Images

Figure CN113986553B_ABST
Abstract
Description
Background Art
[0002] Mobile Edge Computing (MEC) is a network architecture that provides user-required services and cloud computing functions on the wireless side. It is used to accelerate the rapid download of various applications in the network, allowing users to enjoy an uninterrupted high-quality network experience. It has the characteristics of ultra-low latency, ultra-high bandwidth, and strong real-time performance.
[0003] In related technologies, factors such as latency, energy consumption, and resources are generally considered, while the operating costs of MEC operators are ignored.
[0004] In view of this, there is an urgent need in the art to develop a new model caching method and device based on mobile edge computing.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention
[0006] The purpose of the present disclosure is to provide a model caching method based on mobile edge computing, a model caching device based on mobile edge computing, a computer storage medium and an electronic device, thereby at least to a certain extent avoiding the problem of the inability to reasonably configure the cache space of the MEC server in the related art, resulting in operating costs.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to the first aspect of the present disclosure, a model caching method based on mobile edge computing is provided, which is applied to an edge server, including: selecting a first application from multiple applications according to the data volume of the to-be-cached model corresponding to each application and the remaining capacity of the edge server; the to-be-cached model is an artificial intelligence model that is not cached in the edge server; obtaining the cache value of the to-be-cached model corresponding to each of the first applications; caching the to-be-cached model corresponding to the first application with the largest cache value. In an exemplary embodiment of the present disclosure, the first application is selected from the multiple applications in the following manner: comparing the data volume of the to-be-cached model corresponding to each application with the remaining capacity of the edge server, and determining the application whose data volume of the to-be-cached model is less than the remaining capacity as the first application.
[0009] In an exemplary embodiment of the present disclosure, the cache value of the to-be-cached model corresponding to each of the first applications is determined by the following formula:
[0010]
[0011] Wherein, i represents any first application, represents the cache value of the model to be cached corresponding to the first application i; f represents the unit usage fee of the model; represents a set of the first applications;
[0012] P k represents the historical usage data of each of the first applications; j represents each of the artificial intelligence models; represents the set of models to be cached corresponding to the first application i; M k represents a set of to-be-cached models corresponding to each of the first applications; S j Indicates the data volume of each model to be cached.
[0013] In an exemplary embodiment of the present disclosure, after caching the model to be cached corresponding to the first application with the greatest cache value, the method further includes: obtaining a common model between the first application with the greatest cache value and the remaining first applications; the remaining first applications are the first applications other than the first application with the greatest cache value; and updating the model to be cached corresponding to the remaining first applications according to the common model.
[0014] In an exemplary embodiment of the present disclosure, after caching the to-be-cached model corresponding to the first application with the greatest cache value, the method further includes: determining the current remaining capacity of the edge server based on the difference between the remaining capacity of the edge server and the data volume of the to-be-cached model corresponding to the first application with the greatest cache value.
[0015] In an exemplary embodiment of the present disclosure, after determining the current remaining capacity of the edge server, the method further includes: selecting a second application from the remaining first applications based on the amount of data of the models to be cached corresponding to the remaining first applications and the current remaining capacity; obtaining the cache value of the models to be cached corresponding to each of the second applications; and caching the models to be cached corresponding to the second application with the largest cache value.
[0016] In an exemplary embodiment of the present disclosure, a second application is selected from the remaining first applications in the following manner: the data volume of the to-be-cached model corresponding to the remaining first applications is compared with the current remaining capacity, and the application whose data volume is smaller than the current remaining capacity is determined as the second application.
[0017] According to a second aspect of the present disclosure, a model caching device based on mobile edge computing is provided, including: an application selection module, used to select a first application from multiple applications according to the data volume of the models to be cached corresponding to each application and the remaining capacity of the edge server; the models to be cached are artificial intelligence models that are not cached in the edge server; a cache value calculation module, used to obtain the cache value of the models to be cached corresponding to each of the first applications; a model caching module, used to cache the models to be cached corresponding to the first application with the largest cache value.
[0018] According to a third aspect of the present disclosure, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the model caching method based on mobile edge computing described in the first aspect is implemented.
[0019] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the model caching method based on mobile edge computing described in the first aspect above by executing the executable instructions.
[0020] It can be seen from the above technical solutions that the model caching method based on mobile edge computing, the model caching device based on mobile edge computing, the computer storage medium and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0021] In the technical solutions provided in some embodiments of the present disclosure, on the one hand, according to the data volume of the to-be-cached models corresponding to each application and the remaining capacity of the edge server, a first application is selected from multiple applications, and the cache value of the to-be-cached models corresponding to each of the first applications is obtained, which can solve the problem of directly calculating the cache value of the to-be-cached models corresponding to all applications, while the MEC server cannot fully accommodate the to-be-cached models corresponding to individual applications (i.e., resulting in invalid calculations in the early stage), saving the server's computing resources and improving the subsequent data processing speed. On the other hand, caching the to-be-cached models corresponding to the first application with the largest cache value can achieve reasonable configuration of the cache space of the MEC server, reduce the operating costs of MEC operators, and improve the operating income of MEC operators.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0024] Figure 1 An architecture diagram of a model caching system based on mobile edge computing in an embodiment of the present disclosure is shown;
[0025] Figure 2 A flow chart of a model caching method based on mobile edge computing in an embodiment of the present disclosure is shown;
[0026] Figure 3 A schematic diagram showing a process of selecting a first application from applications in an embodiment of the present disclosure is shown;
[0027] Figure 4 A schematic diagram showing a process of updating the to-be-cached models corresponding to the remaining first applications in an embodiment of the present disclosure is shown;
[0028] Figure 5 The overall flow chart of the model caching method based on mobile edge computing in the embodiment of the present disclosure is shown;
[0029] Figure 6 A schematic diagram showing the structure of a model caching device based on mobile edge computing in an exemplary embodiment of the present disclosure is shown;
[0030] Figure 7 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0032] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0034] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems.
[0035] refer to Figure 1 , Figure 1 The architecture diagram of the model caching system based on mobile edge computing in the embodiment of the present disclosure is shown. Figure 1 The system includes user terminals, MEC servers, and cloud servers. The user terminal is the device at the outermost edge of the computer network, which is mainly used for inputting user information and outputting processing results. The MEC server is used to cache the required AI models and run the AI models. The cloud server is used to store all AI models that may be used by AI applications and run the AI models.
[0036] Specifically, users use different applications through user terminals. Each application initiates a request to use the AI model to the MEC server. After the MEC server receives the request, it first checks whether the requested AI model already exists in the local memory. If it exists in the local memory, the MEC server can directly run the AI model. Each time a user uses an AI application i, he needs to pay the operator of the MEC cache service v i If it does not exist in the local memory, the MEC server needs to request the cloud server to run the AI model to respond to the user's usage request. At this time, each time the user uses the AI application i, he needs to pay the operator of the MEC cache service v i , and the MEC cache service operator also needs to pay a certain fee to the cloud serveri Therefore, the revenue of MEC operators will be reduced, and the more frequently the AI application is used, the more its revenue will be reduced.
[0037] In the embodiments of the present disclosure, a model caching method based on mobile edge computing is first provided, which at least to a certain extent overcomes the problem in the related art that the cache space of the MEC server cannot be reasonably configured, resulting in operating costs.
[0038] Figure 2 A flow chart of a model caching method based on mobile edge computing in an embodiment of the present disclosure is shown. The execution subject of the model caching method based on mobile edge computing may be an edge server that caches the model.
[0039] refer to Figure 2 According to an embodiment of the present disclosure, a model caching method based on mobile edge computing includes the following steps:
[0040] Step S210, selecting a first application from multiple applications according to the data volume of the to-be-cached model corresponding to each application and the remaining capacity of the edge server; the to-be-cached model is an artificial intelligence model that has not been cached in the edge server;
[0041] Step S220, obtaining the cache value of the to-be-cached model corresponding to each first application;
[0042] Step S230 , caching the to-be-cached model corresponding to the first application with the greatest cache value.
[0043] exist Figure 2 In the technical solution provided by the illustrated embodiment, on the one hand, according to the data volume of the to-be-cached models corresponding to each application and the remaining capacity of the edge server, the first application is selected from multiple applications, and the cache value of the to-be-cached models corresponding to each first application is obtained, which can solve the problem of directly calculating the cache value of the to-be-cached models corresponding to all applications, while the MEC server cannot fully accommodate the to-be-cached models corresponding to individual applications (i.e., resulting in invalid calculations in the early stage), saving the server's computing resources and improving the subsequent data processing speed. On the other hand, caching the to-be-cached models corresponding to the first application with the largest cache value can realize the reasonable configuration of the cache space of the MEC server, reduce the operating costs of MEC operators, and improve the operating income of MEC operators.
[0044] In step S210, a first application is selected from the applications according to the data amount of the to-be-cached models corresponding to each application.
[0045] In this step, AI applications provide speech recognition, vision, decision logic, and other intelligent functions that simulate human factors.
[0046] Artificial intelligence models are artificial intelligence models used to support AI applications. Models are essentially algorithms. For example, the normal operation of WeChat Pay requires the support of face recognition models, the normal operation of Alipay requires the support of face recognition models, and the normal operation of navigation software requires the support of path planning models.
[0047] The models to be cached corresponding to the application are all artificial intelligence models that need to be called during the normal operation of the application and are not cached in the above edge servers but stored in the cloud server. For example, if the normal operation of the application app requires the support of models 1, 2, 3, and 4, and model 1 has been cached in the MEC server, and models 2, 3, and 4 are stored in the cloud server, then models 2, 3, and 4 can be determined as the models to be cached corresponding to the above application app.
[0048] The data volume of the models to be cached is the memory size occupied by all the models to be cached. For example, the data volume corresponding to a telegram may be 100 bytes (commonly used as a unit of measurement for computer information, regardless of the data type, one byte represents eight bits), and the data volume corresponding to a page of a book may be 10KB (kilobytes, often written as kB, KB or K, is an information measurement unit, nowadays usually used to indicate the storage capacity of storage media with general capacity such as memory).
[0049] Furthermore, refer to Figure 3 , Figure 3 A schematic diagram of a process of selecting a first application from applications in an embodiment of the present disclosure is shown, including steps S301 and S302:
[0050] In step S301, the data volume of the to-be-cached model corresponding to each application is compared with the remaining capacity of the edge server.
[0051] In this step, the data volume of the to-be-cached model corresponding to each application may be compared with the remaining capacity of the edge server, and the first application having a data volume smaller than the remaining capacity may be screened out.
[0052] In step S302, an application whose data volume of the model to be cached is smaller than the remaining capacity is determined as the first application.
[0053] In this step, the remaining capacity of the edge server is taken as Ω1 as an example. Referring to the relevant explanations of the above steps, it can be seen that if the sum of the data volumes of models 2, 3, and 4 to be cached is less than the remaining capacity Ω1, the above application app can be determined as the first application.
[0054] After determining the first application, then refer to Figure 2 In step S220, the cache value of the to-be-cached model corresponding to each first application is obtained.
[0055] In this step, the cache value of the to-be-cached model corresponding to each first application i may be calculated based on the following formula 1:
[0056]
[0057] Wherein, i represents any first application, represents the cache value of the model to be cached corresponding to the first application i; f represents the usage fee of the model (the usage fee charged per KB model can be
[0058] It can be set according to the actual situation, and this disclosure does not make any special restrictions on this); A collection representing a first application;
[0059] P k represents the historical usage data of each first application (for example, it has been used 2,000 times in the past three months, which can be set according to actual conditions, and the present disclosure does not make any special restrictions on this); j represents each artificial intelligence model; represents the set of models to be cached corresponding to the first application i; M k represents a set of models to be cached corresponding to each first application; S j Indicates the amount of data for each model to be cached.
[0060] Specifically, referring to Table 1 and Table 2 below, assuming that the set of the first application There are three first applications (x, y, z) in total, and the set of models to be cached corresponding to the first applications is expressed as For example, the model j required for x is 1 and 2, the model j required for y is 1, 2, and 3, and the model j required for z is 4 and 5. The data volume corresponding to model 1 is S1, the data volume corresponding to model 2 is S2, the data volume corresponding to model 3 is S3, the data volume corresponding to model 4 is S4, and the data volume corresponding to model 5 is S5:
[0061] Table 1
[0062] Application x y z Model J 1,2 1,2,3 4,5 Use times P <![CDATA[P x ]]> <![CDATA[P y ]]> <![CDATA[P z ]]>
[0063] Table 2
[0064] Model J 1 2 3 4 5 <![CDATA[Big S and Little S j > <![CDATA[S1]]> <![CDATA[S2]]> <![CDATA[S3]]> <![CDATA[S4]]> <![CDATA[S5]]>
[0065] In the first round of processing, the cache value of the to-be-cached model corresponding to each first application can be calculated, specifically:
[0066] For the first application x, then i=x, M k ={M x , M y, ,M z}, P k = {P x , P y , P z}, so when M k Take M x When When M k Take M y When When M k Take M z When Therefore, based on the following formula 2, the cache value of the to-be-cached model corresponding to the first application x can be determined as:
[0067]
[0068]
[0069] For the first application y, then i=y, M k ={M x ,M y ,M z}, P k = {P x ,P y ,P z}, so when M k Take M x When When M k Take M y When When M k Take M z When Further, based on the following formula 3, the cache value of the to-be-cached model corresponding to the first application y can be determined as:
[0070]
[0071] For the first application z, then i=z, M k ={M x ,M y ,M z}, P k = {P x ,P y ,P z}, so when M k Take M z When When M k Take M y When When M k Take M z When Further, based on the following formula 4, the cache value of the to-be-cached model corresponding to the first application y can be determined as:
[0072]
[0073] Next reference Figure 2 In step S230, the to-be-cached model corresponding to the first application with the greatest cache value is cached.
[0074] In this step, referring to the relevant explanations of the above steps, the cache model corresponding to the first application with the greatest cache value can be cached. Furthermore, the current capacity of the MEC server can be subtracted from the data volume of the cache model corresponding to the first application with the greatest cache value to obtain the current remaining capacity of the MEC server. At the same time, the first application with the greatest cache value can also be removed from the set corresponding to the first application to obtain the remaining first application.
[0075] After caching the to-be-cached model corresponding to the first application with the greatest cache value, it can be determined whether the to-be-cached model corresponding to the first application with the greatest cache value has a common model with the to-be-cached models corresponding to the remaining other first applications (if there is no common model, there is no need to update the to-be-cached models corresponding to the remaining first applications). If there is a common model, the to-be-cached models corresponding to the remaining first applications need to be updated. For details, refer to Figure 4 , Figure 4 A schematic diagram of a process of updating the cached model corresponding to the remaining first application in an embodiment of the present disclosure is shown, including steps S401 and S402:
[0076] In step S401, a shared model between the first application with the greatest cache value and the remaining first applications is obtained.
[0077] In this step, it can be determined whether the to-be-cached model corresponding to the first application with the greatest cache value has a common model with the to-be-cached models corresponding to the remaining first applications (the remaining first applications are the first applications other than the first application with the greatest cache value).
[0078] In step S402, the to-be-cached models corresponding to the remaining first applications are updated according to the shared model.
[0079] In this step, the shared model may be removed from the models to be cached corresponding to the remaining first applications to update the models to be cached corresponding to the remaining first applications.
[0080] Specifically, taking the first application z with the largest cache value as an example, it can be determined that there is no common model between the first application z and the cached models corresponding to the remaining first applications, so the set of first applications There are two first applications (x, y) in total. The model to be cached corresponding to x is {1, 2}, and the model to be cached corresponding to y is {1, 2, 3}. For details, refer to Table 3-Table 4:
[0081] Table 3
[0082] Application x y Model J 1,2 1,2,3 Use times P <![CDATA[p x ]]> <![CDATA[p y ]]>
[0083] Table 4
[0084] Model J 1 2 3 Data volume <![CDATA[S1]]> <![CDATA[S2]]> <![CDATA[S3]]>
[0085] In an optional implementation manner, the specific processing process for the existence of a shared model is described below:
[0086] Assuming that the cache value of the model to be cached corresponding to the first application z is the largest, the model to be cached corresponding to the first application z can be cached in the MEC server. At the same time, it can be determined that there is no shared model between the first application z and the remaining first applications x and y. At the same time, the first application z can also be removed from the set corresponding to the first application to update it.
[0087] Furthermore, the remaining capacity of the MEC server may be used to subtract the amount of data of the model to be cached corresponding to the first application z from the remaining capacity of the MEC server to determine the current remaining capacity of the MEC server, which is described using Ω2 as an example.
[0088] Furthermore, it is possible to detect whether the amount of data of the model to be cached corresponding to the first application x is less than or equal to the above Ω2. If so, the first application x is determined as the second application participating in the second round of iteration process; and to detect whether the amount of data of the model to be cached corresponding to the first application y is less than or equal to the above Ω2. If so, the first application y is determined as the second application participating in the second round of iteration process.
[0089] Furthermore, for the second application x, i=x, M k ={M x , M y}, P k = {P x , P y}, so when M k Take M x When When M k Take M y When Further, based on the following formula 5, the cache value of the to-be-cached model corresponding to the second application x can be determined as:
[0090]
[0091] For the second application y, then i=y, M k ={M x ,M y}, P k = {P x ,P y}, so when M k Take M x When When M k Take M y When Further, based on the following formula 6, the cache value of the to-be-cached model corresponding to the second application y can be determined as:
[0092]
[0093] After calculating the cache value of the models to be cached corresponding to each second application, the second application with the highest cache value can be selected and its corresponding model to be cached can be cached in the MEC server.
[0094] In another optional implementation, the specific processing process for the existence of a shared model is described below: Assuming that the cache value of the model to be cached corresponding to the first application x is the largest, the model to be cached corresponding to the first application x can be cached in the MEC server. At the same time, it can be determined that there is no shared model between the first application x and the remaining first applications y and z. At this time, the first application x can also be removed from the set corresponding to the first application to update it. Thus, it can be determined that the shared model between the first application x and the remaining first application y is 1,2,
[0095] Therefore, the updated cache model of the first application y is 3, so the set of the first application There are two first applications (y, z) in total. The model to be cached corresponding to y is {3}, and the model to be cached corresponding to z is {4,5}. For details, refer to Table 5-Table 6:
[0096] Table 5
[0097] Application y z Model J 3 4,5 Use times P <![CDATA[p y ]]> <![CDATA[p z ]]>
[0098] Table 6
[0099] Model J 3 4 5 Data volume <![CDATA[S3]]> <![CDATA[S4]]> <![CDATA[S5]]>
[0100] Furthermore, the remaining capacity of the MEC server may be used to subtract the amount of data of the model to be cached corresponding to the first application x from the remaining capacity of the MEC server to determine the current remaining capacity of the MEC server, which is described using Ω2 as an example.
[0101] Further, it is possible to detect whether the data amount of the model to be cached corresponding to the first application y (the data amount of 3) is less than or equal to the above Ω2. If so, the first application y is determined as the second application participating in the second round of iteration process; and, it is possible to detect whether the data amount of the model to be cached corresponding to the first application z (the total data amount of 4 and 5) is less than or equal to the above Ω2. If so, the first application z is determined as the second application participating in the second round of iteration process.
[0102] Thus, for the second application y, i=y, M k ={M y , M z}, P k = {P y , P z}, so when M k Take M y When When M k Take M z When Further, based on the following formula 7, the cache value of the to-be-cached model corresponding to the second application y can be determined as:
[0103]
[0104] For the second application z, then i=z, M k ={M y , M z}, P k = {P y , P z}, so when M k Take M y When When M k Take M z When Further, based on the following formula 8, the cache value of the to-be-cached model corresponding to the second application z can be determined as:
[0105]
[0106] After calculating the cache value of the models to be cached corresponding to each second application, the second application with the highest cache value can be selected and its corresponding model to be cached can be cached in the MEC server.
[0107] Afterwards, it can be determined whether there is a common model between the second application with the highest cache value and the remaining second applications. If there is a common model, it is necessary to remove each public model from the cached models corresponding to the remaining second applications to update the cached models of the remaining second applications.
[0108] Furthermore, the current remaining capacity of the MEC server can be updated, and combined with the data volume of the models to be cached corresponding to the remaining second applications, the above-mentioned application selection can be executed in a loop, and the cache value corresponding to the application can be calculated. The models to be cached corresponding to the application with the largest cache value can be cached until there is insufficient available capacity in the MEC server.
[0109] Therefore, the present disclosure provides a new solution for measuring the cache value of the to-be-cached model corresponding to the application, which can give priority to caching models with high cache value while taking into account the limited memory space of the MEC server. Furthermore, if it is detected that the MEC server still has sufficient available space, the model with higher cache value is selected again from the remaining models and cached until there is not enough available space in the MEC server, so as to realize reasonable configuration of the cache space of the MEC server, reduce the operating cost of the MEC operator, and improve the operating income of the MEC operator.
[0110] Figure 5 The overall flow chart of the model caching method based on mobile edge computing in the embodiment of the present disclosure is shown, including steps S501 to S507:
[0111] In step S501, start;
[0112] In step S502, it is determined whether there are applications whose partial or complete AI models are not cached in the MEC server;
[0113] If not, jump to step S507 and end;
[0114] If yes, jump to step S503 to calculate the data volume of the model to be cached corresponding to each application;
[0115] In step S504, an application whose data volume is not greater than the remaining capacity of the MEC server is selected as the first application;
[0116] In step S505, the cache value of the to-be-cached model corresponding to each first application is calculated;
[0117] In step S506, the to-be-cached model corresponding to the first application with the greatest cache value is cached.
[0118] The above steps are executed in a loop until all AI models required by the applications are cached in the MEC server, or there is insufficient cache space in the MEC server, and then the process jumps to step S507 and ends.
[0119] The present disclosure also provides a model caching device based on mobile edge computing, Figure 6 A schematic diagram of the structure of a model cache device based on mobile edge computing in an exemplary embodiment of the present disclosure is shown; Figure 5 As shown, the model caching device 600 based on mobile edge computing may include an application selection module 610, a cache value calculation module 620 and a model caching module 630. Among them:
[0120] The application selection module 610 is used to select a first application from multiple applications according to the data volume of the to-be-cached model corresponding to each application and the remaining capacity of the edge server; the to-be-cached model is an artificial intelligence model that is not cached in the edge server;
[0121] A cache value calculation module 620, used to obtain the cache value of the to-be-cached model corresponding to each first application;
[0122] The model caching module 630 is used to cache the to-be-cached model corresponding to the first application with the greatest cache value.
[0123] In an exemplary embodiment of the present disclosure, the application selection module 610 is configured to:
[0124] The first application is selected from the multiple applications in the following manner: the data volume of the to-be-cached model corresponding to each application is compared with the remaining capacity of the edge server, and the application whose data volume of the to-be-cached model is smaller than the remaining capacity is determined as the first application.
[0125] In an exemplary embodiment of the present disclosure, the cache value calculation module 620 is configured to:
[0126] The cache value of the to-be-cached model corresponding to each of the first applications is determined by the following formula:
[0127]
[0128] Wherein, i represents any first application, represents the cache value of the model to be cached corresponding to the first application i; f represents the unit usage fee of the model; represents a set of the first applications;
[0129] P k represents the historical usage data of each of the first applications; j represents each of the artificial intelligence models; represents the set of models to be cached corresponding to the first application i; M k represents a set of to-be-cached models corresponding to each of the first applications; S j Indicates the data volume of each model to be cached.
[0130] In an exemplary embodiment of the present disclosure, after caching the to-be-cached model corresponding to the first application with the greatest cache value, the model caching module 630 is configured as follows:
[0131] Obtain a shared model between the first application with the greatest cache value and the remaining first applications; and update the to-be-cached models corresponding to the remaining first applications according to the shared model.
[0132] In an exemplary embodiment of the present disclosure, the model cache module 630 is configured to:
[0133] The current remaining capacity of the edge server is determined according to the difference between the remaining capacity of the edge server and the data volume of the to-be-cached model corresponding to the first application with the greatest cache value.
[0134] In an exemplary embodiment of the present disclosure, the model cache module 630 is configured to:
[0135] After determining the current remaining capacity of the edge server, select a second application from the remaining first applications based on the data volume of the models to be cached corresponding to the remaining first applications and the current remaining capacity; obtain the cache value of the models to be cached corresponding to each of the second applications; and cache the models to be cached corresponding to the second application with the largest cache value.
[0136] In an exemplary embodiment of the present disclosure, the model cache module 630 is configured to:
[0137] The second application is selected from the remaining first applications in the following manner: the data volume of the to-be-cached model corresponding to the remaining first applications is compared with the current remaining capacity, and the application whose data volume is smaller than the current remaining capacity is determined as the second application.
[0138] The specific details of each module in the above-mentioned model caching device based on mobile edge computing have been described in detail in the corresponding model caching method based on mobile edge computing, so they will not be repeated here.
[0139] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0140] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0141] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0142] The present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.
[0143] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0144] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0145] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.
[0146] In addition, an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.
[0147] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0148] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0149] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0150] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can perform the following steps: Figure 2 As shown in: Step S210, selecting a first application from multiple applications according to the data volume of the models to be cached corresponding to each application and the remaining capacity of the edge server; Step S220, obtaining the cache value of the models to be cached corresponding to each of the first applications; Step S230, caching the models to be cached corresponding to the first application with the largest cache value.
[0151] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0152] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0153] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0154] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0155] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A model caching method based on mobile edge computing, applied to an edge server, characterized in that: include: According to the data volume of the to-be-cached model corresponding to each application and the remaining capacity of the edge server, the data volume of the to-be-cached model corresponding to each application is compared with the remaining capacity of the edge server, and the application whose data volume of the to-be-cached model is less than the remaining capacity is determined as the first application selected; the to-be-cached model is an artificial intelligence model that is not cached in the edge server; Determine the cache value of the model to be cached corresponding to any one of the first applications according to the usage fee of the model, the historical usage data of any one of the first applications, the set of models to be cached corresponding to any one of the first applications, the set of models to be cached corresponding to each of the first applications contained in the set of the first applications, and the data volume of each of the models to be cached, so as to obtain the cache value of the models to be cached corresponding to each of the first applications; The to-be-cached model corresponding to the first application with the greatest cache value is cached.
2. The method according to claim 1, characterized in that: The cache value of the model to be cached corresponding to any one of the first applications is determined by the following formula: Wherein, i represents any first application, represents the cache value of the model to be cached corresponding to any one of the first applications i; f represents the usage fee of the model; represents a set of the first applications; P k represents the historical usage data of each of the first applications; j represents each of the artificial intelligence models; represents a set of models to be cached corresponding to any one of the first applications i; M k represents a set of to-be-cached models corresponding to each of the first applications; S j Indicates the data volume of each model to be cached.
3. The method according to claim 1 or 2, characterized in that: After caching the to-be-cached model corresponding to the first application with the greatest cache value, the method further includes: Acquire a shared model between the first application with the largest cache value and the remaining first applications; the remaining first applications are first applications other than the first application with the largest cache value; According to the shared model, the to-be-cached models corresponding to the remaining first applications are updated.
4. The method according to claim 3, characterized in that After caching the to-be-cached model corresponding to the first application with the greatest cache value, the method further includes: The current remaining capacity of the edge server is determined according to the difference between the remaining capacity of the edge server and the data volume of the to-be-cached model corresponding to the first application with the greatest cache value.
5. The method according to claim 4, characterized in that After determining the current remaining capacity of the edge server, the method further includes: Selecting a second application from the remaining first applications according to the amount of data of the to-be-cached model corresponding to the remaining first applications and the current remaining capacity; Obtaining the cache value of the to-be-cached model corresponding to each of the second applications; The to-be-cached model corresponding to the second application with the greatest cache value is cached.
6. The method according to claim 5, characterized in that Select the second application from the remaining first applications in the following manner: The data volume of the to-be-cached model corresponding to the remaining first application is compared with the current remaining capacity, and the application whose data volume is smaller than the current remaining capacity is determined as the second application.
7. A model caching device based on mobile edge computing, characterized in that: include: An application selection module, for comparing the data volume of the to-be-cached model corresponding to each application with the remaining capacity of the edge server according to the data volume of the to-be-cached model corresponding to each application and the remaining capacity of the edge server, and determining an application whose data volume of the to-be-cached model is less than the remaining capacity as the first application to be selected; the to-be-cached model is an artificial intelligence model that is not cached in the edge server; a cache value calculation module, for determining the cache value of the model to be cached corresponding to any one of the first applications according to the usage fee of the model, the historical usage data of any one of the first applications, the set of models to be cached corresponding to any one of the first applications, the set of models to be cached corresponding to each of the first applications contained in the set of the first applications, and the data volume of each of the models to be cached, so as to obtain the cache value of the model to be cached corresponding to each of the first applications; The model caching module is used to cache the to-be-cached model corresponding to the first application with the greatest cache value.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the model caching method based on mobile edge computing described in any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the model caching method based on mobile edge computing as described in any one of claims 1 to 6 by executing the executable instructions.
