Method, device and equipment for creating sandbox environment and storage medium
By acquiring application attributes and resource pool information, the target resource nodes are identified, and a dedicated sandbox environment is created for personal applications. This solves the problem that existing technologies cannot provide a dedicated sandbox environment, and enables efficient development and debugging support.
Patent Information
- Application Number
- CN202310125625.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing technologies cannot provide a dedicated sandbox environment for personal applications, making it impossible to conduct dedicated development and testing.
By obtaining the application's attribute information and the usage information of the sandbox resource pool, the target resource node is identified and allocated to the application to create a dedicated sandbox environment.
It enables the creation of a dedicated sandbox environment for personal applications, supporting development, debugging, and operation, and improving the dynamic stability of user experience and resource management.
Smart Images

Figure CN115994349B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and particularly relates to a sandbox environment creation method and device, equipment and a storage medium. BACKGROUND
[0002] The sandbox environment, also known as a development environment and a test environment, is an environment specially provided for development and testing. The sandbox environment created at present is mainly for projects with a known scale, that is, a development and test environment specially provided for projects with a known scale.
[0003] However, for personal applications, due to the unknown scale and other reasons, only an online compiling and debugging environment can be provided at present, and a development and test environment specially provided for personal applications cannot be provided.
[0004] Application Content
[0005] The present application provides a sandbox environment creation method, device, equipment and storage medium, which can solve the problem that the prior art cannot provide a sandbox environment specially for personal applications.
[0006] In a first aspect, the present application provides a sandbox environment creation method, comprising the following steps.
[0007] In the case that a sandbox environment creation request is received, attribute information of a first application and first usage information of each resource node in a sandbox resource pool are acquired;
[0008] According to at least one of the attribute information and the first usage information, a target resource node capable of providing a first service is determined from the resource nodes, the first service being a service required for running the first application;
[0009] The target resource node is allocated to the first application, and a sandbox environment of the first application is created.
[0010] In a second aspect, the present application provides a sandbox environment creation device, comprising the following steps.
[0011] An acquisition module is configured to acquire attribute information of a first application and first usage information of each resource node in a sandbox resource pool in the case that a sandbox environment creation request is received;
[0012] A determination module is configured to determine a target resource node capable of providing a first service from the resource nodes according to at least one of the attribute information and the first usage information, the first service being a service required for running the first application;
[0013] A creation module is configured to allocate the target resource node to the first application, and create a sandbox environment of the first application.
[0014] In a third aspect, an electronic device is provided, including:
[0015] a processor;
[0016] a memory for storing computer program instructions;
[0017] When the computer program instructions are executed by the processor, the method as described in the first aspect is implemented.
[0018] In a fourth aspect, a computer readable storage medium is provided, which stores computer program instructions, and when the computer program instructions are executed by a processor, the method as described in the first aspect is implemented.
[0019] In a fifth aspect, a computer program product is provided, and instructions in the computer program product are executed by a processor of an electronic device, so that the electronic device executes the method as described in the first aspect.
[0020] In the case where the sandbox environment creation request is received, the target resource node capable of providing the service required by the first application for running can be determined according to at least one of the attribute information of the first application and the usage information of each resource node in the sandbox resource pool, and the target resource node is allocated to the first application to create the sandbox environment of the first application, that is, the sandbox environment dedicated to the first application can be created based on the target resource node, and the problem that the prior art cannot create the sandbox environment dedicated to the personal application is solved. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced below. Those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0022] Figure 1 A flowchart of a sandbox environment creation method provided by the embodiments of the present application;
[0023] Figure 2 A flowchart of a sandbox environment creation method provided by the embodiments of the present application;
[0024] Figure 3 A structural diagram of a sandbox environment creation device provided by the embodiments of the present application;
[0025] Figure 4 A structural diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are merely configured to explain the present application and are not configured to limit the present application. The present application can be implemented without some of the specific details described below. The following description of the embodiments is merely provided to provide a better understanding of the present application by showing examples of the present application.
[0027] It should be noted that, in this document, the terms such as first and second are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0028] As described above, the sandbox environment created at present is mainly for projects with known scale, and for personal applications, due to the large number and unpredictable scale, only online compilation and debugging environment can be provided at present, and a dedicated sandbox environment cannot be provided for personal applications.
[0029] Therefore, the embodiments of the present application provide a sandbox environment creation method, device and equipment and storage medium, which solve the problem that the prior art cannot provide a dedicated sandbox environment for personal applications.
[0030] The overall scheme of the sandbox environment creation method provided by the embodiments of the present application is as shown in Figure 1
[0031] (1) The user opens the cloud IDE, writes or uploads the personal application code, and saves it;
[0032] (2) Through the written or uploaded personal application code, the middleware required for the personal application to run is identified and set;
[0033] (3) The configuration information and initialization script required for the personal application to run are uploaded;
[0034] (4) According to the personal application code selected by the user and uploaded and configured, an online request for creating a sandbox environment is initiated;
[0035] (5) According to the sandbox resource matching algorithm, the personal application is matched with the resources in the sandbox resource pool, and a sandbox environment of the personal application is created;
[0036] (6) The sandbox resource management algorithm is used to dynamically manage the resources in the sandbox resource pool;
[0037] (7) After the sandbox environment of the personal application is successfully created, the user can execute the automatic CICD, and run, test and use the personal application.
[0038] The sandbox environment creation method provided by the embodiments of the present application will be described below in combination with specific embodiments, Figure 2 A flowchart of a sandbox environment creation method provided by the embodiments of the present application. The method can be applied to an electronic device, which can include but is not limited to a mobile phone, a tablet computer, a notebook computer, a palm computer, etc.
[0039] As shown in the figure, Figure 2 The sandbox environment creation method can include the following steps:
[0040] S210, in the case of receiving a sandbox environment creation request, obtaining attribute information of a first application and first usage information of each resource node in a sandbox resource pool.
[0041] S220, according to at least one of the attribute information and the first usage information, determining a target resource node capable of providing a first service from each resource node.
[0042] The first service is a service required for the first application to run.
[0043] S230, assigning the target resource node to the first application, and creating a sandbox environment of the first application.
[0044] In the case of receiving a sandbox environment creation request, the embodiments of the present application can determine a target resource node capable of providing a service required for a first application to run according to at least one of attribute information of the first application and usage information of each resource node in a sandbox resource pool, and assign the target resource node to the first application to create a sandbox environment of the first application. That is, the embodiments of the present application can create a dedicated sandbox environment for the first application based on the target resource node, solving the problem that the prior art cannot create a dedicated sandbox environment for a personal application.
[0045] The above steps will be described in detail as follows:
[0046] In S210, the sandbox environment creation request is used to request to create a dedicated sandbox environment for the test and running of a personal application. For example, in the case of determining a personal application code by a user, the user can initiate a sandbox environment creation request online.
[0047] The personal application code can be pre-written or uploaded by the user. For example, the user can upload the local personal application code through a cloud IDE environment, or write the personal application code according to a cloud function template provided by a Serverless service (or other services). After writing or uploading, the personal application code can be automatically uploaded to the same code repository for storage.
[0048] The first application can be a personal application, for example. The attribute information of the first application can include, for example, the application size of the first application, i.e., the size of the first application (e.g., 2M), and the initialization data volume of the first application. The initialization data volume can be determined based on the initialization script uploaded by the user.
[0049] The sandbox resource pool is used to store a plurality of resource nodes, and different resource nodes can provide different services. The first usage information, i.e., the usage of the hardware resources by the resource nodes, can include, for example, the usage of the central processing unit (CPU), memory, input / output (I / O), and the like.
[0050] For example, the usage information of the resource nodes in the sandbox resource pool can be obtained through a heartbeat monitoring program. For example, the heartbeat monitoring program can monitor the usage percentage of the CPU, memory, I / O, and the like by the resource nodes.
[0051] In S220, the first service is a service required for the first application to run, i.e., a middleware service. The middleware can include, for example, MySQL, Redis, and the like.
[0052] The target resource node can be one or more resource nodes in the sandbox resource pool.
[0053] In some embodiments, the target resource node can be determined from the resource nodes based on at least one of the size information of the first application and the first usage information of the resource nodes, to provide a basis for creating a sandbox environment for the personal application.
[0054] For example, the target resource node can be determined based on the first usage information of the resource nodes. In this case, the first usage information can include the usage percentage of the preset resources by the resource nodes, and the preset resources can include, for example, the CPU, memory, and I / O.
[0055] Based on this, in some embodiments, S220 described above can include the following steps:
[0056] In a case where the percentage of use of the preset resource by the resource node is less than the first use lower limit, the resource node with the percentage of use of the preset resource less than the first use lower limit is determined as the target resource node, and the first use lower limit is a use lower limit of the preset resource by the sandbox resource pool.
[0057] Exemplarily, the first use lower limit is a use lower limit of the sandbox resource pool on CPU, memory and I / O, which are LL cpu , LL mem and LL I / O respectively, wherein LL cpu <100%, LL mem <100% and LL I / O <100%. The first use lower limit can be preset.
[0058] Specifically, the percentage of use of CPU, memory and I / O by each resource node can be counted by the heartbeat listener, and then the resource node with the percentage of use of CPU R cpu less than LL cpu , the percentage of use of memory R mem less than LL mem and the percentage of use of I / O less than LL I / O is determined as the target resource node from the sandbox resource pool.
[0059] Embodiments of the present application first consider the use of hardware resources by each resource node from the perspective of hardware resources, that is, if the percentage of use of CPU, memory and I / O by a resource node is less than the use lower limit of CPU, memory and I / O by the sandbox resource pool, it indicates that the resource node can still provide other services, for example, it can still provide middleware services required for running the first application, and therefore the resource node can be used as the target resource node to create a sandbox environment.
[0060] Exemplarily, the first use information can further include the percentage of use of the resource node, which is determined according to the percentage of use of the preset resource by the resource node. Exemplarily, R node = W cpu *R cpu +W mem *R mem +W I / O *R I / O , wherein R node is the percentage of use of the resource node, W cpu , W mem and W I / O are evaluation weights of CPU, memory and I / O respectively, and W cpu +W mem +W I / O = 1.
[0061] Based on this, in some embodiments, S220 can include the following steps:
[0062] In the case that the usage percentage of the preset resource of the resource node is not less than the first usage lower limit, and the usage percentage of the resource node is less than the second usage lower limit, the resource node whose usage percentage of the preset resource is not less than the first usage lower limit and whose usage percentage of the resource node is less than the second usage lower limit is determined as the target resource node, and the second usage lower limit is the usage lower limit of the resource node.
[0063] The second usage lower limit LL node <100%. For example, when the usage percentage R cpu of CPU of a certain resource node is greater than or equal to LL cpu , the usage percentage R mem of memory is greater than or equal to LL mem , and the usage percentage R I / O of I / O is greater than or equal to LL I / O , the relationship between R node and LL node may be further determined. For example, in the case of R node < LL node , the resource node can be determined as the target resource node, otherwise not as the target resource node.
[0064] In the case that the usage percentage of the preset resource of the resource node is greater than or equal to the usage lower limit of the preset resource of the sandbox resource pool, the embodiments of the present application further consider the relationship between the resource of the resource node and the usage lower limit of the resource node. If the resource of the resource node is less than the usage lower limit of the resource node, it indicates that the resource node can still provide the middleware service required by the first application to run, and at this time the resource node can be used as the target resource node to create a sandbox environment.
[0065] For example, the target resource node can also be determined according to the attribute information of the first application and the first usage information of the resource node. For example, the attribute information of the first application includes the application size and the initialization data volume of the first application. In some embodiments, S220 can include the following steps:
[0066] In the case that the usage percentage of the preset resource of the resource node is not less than the first usage lower limit, the usage percentage of the resource node is not less than the second usage lower limit, the application size of the first application satisfies the first preset condition, and the initialization data volume of the first application satisfies the second preset condition, the resource node whose usage percentage is greater than the second usage lower limit and less than the first usage upper limit is determined as the target resource node, and the first usage upper limit is the usage upper limit of the resource node.
[0067] Exemplarily, the first preset condition can be that the application size of the first application is at or below medium, and the second preset condition can be that the initialization data amount of the first application is at or below medium.
[0068] Exemplarily, the application size can be classified into different levels according to the size of the application size, for example, the application size can be classified into three levels of high, medium and low, wherein the larger the application size is, the higher the corresponding level is, for example, the three levels of high, medium and low represent the application size decreasing in turn. The level division of the initialization data amount is similar to that of the application size, that is, the initialization data amount can also be divided into three levels of high, medium and low according to the size of the initialization data amount.
[0069] The first usage upper limit UL node is the usage upper limit of the resource node.
[0070] Specifically, the resource node whose usage percentage of the preset resource is not less than the first usage lower limit, the usage percentage of the resource node is not less than the second usage lower limit, the level of the application size is at or below medium, the level of the initialization data amount is at or below medium, and the usage percentage is greater than the second usage lower limit and less than the first usage upper limit, can be determined as the target resource node.
[0071] The embodiment of the present application determines the target resource node according to the level of the application size and the initialization data amount of the first application and the relationship between R cpu , R mem and R I / O is not less than LL cpu , LL mem and LL I / O , and R node is not less than LL node . node node node , so as to ensure that the determined target resource node can provide the middleware service required for the running of the first application, thereby creating a dedicated sandbox environment for the first application.
[0072] The above W cpu , W mem and W I / O , LL cpu , LL mem and LL I / O , UL cpu , UL mem and UL I / O , and UL node and LL node The values of the parameters, and the level of the application size and the initialization data volume can be configured in advance through a configuration page, and the specific sizes of the parameters and the level are not limited in the embodiments of the present application.
[0073] The embodiments of the present application can automatically allocate the resource nodes in the sandbox resource pool to the first application according to the usage of the sandbox resource pool, the application size of the first application, and the initialization data volume, and create a sandbox environment based on the allocated resource nodes, thereby solving the problem that the prior art cannot create a dedicated sandbox environment for a personal application.
[0074] In S230, after the target resource node is determined, the target resource node can be allocated to the first application, and a sandbox environment of the first application is created.
[0075] After the sandbox environment is created, the user can develop, debug, and run the first application in the sandbox environment based on the cloud IDE, and can also perform automatic CICD operation, continuously integrate and deploy the personal application to the dedicated sandbox environment based on the Serverless service and application and in combination with the GitOps engine.
[0076] In some embodiments, when the user exits the sandbox environment, the user can be prompted to download the configuration information and data scripts related to the first application, so that the user can continue to develop, debug, and run on the basis of the first application by uploading the latest configuration information and data scripts the next time the sandbox environment is applied, thereby saving time and effort.
[0077] It should be understood that as the resource nodes are used, the resources in the sandbox resource pool are also consumed, and at this time, the stability of the resources needs to be maintained, for example, when the user exits the sandbox environment, the sandbox resources are recovered in time; the usage of the sandbox resource pool is acquired in real time and the resources are supplemented in time; the historical application data of the sandbox resources are analyzed, and the sandbox resources are reserved in advance, and in this way, the availability of the sandbox environment and the experience of the user can be improved.
[0078] Based on this, in some embodiments, after the user exits the sandbox environment, the personal application (such as a personal namespace, a POD, a Service, an image, and a deployment file) of the user can be stopped and deleted, the middleware service can be stopped and deleted, and the configuration information and data related to the personal application can be deleted, so as to recover the sandbox resources.
[0079] In some embodiments, after S230, the sandbox environment creation method can further include the following steps:
[0080] S240, counting the first resource nodes in the sandbox resource pool whose first usage information meets a second preset condition;
[0081] S250, supplementing resources to the sandbox resource pool according to the number of the first resource nodes and the first usage information.
[0082] The first usage information of each resource node in the sandbox resource pool can be obtained in the manner described in the above embodiments, and will not be described again here for brevity.
[0083] The second preset condition can be, for example, that the first usage information is greater than a set threshold, that is, the embodiments of the present application can filter the resource nodes based on the first usage information, and supplement resources for the sandbox resource pool based on the number and usage information of the filtered resource nodes, to maintain the dynamic stability of the sandbox resource pool.
[0084] Taking an example in which the first usage information includes the usage percentage of the resource node on the central processing unit (CPU), memory, and input / output, the S240 described above can include the following steps:
[0085] The second resource node whose usage percentage on the CPU is greater than a second usage upper limit, the third resource node whose usage percentage on the memory is greater than a third usage upper limit, the fourth resource node whose usage percentage on the input / output is greater than a fourth usage upper limit, and the fifth resource node whose usage percentage is greater than a first usage upper limit are counted.
[0086] The second resource node, the third resource node, the fourth resource node, and the fifth resource node are determined as the first resource node.
[0087] The second preset condition can include, for example, that the usage percentage on the CPU is greater than a second usage upper limit UL cpu , the usage percentage on the memory is greater than a third usage upper limit UL mem , the usage percentage on the input / output is greater than a fourth usage upper limit UL I / O , and the usage percentage is greater than a first usage upper limit UL node .
[0088] Specifically, the second resource node whose usage percentage on the CPU is greater than a second usage upper limit, the third resource node whose usage percentage on the memory is greater than a third usage upper limit, the fourth resource node whose usage percentage on the input / output is greater than a fourth usage upper limit, and the fifth resource node whose usage percentage is greater than a first usage upper limit can be counted as the first resource node.
[0089] The embodiments of the present application count the resource nodes whose usage percentages on the CPU, memory, and I / O are greater than the corresponding usage upper limits, so that the resources of the sandbox resource pool can be supplemented based on the number and usage of the counted resource nodes in the future, to maintain the dynamic stability of the sandbox resource pool.
[0090] Based on the above embodiments, exemplary, the S250 can include the following steps:
[0091] According to the number of second resource nodes and the percentage of CPU used by the second resource nodes, determine the amount of CPU that needs to be supplemented to the sandbox resource pool;
[0092] According to the number of third resource nodes and the percentage of memory used by the third resource nodes, determine the amount of memory that needs to be supplemented to the sandbox resource pool;
[0093] According to the number of fourth resource nodes and the percentage of input / output used by the fourth resource nodes, determine the amount of input / output that needs to be supplemented to the sandbox resource pool;
[0094] According to the number of fifth resource nodes and the percentage of use of the fifth resource nodes, determine the number of resource nodes that needs to be supplemented to the sandbox resource pool, or the resource that needs to be supplemented to the fifth resource node.
[0095] The embodiments of the present application do not limit the execution order of the above steps, for example, the above steps can be executed in the above order, or in other order, or the above steps can be executed simultaneously.
[0096] Exemplary, the amount of CPU that needs to be supplemented to the sandbox resource pool can be determined according to the number of second resource nodes and the percentage of CPU used by each second resource node, for example, if the percentage of CPU used by three second resource nodes exceeds the second usage upper limit, then the total amount of the percentage of CPU used by each second resource node that exceeds the second usage upper limit can be calculated, and then based on the total amount, the corresponding amount of CPU is supplemented to the sandbox resource pool, and the actual amount of CPU supplemented can be adjusted based on the calculated amount of CPU.
[0097] The supplement process of the amount of memory and the amount of input / output is similar, and the supplement process of CPU can be referred to.
[0098] It should be understood that the number of resource nodes in the sandbox resource pool and the services provided by each resource node are limited, therefore, during use, certain resource nodes need to be supplemented to the sandbox resource pool in time, or certain resources need to be supplemented to certain resource nodes.
[0099] For example, the number of resource nodes that needs to be supplemented to the sandbox resource pool, or the resource that needs to be supplemented to the fifth resource node can be determined according to the number of fifth resource nodes (used resource nodes) and the usage of the fifth resource nodes.
[0100] The resource that needs to be supplemented to the fifth resource node can be middleware services and the like.
[0101] In some embodiments, "determining the number of resource nodes that need to be supplemented to the sandbox resource pool according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes" can include the following steps:
[0102] In the case that there is no idle resource node left in the sandbox resource pool, determining the number of resource nodes that need to be supplemented to the sandbox resource pool according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes;
[0103] In the case that there is idle resource node left in the sandbox resource pool, transferring the resource nodes in the fifth resource nodes whose usage percentage is greater than the first usage upper limit to the idle resource nodes.
[0104] For example, when all the resource nodes in the sandbox resource pool are used, i.e., there is no idle resource node left, the number of resource nodes that need to be supplemented can be determined according to the usage percentage of each resource node. For example, when the usage percentage of each resource node is greater than UL node , more resource nodes can be supplemented. When only a small number of resource nodes in each resource node have a usage percentage greater than UL node , a small number of resource nodes can be supplemented to reduce the use of memory by the sandbox resource pool.
[0105] For example, when the resource nodes in the sandbox resource pool are not all used, i.e., there is an idle resource node, the idle resource node can be used first. For example, the services on the resource nodes whose usage percentage is greater than UL node can be transferred to the idle resource nodes to keep the services on each resource node balanced.
[0106] When there is no idle resource node in the sandbox resource pool, the embodiments of the present application supplement a certain number of resource nodes in time according to the usage of the used resource nodes. When there is an idle resource node in the sandbox resource pool, the idle resource node is used first to keep the services of each resource node balanced, so that the dynamic stability of the sandbox resource pool can be maintained.
[0107] In addition to supplementing the resources of the sandbox resource pool in time according to the usage of the resource nodes, the historical creation information of the sandbox environment can also be analyzed to reserve sandbox resources in advance to meet the sudden needs.
[0108] Based on this, in some embodiments, after S230, the sandbox environment creation method can further include the following steps:
[0109] Obtaining historical creation information of the sandbox environment and historical usage information of the resource nodes;
[0110] Determining the resource nodes and / or resources that need to be supplemented to the sandbox resource pool according to the historical creation information and usage data.
[0111] The historical creation information may include, for example, historical application information, application scale of a historical application, and initialization data volume, and the historical usage information may include, for example, historical usage of the sandbox environment on resource nodes such as CPU, memory, and I / O.
[0112] According to the historical creation information of the sandbox environment and the historical usage information of the resource nodes, the resource nodes and / or resources that need to be supplemented in the future can be determined, and the resources are reserved in advance to cope with sudden needs.
[0113] The embodiments of the present application realize dynamic management of resources in the sandbox resource pool by supplementing and reserving the sandbox resource pool in advance, and improve the availability of the sandbox environment and the user experience.
[0114] The embodiments of the present application provide a sandbox environment creation method for a developer personal application, and at least one of the scale information of the personal application and the usage information of each resource node in the sandbox resource pool can be used to automatically allocate a dedicated sandbox environment for the personal application. In the dedicated sandbox environment, the developer can develop, debug, and run the personal application, and perform CICD operations. Meanwhile, the resources in the sandbox resource pool can be dynamically managed to maintain the dynamic stability of the resources. For example, when the sandbox resources are insufficient, the sandbox resources can be supplemented in time, and the sandbox resources can be reserved in advance according to the historical application information of the sandbox environment to cope with sudden needs.
[0115] Based on the same inventive concept, the embodiments of the present application also provide a sandbox environment creation device, which will be described below in combination with Figure 3 The sandbox environment creation device provided by the embodiments of the present application will be described in detail.
[0116] Figure 3 The structure diagram of the sandbox environment creation device provided by the embodiments of the present application.
[0117] As shown in the structure diagram, the sandbox environment creation device may include: Figure 3
[0118] The acquisition module 310 is configured to acquire attribute information of a first application and first usage information of each resource node in a sandbox resource pool when a sandbox environment creation request is received.
[0119] The determination module 320 is configured to determine, according to at least one of the attribute information and the first usage information, a target resource node that can provide a first service from the resource nodes, the first service being a service required for running the first application.
[0120] The creation module 330 is configured to allocate the target resource node to the first application, and create a sandbox environment of the first application.
[0121] In the case that the sandbox environment creation request is received, the embodiment of the present application can determine the target resource node capable of providing the service required by the first application running according to at least one of the attribute information of the first application and the usage information of each resource node in the sandbox resource pool, and allocate the target resource node to the first application to create the sandbox environment of the first application, that is, the embodiment of the present application can create the exclusive sandbox environment for the first application based on the target resource node, and solve the problem that the prior art cannot create the exclusive sandbox environment for the personal application.
[0122] In some embodiments, the first usage information includes a usage percentage of the resource node on the preset resource.
[0123] The determining module 320 is specifically configured to:
[0124] In the case that the usage percentage of the resource node on the preset resource is less than the first usage lower limit, the resource node with the usage percentage of the preset resource less than the first usage lower limit is determined as the target resource node, and the first usage lower limit is the usage lower limit of the sandbox resource pool on the preset resource.
[0125] In some embodiments, the first usage information further includes a usage percentage of the resource node, and the usage percentage of the resource node is determined according to the usage percentage of the resource node on the preset resource.
[0126] The determining module 320 is specifically configured to:
[0127] In the case that the usage percentage of the resource node on the preset resource is not less than the first usage lower limit, and the usage percentage of the resource node is less than the second usage lower limit, the resource node with the usage percentage of the preset resource not less than the first usage lower limit and the usage percentage of the resource node less than the second usage lower limit is determined as the target resource node, and the second usage lower limit is the usage lower limit of the resource node.
[0128] In some embodiments, the attribute information of the first application includes an application size and an initialization data amount of the first application.
[0129] The determining module 320 is specifically configured to:
[0130] In the case that the usage percentage of the resource node on the preset resource is not less than the first usage lower limit, the usage percentage of the resource node is not less than the second usage lower limit, the application size of the first application satisfies the first preset condition, and the initialization data amount of the first application satisfies the second preset condition, the resource node with the usage percentage greater than the second usage lower limit and less than the first usage upper limit is determined as the target resource node, and the first usage upper limit is the usage upper limit of the resource node.
[0131] In some embodiments, the sandbox environment creation device can further include:
[0132] a statistics module, configured to, after the creating module 330 assigns the target resource node to the first application and creates the sandbox environment of the first application, count first resource nodes in the sandbox resource pool that satisfy second preset conditions according to the first usage information;
[0133] a supplement module, configured to supplement resources for the sandbox resource pool according to the number of the first resource nodes and the first usage information.
[0134] In some embodiments, the first usage information includes usage percentages of the resource nodes on a central processing unit (CPU), memory and input / output;
[0135] the statistics module, specifically configured to:
[0136] count second resource nodes whose usage percentages on the CPU are greater than a second usage upper limit, third resource nodes whose usage percentages on the memory are greater than a third usage upper limit, fourth resource nodes whose usage percentages on the input / output are greater than a fourth usage upper limit, and fifth resource nodes whose usage percentages are greater than a first usage upper limit, the first usage upper limit being a usage upper limit of the resource nodes, the second usage upper limit being a usage upper limit of the sandbox resource pool on the CPU, the third usage upper limit being a usage upper limit of the sandbox resource pool on the memory, and the fourth usage upper limit being a usage upper limit of the sandbox resource pool on the input / output;
[0137] determine the second resource nodes, the third resource nodes, the fourth resource nodes and the fifth resource nodes as the first resource nodes.
[0138] In some embodiments, the supplement module is specifically configured to:
[0139] determine an amount of CPU that needs to be supplemented for the sandbox resource pool according to the number of the second resource nodes and the usage percentages of the second resource nodes on the CPU;
[0140] determine an amount of memory that needs to be supplemented for the sandbox resource pool according to the number of the third resource nodes and the usage percentages of the third resource nodes on the memory;
[0141] determine an amount of input / output that needs to be supplemented for the sandbox resource pool according to the number of the fourth resource nodes and the usage percentages of the fourth resource nodes on the input / output;
[0142] determine the number of resource nodes that needs to be supplemented for the sandbox resource pool or resources that needs to be supplemented for the fifth resource nodes according to the number of the fifth resource nodes and the usage percentages of the fifth resource nodes.
[0143] In some embodiments, the supplement module is specifically configured to:
[0144] In the case that no free resource node is left in the sandbox resource pool, the number of resource nodes that need to be supplemented to the sandbox resource pool is determined according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes.
[0145] In the case that free resource nodes are left in the sandbox resource pool, the resource nodes with the usage percentage greater than the first usage upper limit in the fifth resource nodes are transferred to the free resource nodes.
[0146] In some embodiments, the obtaining module 310 is further configured to, after the creating module 330 allocates the target resource node to the first application and creates the sandbox environment of the first application, obtain historical creation information of the sandbox environment and historical usage information of the resource nodes.
[0147] The determining module 320 is further configured to determine the resource nodes and / or resources that need to be supplemented to the sandbox resource pool according to the historical creation information and the usage data.
[0148] Figure 3 Each module in the apparatus has the function of implementing each step in the method and can achieve the corresponding technical effects. For brevity, no further description is given here. Figures 1-2
[0149] Based on the same inventive concept, the embodiments of the present application further provide an electronic device, which can be a mobile phone, a tablet computer, a notebook computer, a palm computer, etc. The electronic device provided by the embodiments of the present application will be described in detail below. Figure 4 The electronic device provided by the embodiments of the present application will be described in detail below.
[0150] As shown in FIG. 4, the electronic device can include a processor 410 and a memory 420 for storing computer program instructions. Figure 4 The processor 410 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement the embodiments of the present application.
[0151]
[0152] The memory 420 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 420 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a solid-state drive (SSD), a USB drive, or a combination of two or more of these. In one example, the memory 420 can include removable or non-removable (or fixed) media, where the memory 420 is a nonvolatile solid-state memory in one example. In one example, the memory 420 can be a read-only memory (ROM). In one example, the ROM can be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0153] The processor 410 implements the methods of the embodiments shown in FIGS. 1-3 by Figure 1 and Figure 2 reading instructions stored by the memory 420 and executing the instructions as Figure 1 and Figure 2 described herein. The instructions produced by the methods of the embodiments shown in FIGS. 1-3 achieve the corresponding technical effects of the embodiments performing the methods, which are described herein for brevity.
[0154] In one example, the electronic device can also include a communication interface 430 and a bus 440. As shown in FIG. 4, the processor 410, the memory 420, and the communication interface 430 are connected by the bus 440 and complete communication among each other. Figure 4
[0155] The communication interface 430 is mainly used to realize the communication between the modules, devices and / or equipment in the embodiments of the present application.
[0156] Bus 440 includes hardware, software, or both, to couple various components of electronic device to each other. By way of example, and not limitation, bus 440 can include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand™ interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 440 can include one or more buses. Although this application describes and shows a particular bus, this application contemplates any suitable bus or interconnect.
[0157] The electronic device can execute the data processing method in the embodiments of the present application after receiving the sandbox environment creation request, obtaining the attribute information of the first application and the first usage information of each resource node in the sandbox resource pool, thereby realizing the creation of the sandbox environment in combination with Figure 1 and Figure 2 the creation method of the sandbox environment described above and Figure 3 the creation apparatus of the sandbox environment described above.
[0158] In addition, in combination with the creation method of the sandbox environment in the above embodiments, the embodiments of the present application can provide a computer storage medium for implementation. The computer storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to implement any one of the creation methods of the sandbox environment in the above embodiments.
[0159] It needs to be clear that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present application.
[0160] The functions indicated in the structural block diagram described above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and the like. When implemented in software, the elements of the present application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium that can store or transfer information. Examples of the machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like. The code segments can be downloaded via a computer network, such as the Internet, an intranet, and the like.
[0161] It is also noted that the examples mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the steps mentioned above, that is, the steps can be performed in the order mentioned in the examples, or in an order different from the examples, or several steps can be performed simultaneously.
[0162] The above-described aspects of the present application can be implemented in hardware, software, firmware or any combination thereof. The above-described aspects of the present application can be implemented in any of the ways described above, or in any combination thereof. The above-described aspects of the present application can be implemented using a computer program product tangibly embodied in a machine-readable storage medium for execution by a processor. The machine-readable storage medium can include, but is not limited to, one or more types of computer-readable media, for example, a disk including floppy disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, flash memory devices, or any type of media suitable for storing electronic instructions. The present application can also be embodied in a computer system including a processor and a memory coupled to the processor. The memory can include, but is not limited to, one or more types of computer-readable media. The present application can also be embodied in a computer program product tangibly embodied in a machine-readable storage medium for execution by a processor. The machine-readable storage medium can include, but is not limited to, one or more types of computer-readable media, for example, a disk including floppy disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, flash memory devices, or any type of media suitable for storing electronic instructions. The present application can also be embodied in a computer system including a processor and a memory coupled to the processor. The memory can include, but is not limited to, one or more types of computer-readable media.
[0163] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A method of creating a sandbox environment, characterized by, The method comprises: In the case of receiving a sandbox environment creation request, obtaining attribute information of a first application and first usage information of each resource node in a sandbox resource pool; wherein the attribute information of the first application comprises: application size and initialization data volume of the first application; According to at least one of the attribute information and the first usage information, determine a target resource node capable of providing a first service from each of the resource nodes, the first service being a service required for running the first application; The method according to at least one of the attribute information and the first usage information, determining a target resource node capable of providing a first service from each of the resource nodes, comprises: In the case that the usage percentage of the resource node on the preset resource is not less than the first usage lower limit, the usage percentage of the resource node is not less than the second usage lower limit, the application size of the first application meets the first preset condition, and the initialization data volume of the first application meets the second preset condition, determine the resource node whose usage percentage is greater than the second usage lower limit and less than the first usage upper limit as the target resource node, the first usage upper limit being the usage upper limit of the resource node; wherein the preset resource comprises: CPU, memory and I / O; Assign the target resource node to the first application, and create a sandbox environment of the first application.
2. The method of claim 1, wherein, The first usage information comprises the usage percentage of the resource node on the preset resource; The method according to at least one of the attribute information and the first usage information, determining a target resource node capable of providing a first service from each of the resource nodes, comprises: In the case that the usage percentage of the resource node on the preset resource is less than the first usage lower limit, determine the resource node whose usage percentage on the preset resource is less than the first usage lower limit as the target resource node, the first usage lower limit being the usage lower limit of the sandbox resource pool on the preset resource.
3. The method of claim 2, wherein, The first usage information further comprises the usage percentage of the resource node, which is determined according to the usage percentage of the resource node on the preset resource; The method according to at least one of the attribute information and the first usage information, determining a target resource node capable of providing a first service from each of the resource nodes, comprises: In the case that the usage percentage of the resource node on the preset resource is not less than the first usage lower limit, and the usage percentage of the resource node is less than the second usage lower limit, determine the resource node whose usage percentage on the preset resource is not less than the first usage lower limit and the usage percentage of the resource node is less than the second usage lower limit as the target resource node, the second usage lower limit being the usage lower limit of the resource node.
4. The method of claim 1, wherein, After the target resource node is assigned to the first application to create a sandbox environment of the first application, the method further comprises: Statistically count first resource nodes in the sandbox resource pool whose first usage information meets a second preset condition; According to the number of the first resource nodes and the first usage information, supplement resources for the sandbox resource pool.
5. The method of claim 4, wherein, The first usage information includes usage percentages of central processing unit (CPU), memory and input / output of the resource nodes; The first resource nodes in the sandbox resource pool whose first usage information meets the second preset condition are counted, including: second resource nodes whose usage percentage of CPU is greater than a second usage upper limit, third resource nodes whose usage percentage of memory is greater than a third usage upper limit, fourth resource nodes whose usage percentage of input / output is greater than a fourth usage upper limit, and fifth resource nodes whose usage percentage is greater than a first usage upper limit, the first usage upper limit being a usage upper limit of the resource nodes, the second usage upper limit being a usage upper limit of the sandbox resource pool for CPU, the third usage upper limit being a usage upper limit of the sandbox resource pool for memory, and the fourth usage upper limit being a usage upper limit of the sandbox resource pool for input / output; The second resource nodes, the third resource nodes, the fourth resource nodes and the fifth resource nodes are determined as the first resource nodes.
6. The method of claim 5, wherein, The sandbox resource pool is supplemented with resources according to the number of the first resource nodes and the first usage information, including: an amount of CPU needed to be supplemented to the sandbox resource pool is determined according to the number of the second resource nodes and the usage percentage of CPU of the second resource nodes; an amount of memory needed to be supplemented to the sandbox resource pool is determined according to the number of the third resource nodes and the usage percentage of memory of the third resource nodes; an amount of input / output needed to be supplemented to the sandbox resource pool is determined according to the number of the fourth resource nodes and the usage percentage of input / output of the fourth resource nodes; a number of resource nodes needed to be supplemented to the sandbox resource pool or resources needed to be supplemented to the fifth resource nodes is determined according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes.
7. The method of claim 6, wherein, The number of resource nodes needed to be supplemented to the sandbox resource pool is determined according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes, including: in a case where there is no idle resource node left in the sandbox resource pool, the number of resource nodes needed to be supplemented to the sandbox resource pool is determined according to the number of the fifth resource nodes and the usage percentage of the fifth resource nodes; in a case where there is an idle resource node left in the sandbox resource pool, resources in the fifth resource nodes whose usage percentage is greater than the first usage upper limit are transferred to the idle resource node.
8. The method of claim 1, wherein, After the target resource nodes are allocated to the first application to create a sandbox environment of the first application, the method further includes: obtaining historical creation information of the sandbox environment and historical usage information of the resource nodes; determining resource nodes and / or resources needed to be supplemented to the sandbox resource pool according to the historical creation information and the usage data.
9. An apparatus for creating a sandbox environment, characterized by, including: an obtaining module, configured to, in a case where a sandbox environment creation request is received, obtain attribute information of a first application and first usage information of resource nodes in a sandbox resource pool, wherein the attribute information of the first application includes an application size of the first application and an initialization data amount; A determining module is configured to determine a target resource node capable of providing a first service from the resource nodes according to at least one of the attribute information and the first usage information, the first service being a service required by the first application to run; The determining module is specifically configured to: In a case where the usage percentage of the resource node on the preset resource is not less than the first usage lower limit, the usage percentage of the resource node is not less than a second usage lower limit, the application size of the first application satisfies a first preset condition, and the initialization data volume of the first application satisfies a second preset condition, the resource node with the usage percentage greater than the second usage lower limit and less than a first usage upper limit is determined as the target resource node, the first usage upper limit being a usage upper limit of the resource node; wherein the preset resource includes a CPU, a memory, and an I / O. A creating module is configured to assign the target resource node to the first application and create a sandbox environment of the first application.
10. An electronic device, comprising: Comprise: A processor; A memory for storing computer program instructions; When the computer program instructions are executed by the processor, the method in any one of claims 1-8 is implemented.
11. A computer-readable storage medium having stored thereon computer program instructions, wherein, When the computer program instructions are executed by the processor, the method in any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Model training method and device based on GPU resources, electronic equipment and storage medium
CN114595058A