Electronic device for providing artificial intelligence service through container prediction on basis of serverless platform, and operating method thereof
The electronic device optimizes resource allocation and execution times in serverless computing by using container prediction based on function execution patterns, addressing inefficiencies in container-based systems and enhancing AI service delivery.
Patent Information
- Application Number
- PCT/KR2025/008750
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-09-12
- Filing Date
- 2025-06-24
- Publication Date
- 2026-01-02
AI Technical Summary
Container-based computing systems face inefficiencies in resource allocation and execution time due to the variability of resource needs based on user requests, leading to wasted or insufficient resources and prolonged function execution times.
An electronic device provides artificial intelligence services through a serverless platform by utilizing container prediction based on function execution patterns to efficiently create and manage containers, optimizing resource allocation and execution.
This approach enhances resource utilization, reduces response and execution times, and enables effective monitoring of function execution in a serverless computing environment.
Smart Images

Figure KR2025008750_02012026_PF_FP_ABST
Abstract
Description
Electronic device providing artificial intelligence service through container prediction based on serverless platform and its operation method
[0001] Various embodiments disclosed in this document relate to an electronic device and its operating method that provides an artificial intelligence service through container prediction based on a serverless platform.
[0002] Recently, with the development of cloud computing technology, container-based computing technology and serverless-based computing technology are also developing.
[0003] In serverless computing technology, all the basic environments, such as programs, networks, and storage, required for developing / running specific applications are provided as a service, so developers do not need to separately build computer servers (virtual servers, web servers) or add or manage resources, such as operating systems (OSs) and memory.
[0004] In particular, interest is growing in technologies that combine container-based computing technology with AI technology to provide AI services (Artificial Intelligence Services) in container-based computing environments. For example, various services that analyze or generate images using AI models are being offered in container-based computing environments.
[0005] The above information may be provided as background information to aid in understanding the present disclosure. No claim or determination is made as to whether any of the above is applicable as prior art in connection with the present disclosure.
[0006] Traditionally, container-based computing systems have struggled to appropriately allocate resources in response to requests for function executions requiring diverse resources. For example, even though the amount of resources required varied depending on the type of service requested by the user, the same resources were allocated, resulting in wasted or insufficient resources.
[0007] Furthermore, in the past, container-based computing systems created a container and executed the function if a container corresponding to the function did not exist. Therefore, container-based computing systems created a container and then executed the function, which caused a significant amount of time to be required for the function to be executed. Furthermore, if the number of containers created when a container corresponding to the requested function did not exist exceeded a preset value, the existing container had to be deleted and a new container had to be created before the function could be executed, which caused a significant amount of time to be required.
[0008] According to various embodiments disclosed in this document, artificial intelligence services can be provided while efficiently utilizing resources in a serverless computing system environment.
[0009] According to various embodiments disclosed in this document, response time, execution time, etc. can be increased for a function execution request in a computing system environment.
[0010] According to various embodiments disclosed in this document, it is possible to monitor function execution in a computing system environment.
[0011] According to various embodiments, an electronic device providing an artificial intelligence service based on a serverless platform may include a communication circuit for transmitting and receiving signals with a user device, at least one processor, and a memory for storing instructions. The instructions may be individually or collectively executed by the at least one processor so that the electronic device obtains container prediction information related to container creation and container deletion (kill) based on function execution pattern information, creates at least one container for a user execution environment related to the user device based on the container prediction information, and, when a request for a first artificial intelligence service is received from the user device through the communication circuit, obtains a first function corresponding to the first artificial intelligence service, selects a first container for providing the first artificial intelligence service from among the at least one container, and executes the first function through a library loaded in the first container to provide the first artificial intelligence service to the user device.
[0012] According to various embodiments, an operating method of an electronic device providing an artificial intelligence service based on a serverless platform may include an operation of obtaining container prediction information related to container creation and container deletion (kill) based on function execution pattern information, an operation of creating at least one container for a user execution environment related to the user device based on the container prediction information, an operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit, an operation of selecting a first container for providing the first artificial intelligence service among the at least one container, and an operation of executing the first function through a library loaded in the first container to provide the artificial intelligence service to the user device.
[0013] According to various embodiments, a recording medium may include a computer-readable recording medium having recorded thereon a program for executing an operation of obtaining container prediction information related to container creation and container deletion (kill) based on function execution pattern information, an operation of creating at least one container for a user execution environment related to the user device based on the container prediction information, an operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit, an operation of selecting a first container to provide the first artificial intelligence service from among the at least one container, and an operation of executing the first function through a library loaded into the first container to provide the artificial intelligence service to the user device.
[0014] Electronic devices according to various embodiments disclosed in this document can provide artificial intelligence services while efficiently utilizing resources in a serverless computing system environment.
[0015] An electronic device according to various embodiments disclosed in this document can speed up response time, execution time, etc., for a function execution request in a computing system environment.
[0016] An electronic device according to various embodiments disclosed in this document can monitor function execution in a computing system environment.
[0017] In addition, various effects may be provided, either directly or indirectly, through this document.
[0018] Figure 1 is a diagram illustrating a system that provides artificial intelligence services based on a serverless platform.
[0019] Figure 2 is a block diagram showing the configuration of a system that provides artificial intelligence services.
[0020] FIG. 3 is a block diagram of an electronic device according to various embodiments.
[0021] FIG. 4 is a flowchart illustrating an operation of an electronic device allocating resources based on resource prediction information according to various embodiments.
[0022] FIG. 5 is a diagram illustrating an electronic device according to various embodiments obtaining resource prediction information using a resource prediction model.
[0023] FIG. 6 is a flowchart illustrating an operation of an electronic device reallocating resources based on resource usage information according to various embodiments.
[0024] FIG. 7 is a flowchart illustrating an operation of an electronic device allocating resources when execution of an algorithm obtained through a first service is requested according to various embodiments.
[0025] FIG. 8 is a flowchart illustrating an operation of an electronic device according to various embodiments to create a user execution environment based on resource recommendation information.
[0026] FIG. 9 is a flowchart illustrating an operation of an electronic device generating at least one container based on container prediction information according to various embodiments.
[0027] FIG. 10 is a diagram illustrating an electronic device according to various embodiments creating a container and executing a function in response to a function execution request.
[0028] FIG. 11 is a diagram illustrating an electronic device deleting a container based on container prediction information according to various embodiments.
[0029] FIG. 12 is a flowchart illustrating an operation of an electronic device according to various embodiments to obtain container prediction information based on user history information.
[0030] FIG. 13 is a diagram illustrating an electronic device according to various embodiments obtaining container prediction information using a container prediction model.
[0031] FIG. 14 is a flowchart illustrating an operation of an electronic device according to various embodiments to execute a function through a plurality of sub-functions based on container status information.
[0032] FIG. 15 is a diagram illustrating an electronic device according to various embodiments executing a function through a plurality of sub-functions based on container status information.
[0033] FIG. 16 is a flowchart illustrating an operation of an electronic device according to various embodiments to determine whether a container has been created based on predicted generation information.
[0034] FIG. 17 is a diagram illustrating an electronic device according to various embodiments executing a function based on prediction generation information and container status information.
[0035] FIG. 18 is a flowchart illustrating an operation of an electronic device selecting a container for executing a function according to various embodiments.
[0036] FIG. 19 is a flowchart illustrating an operation of an electronic device re-requesting container creation according to various embodiments.
[0037] FIG. 20 is a flowchart illustrating an operation of an electronic device monitoring the execution of a function based on a monitoring execution environment according to various embodiments.
[0038] FIG. 21 is a flowchart illustrating an operation of creating a monitoring execution environment when an electronic device executes a function acquired based on a first service according to various embodiments.
[0039] Figure 22 is a diagram illustrating a first monitoring environment by a container engine generated based on the operating system of a user device.
[0040] Figure 23 is a diagram illustrating a second monitoring environment created based on an operating system separate from the operating system of the user device.
[0041] FIG. 24 is a flowchart illustrating an operation of an electronic device transmitting a diagnostic report to a user device according to various embodiments.
[0042] In connection with the description of the drawings, the same or similar reference numerals may be used for identical or similar components.
[0043] Specific structural or functional descriptions of various embodiments are merely illustrative for the purpose of explaining the various embodiments, and the various embodiments may be implemented in various forms and should not be construed as limited to the embodiments described in this specification or application.
[0044] Since various embodiments may have various modifications and take various forms, various embodiments are illustrated in the drawings and described in detail in this specification or application. However, the matters disclosed in the drawings are not intended to specify or limit the various embodiments, and should be understood to include all modifications, equivalents, and alternatives included within the spirit and technical scope of the various embodiments.
[0045] While terms such as "first" and / or "second" may be used to describe various components, these components should not be limited by these terms. These terms are only intended to distinguish one component from another; for example, without departing from the scope of the present disclosure, a first component may be referred to as a "second component," and similarly, a second component may also be referred to as a "first component."
[0046] When a component is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components in between. Conversely, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that there are no other components in between. Other expressions that describe the relationship between components, such as "between" and "directly between" or "adjacent to" and "directly adjacent to", should be interpreted similarly.
[0047] In addition, the “information” described below may be interpreted to mean “data” or “signal,” and “data” may be understood as a concept that includes both analog data and digital data.
[0048] The terminology used herein is for the purpose of describing specific embodiments only and is not intended to limit the various embodiments. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this specification, it should be understood that the terms "comprises" or "has" specify the presence of a described feature, number, step, operation, component, part, or combination thereof, but do not exclude in advance the presence or possibility of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0049] Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by those of ordinary skill in the art to which this disclosure pertains. Terms defined in commonly used dictionaries should be interpreted to have a meaning consistent with their meaning in the context of the relevant technology, and will not be interpreted in an idealized or overly formal sense unless explicitly defined herein.
[0050] Hereinafter, the present disclosure will be described in detail by describing preferred embodiments of the present disclosure with reference to the attached drawings. The same reference numerals presented in each drawing represent the same components.
[0051]
[0052] Figure 1 is a diagram illustrating a system that provides artificial intelligence services based on a serverless platform.
[0053] Referring to Fig. 1, a system (1) providing artificial intelligence service is illustrated.
[0054] According to various embodiments, a system (1) providing an artificial intelligence service may include at least one of an artificial intelligence service server (100), a first user device (110), a second user device (120), or a third user device (130).
[0055] According to one embodiment, the system (1) providing the artificial intelligence service is a system that provides various cloud computing services, including SaaS (Software as a Service) and various forms of aaS (Anything as a Service), and a serverless cloud computing method is included as one of them. Serverless cloud computing is a method that responds to events by executing code, allowing users to use services without having to directly manage infrastructure and platforms. Here, the expression serverless does not mean that there is no server, but refers to an environment in which users do not have to manage infrastructure. The system (1) according to one embodiment can provide various aaS forms of cloud services, such as FaaS (Function as a Service) in which users can receive specific functions as services, as well as SaaS in which users can receive software in the form of services.
[0056] For example, system (1) according to one embodiment can support the implementation of event-driven, responsive services without requiring users to worry about managing individual servers, through FaaS, which automatically executes code at the functional level when an event occurs. Various aaS models encompass multiple layers of services, from infrastructure management to software provisioning, depending on the level of service required by the user, and can enable flexible expansion in a cloud environment.
[0057] According to various embodiments, the artificial intelligence service server (100) may provide an artificial intelligence service to at least one of a first user device (110), a second user device (120), or a third user device (130). In the present disclosure, the artificial intelligence service is a service provided to at least one of the first user device (110), the second user device (120), or the third user device (130) through the artificial intelligence service server (100), and specifically, may refer to all services provided to at least one of the first user device (110), the second user device (120), or the third user device (130) using an artificial intelligence model included in the artificial intelligence service server (100).
[0058] According to various embodiments, the artificial intelligence service of the present disclosure may include at least one of a first service that receives an algorithm from a first user device (110) and generates an artificial intelligence model, a second service that obtains various data sets usable for training an artificial intelligence model from a second user device (120), and a third service that executes various artificial intelligence models stored in a database and provides result values upon a request from a third user device (130).
[0059] According to one embodiment, the third service may be any one of services that provides an appropriate service to a third user device (130) by using an artificial intelligence model that performs functions such as natural language processing, machine translation, a dialogue system, question answering, speech recognition / synthesis, object recognition, object tracking, image search, person recognition, scene understanding, spatial understanding, image enhancement, knowledge / probability-based reasoning, optimization prediction, preference-based planning, recommendation, knowledge building (data creation / classification), knowledge management (data utilization), knowledge building (data creation / classification), knowledge management (data utilization), etc.
[0060] For example, the artificial intelligence service server (100) may obtain a request related to video generation through a prompt from a third user device (130), obtain a video using at least one artificial intelligence model stored in a database based on the request related to video generation, and provide the obtained video to the third user device (130). At this time, the at least one artificial intelligence model may be an artificial intelligence model generated based on an algorithm obtained from the first user device (110) and / or an artificial intelligence model stored in the artificial intelligence service server (100).
[0061] According to various embodiments, the artificial intelligence service server (100) may, based on an artificial intelligence service request obtained from at least one of a first user device (110), a second user device (120), and a third user device (130), execute a function stored in a database (not shown) and provide the obtained result value to the device that requested the artificial intelligence service. For example, the artificial intelligence service server (100) may, based on an artificial intelligence service request obtained from at least one of a first user device (110), a second user device (120), and a third user device (130), create a container corresponding to the service request, and execute a function corresponding to the artificial intelligence service through the container to obtain a result value.
[0062] According to various embodiments, the AI service server (100) may store an AI service function to provide an AI service. The AI service function may include a set of codes that perform specific tasks of the AI service. For example, the set of codes may include an AI model, model prediction code, and operation information for the AI model.
[0063] According to various embodiments, the artificial intelligence service server (100) may provide the first service based on a request from the first user device (110). For example, the artificial intelligence service server (100) may provide an interface related to the first service to the first user device (110) and receive an algorithm from the first user device (110) through the interface.
[0064] According to various embodiments, the artificial intelligence service server (100) can verify the execution of the algorithm. In addition, the algorithm can be stored in a database, and when a service request that can be provided through the execution of the algorithm is obtained, the algorithm obtained from the first user device (110) can be executed to provide a result corresponding to the service. In this case, when the artificial intelligence service server (100) provides a service to another user device by executing the algorithm obtained from the first user device (110), the artificial intelligence service server (100) can provide compensation to the first user device (110). In various embodiments, the algorithm can include the execution of various functions, such as the creation of an artificial intelligence model and the learning of an artificial intelligence model.
[0065] According to various embodiments, the artificial intelligence service server (100) may provide the second service based on a request from the second user device (120). For example, the artificial intelligence service server (100) may provide an interface related to the second service to the second user device (120) and receive a data set from the second user device (120) through the interface. According to various embodiments, the second user device (120) may provide a data set that can be used to train various artificial intelligence models stored in the artificial intelligence service server (100) through the second service. For example, the second user device (120) may provide various data sets, such as image data, text data, audio data, video data, tabular data, time series data, sensor data, graph data, mixed text and image data, and 3D model data, to the artificial intelligence service server (100) through the second service.
[0066] According to various embodiments, the artificial intelligence service server (100) may verify the data set. For example, the artificial intelligence service server (100) may determine whether the data set is appropriate data for training an artificial intelligence model stored in the artificial intelligence service server (100) or data that can be provided to another user device. In addition, the artificial intelligence service server (100) may store the data set in a database, and when a request for generation (or tuning) of an artificial intelligence model is obtained, the artificial intelligence service server (100) may train (or tune (retrain)) the artificial intelligence model using the data set obtained from the second user device (120). In this case, when the artificial intelligence service server (100) provides a service to another user autonomously using the data set obtained from the second user device (120), the artificial intelligence service server (100) may provide compensation to the second user device (120).
[0067] According to various embodiments, the artificial intelligence service server (100) may provide the third service based on a request from a third user device (130). For example, the artificial intelligence service server (100) may provide an interface related to the third service to the third user device (130) and receive an artificial intelligence service request using an artificial intelligence model from the third user device (130) through the interface. According to various embodiments, the artificial intelligence service server (100) may provide a service requested by the third user device (130) using an artificial intelligence model stored in a database in response to the third service request.
[0068] According to various embodiments, the third user device (130) may request a service for retraining the artificial intelligence model stored in the database into a personalized model, in addition to a service using the artificial intelligence model stored in the artificial intelligence service server (100). For example, the third user device (130) may generate an artificial intelligence model specialized for a specific function according to the user needs of the third user device (130). At this time, the artificial intelligence service server (100) may retrain the artificial intelligence model stored in the database using a learning data set selected by the third user device (130), thereby providing the personalized model to the third user device (130). Providing the personalized model may include providing a service using the personalized model when the artificial intelligence service server (100) obtains a request for provision of an artificial intelligence service from the third user device (130).
[0069] According to various embodiments, the artificial intelligence service server (100) may determine the user type of each user device (110), the second user device (120), and / or the third user device (130) based on the type of service requested. For example, the artificial intelligence service server (100) may classify the user type of the user device requesting the first service as the first user type. For example, the artificial intelligence service server (100) may classify the user type of the user device requesting the second service as the second user type. For example, the artificial intelligence service server (100) may classify the user type of the user device requesting the third service as the third user type.
[0070] According to various embodiments, the artificial intelligence service server (100) may be implemented in the form of a server, such as a cloud server or an artificial intelligence server. However, it is not limited thereto and may be implemented in any electronic device.
[0071] The first user device (110), the second user device (120), and / or the third user device (130) according to various embodiments may be devices of various types. For example, the first user device (110), the second user device (120), and / or the third user device (130) may include a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device. Electronic devices according to embodiments of the present document are not limited to the aforementioned devices.
[0072]
[0073] Figure 2 is a block diagram showing the configuration of a system that provides artificial intelligence services.
[0074] Referring to FIG. 2, a system (1) providing an artificial intelligence service may include a web server (221), a controller (231), a streaming platform (232) (e.g., kafka, scheduler, queue), a database (241), an invoker (251), and a container (252). The components listed above may be operatively or electrically connected to each other. The components of the system (1) providing an artificial intelligence service illustrated in FIG. 2 may be partially modified, deleted, or added, as an example.
[0075] According to various embodiments, the web server (221) operates as a front-end of the system (1) providing an artificial intelligence service and can provide a web to a user of a user device (210) (e.g., the first user device (110), the second user device (120), and the third user device (130) of FIG. 1). For example, the web server (221) can provide a web page composed of HTML through a network when a user requests an artificial intelligence service. The web server (221) can be composed of nginx, Apache, etc., but is not limited thereto.
[0076] According to various embodiments, the artificial intelligence service server (100) may create a user execution environment (e.g., a virtual machine, a virtual execution environment, a Guest OS, a User OS) including a scheduling layer (230) and a task layer (250). For example, the artificial intelligence service server (100) may create a user execution environment including a scheduling layer (230) and a task layer (250) when a request for an artificial intelligence service is obtained from a web server (221). At this time, the artificial intelligence service server (100) may allocate resources to the user execution environment by considering the resources required for executing the requested service. According to various embodiments, the artificial intelligence service server (100) allocating resources to create a user execution environment will be described below with reference to FIGS. 4 to 8.
[0077] According to various embodiments, the web server (221) may receive an artificial intelligence service request and a function (action) execution request for the artificial intelligence service request in various forms from the user device (210).
[0078] According to various embodiments, the web server (221) may transmit a request for execution of a function received from a user device (210) to a controller (231), receive an execution result of the function from the controller (231), and transmit it to the user device (210).
[0079] According to various embodiments, the controller (231) may transmit a request for executing the function to the streaming platform (232). At this time, the request for executing the function may include a request for creating a container depending on whether a container corresponding to the function has been created. For example, the controller (231) may determine whether a container for executing the function has been created based on the attribute information of the function stored in the database (241) and the container status information for the function. If, as a result of the determination, a container capable of executing the function exists, the controller (231) may request the streaming platform (232) to execute the function using the container through a message queue. In addition, if, as a result of the determination, a container capable of executing the function does not exist, the controller (231) may request the streaming platform (232) to create a container corresponding to the function and to execute the function using the container through a message queue. However, the controller (231) is not limited thereto and may transmit requests, data, etc. through various forms.
[0080] According to various embodiments, the controller (231) may request the creation of a container in advance through container prediction before a function execution request is made. In addition, the controller (231) may request the deletion of a created container based on the container prediction information. In addition, the controller (231) may divide the requested function into a plurality of sub-functions based on the container prediction information and the container status information, and request the execution of the plurality of sub-functions. According to various embodiments, the controller (231) requesting the creation of a container based on the container prediction information is described below with reference to FIGS. 9 to 15.
[0081] According to various embodiments, the controller (231) may transmit a request for creating a monitoring execution environment for monitoring the execution of the function to the streaming platform (232) based on a request for executing the function. For example, the controller (231) may transmit a request for creating a monitoring execution environment to the streaming platform (232) based on a request for executing the function. Through this, the controller (231) may monitor the execution of the function as the function is executed. According to various embodiments, the controller (231) creating the monitoring execution environment will be described below with reference to FIGS. 20 to 24.
[0082] According to various embodiments, the invoker (251) can retrieve information required for a task assigned by the streaming platform (232) from the database (241) and control the execution of the task in the container (252). For example, the invoker (251) can retrieve code corresponding to a function for which execution is requested from the database (241) and transfer it to the container (252), and the container (252) can execute the code received from the invoker (251).
[0083] According to various embodiments, the invoker (251) may create a container (252) if a container for executing the above function has not been created. Alternatively, the invoker (251) may obtain necessary information from the database (241) and create a container (252) if the creation of a container (252) is requested by the streaming platform (232). In one embodiment, the created container may be a CPU-based container using CPU resources or a GPU-based container using GPU resources.
[0084] According to one embodiment, a container (252) generated by an invoker (251) may include a library for an artificial intelligence model. Based on the library for the artificial intelligence model, the container (252) can load a trained artificial intelligence model and execute a function using the loaded artificial intelligence model.
[0085] According to various embodiments, the state related to the execution of an artificial intelligence model (function) can be divided into three states. For example, a state in which a container for executing the function has not been created can be determined as a cold state. For example, a container in which an artificial intelligence model has not been loaded or a container in which at least one artificial intelligence model has been loaded but a function has not been executed using the loaded artificial intelligence model can be determined as a pre-warm container. On the other hand, a container that has executed a function using a loaded artificial intelligence model can be determined as a warm container.
[0086] According to various embodiments, the invoker (251) may kill a created container considering the amount of allocated resources. For example, when a request to execute function B is received, the invoker (251) may delete a container created to execute function A and create a container to execute function B.
[0087] According to various embodiments, the database (241) may store various data such as artificial intelligence models, data sets, data, files, libraries, codes, etc. required to provide artificial intelligence services provided through the system (1) providing artificial intelligence services. In addition, the database (241) may store various information such as container state information indicating the state of the container (252), predicted generation information indicating the creation state of the container based on container prediction information, resource prediction information, user type information, user history information, function execution patterns, etc.
[0088] According to various embodiments, a system (1) providing an artificial intelligence service may be divided into a front-end layer (220), a scheduling layer (230), a storage layer (240), and / or a task layer (250) depending on its function. However, the present invention is not limited thereto, and various additional layers may be included or some layers may be omitted.
[0089] According to various embodiments, at least one of the web server (221), the controller (231), the streaming platform (232), the invoker (251), and the container (252) may be manufactured in hardware form and mounted on one device, or may be mounted on separate devices, respectively. In addition, according to one embodiment, at least one of the web server (221), the controller (231), the streaming platform (232), the invoker (251), and the container (252) may be implemented as a software module. According to one embodiment, when at least one of the web server (221), the controller (231), the streaming platform (232), the invoker (251), and the container (252) is implemented as a software module (or a program module including instructions), the software module may be stored on a non-transitory computer readable medium that can be read by a computer. Additionally, in this case, at least one software module may be provided by an operating system (OS) or by a predetermined application. Alternatively, some of the at least one software module may be provided by the operating system (OS) and some may be provided by a predetermined application.
[0090]
[0091] FIG. 3 is a block diagram of an electronic device according to various embodiments.
[0092] Referring to FIG. 3, an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may include a processor (310), a memory (320), and / or a communication circuit (330). The components listed above may be operatively or electrically connected to each other. The components of the electronic device (300) illustrated in FIG. 3 may be modified, deleted, or added, for example.
[0093] According to various embodiments, the electronic device (300) may include a processor (310). In various embodiments, the processor (310) may execute software (e.g., a program) to control at least one other component (e.g., a hardware or software component) of the electronic device (300) connected to the processor (310) and perform various data processing or calculations. According to various embodiments, as at least a part of the data processing or calculations, the processor (310) may store a command or data received from another component (e.g., a communication circuit (330)) in a volatile memory, process the command or data stored in the volatile memory, and store the resulting data in a non-volatile memory. According to various embodiments, the processor (310) may include a main processor (e.g., a central processing unit) or an auxiliary processor (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together therewith. For example, if the electronic device (300) includes a main processor and a secondary processor, the secondary processor may be configured to use less power than the main processor or to be specialized for a specific function. The secondary processor may be implemented separately from the main processor or as part of the main processor.
[0094] According to various embodiments, the auxiliary processor (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. Such learning may be performed, for example, within the electronic device (300) performing the artificial intelligence, or may be performed through a separate server. The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model may include multiple artificial neural network layers. The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.
[0095] According to various embodiments, the processor (310) may execute operations or data processing related to control and / or communication of at least one other component of the electronic device (300) using instructions stored in the memory (320). According to one embodiment, the processor (310) may include at least one of a central processing unit (CPU), a graphics processing unit (GPU), a micro controller unit (MCU), a sensor hub, a supplementary processor, a communication processor, an application processor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or a neural processing unit (NPU), and may have multiple cores.
[0096] According to various embodiments, the processor (310) may perform at least one of the operations of the controller (231), streaming platform (232), invoker (251), and container (252) described with reference to FIG. 2.
[0097] According to various embodiments, the memory (320) may store various data, programs, or applications for driving and controlling the electronic device (300). The program stored in the memory (320) may include one or more instructions. The memory (320) may include, but is not limited to, the database described with reference to FIG. 1 and the database (241) described with reference to FIG. 2.
[0098] According to various embodiments, the electronic device (300) may include a communication circuit (330). In various embodiments, the communication circuit (330) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (300) and an external electronic device (e.g., the first user device (110), the second user device (120), the third user device (130) of FIG. 1), and the performance of communication through the established communication channel. The communication circuit (330) may operate independently from the processor (310) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication circuit (330) may include a wireless communication module (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (e.g., a local area network (LAN) communication module, or a power line communication module). Any of these communication modules may communicate with an external electronic device via a first network (e.g., a short-range communication network such as Bluetooth, WiFi Direct (wireless fidelity direct), or IrDA (infrared data association)) or a second network (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a local area network or a wide area network)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips).
[0099] According to various embodiments, the electronic device (300) may obtain resource prediction information based on at least one of user type information, user history information, and function execution pattern information, allocate resources based on the resource prediction information to create a user execution environment, and execute the first function in the user execution environment based on a request for execution of the first function being received. According to various embodiments, the electronic device (300) allocating resources and creating the user execution environment will be described below with reference to FIGS. 4 to 8.
[0100] According to various embodiments, the electronic device (300) obtains container prediction information related to container creation and container deletion (kill) based on function execution pattern information, creates at least one container for a user execution environment related to the user device based on the container prediction information, and, when a request for a first artificial intelligence service is received from the user device through the communication circuit, obtains a first function corresponding to the first artificial intelligence service, selects a first container to provide the first artificial intelligence service among the at least one container, and executes the first function through a library loaded in the first container to provide the first artificial intelligence service to the user device. According to various embodiments, the electronic device (300) may generate a container based on the container prediction information as described below with reference to FIGS. 9 to 15.
[0101] According to various embodiments, the electronic device (300) may transmit a request for generating a first container for a user execution environment related to the user device based on container prediction information, determine whether the first container has been generated through the prediction generation information, and, based on the determination result, obtain a first function corresponding to the first artificial intelligence service when a request for a first artificial intelligence service is received from the user device, and execute the first function through a library loaded in the first container to provide the artificial intelligence service to the user device. The prediction generation information may include status information for a container generated based on the container prediction information. According to various embodiments, the electronic device (300) may generate a container and execute a function using the prediction generation information as described below with reference to FIGS. 16 to 19.
[0102] According to various embodiments, the electronic device (300) obtains a request for the artificial intelligence service from the user, obtains a request for executing a first function corresponding to the artificial intelligence service, generates a user execution environment for executing the first function in response to the request for executing the first function, generates a monitoring execution environment for monitoring the user execution environment, monitors the execution of the first function based on the monitoring execution environment, and, if an error is detected in the execution of the first function as a result of the monitoring, controls the operating system of the user execution environment in the monitoring execution environment to perform an operation based on the type of the error. According to various embodiments, the electronic device (300) performing a monitoring operation for function execution will be described below with reference to FIGS. 20 to 24.
[0103]
[0104] FIG. 4 is a flowchart (400) illustrating an operation of an electronic device allocating resources based on resource prediction information according to various embodiments.
[0105] FIG. 5 is a diagram illustrating an electronic device according to various embodiments obtaining resource prediction information using a resource prediction model.
[0106] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0107] According to various embodiments, the operations illustrated in FIG. 4 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 4, or at least one operation may be performed less than those illustrated in FIG.
[0108] Referring to FIG. 4, the electronic device (300) may obtain resource prediction information based on at least one of user type information, user history information, or function execution pattern information in operation 401.
[0109] According to various embodiments, when an electronic device (300) receives a request for an artificial intelligence service from a user device (210) via a web server (221), the electronic device (300) may create a user execution environment and allocate resources to the user execution environment in order to provide the request for the artificial intelligence service. At this time, the electronic device (300) may generate resource prediction information to determine the amount of resources to be allocated.
[0110] According to one embodiment, the electronic device (300) can obtain resource prediction information based on at least one of user type information, user history information, or function execution pattern information.
[0111] According to one embodiment, the user type information may be determined based on the type of request for an artificial intelligence service obtained from the user device (210). For example, if the artificial intelligence service request is a request for a first service related to algorithm provision, the electronic device (300) may classify the user as a first user type. For example, if the artificial intelligence service request is a request for a second service related to data set provision, the electronic device (300) may classify the user as a second user type. For example, if the artificial intelligence service request is a request for a third service related to the use of at least one artificial intelligence model, the electronic device (300) may classify the user as a third user type.
[0112] According to various embodiments, the electronic device (300) may obtain resource prediction information based on user type information. For example, if the user type according to the user type information is a first user type associated with the first service, the electronic device (300) may predict to allocate a first size of resource. For example, if the user type according to the user type information is a second user type associated with the second service, the electronic device (300) may predict to allocate a second size of resource. For example, if the user type according to the user type information is a third user type associated with the third service, the electronic device (300) may predict to allocate a third size of resource. According to one embodiment, the first size may be greater than the second size or the third size.
[0113] For example, if the electronic device (300) determines that the user type is the first user type through user type information, it can predict that a large amount of resource allocation is required because learning of an artificial intelligence model is required to provide an algorithm. However, the present invention is not limited thereto, and the electronic device (300) can obtain resource prediction information through the user type information. For example, even if the electronic device (300) determines that the user type is the first user type through user type information, if a request is obtained to generate a personalized artificial intelligence model through retraining rather than using the artificial intelligence model as is, the electronic device (300) can generate resource prediction information to allocate a large amount of resources.
[0114] According to various embodiments, the electronic device (300) may obtain resource prediction information based on user history information. For example, the electronic device (300) may generate resource prediction information based on user history information related to resource usage of the user device (210). For example, the electronic device (300) may obtain various information, such as the amount of resources used on average by the user device (210), types of resources, resource usage time zones, and resource usage cycles, based on the user history information, and may generate resource prediction information based on the various information.
[0115] According to various embodiments, the electronic device (300) may obtain resource prediction information based on function execution pattern information. According to various embodiments, the function execution pattern information may be determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the order of execution of at least one function executed to provide the at least one artificial intelligence service.
[0116] According to one embodiment, the electronic device (300) may generate function execution pattern information regarding the type and order of artificial intelligence service requests obtained from a specific user device (210). For example, the electronic device (300) may obtain a video upload and scene understanding request from the user device (210). Based on the video upload and scene understanding request, the electronic device (300) may generate function execution pattern information in which at least one of a bounding box extraction request, a key-point extraction request, a background removal request, a video summary request, a background transformation request, an image editing request, an automatic subtitle generation request, and a video editing recommendation request is obtained as the next artificial intelligence service request. For example, the electronic device (300) may generate function execution pattern information in which a video upload and scene understanding request is followed by a bounding box extraction request and a key-point extraction request, followed by a background removal request and a background transformation request, and may generate resource prediction information based on the function execution pattern information. The function execution patterns described above are merely examples and are not limited to the described examples. For example, the electronic device (300) can store various artificial intelligence service requests or function execution requests obtained through the user device (210) and generate function execution pattern information based on the stored information.
[0117] According to various embodiments, in operation 403, the electronic device (300) may allocate resources based on resource prediction information to generate a user execution environment (e.g., the user execution environment described with reference to FIG. 2). According to one embodiment, the electronic device (300) may allocate resources to the user execution environment based on the resource prediction information, based on a request for generating a user execution environment.
[0118] According to various embodiments, the electronic device (300) may obtain a request to create a user execution environment. For example, the electronic device (300) may obtain a request to create a user execution environment based on a function execution request according to an artificial intelligence service request. Furthermore, the electronic device (300) may obtain a request to create a user execution environment in advance before obtaining a function execution request according to an artificial intelligence service request.
[0119] According to one embodiment, the electronic device (300) may allocate resources to a user execution environment based on a function execution request corresponding to an artificial intelligence service request. For example, the electronic device (300) may obtain resource prediction information based on a function execution request corresponding to an artificial intelligence service request, and allocate resources based on the resource prediction information to create a user execution environment.
[0120] According to one embodiment, the electronic device (300) may obtain resource prediction information based on a request for creating a user execution environment (or creating at least one container for the user execution environment) based on container prediction information. The electronic device (300) may allocate resources based on the resource prediction information to create the user execution environment. The container prediction information according to various embodiments will be described below with reference to FIGS. 9 to 16.
[0121] According to one embodiment, the electronic device (300) can extract physical hardware resources of the electronic device (300) and allocate them to the user execution environment. In one embodiment, the resources allocated to the user execution environment may include various resources such as a CPU, memory disk space, and a GPU. For example, the electronic device (300) can allocate necessary resources and create a user execution environment through the controller (231) described with reference to FIG. 2. According to various embodiments, the user execution environment can provide an independent environment for function execution.
[0122] According to various embodiments, the user execution environment may include a virtual machine, a virtual execution environment, a guest operating system (GUEST OS), and / or a user operating system (US OS). For example, if a user execution environment for executing the requested function has not been created, the electronic device (300) may determine the amount of resources to be allocated based on resource prediction information. Furthermore, a user execution environment may be created that allocates resources based on the amount of resources.
[0123] According to various embodiments, the user execution environment may include a container loaded with a library for providing an artificial intelligence service. For example, the electronic device (300) may create a container through the streaming platform (232) described with reference to FIG. 2 based on resource prediction information. For example, the electronic device (300) may determine whether a container corresponding to the requested function has been created in the Guest OS and control the creation of the container. At this time, the electronic device (300) may allocate resources based on the resource prediction information when creating the container.
[0124] According to various embodiments, in operation 405, the electronic device (300) may execute a function in a user execution environment based on a function execution request received. For example, the electronic device (300) may create a user execution environment for executing the function based on resource prediction information, and execute the function in the pre-created user execution environment based on the function execution request received.
[0125] According to one embodiment, the electronic device (300) may predict a function to be executed next based on function execution pattern information, and allocate resources to a container or user execution environment in which the predicted function will be loaded. For example, the electronic device (300) may execute a first function based on a first function execution request for an artificial intelligence service request obtained from the user device (210). In addition, the electronic device (300) may predict that execution of a second function will be requested based on the function execution pattern information as the first function is executed. For example, the electronic device (300) may predict that a background removal request (e.g., the second function) will be obtained after a video upload and scene understanding request (e.g., the first function) is obtained. According to one embodiment, when the electronic device (300) predicts that execution of the second function will be requested, the electronic device (300) may reallocate resources necessary for execution of the second function to a container in which the second function will be loaded or to a user execution environment in which the second function will be executed. At this time, the electronic device (300) can predict the resources required for execution of the second function based on the resource prediction information, and reallocate the resources required for execution of the second function to a container that loads the second function or a user execution environment that executes the second function.
[0126] According to various embodiments, when a function execution request is received, the electronic device (300) can quickly execute the function by immediately executing the function through a pre-generated user execution environment and provide the function execution result to the user device (210). In addition, the electronic device (300) can efficiently utilize resources by allocating resources through resource prediction information when generating the user execution environment.
[0127] Referring to FIG. 5, the electronic device (300) can generate resource prediction information (530) using the resource prediction model (520). For example, the electronic device (300) can obtain resource prediction information (530) using the resource prediction model (520) in operation 401 described with reference to FIG. 4. For example, the electronic device (300) can use the resource prediction model (520) to predict resources for each function to be requested for execution, resources required for the user execution environment, etc.
[0128] According to one embodiment, the electronic device (300) can input input data (510) including at least one of user type information, user history information, and function execution pattern information into a resource prediction model (520) to obtain resource prediction information (530) as output data.
[0129] According to various embodiments, the electronic device (300) may store a resource prediction model (520) in a memory (320) (e.g., database (241) of FIG. 2). According to one embodiment, the resource prediction model (520) may be an artificial intelligence model trained to receive at least one of user type information, user history information, or function execution pattern information and output resource prediction information. In other words, the resource prediction model may be an artificial intelligence model trained to predict resources required for executing a function corresponding to an artificial intelligence service.
[0130] According to one embodiment, the electronic device (300) may collect user type information, user history information, function execution pattern information, and resource information necessary for training the resource prediction model (520). In one embodiment, the resource prediction model (520) may be trained based on resource usage information corresponding to each of the user type information, the user history information, and the function execution pattern information. For example, the electronic device (300) may obtain learning data for resource prediction, including resource usage information according to user type information generated when at least one user device (e.g., a first user device (110), a second user device (120), a third user device (130), and a user device (210)) uses a system (1) that provides an artificial intelligence service, user history information including resource usage, function execution patterns, and resource usage information according to each function execution.
[0131] According to one embodiment, the electronic device (300) can train a resource prediction model (520) based on the acquired learning data. According to one embodiment, the structure of the resource prediction model (520) is not limited to a regression model, a neural network model, an ensemble model, and various model structures can be used. For example, the resource prediction model (520) can be a model based on a neural network, and for example, a model such as a DNN (Deep Neural Network), an RNN (Recurrent Neural Network), or a BRDNN (Bidirectional Recurrent Deep Neural Network) can be used, but is not limited thereto.
[0132] According to various embodiments, the electronic device (300) can optimize the resource prediction model (520) through a hyperparameter tuning or retraining process through a verification operation. For example, the electronic device (300) can generate output data including resource prediction information (530) based on input data (510), and obtain resource information actually used in a user execution environment generated based on the output data. The electronic device (300) can evaluate and update the performance of the resource prediction model (520) by comparing the actually used resource information with the resource prediction information.
[0133]
[0134] FIG. 6 is a flowchart (600) illustrating an operation of an electronic device reallocating resources based on resource usage information according to various embodiments.
[0135] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0136] According to various embodiments, the operations illustrated in FIG. 6 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 6, or at least one operation may be performed less than those illustrated in FIG.
[0137] Referring to FIG. 6, the electronic device (300) can obtain resource information used by the user according to the use of the artificial intelligence service in operation 601. For example, after a user execution environment (e.g., the user execution environment described with reference to FIG. 2) is generated in response to a request for an artificial intelligence service obtained from the user device (210), the electronic device (300) can obtain resource usage information used through the user device (210) in the user execution environment. For example, the electronic device can obtain various information related to resource usage, such as the amount of resources used by the user in the user execution environment generated through the user device (210), the type of resources, the resource usage time zone, and the resource usage cycle.
[0138] According to various embodiments, in operation 603, the electronic device (300) may update user history information (e.g., user history information described with reference to FIG. 4) based on resource usage information. For example, the electronic device (300) may update user history information based on resource usage by the user through the user device (210) in the generated user execution environment.
[0139] According to various embodiments, in operation 605, the electronic device (300) may reallocate resources to the user execution environment based on the updated user history information. For example, if the amount of resources used by the user in the user execution environment increases over a certain period of time, the electronic device (300) may allocate additional resources to the user execution environment based on the updated user history information.
[0140] According to various embodiments, the electronic device (300) can acquire information on resources used by a user in the user execution environment in real time (or periodically), update user history information, and reallocate resources to the user execution environment based on the user history information, thereby preparing and allocating resources required for each user in advance. Accordingly, the electronic device (300) can efficiently utilize resources to be allocated to the user execution environment.
[0141]
[0142] FIG. 7 is a flowchart (700) illustrating an operation of an electronic device allocating resources when execution of an algorithm obtained through a first service is requested according to various embodiments.
[0143] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0144] According to various embodiments, the operations illustrated in FIG. 7 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 7, or at least one operation may be performed less than those illustrated in FIG.
[0145] Referring to FIG. 7, when the request for the artificial intelligence service in operation 701 is the first service, the electronic device (300) can create a user execution environment by allocating resources for execution of a function corresponding to the first service.
[0146] According to one embodiment, when a request for an artificial intelligence service is obtained from a user device (210) through a web server (221), the electronic device (300) may create a user execution environment and allocate resources to provide the request for the artificial intelligence service. For example, the electronic device (300) may obtain a request for a first service, which is a service that receives an algorithm from a user device (e.g., the first user device (110) of FIG. 1) and creates an artificial intelligence model, from the user device, and allocate a first-size resource. At this time, when providing the first service, the electronic device (300) may predict that a large amount of resources will be required for testing the execution of the algorithm (e.g., training the artificial intelligence model), and may create a user execution environment that allocates a certain amount or more of the first-size resource.
[0147] According to various embodiments, in operation 703, the electronic device (300) may determine the resources required to execute an algorithm acquired in response to the provision of the first service in the user execution environment. For example, the electronic device (300) may calculate the amount of resources required to execute the algorithm acquired through the user device. For example, the amount of resources required to execute an artificial intelligence model acquired from the user device in response to the first service may be determined.
[0148] According to various embodiments, in operation 705, the electronic device (300) may store resource information required for executing the algorithm based on the determination result. For example, the electronic device (300) may store information on resources required for executing an algorithm obtained from the user device as it provides a first service to the user device. For example, the electronic device (300) may obtain an artificial intelligence model based on the provision of the first service from the user device and store resource information required for executing the artificial intelligence model. In one embodiment, the resource information may be obtained while the user device tests and executes the algorithm based on the first service.
[0149] According to various embodiments, in operation 707, when an execution request for the algorithm is obtained, the electronic device (300) may allocate resources based on the resource information. For example, the electronic device (300) may store an algorithm obtained based on the provision of the first service in a database, and when an execution request for the algorithm is obtained from another user device (or a user device that provided the first service), the electronic device (300) may provide a service based on the stored algorithm. According to one embodiment, when the electronic device (300) obtains an execution request for an algorithm obtained based on the first service, the electronic device (300) may allocate resources based on pre-stored resource information required for executing the algorithm. For example, when the electronic device (300) obtains an artificial intelligence service request from a user device (e.g., the third user device (130) of FIG. 1), the electronic device (300) may provide a service (e.g., the third service described with reference to FIG. 4) using the algorithm stored in the database. At this time, when the electronic device (300) creates a user execution environment to provide the above service, it can allocate resources based on resource information required for execution of the above algorithm.
[0150] FIG. 8 is a flowchart illustrating an operation of an electronic device according to various embodiments to create a user execution environment based on resource recommendation information.
[0151] Referring to FIG. 8, the electronic device (300) can obtain resource recommendation information based on at least one of user type information, user history information, or function execution pattern information in operation 801.
[0152] According to one embodiment, when a request for an artificial intelligence service is obtained from a user device (210), the electronic device (300) may generate resource recommendation information based on at least one of user type information, user history information, or function execution pattern information described with reference to FIG. 4.
[0153] According to various embodiments, in operation 803, the electronic device (300) may transmit the resource recommendation information to the user device (210). For example, the electronic device (300) may transmit resource recommendation information generated based on at least one of user type information, user history information, or function execution pattern information when a request for an artificial intelligence service is obtained from the user device (210). The resource recommendation information may include information that predicts and recommends the amount of resources required to provide an artificial intelligence service in response to the request for the artificial intelligence service.
[0154] According to various embodiments, in operation 805, the user device (210) may obtain user input regarding resource recommendation information. For example, the user device (210) may display the resource recommendation information through an output device (e.g., a display) of the user device and obtain user input regarding the resource recommendation information. According to one embodiment, the user input may include at least one of a resource allocation request according to the resource recommendation information, a resource amount modification request (adding or reducing resources) according to the resource recommendation information, or a resource setting request.
[0155] According to various embodiments, in operation 807, the user device (210) may transmit the user input to the electronic device (300). For example, the user device (210) may transmit the user input in response to the acquired resource recommendation information.
[0156] According to various embodiments, in operation 809, the electronic device (300) may generate a user execution environment based on user input and resource recommendation information. For example, if the user input based on the resource recommendation information is a resource allocation request, the electronic device (300) may allocate resources based on the resource recommendation information. In addition, if the user input based on the resource recommendation information is a resource reduction or addition request, the electronic device (300) may allocate resources by reflecting the resource reduced or added by the user in the resource amount based on the resource recommendation information. In addition, if the user input based on the resource recommendation information is a request for allocation setting of a specific resource, the electronic device (300) may allocate resources in the amount of resources input by the user.
[0157] According to various embodiments, when the electronic device (300) obtains user input by providing resource recommendation information to the user device (210) and allocates resources accordingly, the user can efficiently adjust resource usage by checking in advance the amount of resources determined based on at least one of user type information, user history information, and function execution pattern information. In addition, when the user adjusts the resource allocation amount based on the resource recommendation information, the electronic device (300) can create a user execution environment that allocates resources while suggesting an appropriate amount of resources and reflecting the user's needs.
[0158]
[0159] FIG. 9 is a flowchart (900) illustrating an operation of an electronic device generating at least one container based on container prediction information according to various embodiments.
[0160] FIG. 10 is a diagram illustrating an electronic device according to various embodiments creating a container and executing a function in response to a function execution request.
[0161] FIG. 11 is a diagram illustrating an electronic device deleting a container based on container prediction information according to various embodiments.
[0162] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0163] According to various embodiments, the operations illustrated in FIG. 9 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 9, or at least one operation may be performed less than those illustrated in FIG.
[0164] According to various embodiments, before obtaining a function execution request for an artificial intelligence service from a user device (210), the electronic device (300) may predict a request for execution of the function and create a container necessary for executing the function in advance. For example, the electronic device (300) may create a container for executing a function to be requested from the user device (210). The created container may include or install libraries, data, files, etc. for executing the function. In addition, before obtaining a function execution request for an artificial intelligence service from the user device (210), the electronic device (300) may delete the created container in advance by considering the resource usage of each user execution environment.
[0165] Below, the operation of the electronic device (300) to create or delete a container in advance is described.
[0166]
[0167] Referring to FIG. 9, the electronic device (300) can obtain container prediction information related to container creation and container deletion based on function execution pattern information in operation 901.
[0168] According to one embodiment, the electronic device (300) may obtain container prediction information to pre-create or delete a container. For example, the electronic device (300) may generate container prediction information based on function execution pattern information determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the execution order of at least one function executed to provide the at least one artificial intelligence service.
[0169] According to various embodiments, the electronic device (300) may generate function execution pattern information regarding the type and order of artificial intelligence service requests obtained from a specific user device (210). For example, the electronic device (300) may obtain a video upload and scene understanding request from the user device (210). Based on the video upload and scene understanding request, the electronic device (300) may generate function execution pattern information in which at least one of a bounding box extraction request, a key-point extraction request, a background removal request, a video summary request, a background transformation request, an image editing request, an automatic subtitle generation request, and a video editing recommendation request is obtained as the next artificial intelligence service request. For example, the electronic device (300) may generate function execution pattern information in which a video upload and scene understanding request is followed by a bounding box extraction request and a key-point extraction request, and then a background removal request and a background transformation request, and may obtain container prediction information based on the function execution pattern information.
[0170] Additionally, and not limited to the above-described example, according to various embodiments, the electronic device (300) may generate container prediction information based on at least one of function execution pattern information, user history information described with reference to FIG. 4, or user type information.
[0171] According to various embodiments, in operation 903, the electronic device (300) may generate at least one container for a user execution environment associated with the user device (210) based on container prediction information. For example, the electronic device (300) may predict a function to be requested next based on previous function execution based on function execution pattern information, and generate a container for the function to be requested.
[0172] For example, referring to FIG. 10, a first controller (1011) of an electronic device (300) (e.g., controller (231) of FIG. 2) can obtain a prediction generation request (1001). According to one embodiment, the electronic device (300) includes at least one controller (e.g., first controller (1011), second controller (1013)) and can obtain a request (1001) to predict and pre-generate a container through the controller.
[0173] According to one embodiment, the electronic device (300) may generate the container prediction information based on the prediction module (1012). For example, the electronic device (300) may generate the container prediction information based on at least one of function execution pattern information, user history information, or user type information through the prediction module (1012).
[0174] According to one embodiment, the electronic device (300) may transmit a container creation request (1002) to a streaming platform (1020) (e.g., streaming platform (232) of FIG. 2) based on container prediction information through the first controller (1011). For example, the first controller (1011) may predict that an execution request for the a1 function will be obtained and transmit a container creation request (1002) related to the execution of the a1 function to the streaming platform (1020).
[0175] According to one embodiment, the streaming platform (1020) may include at least one message queue for managing container creation requests and function execution requests of at least one invoker (e.g., invoker (251) of FIG. 2) included in the user execution environment. For example, the streaming platform (1020) may include a message queue (1021) for a container creation (or deletion) request of a first invoker (1031) and a message queue (1022) for a container creation (or deletion) request of a second invoker (1022), with respect to the user execution environment. In addition, the streaming platform (1020) may include at least one message queue for managing function execution requests. For example, the streaming platform (1020) may include a message queue (1023) for a request for function execution a1 and a message queue (1024) for a request for function execution a2.
[0176] According to one embodiment, the streaming platform (1020) may store a container creation request for the a1 function in a message queue (1021) according to the container creation request (1002). According to various embodiments, the streaming platform (1020) may store not only the container creation request for the a1 function, but also various data (e.g., libraries, files, etc.) for creating a container for the a1 function in the message queue (1021).
[0177] According to one embodiment, the first invoker (1031) can create the a1 container (1003) based on a container creation request for the a1 function stored in the message queue (1021). For example, the first invoker (1031) can obtain the a1 container creation request based on container prediction information through the message queue (1021) and create the a1 container (1003). The first invoker (1031) can create the a1 container (1003) that can include or install libraries, data, files, etc. required to execute the a1 function.
[0178] That is, the electronic device (300) can determine whether a first container has been created for the user execution environment based on container prediction information, and if the first container has been created, load a library to execute a function corresponding to the first container.
[0179] According to various embodiments, in operation 905, when a request for a first artificial intelligence service is received from a user device (210), the electronic device (300) may obtain a first function corresponding to the first artificial intelligence service.
[0180] According to one embodiment, the electronic device (300) may obtain an artificial intelligence service request from the user device (210) and obtain a first function for providing the artificial intelligence service. For example, the electronic device (300) may generate a first function for providing the artificial intelligence service or obtain a first function (e.g., function a1) stored in a database (e.g., database (241) of FIG. 2).
[0181] For example, the electronic device (300) may obtain a request for execution of a first function through the first controller (1011). According to one embodiment, the first controller (1011) may obtain a request for execution (1004) of a1 function for providing the artificial intelligence service based on a request for the artificial intelligence service obtained from the user device (210).
[0182] According to one embodiment, the electronic device (300) may transmit a request (1005) for executing the a1 function to the streaming platform (1020) via the first controller (1011). For example, upon obtaining the request (1004) for executing the a1 function, the first controller (1011) may request (1005) the streaming platform (1020) to execute the a1 function.
[0183] According to one embodiment, the streaming platform (1020) may store an execution request for the a1 function in the message queue (1023) in response to an execution request (1005) for the a1 function. According to various embodiments, the streaming platform (1020) may store not only the execution request for the a1 function but also various data required for the execution of the a1 function in the message queue (1023). For example, the streaming platform (1020) may store various data (e.g., code, artificial intelligence model, etc.) so that the first invoker (1031) can execute the function based on the execution request for the a1 function.
[0184] According to various embodiments, in operation 907, the electronic device (300) may select a first container to provide a first artificial intelligence service from among at least one container. According to one embodiment, the electronic device (300) may select the first container from among at least one container created for at least one invoker, based on at least one of the container status information, the resources allocated to each container, or the resources required to provide the first artificial intelligence service. For example, the streaming platform (1020) may select the a1 container (1003) for executing the a1 function based on an execution request for the a1 function.
[0185] According to various embodiments, in operation 909, the electronic device (300) may provide a first artificial intelligence service to the user device (210) by executing a first function through a library loaded into the first container. For example, the electronic device (300) may provide an artificial intelligence service to the user device (210) by executing a1 function through a library loaded into the a1 container (1003).
[0186] For example, the first invoker (1021) can execute (1006) the a1 function based on an execution request of the a1 function stored in the message queue (1023). For example, the first invoker (1031) can execute the a1 function through the a1 container (1003) generated based on the container prediction information. According to one embodiment, the electronic device (300) can execute the a1 function directly from the pre-generated a1 container (1003) according to the execution request of the a1 function, thereby executing the function more responsively and providing an artificial intelligence service.
[0187] According to one embodiment, the first invoker (1031) can update state information (1033) related to the execution of the a1 function. According to one embodiment, the container state information (1033) can include information on whether a function is being executed for the container. Accordingly, when the a1 function is executed in the a1 container (1003) in response to an execution request for the a1 function, the first invoker (1031) can store (1007) the state (cold, pre-warm, warm) of the a1 container (1003) in the state information (1033).
[0188]
[0189] Referring to FIG. 11, an operation of an electronic device (300) deleting a pre-generated container based on container prediction information is illustrated.
[0190] According to one embodiment, the invoker of the user execution environment can create and manage a limited number of containers. For example, the first invoker (1031) and / or the second invoker (1032) can each create and manage four containers. According to one embodiment, if an execution request for a function that does not correspond to a pre-created container is received, or if the requested function cannot be executed with only the pre-created containers, the invoker must create a new container. In this case, if the number of containers that the invoker can hold is full and a new container cannot be created, the invoker may have to delete one of the created containers and create a new container. In this case, since the container created for the execution of the function must be deleted, a container must be created again, and then the function must be executed, the execution of the function according to the user request may be delayed.
[0191] Below, an embodiment is described in which an electronic device (300) can execute a function more quickly by deleting a container in advance based on container prediction information.
[0192] According to various embodiments, the electronic device (300) may generate the container prediction information based on the prediction module (1012). For example, the electronic device (300) may generate the container prediction information based on at least one of function execution pattern information, user history information, or user type information through the prediction module (1012). In this case, the container prediction information may include prediction deletion information of the container.
[0193] According to one embodiment, the electronic device (300) may transmit a container deletion request (1101) to the streaming platform (1020) based on container prediction information through the first controller (1011). For example, the first controller (1011) may transmit a container deletion request (1102) related to the execution of the a1 function to the streaming platform (1020) in order to delete the container related to the execution of the a1 function in advance by predicting that an execution request of the a2 function will be obtained.
[0194] According to one embodiment, the streaming platform (1020) may store a container deletion request for the a1 function in a message queue (1021) in response to a container creation request (1002).
[0195] According to one embodiment, the first invoker (1021) may delete (1104) the a1 container based on a container deletion request for the a1 function stored in the message queue (1021). For example, the first invoker (1021) may obtain (1103) an a1 container deletion request based on container prediction information through the message queue (1021) and delete (1104) the a1 container.
[0196] According to one embodiment, the electronic device (300) may obtain an artificial intelligence service request from a user device (210) and obtain (1105) an execution request of a2 function for providing the artificial intelligence service.
[0197] According to one embodiment, the electronic device (300) may transmit a request (1106) for creating a container for executing the a2 function and a request (1107) for executing the a2 function to the streaming platform (1020) through the first controller (1011). For example, upon obtaining a request (1105) for executing the a1 function, the first controller (1011) may request (1106, 1107) the streaming platform (1020) to create a container for executing the a2 function and to execute the a2 function.
[0198] According to one embodiment, the streaming platform (1020) may store a container creation request for the a2 function in a message queue (1021) in response to a container creation request (1106) for executing the a2 function. According to various embodiments, the streaming platform (1020) may store not only the container creation request for the a2 function but also various data (e.g., libraries, files, etc.) for creating a container for the a2 function in the message queue (1021).
[0199] According to one embodiment, the first invoker (1031) can create the a2 container (1109) based on a container creation request for the a2 function stored in the message queue (1021). For example, the first invoker (1031) can obtain (1108) an a2 container creation request based on container prediction information through the message queue (1021) and create (1109) the a2 container. In this case, in order to create the a2 container according to the execution request of the a2 function, the a2 container can be created without having to delete the a1 container that was previously created and then create the a2 container, thereby creating the a2 container more quickly.
[0200] According to one embodiment, the streaming platform (1020) may store an execution request for the a2 function in the message queue (1023) in response to an execution request (1105) for the a2 function. According to various embodiments, the streaming platform (1020) may store not only the execution request for the a2 function but also various data required for the execution of the a2 function in the message queue (1023). For example, the streaming platform (1020) may store various data (e.g., code, artificial intelligence model, etc.) so that the first invoker (1031) can execute the function based on the execution request for the a2 function.
[0201] According to one embodiment, the electronic device (300) may provide an artificial intelligence service to the user device (210) by executing the a2 function through a library loaded in the a2 container. For example, the first invoker (1021) may execute the a2 function (1110) based on an execution request of the a2 function stored in the message queue (1023). For example, the first invoker (1031) may execute the a2 function through the a2 container generated based on the container prediction information.
[0202]
[0203] FIG. 12 is a flowchart (1200) illustrating an operation of an electronic device according to various embodiments to obtain container prediction information based on user history information.
[0204] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0205] According to various embodiments, the operations illustrated in FIG. 12 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 12, or at least one operation may be performed less than those illustrated in FIG.
[0206] Referring to FIG. 12, the electronic device (300) can obtain user history information based on the type of function executed in the electronic device, the type of artificial intelligence service requested to the electronic device, and whether a preset time has been taken from the execution time of the last executed function in the electronic device, in operation 1201.
[0207] According to one embodiment, the electronic device (300) may store information about functions executed on a system providing an artificial intelligence service (e.g., execution of an artificial intelligence model and types of artificial intelligence models, etc.). In addition, the electronic device (300) may store information about types of various artificial intelligence services acquired on the system providing an artificial intelligence service. In addition, the electronic device (300) may store information about whether a certain period of time has passed since the execution of the last executed function on the system providing an artificial intelligence service. In this case, the electronic device (300) may store user history information, including the type of the executed function, the type of artificial intelligence service requested to the electronic device, and whether a preset period of time has passed since the execution of the last executed function on the electronic device, for each user of the system.
[0208] According to various embodiments, the electronic device (300) may obtain container prediction information based on user history information. For example, the electronic device (300) may generate container prediction information, which is information for predicting a container to be generated in advance, based on user history information including at least one of the types of functions that a specific user has executed in the system, the types of artificial intelligence services requested by the electronic device, and the type and execution time of the last executed function.
[0209]
[0210] FIG. 13 is a diagram illustrating an electronic device according to various embodiments obtaining container prediction information using a container prediction model.
[0211] Referring to FIG. 13, the electronic device (300) can generate container prediction information (1330) using the container prediction model (1320). According to an embodiment, the electronic device (300) can obtain container prediction information (1330) using the container prediction model (1320) in operation 901 described with reference to FIG. 9. According to an embodiment, the electronic device (300) can obtain container prediction information (1330) using the container prediction model (1320) in operation 1201 described with reference to FIG. 12. For example, the electronic device (300) can generate container prediction information by predicting that creation or deletion of a container is required for a function to be requested to be executed using the container prediction model (1320).
[0212] According to one embodiment, the electronic device (300) may input input data (1310) including at least one of user history information (e.g., user history information of FIG. 12) and function execution pattern information (e.g., function execution pattern information of FIG. 9) into a container prediction model (1320) to obtain container prediction information (1330) as output data.
[0213] According to various embodiments, the electronic device (300) may store a container prediction model (1320) in a memory (320) (e.g., a database (241) of FIG. 2). According to one embodiment, the container prediction model (1320) may be an artificial intelligence model trained to receive at least one of user type information, user history information, or function execution pattern information and output container prediction information. That is, the container prediction model (1320) may be an artificial intelligence model trained to predict an execution request of a function corresponding to an artificial intelligence service and output information for pre-creating a container for executing the function or information for deleting a pre-created container to pre-create a container for executing the function.
[0214] According to one embodiment, the electronic device (300) may collect user history information and / or function execution pattern information necessary for training the container prediction model (1320). In one embodiment, the container prediction model (1320) may be trained based on resource usage information corresponding to each of user type information, user history information, and function execution pattern information. For example, the electronic device (300) may obtain training data for information on execution requests of various functions obtained through at least one user device (e.g., a first user device (110), a second user device (120), a third user device (130), and a user device (210)) in a system (1) providing an artificial intelligence service.
[0215] According to one embodiment, the electronic device (300) can train a container prediction model (1320) based on the acquired learning data. According to one embodiment, the structure of the container prediction model (1320) is not limited to a regression model, a neural network model, an ensemble model, and various model structures can be used. For example, the container prediction model (1320) can be a model based on a neural network, and for example, a model such as a DNN (Deep Neural Network), an RNN (Recurrent Neural Network), or a BRDNN (Bidirectional Recurrent Deep Neural Network) can be used, but is not limited thereto.
[0216] According to various embodiments, the electronic device (300) can optimize the container prediction model (1320) through a hyperparameter tuning or retraining process through a verification operation. For example, the electronic device (300) can generate output data (1330) including container prediction information based on input data (1310), and obtain container information to be created or deleted in a user execution environment generated based on the output data (1330). The electronic device (300) can evaluate and update the performance of the container prediction model (1320) by comparing the container prediction information with a function that is actually requested to be executed.
[0217]
[0218] FIG. 14 is a flowchart (1400) illustrating an operation of an electronic device according to various embodiments to execute a function through a plurality of sub-functions based on container status information.
[0219] FIG. 15 is a diagram illustrating an electronic device according to various embodiments executing a function through a plurality of sub-functions based on container status information.
[0220] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0221] According to various embodiments, the operations illustrated in FIG. 14 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 14, or at least one operation may be performed less than those illustrated in FIG.
[0222] Referring to FIG. 14, the electronic device (300) can determine the amount of resources required to execute a function based on the properties of the function to be executed to provide a request obtained from the user device in operation 1401.
[0223] Referring to FIG. 15, an electronic device (300) according to an embodiment may obtain (1501) a request for execution of a function from a first controller (1011) (e.g., controller (231) of FIG. 2). For example, the first controller (1011) may obtain (1501) a request for execution of a function that provides a request for an artificial intelligence service obtained from a user device (210).
[0224] According to one embodiment, the electronic device (300) can determine the amount of resources required to execute the function. For example, the electronic device (300) can determine the amount of resources required to execute the function in a user execution environment created to provide the artificial intelligence service to the user device (210).
[0225] According to various embodiments, in operation 1403, the electronic device (300) may obtain container state information for each of a plurality of containers for the user execution environment.
[0226] According to one embodiment, the first invoker (1031) (invoker (251) of FIG. 2) may create multiple containers for the user execution environment under the control of the first controller (1011). For example, the first invoker (1031) may include multiple a1 containers (e.g., a1 container (1003) described with reference to FIG. 10) that execute the a1 function.
[0227] According to one embodiment, the electronic device (300) can obtain container status information (e.g., status information (1033) of FIG. 10) for each of a plurality of containers created for a user execution environment. For example, the electronic device (300) can obtain status information for each of the plurality of a1 containers through the first controller (1011) (or the first invoker (1031)).
[0228] According to various embodiments, container state information may include information indicating the state of each container created in the user execution environment. For example, the information may include at least one of the following: resource usage of each container, creation and / or execution time of each container, and whether a function is currently running for the container (cold, prewarm, or warm state).
[0229] According to various embodiments, in operation 1405, the electronic device (300) may divide the function into multiple sub-functions based on the amount of resources for the function and container state information.
[0230] According to one embodiment, the electronic device (300) may select a container that has sufficient remaining resources to execute the function based on the amount of resources required to execute the requested function and container status information. According to one embodiment, if the electronic device (300) determines that there is no specific container that has sufficient remaining resources to execute the function based on the amount of resources required to execute the requested function and container status information, the electronic device (300) may divide the function into multiple sub-functions.
[0231] Additionally, according to one embodiment, the electronic device (300) may calculate the total amount of resources required to execute a function, calculate the remaining resources of each of a plurality of containers created for a user execution environment based on container status information, and divide the function into a plurality of sub-functions based on the remaining resources of each of the plurality of containers.
[0232] For example, referring to FIG. 10, the first controller (1011) may include a prediction module (1012), a parsing module (1511), and / or a merging module (1512) described with reference to FIG. 10. In one embodiment, the parsing module (1511) may divide a function requested for execution into a plurality of sub-functions so that the functions may be requested for execution. In addition, in one embodiment, the merging module (1512) may provide a function for merging execution results of sub-functions so that an execution result value of a function requested from the user device (210) is provided according to the execution of the plurality of sub-functions.
[0233] According to various embodiments, the first controller (1011) may divide the requested a1 function into sub-functions, such as the a1_1 function and the a1_2 function, through the parsing module (1511) based on the required resource amount and container status information of the requested a1 function.
[0234] According to various embodiments, in operation 1407, the electronic device (300) may execute each of the plurality of sub-functions through at least one container among the plurality of containers based on the container state information.
[0235] According to one embodiment, the first controller (1011) may generate sub-functions a1_1 and a1_2 for the a1 function in response to an execution request for the a1 function through operation 1405. In one embodiment, the electronic device (300) may transmit an execution request (1502) for the a1_1 function and an execution request (1503) for the a1_2 function to the streaming platform (1020) through the first controller (1011).
[0236] According to one embodiment, the streaming platform (1020) may store an execution request for the a1_1 function in a message queue (1521) for the execution of the a1_1 function, and may store an execution request for the a1_2 function in a message queue (1522) for the execution of the a1_2 function. According to various embodiments, the streaming platform (1020) may store not only execution requests for the a1_1 and a1_2 functions, but also various data required for the execution of the a1_1 and a1_2 functions in the message queues (1521, 1522). For example, the streaming platform (1020) may store various data (e.g., code, artificial intelligence model, etc.) so that the first invoker (1031) may execute functions based on the execution requests for the a1_1 and a1_2 functions.
[0237] According to one embodiment, the first invoker (1031) can execute a function through a library loaded into multiple a1 containers (e.g., a1 containers (1003) of FIG. 10) for the first invoker (1031). For example, the first invoker (1021) can execute the a1_1 function (1504) and the a1_2 function (1505) based on execution requests of the a1_1 function and the a1_2 function stored in a message queue (1521) for execution of the a1_1 function and a message queue (1522) for execution of the a1_2 function.
[0238] According to one embodiment, the first invoker (1021) may select a container (1506) for executing a1_1, which is a sub-function for the a1 function, based on container state information, and execute the a1_1 function through the container (1506). In addition, according to one embodiment, the first invoker (1021) may select a container (1506) for executing a1_2, which is a sub-function for the a1 function, based on container state information, and execute the a1_2 function through the container (1506).
[0239] According to various embodiments, the first invoker (1031) may transfer the execution results of the a1_1 function and the a1_2 function executed through the a1 containers (1506, 1507) to the merge module (1512) in order to provide the execution results for the a1 function to the user device (210).
[0240] According to one embodiment, the merge module (1512) may merge the results of the divided sub-functions to provide the results of executing the function requested from the user device (210). Accordingly, the electronic device (300) may provide the same effect as transmitting the results to the user device (210) upon completion of execution of the requested function.
[0241] For example, when the electronic device (300) receives a request for video background removal using an artificial intelligence model from the user device (210) (e.g., function a1 of FIG. 15), the electronic device (300) may divide a plurality of image frames in the video into a first group and a second group, and then generate sub-functions (e.g., function a1_1 and function a1_2 of FIG. 15) that are background removal requests for each group. The electronic device (300) may perform background removal for each group, and then merge the background-removed images of each group through the merge module (1512) to provide the background removal result of the entire video to the user device (210).
[0242] According to various embodiments, the above-described a1 function and the plurality of sub-functions are not limited to the above-described examples, and can be applied to any sub-function that can be independently executed for the requested function.
[0243] According to various embodiments, the electronic device (300) can efficiently manage resource usage for each container by actively dividing and executing functions based on the amount of resources required for executing the function and the status information of the container. In addition, the electronic device (300) can provide the user with the execution result of the function more quickly by dividing the function into multiple sub-functions and executing the function even when the amount of resources to execute the entire function in a specific container is insufficient.
[0244]
[0245] FIG. 16 is a flowchart (1600) illustrating an operation of an electronic device according to various embodiments to determine whether a container has been created based on predicted generation information.
[0246] FIG. 17 is a diagram illustrating an electronic device according to various embodiments executing a function based on prediction generation information and container status information.
[0247] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0248] According to various embodiments, the operations illustrated in FIG. 16 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 16, or at least one operation may be performed less than those illustrated in FIG.
[0249] Meanwhile, the operation of the electronic device (300) generating a container based on the prediction generation information through FIG. 16 may be identical to or similar to the operation of the electronic device (300) generating a container based on the container prediction information through FIGS. 9 to 11. Therefore, in the following, any content overlapping with the content described with reference to FIGS. 9 to 11 may be omitted.
[0250] Referring to FIG. 16, the electronic device (300) may transmit a request for creation of a first container (e.g., a1 container) for a user execution environment associated with the user device based on container prediction information in operation 1601.
[0251] According to one embodiment, the electronic device (300) may obtain container prediction information through operation 901 and transmit a request to create a container based on the container prediction information.
[0252] For example, referring to FIG. 17, a first controller (1011) of an electronic device (300) (e.g., controller (231) of FIG. 2) can obtain a prediction generation request (1701). According to one embodiment, the electronic device (300) includes at least one controller (e.g., first controller (1011)) and can obtain a request (1701) to predict and pre-generate a container through the controller.
[0253] According to one embodiment, the electronic device (300) may generate the container prediction information based on the prediction module (1012). For example, the electronic device (300) may generate the container prediction information based on at least one of function execution pattern information, user history information, or user type information through the prediction module (1012).
[0254] According to one embodiment, the electronic device (300) may transmit a container creation request (1702) to a streaming platform (1020) (e.g., streaming platform (232) of FIG. 2) based on container prediction information through the first controller (1011). For example, the first controller (1011) may predict that an execution request for the a1 function will be obtained and transmit a container creation request (1702) related to the execution of the a1 function to the streaming platform (1020).
[0255] According to one embodiment, the streaming platform (1020) may store a container creation request for the a1 function in the message queue (1021) according to the container creation request (1702). According to various embodiments, the streaming platform (1020) may store not only the container creation request for the a1 function, but also various data (e.g., libraries, files, etc.) for creating a container for the a1 function in the message queue (1021).
[0256] According to one embodiment, the first invoker (1031) can create an a1 container (1703) based on a container creation request for the a1 function stored in the message queue (1021). For example, the first invoker (1031) can obtain an a1 container creation request based on container prediction information through the message queue (1021) and create an a1 container (1703). The first invoker (1031) can create an a1 container (1703) that can include or install libraries, data, files, etc. required to execute the a1 function.
[0257] According to various embodiments, the first invoker (1031) may generate prediction generation information (1710), which is status information related to the prediction generation of the a1 container (1703). For example, when the creation of the a1 container is requested based on the container prediction information, the prediction generation information may include first generation status information. In one embodiment, the first generation status information may include a status in which a request for creation of a container has been obtained but container creation has not yet been completed.
[0258] According to various embodiments, when the first invoker (1031) completes the creation of the a1 container based on the container prediction information, the prediction creation information may include second creation status information. In one embodiment, the second creation status information may include a status indicating that the creation of the container is complete according to a container creation request based on the container prediction information.
[0259] According to one embodiment, when the generation of the a1 container (1703) is completed, the first invoker (1031) may store the status information for the a1 container (1703) as the second generation status information in the prediction generation information (1710).
[0260] According to various embodiments, in operation 1603, the electronic device (300) can determine whether the first container has been generated through the prediction generation information (1710).
[0261] According to one embodiment, the electronic device (300) may determine the predicted generation information as a first generation state based on a request for container generation. Thereafter, when the predicted generation information (1710) is in the first generation state and the generation of the first container is completed, the electronic device (300) may determine the predicted generation information (1710) as a second generation state.
[0262] For example, the electronic device (300) can determine whether the requested container has been created based on a container creation request based on container prediction information through prediction creation information (1710).
[0263] For example, the electronic device (300) can obtain a request for executing a first function through the first controller (1011). According to one embodiment, the first controller (1011) can obtain a request for executing a function a1 (1705) for providing the artificial intelligence service based on a request for an artificial intelligence service obtained from the user device (210). In one embodiment, the first controller (1011) can determine (1706) whether the prediction generation of the a1 container (1703) for the a1 function is completed through the prediction generation information (1710).
[0264] According to various embodiments, in operation 1605, the electronic device (300) may obtain a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device based on the judgment result.
[0265] According to various embodiments, in operation 1607, the electronic device (300) may provide an artificial intelligence service to the user device by executing a first function through a library loaded into the first container.
[0266] According to one embodiment, the electronic device (300) may transmit a request (1707) for executing the a1 function to the streaming platform (1020) via the first controller (1011). For example, upon obtaining the request (1705) for executing the a1 function, the first controller (1011) may request (1707) the streaming platform (1020) to execute the a1 function.
[0267] According to one embodiment, the streaming platform (1020) may store an execution request for the a1 function in the message queue (1023) in response to an execution request (1005) for the a1 function. According to various embodiments, the streaming platform (1020) may store not only the execution request for the a1 function but also various data required for the execution of the a1 function in the message queue (1023). For example, the streaming platform (1020) may store various data (e.g., code, artificial intelligence model, etc.) so that the first invoker (1031) can execute the function based on the execution request for the a1 function.
[0268] For example, the first invoker (1021) can execute (1708) the a1 function based on an execution request of the a1 function stored in the message queue (1023). For example, the first invoker (1031) can execute the a1 function through the a1 container (1703) generated based on the container prediction information. According to one embodiment, the electronic device (300) can execute the a1 function directly from the pre-generated a1 container (1703) according to the execution request of the a1 function, thereby executing the function more responsively and providing an artificial intelligence service.
[0269] According to various embodiments, if the electronic device (300) determines based on the prediction generation information that the generation of the first container is not completed, the electronic device (300) may create a container for executing the first function and execute the function through the created container. For example, if the electronic device (300) determines that the a1 container (1703) has not been created, the electronic device (300) may create the a1 container according to an execution request (1705) for the a1 function and then execute the a1 function through the a1 container.
[0270] According to various embodiments, the first controller (1011) (or the first invoker (1031)) may update the container state information (1720) of the a1 container (1703) related to the execution of the a1 function (e.g., the state information (1033) of FIG. 10).
[0271] According to various embodiments, the electronic device (300) is not limited to the above-described example, and may utilize the prediction generation information (1710) when deleting a pre-generated container based on container prediction information. For example, when a deletion request based on container prediction information is obtained for a pre-generated container, the electronic device (300) may store information indicating whether the deletion of the container has been completed in the prediction generation information (1710). That is, the prediction generation information (1710) may include status information regarding whether the creation and / or deletion of the container based on the container prediction information has been completed.
[0272]
[0273] FIG. 18 is a flowchart (1800) illustrating an operation of an electronic device selecting a container for executing a function according to various embodiments.
[0274] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0275] According to various embodiments, the operations illustrated in FIG. 18 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 18, or at least one operation may be performed less than those illustrated in FIG.
[0276] Referring to FIG. 18, in operation 1801, when a request for a second artificial intelligence service is received from a user device, the electronic device (300) can obtain a second function corresponding to the second artificial intelligence service.
[0277] According to various embodiments, the electronic device (300) may select a container for executing a second function among at least one container based on at least one of container state information, resources allocated to each of at least one container, or resources required to provide a second artificial intelligence service.
[0278] Referring to FIG. 17, the first controller (1011) may obtain an execution request for the a2 function following an execution request for the a1 function. As the execution request for the a2 function is obtained, the first controller (1011) may obtain the a2 function and select and execute a container for executing the a2 function from among at least one container created by the first invoker (1031) or the second invoker (1032). At this time, the first controller (1011) may select a container based on at least one of container status information, resources allocated to each of at least one containers, or resources required to provide the second artificial intelligence service.
[0279] According to various embodiments, the electronic device (300) selecting a container for execution of the a2 function may be identical to or similar to the operation 907 described with reference to FIG. 9. Therefore, redundant descriptions may be omitted.
[0280]
[0281] FIG. 19 is a flowchart illustrating an operation of an electronic device re-requesting container creation according to various embodiments.
[0282] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0283] According to various embodiments, the operations illustrated in FIG. 19 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 19, or at least one operation may be performed less than those illustrated in FIG.
[0284] Referring to FIG. 19, in operation 1901, the electronic device (300) can determine whether the creation of the first container has been completed within a preset time. For example, the electronic device (300) can determine whether the first container has been created through predicted creation information according to operation 1603, and determine whether the preset time has passed from the time when the creation of the first container was requested, and whether the creation of the first container has been completed within the preset time.
[0285] According to various embodiments, in operation 1903, if the generation of the first container is not completed within a preset time, the electronic device (300) may re-request the generation of the first container. For example, if the electronic device (300) requests the generation of the first container based on container prediction information, but the generation of the first container is not completed within a preset time, the electronic device (300) may re-request the generation of the first container. At this time, the electronic device (300) may determine whether the first container is generated within the preset time based on the prediction generation information (1710).
[0286] According to various embodiments, if the electronic device (300) determines that the first container has not been generated within a preset time based on the result of checking through the prediction generation information (1710), the electronic device (300) may determine that the prediction generation has failed and re-request the generation of the first container.
[0287] However, without being limited to the above-described example, if the electronic device (300) determines through the prediction generation information (1710) that the first container has not been generated within a preset time, the electronic device (300) may generate a container when a function execution request is made without performing prediction generation.
[0288] According to various embodiments, the electronic device (300) can manage not only the container state information (1720) that can be shared between various components described with reference to FIG. 2, such as an invoker, a controller, etc., but also the prediction generation information (1710), thereby checking not only the state of the container (the execution state of the function) according to the function execution request, but also the state of the container prediction generation / deletion. Accordingly, the electronic device (300) can check and resolve the problem that the container creation / deletion based on the container prediction information is not processed due to an error.
[0289]
[0290] FIG. 20 is a flowchart (2000) illustrating an operation of an electronic device according to various embodiments to monitor the execution of a function based on a monitoring execution environment.
[0291] FIG. 21 is a flowchart (2100) illustrating an operation of creating a monitoring execution environment when an electronic device executes a function acquired based on a first service according to various embodiments.
[0292] Figure 22 is a diagram illustrating a first monitoring environment by a container engine generated based on the operating system of a user device.
[0293] Figure 23 is a diagram illustrating a second monitoring environment created based on an operating system separate from the operating system of the user device.
[0294] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0295] According to various embodiments, the operations illustrated in FIG. 20 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 20, or at least one operation may be performed less than those illustrated in FIG.
[0296] According to various embodiments, the operations illustrated in FIG. 21 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 21, or at least one operation may be performed less than those illustrated in FIG.
[0297] Referring to FIG. 20, in operation 2001, the electronic device (300) may obtain a request for an artificial intelligence service from a user device (e.g., the user device (210) of FIG. 2). For example, the electronic device (300) may obtain a request for an artificial intelligence service from the user device (210) through a web server (221).
[0298] According to various embodiments, the electronic device (300) may obtain a request for execution of a first function corresponding to an artificial intelligence service in operation 2003.
[0299] According to various embodiments, the electronic device (300) may, in operation 2005, generate a user execution environment for executing the first function in response to a request for executing the first function.
[0300] According to various embodiments, the electronic device (300) may create a monitoring execution environment for monitoring a user execution environment in operation 2007.
[0301] According to various embodiments, the electronic device (300) may monitor the execution of the first function based on the monitoring execution environment in operation 2009.
[0302] Referring to FIG. 22, a hierarchical structure of a serverless platform (2200) (e.g., the serverless platform of FIG. 1) including a first monitoring container engine (M_Con_Eng) (2206) based on a user operating system (U_OS) (2204) is illustrated.
[0303] Referring to FIG. 23, a hierarchical structure of a serverless platform (2200) (e.g., the serverless platform of FIG. 1) including a second monitoring container engine (M_Con_Eng) (2304) based on a monitoring operating system (M_OS) (2302) is illustrated.
[0304] According to various embodiments, a serverless platform (2200) may include actual physical hardware (2201), a host OS (2202) which is an operating system running on the physical hardware, a hypervisor (2203) which runs multiple virtual machines (guest OS) through virtualization, a user operating system (U_OS) (2204) which has an independent operating system as a virtual machine running on the hypervisor, a container engine (2205) which manages containers for function execution as software that manages and runs containers, a first monitoring container engine (2206) which manages containers for monitoring, containers (2207, 2208) in which actual functions are run, monitoring containers (2209, 2210) in which functions for monitoring are run, functions (2211, 2212) which are run through containers, and functions for monitoring (2213, 2214). The components of the serverless platform (2200) illustrated in FIG. 22 may be modified, deleted, or added, as an example.
[0305] According to various embodiments, the serverless platform (2200) may include a user operating system (U_OS) (2301) having an independent operating system as a virtual machine running on a hypervisor, a monitoring operating system (M_OS) (2302) as an operating system for monitoring, a container engine (2303) as software for managing and executing containers for managing containers for function execution, a second monitoring container engine (2306) for managing containers for monitoring based on the monitoring operating system, containers (2305, 2306) in which actual functions are executed, monitoring containers (2308, 2309) in which functions for monitoring are executed, functions (2310, 2311) executed through containers, and functions for monitoring (2312, 2313).
[0306] That is, according to various embodiments, the monitoring execution environment may include a first monitoring environment generated by a container engine based on the user operating system or a second monitoring environment generated based on an operating system separate from the user operating system. In one embodiment, the electronic device (300) may monitor the execution process through at least one of the monitoring containers (2209, 2210, 2308, 2309) as the first function is executed, and may collect status information or record a log when necessary.
[0307] According to various embodiments, when using an additional, separate virtual machine for monitoring, i.e., when monitoring is based on a monitoring operating system (2302), the monitoring tasks can be virtually separated so that they do not share the same hardware resources. This allows for a more stable monitoring environment.
[0308] According to various embodiments, when a request for execution of a function is obtained, the serverless platform (2200) may create a new virtual machine (user operating system (2204, 2301) or reuse an existing machine, and create a container (2207, 2208, 2305, 2306) through a container engine (2205, 2303) on top of the virtual machine to execute the function (2211, 2212, 2310, 2311). At this time, the monitoring environment may be an environment by a monitoring container engine (2206) created based on the user operating system (2205). In addition, the monitoring environment may be an environment by a monitoring container engine (2304) created based on the monitoring operating system (2302). According to various embodiments, the monitoring container engine (2206, 2304) may delete or stop a container executing a function through an API. According to one embodiment, the monitoring container To manage the execution of functions through and their deletion, the monitoring container engine (2206, 2304) may be connected to a container engine (2205, 2303) and / or a hypervisor (2203).
[0309] According to various embodiments, the electronic device (300) may generate a first monitoring environment and / or a second monitoring environment as described with reference to FIG. 22 and / or FIG. 23 in operation 2007.
[0310] According to various embodiments, the electronic device (300) may, in operation 2011, control the operating system of the user execution environment in the monitoring execution environment to perform an operation based on the type of error. For example, the electronic device (300) may, based on the type of the error, perform at least one of terminating a first container in which a first function is loaded, reallocating resources for the first container, re-executing the first function, and regenerating a user execution environment corresponding to the user execution environment.
[0311] According to one embodiment, the electronic device (300) can monitor the execution of the first function through the monitoring execution environment, and deactivate the monitoring execution environment when the execution of the first function is completed.
[0312] Referring to FIG. 21, the electronic device (300) may determine, in operation 2101, whether the artificial intelligence service obtained from the user device is a third-party service. For example, the electronic device (300) may determine whether the request for the artificial intelligence service obtained from the user device (210) is a request for a third-party service related to the use of at least one artificial intelligence model.
[0313] According to various embodiments, in operation 2103, the electronic device (300) may determine whether the first function to be executed by the third service is a function obtained based on the first service. For example, the electronic device (300) may determine whether the artificial intelligence model to be executed in the artificial intelligence service providing system (1) is a function obtained based on the first service, in response to a request from the third service related to the use of the artificial intelligence model. In one embodiment, the first service may mean a request related to the provision of an algorithm.
[0314] According to various embodiments, in operation 2105, if the first function is a function acquired by the first service as a result of the determination, the electronic device (300) may create a monitoring execution environment. For example, if the electronic device (300) executes a function in response to a request for an artificial intelligence service acquired from the user device (210), the electronic device (300) may create a monitoring execution environment in response to the function being a function acquired by the first service described with reference to FIG. 1.
[0315] According to one embodiment, unlike functions (e.g., artificial intelligence models) generated and managed by the system (1), functions obtained by providing the first service from the user device (210) may have a higher possibility of errors occurring during execution. Accordingly, the electronic device (300) may create a monitoring execution environment for monitoring when the function to be executed by the system (1) is an algorithm obtained from the user device (210) in accordance with the provision of the first service.
[0316] According to various embodiments, the electronic device (300) may determine, when an error is detected in the execution of the first function as a result of monitoring the execution of the first function through a monitoring execution environment. When an error is detected in the execution of the first function, the electronic device (300) may provide information about the error to a user device (e.g., the first user device (110)) that provided the first function. That is, when a function acquired through the user device (210) is executed at the request of another user and an error is found in the process, the electronic device (300) may provide various information about the error, including when, when, and what code was executed, and what error occurred, to the user device (110) that provided the first function.
[0317]
[0318] FIG. 24 is a flowchart illustrating an operation of an electronic device transmitting a diagnostic report to a user device according to various embodiments.
[0319] Each of the operations described below may be performed in combination with one another. In addition, among the operations described below, operations by an electronic device (300) (e.g., the artificial intelligence service server (100) of FIG. 1) may refer to operations by a processor (310) of the electronic device (300).
[0320] According to various embodiments, the operations illustrated in FIG. 24 may be performed in various orders, not limited to the order illustrated. Furthermore, according to various embodiments, more operations may be performed than those illustrated in FIG. 24, or at least one operation may be performed less than those illustrated in FIG.
[0321] Referring to FIG. 24, in operation 2401, if an error is detected in the execution of the first function as a result of monitoring, the electronic device (300) may generate a diagnostic report including information on the type of error and an operation to be performed based on the type of error. For example, the electronic device (300) may monitor the execution of the first function according to operation 2009, and if an error is detected as a result of monitoring, generate information on the error as a diagnostic report.
[0322] According to various embodiments, in operation 2403, the electronic device (300) may transmit a diagnostic report to the user device. For example, the electronic device (300) may provide information about the error to the user device (e.g., the first user device (110)) that provided the first function. That is, when the function acquired through the user device (210) is executed at the request of another user and an error is found in the process, the electronic device (300) may provide the user device (110) that provided the first function with various information about the error, including when, when which code was executed, and what error occurred.
[0323] As described above, an electronic device providing an artificial intelligence service based on a serverless platform according to an embodiment may include a communication circuit for transmitting and receiving signals with a user device, at least one processor, and a memory for storing instructions. The instructions may be individually or collectively executed by the at least one processor so that the electronic device obtains container prediction information related to container creation and container deletion (kill) based on function execution pattern information, creates at least one container for a user execution environment related to the user device based on the container prediction information, and, when a request for a first artificial intelligence service is received from the user device through the communication circuit, obtains a first function corresponding to the first artificial intelligence service, selects a first container for providing the first artificial intelligence service from among the at least one container, and executes the first function through a library loaded in the first container to provide the first artificial intelligence service to the user device.
[0324] According to one embodiment, the function execution pattern information may be determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the order of execution of at least one function executed to provide the at least one artificial intelligence service.
[0325] According to one embodiment, the instructions may be individually or collectively executed by the at least one processor so that the electronic device: predicts that execution of a second function will be requested as the first function is executed based on the function execution pattern information, creates a second container for loading the second function, and executes the second function through a library loaded in the second container to provide an artificial intelligence service to the user device.
[0326] In one embodiment, the instructions may be individually or collectively executed by the at least one processor to cause the electronic device to delete some of the at least one container created in the user execution environment based on the container prediction information.
[0327] According to one embodiment, the instructions may be individually or collectively executed by the at least one processor to cause the electronic device to obtain the container prediction information based on user history information. The user history information may include at least one of the type of function executed by the electronic device, the type of artificial intelligence service requested to the electronic device, and whether a preset amount of time has elapsed since the execution time of the last function executed by the electronic device.
[0328] According to one embodiment, the instructions may be individually or collectively executed by the at least one processor to cause the electronic device to input at least one of the user history information or the function execution pattern information into a container prediction model to obtain the container prediction information.
[0329] The container prediction model may include an artificial intelligence model trained to predict a container required for execution of a function related to a request to be obtained from the user device.
[0330] According to one embodiment, the user execution environment may include a plurality of containers. The instructions may be individually or collectively executed by the at least one processor to cause the electronic device to select the first container based on at least one of container state information of each of the plurality of containers, resources allocated to each of the plurality of containers, or resources required to provide the first artificial intelligence service.
[0331] According to one embodiment, the container status information for each of the plurality of containers may include information on whether a function corresponding to the artificial intelligence service is being executed.
[0332] According to one embodiment, the instructions may be individually or collectively executed by the at least one processor to cause the electronic device to: determine an amount of resources required for execution of a third function based on properties of the third function to be executed to provide a request obtained from the user device; obtain container state information for each of a plurality of containers for the user execution environment; divide the third function into a plurality of sub-functions based on the amount of resources for the third function and the container state information; and execute each of the plurality of sub-functions through at least one container among the plurality of containers based on the container state information.
[0333] According to one embodiment, the instructions may be individually or collectively executed by the at least one processor to cause the electronic device to: determine whether the first container has been created for the user execution environment based on the container prediction information, and, based on the determination result that the first container has been created, load a library for executing a function corresponding to the first container.
[0334] As described above, an operating method of an electronic device providing an artificial intelligence service based on a serverless platform according to an embodiment may include an operation of obtaining container prediction information related to container creation and container deletion (kill) based on function execution pattern information, an operation of creating at least one container for a user execution environment related to the user device based on the container prediction information, an operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit, an operation of selecting a first container for providing the first artificial intelligence service from among the at least one container, and an operation of executing the first function through a library loaded in the first container to provide the artificial intelligence service to the user device.
[0335] According to one embodiment, the function execution pattern information may be determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the order of execution of at least one function executed to provide the at least one artificial intelligence service.
[0336] According to one embodiment, the operating method of the electronic device may include an operation of predicting that execution of a second function will be requested as the first function is executed based on the function execution pattern information, an operation of creating a second container for loading the second function, and an operation of providing an artificial intelligence service to the user device by executing the second function through a library loaded into the second container.
[0337] According to one embodiment, the method of operating the electronic device may include an operation of deleting some of at least one container created in the user execution environment based on the container prediction information.
[0338] According to one embodiment, the method of operating the electronic device may include an operation of obtaining the container prediction information based on user history information. The user history information may include at least one of the type of function executed on the electronic device, the type of artificial intelligence service requested to the electronic device, and whether a preset amount of time has elapsed since the execution time of the last executed function on the electronic device.
[0339] According to one embodiment, the operation of obtaining the container prediction information may include an operation of obtaining the container prediction information by inputting at least one of the user history information or the function execution pattern information into a container prediction model. The container prediction model may include an artificial intelligence model trained to predict a container required for execution of a function related to a request to be obtained from the user device.
[0340] According to one embodiment, the user execution environment may include a plurality of containers. The operation of selecting the first container may include an operation of selecting the first container based on at least one of container state information of each of the plurality of containers, resources allocated to each of the plurality of containers, or resources required to provide the first artificial intelligence service.
[0341] According to one embodiment, the container status information for each of the plurality of containers may include information on whether a function corresponding to the artificial intelligence service is being executed.
[0342] According to one embodiment, the operating method of the electronic device may include an operation of determining an amount of resources required for executing a third function based on an attribute of the third function to be executed to provide a request obtained from the user device, an operation of obtaining container status information for each of a plurality of containers for the user execution environment, an operation of dividing the third function into a plurality of sub-functions based on the amount of resources for the third function and the container status information, and an operation of executing each of the plurality of sub-functions through at least one container among the plurality of containers based on the container status information.
[0343] As described above, a recording medium according to an embodiment may include a computer-readable recording medium recording a program for executing an operation of obtaining container prediction information related to container creation and container deletion (kill) based on function execution pattern information, an operation of creating at least one container for a user execution environment related to the user device based on the container prediction information, an operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit, an operation of selecting a first container to provide the first artificial intelligence service from among the at least one container, and an operation of executing the first function through a library loaded into the first container to provide the artificial intelligence service to the user device.
[0344] In this disclosure, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" may include any one of the items listed together in the corresponding phrase, or all possible combinations thereof.
[0345] Terms such as "first," "second," or "first" or "second" may be used simply to distinguish one component from another and do not qualify the components in any other respect (e.g., importance or order).
[0346] The terms "unit" and "module" used in various embodiments of the present disclosure may include units implemented in hardware, software, or firmware. For example, they may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integrally formed component or a minimum unit or part of the component that performs one or more functions. The "unit" and "module" used in various embodiments of the present disclosure may be stored in an addressable storage medium and implemented by various programs that can be executed by a processor.
[0347] Various embodiments of the present disclosure may be implemented as software (e.g., a program) including one or more commands stored in a memory (320) (e.g., built-in memory or external memory) readable by a device (e.g., an electronic device (300)). The memory (320) may be represented as a storage medium.
[0348] According to one embodiment, the methods according to the various embodiments disclosed in this document may be provided as a computer program product. The computer program product may be traded as a commodity between a seller and a buyer. The computer program product may be distributed in the form of a device-readable storage medium (e.g., a compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) through an application store or directly between two user devices.
[0349] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and placed in other components. According to various embodiments, one or more components or operations of the above-described components may be omitted, or one or more other components or operations may be added. Additionally or alternatively, a plurality of components (e.g., a module or a program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each component of the plurality of components in a manner identical to or similar to that performed by the corresponding component among the plurality of components prior to the integration.
[0350] According to various embodiments, the operations performed by a module, program or other component may be performed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be performed in a different order, omitted, or one or more other operations may be added.
Claims
1. In an electronic device that provides artificial intelligence services based on a serverless platform, A communication circuit for transmitting and receiving signals with a user device; at least one processor; and Contains memory for storing commands, The above instructions are individually or collectively executed by the at least one processor so that the electronic device: Obtain container prediction information related to container creation and container deletion (kill) based on function execution pattern information, Based on the above container prediction information, at least one container is created for a user execution environment associated with the user device, When a request for a first artificial intelligence service is received from the user device through the above communication circuit, a first function corresponding to the first artificial intelligence service is obtained, Selecting a first container to provide the first artificial intelligence service among at least one of the containers, and An electronic device that provides the first artificial intelligence service to the user device by executing the first function through the library loaded into the first container.
2. In claim 1, An electronic device wherein the above function execution pattern information is determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the order of execution of at least one function executed to provide the at least one artificial intelligence service.
3. In claim 2, The above instructions are individually or collectively executed by the at least one processor so that the electronic device: Based on the above function execution pattern information, it is predicted that execution of the second function will be requested as the first function is executed, Create a second container to load the second function, An electronic device that provides an artificial intelligence service to the user device by executing the second function through a library loaded into the second container.
4. In claim 1, An electronic device, wherein the commands are individually or collectively executed by the at least one processor to cause the electronic device to delete some of the at least one container created in the user execution environment based on the container prediction information.
5. In claim 1, The above instructions are individually or collectively executed by the at least one processor to cause the electronic device to obtain the container prediction information based on user history information, An electronic device, wherein the user history information includes at least one of the type of function executed on the electronic device, the type of artificial intelligence service requested to the electronic device, and whether a preset amount of time has elapsed since the execution time of the last executed function on the electronic device.
6. In claim 5, The above instructions are individually or collectively executed by the at least one processor, so that the electronic device: By inputting at least one of the user history information or the function execution pattern information into a container prediction model, the container prediction information is obtained, An electronic device, wherein the container prediction model includes an artificial intelligence model learned to predict a container required for execution of a function related to a request to be obtained from the user device.
7. In claim 1, The above user execution environment includes multiple containers, The above instructions are individually or collectively executed by the at least one processor so that the electronic device: An electronic device that selects the first container based on at least one of container status information of each of the plurality of containers, resources allocated to each of the plurality of containers, or resources required to provide the first artificial intelligence service.
8. In claim 7, An electronic device, wherein the container status information for each of the plurality of containers includes information on whether a function corresponding to the artificial intelligence service is being executed.
9. In claim 1, The above instructions are individually or collectively executed by the at least one processor so that the electronic device: Based on the properties of the third function to be executed to provide the request obtained from the user device, the amount of resources required for executing the third function is determined, Obtain container status information for each of multiple containers for the above user execution environment, Based on the amount of resources for the third function and the container status information, the third function is divided into multiple sub-functions, An electronic device that executes each of the plurality of sub-functions through at least one container among the plurality of containers based on the container status information.
10. In claim 1, The above instructions are individually or collectively executed by the at least one processor so that the electronic device: Based on the above container prediction information, it is determined whether the first container has been created for the user execution environment, An electronic device that loads a library for executing a function corresponding to the first container based on the above judgment result that the first container is created.
11. In the method of operating an electronic device that provides artificial intelligence services based on a serverless platform, An action to obtain container prediction information related to container creation and container kill based on function execution pattern information; An operation of generating at least one container for a user execution environment associated with a user device based on the container prediction information; An operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit; An operation of selecting a first container to provide the first artificial intelligence service among at least one of the containers; and An operating method of an electronic device, comprising an operation of providing an artificial intelligence service to the user device by executing the first function through a library loaded into the first container.
12. In claim 11, An operating method of an electronic device, wherein the above function execution pattern information is determined based on at least one of the order of at least one artificial intelligence service provided through the serverless platform or the order of execution of at least one function executed to provide the at least one artificial intelligence service.
13. In claim 12, An action of predicting that execution of a second function will be requested as the first function is executed based on the above function execution pattern information; An action of creating a second container to load the second function; and An operating method of an electronic device, further comprising an action of providing an artificial intelligence service to the user device by executing the second function through a library loaded into the second container.
14. In claim 11, An operating method of an electronic device, further comprising an action of deleting at least some of the containers created in the user execution environment based on the container prediction information.
15. An action to obtain container prediction information related to container creation and container deletion (kill) based on function execution pattern information; An operation of generating at least one container for a user execution environment associated with the user device based on the container prediction information; An operation of obtaining a first function corresponding to the first artificial intelligence service when a request for the first artificial intelligence service is received from the user device through the communication circuit; An operation of selecting a first container to provide the first artificial intelligence service among at least one of the containers; and A computer-readable recording medium recording a program for executing an operation of providing an artificial intelligence service to the user device by executing the first function through a library loaded into the first container.
Citation Information
Patent Citations
Resource management device and resource management method
JP7459407B2
An electronic device for switching voice focus among a plurality of counterparts, and method for controlling the same
KR1020230151421A
Cloud system and control method thereof
KR102284264B1
Garlic bread manufacturing method and garlic bread using the same
KR102300693B1
System and method for proactively and automatically allocating resources for AI workloads in cloud native computing environment
KR102563279B1