A container information processing method and an electronic device

By generating a simulated memory file of the target container, the problem of container memory information leakage is solved, thus achieving information security and efficient application operation, and avoiding resource waste.

CN114741157BActive Publication Date: 2025-12-19LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210314783.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-12-19
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In existing technologies, containers pose a high risk of memory information leakage, resulting in low user information security, low application running efficiency, and serious resource waste.

Method used

Generate a simulated memory file for the target container, enabling it to read memory information through the simulated memory file, ensuring information security and supporting the normal operation of the application.

Benefits of technology

It improves application performance, avoids resource waste, and ensures user information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741157B_ABST
    Figure CN114741157B_ABST
Patent Text Reader

Abstract

The application discloses a container information processing method and an electronic device. The container information processing method comprises the following steps: obtaining memory information of a target container; generating a simulated memory file based on the memory information by using a preset generation rule, wherein the simulated memory file is uniquely corresponding to the target container; and associating the simulated memory file with the target container, so that the target container reads the memory information through the simulated memory file. The application generates the simulated memory file of the target container, so that the target container reads its own memory information through the simulated memory file, which not only ensures the safety of user information, but also ensures the normal operation of the application program of the service, thereby achieving the purpose of improving the operation efficiency of the application program and avoiding resource waste.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information processing of electronic devices, and in particular to a container information processing method and an electronic device. BACKGROUND

[0002] Containers can effectively divide the resources of a single operating system into independent groups to better balance conflicting resource use requirements between isolated groups. Currently, only the memory usage of each container can be set, that is, only the memory size of the container can be set, but the memory files stored in the container and the host machine are the same, that is, the memory files representing the memory information of the host machine, that is, when the system reads the / proc / meminfo file to obtain memory information, the total memory and used memory and other memory information read are the same as those on the host machine. However, in the case of the same container serving different clients, different clients can obtain information on the container, at which time there is a risk of leakage of user information, that is, the security of user information is low; and in the case of allocating the memory of the host machine to multiple containers, when the memory of each container is less than the total memory of the host machine, based on the memory information displayed on the memory file (the memory information on the host machine), it will not be possible to run the application program of its service, resulting in low running efficiency of the application program and resource waste. SUMMARY

[0003] The purpose of the embodiments of the present application is to provide a container information processing method and an electronic device, which not only ensures the security of user information, but also ensures the normal running of the application program of its service, thereby achieving the purpose of improving the running efficiency of the application program and avoiding resource waste.

[0004] In a first aspect, the embodiments of the present application provide a container information processing method, comprising:

[0005] obtaining memory information of a target container;

[0006] generating a simulated memory file based on the memory information using a pre-set generation rule, the simulated memory file corresponding uniquely to the target container;

[0007] associating the simulated memory file with the target container, so that the target container reads the memory information through the simulated memory file.

[0008] In a possible implementation, the obtaining of the memory information of the target container comprises:

[0009] determining that the target container is configured with a memory quota;

[0010] obtaining memory quota information of the target container and host machine memory allocation information.

[0011] In a possible implementation, the obtaining the memory information of the target container further includes:

[0012] determining that the target container is not configured with a memory quota;

[0013] obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by a system supported by the host.

[0014] In a possible implementation, the calculating the memory information according to the preset generation rule to obtain the simulated memory file includes:

[0015] In a case where it is determined that a generation condition is met, the memory information is calculated according to a preset generation rule to obtain a simulated memory file, wherein the generation condition includes any one of a generation period, a received generation instruction, and a change in the memory information.

[0016] In a possible implementation, the associating and setting the simulated memory file with the target container includes:

[0017] mounting the simulated memory file as a memory file of the target container, and the target container reading memory information from the memory file by default.

[0018] In a possible implementation, the processing method further includes:

[0019] in response to a running instruction, feeding back a simulated memory file of the target container corresponding to the running instruction, to determine whether the running instruction can be executed.

[0020] In a possible implementation, before the response to the running instruction, the processing method further includes:

[0021] receiving a running instruction of a target application program sent by a client, wherein the target application program is an application program supported by a current container to run.

[0022] In a possible implementation, before the response to the running instruction, the processing method further includes:

[0023] In a second aspect, an electronic device is provided, including:

[0024] an obtaining module configured to obtain memory information of a target container;

[0025] a generating module configured to generate a simulated memory file based on the memory information according to a preset generation rule, the simulated memory file being unique to the target container;

[0026] an association module, configured to associate the simulation memory file with the target container, so that the target container reads the memory information through the simulation memory file.

[0027] In a possible implementation, the obtaining module is specifically configured to:

[0028] determine that the target container is configured with a memory quota;

[0029] obtain the used memory of the target container at runtime and the maximum memory of the target container.

[0030] In a possible implementation, the obtaining module is further configured to:

[0031] determine that the target container is not configured with a maximum memory;

[0032] obtain the total memory of a host corresponding to the target container and fixed memory corresponding to the host, the fixed memory being memory used by a system supported by the host to run.

[0033] Embodiments of the present application generate a simulation memory file of a target container, so that the target container reads its own memory information through the simulation memory file, which not only ensures the security of user information, but also ensures the normal running of application programs of the service, thereby achieving the purpose of improving the running efficiency of the application programs and avoiding resource waste. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0035] Figure 1 a flow chart of a container information processing method provided by the present application is shown;

[0036] Figure 2 a working schematic diagram of a host and a container provided by the present application is shown;

[0037] Figure 3 a working schematic diagram of a container provided by the present application is shown;

[0038] Figure 4 a structural schematic diagram of an electronic device provided by the present application is shown;

[0039] Figure 5 a structural schematic diagram of another electronic device provided by the present application is shown. Detailed Implementation

[0040] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0041] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0042] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0043] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0044] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.

[0045] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0046] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0047] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0048] The container information processing method provided by the embodiments of the present application is applied to an electronic device. The processing method generates a simulation memory file of a target container, so that the target container reads its own memory information through the simulation memory file. The processing method can not only ensure the security of user information, but also ensure the normal operation of an application program of the service, thereby improving the operation efficiency of the application program and avoiding resource waste. In order to facilitate the understanding of the present application, first, a container information processing method provided by the present application is described in detail.

[0049] As shown in Figure 1 , a flowchart of the container information processing method provided by the embodiments of the present application is shown, and the specific steps include S101-S103.

[0050] S101, obtaining memory information of a target container.

[0051] Here, the container can support one or more application programs to run. The container contains a complete running environment, that is, in addition to the application program itself, the container contains all dependencies, class libraries, other binary files, configuration files, and the like required by the application program. When the container is created, the running environment of each application program is packed into the container image package. In actual application, multiple containers can run on a host of a server, and the memory information such as the memory quota of each container is recorded in the memory file (such as the meminfo file under the proc / file path) of the host. Each container mounts the file path of the memory file and a certain file path of itself to obtain the memory information of itself from the memory file. That is, the file recording the memory information read by each container is the same, which leads to the risk that the memory information of the container itself is leaked to other containers.

[0052] In view of the above scenario, in order to avoid the problem that the client in different containers corresponding to the same host can obtain the memory information on all containers, resulting in low security of user information and low efficiency of application program running, in the specific implementation, the processing method in the embodiments of the present application further determines the attribute information of each container after determining the number of containers corresponding to the host. The attribute information of the container includes the code of the container, the memory information of the container, the location of the container, and the application program corresponding to the container, and the like. The code of the container can be set for the container when the container is created, and the code of each container is unique. Correspondingly, the location of the container and the application program corresponding to the container can also be set in advance when the container is created.

[0053] Each container corresponding to the host machine can be a target container described in the embodiments of the present application. After determining the attribute information of each target container, memory information of the target container is obtained. Optionally, when the memory information of the target container is obtained, it can be determined whether the target container is configured with a memory quota, that is, whether the target container is allocated with maximum memory. As an example, a specific identifier is set, and when the specific identifier is set to 1, it indicates that the target container is configured with a memory quota, and when the specific identifier is set to 0, it indicates that the target container is not configured with a memory quota. Of course, the embodiments of the present application are not limited thereto.

[0054] Further, when it is determined that the target container is configured with a memory quota, that is, the target container is allocated with maximum memory, the memory quota information of the target container, that is, the maximum memory of the target container, is obtained, and the memory allocation information of the host machine is obtained, and then it is determined whether the application program can be started or not.

[0055] In addition, when it is determined that the target container is not configured with maximum memory, there can be only one target container corresponding to the host machine, and the memory quota of the target container is the memory quota of the host machine, that is, the maximum memory of the target container is the maximum memory of the host machine. At this time, the total memory of the host machine corresponding to the target container and the fixed memory of the host machine are directly obtained, and the fixed memory is the memory used for supporting the system to run, and then the host machine is ensured to support the application program to start or run under the condition of ensuring the normal operation of the system.

[0056] The memory information can further include interactive space information, large page information and page information, the interactive space information is obtained from the current, high and max fields of mhandler.mem_cgroup.swap, the page information records the usage quantity of various types of pages of the container, and the large page information records the usage information of the large page memory of the container.

[0057] In S102, a simulation memory file is generated based on the memory information by using a pre-set generation rule, and the simulation memory file uniquely corresponds to the target container.

[0058] After the memory information of the target container is obtained, a simulation memory file is generated based on the memory information by using a pre-set generation rule, and the simulation memory file is used to provide the memory information of the target container, and the simulation memory file uniquely corresponds to the target container.

[0059] Here, a memory file exists on the host computer, a generation rule for generating the memory file on the host computer is determined, and the memory information is calculated using the generation rule to obtain a simulated memory file, for example, for the memory quota of the target container, if the target container is configured with a memory quota, the memory quota of the target container is determined as the maximum memory, if the target container is not configured with a memory quota, the memory difference between the total memory of the host computer and the fixed memory corresponding to the host computer is the maximum memory; for the remaining memory of the target container, that is, the memory difference between the maximum memory of the target container and the current memory used by the target container; for the available memory of the target container, that is, the memory difference between the maximum memory of the target container and the current memory used by the target container and not recyclable, etc.

[0060] The memory file in the host computer is configured to record the memory information of the container in a specific form, and the container reads the memory information by default in a manner corresponding to the specific form in which the memory information is recorded. In order to enable the present embodiment to be directly compatible with the use of various containers, avoid modification of the container itself, and also enable the present embodiment to be quickly applied to various containers, the generation rule pre-set in the present embodiment refers to a specific memory information class that is pre-constructed, and each container can instantiate a memory information object corresponding to the memory information class, and in the present embodiment, the memory information object is used to record the memory information corresponding to the container. Further, the above-mentioned memory information object not only records the memory information of the container, but also generates a simulated memory file. The simulated memory file is generated according to the form in which the memory information of the host computer is recorded, so that when the container reads the memory file by default, it actually reads the memory information recorded in the above-mentioned memory information object. Through the above-mentioned embodiment, a simulated memory file is simulated, which can be directly read by the target container in the default manner and is unique to the target container. That is, the isolation of the memory file between containers is achieved, and the modification of the default reading manner of the container itself is avoided.

[0061] In specific implementation, before generating the simulated memory file, it can be further determined whether the generation condition is met, wherein the generation condition includes any one of a generation period, a received generation instruction, and a change in memory information, that is, when the generation condition is the generation period, it is determined whether the current time point reaches the period time point, if so, the simulated memory file is generated; when the generation condition is the received generation instruction, it is determined whether the generation instruction is received, the generation instruction can be generated by an application program or by a user, if it is determined that the generation instruction has been received, the simulated memory file is generated; when the generation condition is the change in memory information, the current memory of the target container is monitored in real time, and the current memory is compared with the historical memory to determine whether the memory information changes, and after it is determined that the memory information changes, the simulated memory file is generated.

[0062] S103, set the simulation memory file in association with the target container, so that the target container reads memory information through the simulation memory file.

[0063] After generating the simulation memory file of the target container, the simulation memory file is set in association with the target container, so that the target container reads memory information through the simulation file. In the conventional way, the reading of the memory file by the container is realized by mounting the memory file path in the host machine to a specific path in the container, and optionally, in the embodiment, the simulation memory file is mounted as the memory file of the target container to replace the original memory file in the host machine, so that the target container reads memory information through the simulation memory file by default. Of course, the simulation file can also be used as identification information of the target container, or a mapping relationship between the simulation file and the target container can be established.

[0064] The embodiment of the application generates a simulation memory file of the target container, so that the target container reads its own memory information through the simulation memory file, which not only ensures the security of user information, but also ensures the normal operation of the application program of the service, thereby achieving the purpose of improving the efficiency of the application program and avoiding resource waste.

[0065] Here, when the user runs the application program based on the client, that is, the electronic device, a corresponding running instruction will be generated, and the client will send the generated running instruction to the corresponding processor or server of the system for response.

[0066] In actual application, the running instruction of the target application program sent by the client is received; wherein the target application program is an application program supported by the current container for running. The corresponding processor or server of the system responds to the running instruction and feeds back the simulation memory file of the target container corresponding to the running instruction, to determine whether the running instruction can be executed, that is, to determine whether the target container can support the normal operation of the target application program, thereby avoiding the case that the insufficient memory space of the target container causes the abnormal operation (such as freezing, lagging, etc.) of the target application program, and improving the user experience.

[0067] Reference Figure 2 The working schematic diagram of the host machine and the container is shown, and the host machine and each container corresponding thereto each include a respective memory file, wherein the memory file of the host machine is generated based on the total memory information of the host machine, and the memory file of the host machine can be generated by the host machine itself, the memory file of each container is generated by the container itself or by the total memory module, and the memory file is generated based on the maximum memory, the remaining memory, the available memory, etc. of the container. Further, Figure 3 The working schematic diagram of the target container is also shown, and the simulation memory file is set in association with the target container, so that the target container reads memory information through the simulation memory file. Figure 3It is known that the maximum memory, remaining memory, and available memory are generated from the runtime system files, interactive space information, big page information, and page information stored in the runtime memory module corresponding to the container. This ensures that the generated memory file is more accurate and has higher real-time performance.

[0068] Based on the same inventive concept, the second aspect of this application also provides an electronic device corresponding to the container information processing method. Since the principle of solving the problem by the electronic device in this application is similar to the page switching method mentioned above, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be described again.

[0069] Figure 4 A schematic diagram of an electronic device provided in an embodiment of this application is shown, specifically including:

[0070] The module 401 is configured to acquire memory information of the target container;

[0071] The generation module 402 is configured to generate a simulated memory file based on the memory information using a pre-set generation rule, wherein the simulated memory file uniquely corresponds to the target container.

[0072] The association module 403 is configured to associate the simulated memory file with the target container, so that the target container can read the memory information through the simulated memory file.

[0073] In yet another embodiment, the acquisition module 401 is specifically configured as follows:

[0074] It is determined that the target container is configured with a memory quota;

[0075] Obtain the memory quota information of the target container and the host machine memory allocation information.

[0076] In yet another embodiment, the acquisition module 401 is further configured to:

[0077] It was determined that the target container did not have a memory quota configured;

[0078] Obtain the total memory of the host machine corresponding to the target container and the fixed memory corresponding to the host machine, wherein the fixed memory is the memory used by the host machine to support the operation of the system.

[0079] In yet another embodiment, the generation module 402 is specifically configured as follows:

[0080] If the generation conditions are met, the memory information is calculated using pre-set generation rules to obtain a simulated memory file; wherein, the generation conditions include any one of the following: generation cycle, receiving a generation instruction, and changes in the memory information.

[0081] In yet another embodiment, the association module 403 is specifically configured to:

[0082] mount the simulation memory file as a memory file of the target container, which reads memory information from the memory file by default.

[0083] In yet another embodiment, the electronic device further comprises a response module 404, which is configured to:

[0084] in response to the running instruction, feed back the simulation memory file of the target container corresponding to the running instruction to determine whether the running instruction can be executed.

[0085] In yet another embodiment, the electronic device further comprises a receiving module 405, which is configured to:

[0086] receive the running instruction of the target application program sent by the client; wherein the target application program is an application program supported by the current container for running.

[0087] The embodiments of the present application generate a simulation memory file of a target container, so that the target container reads its own memory information through the simulation memory file, which not only ensures the security of user information, but also ensures the normal operation of the application program of the service, thereby achieving the purpose of improving the running efficiency of the application program and avoiding resource waste.

[0088] The embodiments of the present application provide a storage medium, which is a computer readable medium and stores a computer program. The computer program is executed by a processor to implement the method provided by any embodiment of the present application, including the following steps S11 to S13:

[0089] S11, obtaining memory information of a target container;

[0090] S12, generating a simulation memory file based on the memory information by using a pre-set generation rule, the simulation memory file corresponding to the target container uniquely;

[0091] S13, associating the simulation memory file with the target container to enable the target container to read the memory information through the simulation memory file.

[0092] When the computer program is executed by the processor to obtain the memory information of the target container, the processor specifically executes the following steps: determining that the target container is configured with a memory quota; obtaining memory quota information and host memory allocation information of the target container.

[0093] When the computer program is executed by the processor to obtain the memory information of the target container, the processor further executes the following steps: determining that the target container is not configured with a memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0094] When the computer program is executed by the processor to obtain the memory information of the target container, the processor further executes the following steps: determining that the target container is not configured with a memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0095] When the computer program is executed by the processor to obtain the memory information of the target container, the processor further executes the following steps: determining that the target container is not configured with a memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0096] When the computer program is executed by the processor to obtain the memory information of the target container, the processor further executes the following steps: determining that the target container is not configured with a memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0097] When the computer program is executed by the processor to obtain the memory information of the target container, the processor further executes the following steps: determining that the target container is not configured with a memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0098] The embodiment of the present application generates the simulation memory file of the target container, so that the target container reads its own memory information through the simulation memory file, which not only ensures the security of user information, but also ensures the normal running of the application program of the service, thereby achieving the purpose of improving the running efficiency of the application program and avoiding resource waste.

[0099] The embodiment of the present application provides an electronic device, a structure diagram of the electronic device can be as shown in Figure 5 The electronic device computer program steps are as follows S21 to S23, for example:

[0100] S21, obtaining memory information of a target container;

[0101] S22, generating a simulated memory file based on the memory information according to a preset generation rule, the simulated memory file uniquely corresponding to the target container;

[0102] S23, associating the simulated memory file with the target container, so that the target container reads the memory information through the simulated memory file.

[0103] When the processor executes the memory information acquisition program stored in the memory, the processor further executes the following computer program: determining that the target container is configured with a memory quota; and acquiring memory quota information of the target container and host memory allocation information.

[0104] When the processor executes the memory information acquisition program stored in the memory, the processor further executes the following computer program: determining that the target container is not configured with a memory quota; and acquiring total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used by the host to support system running.

[0105] When the processor executes the memory information calculation program stored in the memory, the processor further executes the following computer program: in a case where it is determined that a generation condition is met, calculating the memory information according to a preset generation rule to obtain a simulated memory file; wherein the generation condition includes any one of a generation period, a generation instruction being received, and the memory information being changed.

[0106] When the processor executes the simulated memory file association program stored in the memory, the processor further executes the following computer program: mounting the simulated memory file as a memory file of the target container, the target container reading memory information from the memory file by default.

[0107] When the processor executes the processing method stored in the memory, the processor further executes the following computer program: in response to a running instruction, feeding back a simulated memory file of the target container corresponding to the running instruction, to determine whether the running instruction can be executed.

[0108] Before the processor executes the running instruction response program stored in the memory, the processor further executes the following computer program: receiving a running instruction of a target application program sent by a client; wherein the target application program is an application program supported by a current container to run.

[0109] The embodiments of the present application generate a simulated memory file of a target container, so that the target container reads its own memory information through the simulated memory file, which not only ensures the security of user information, but also ensures the normal running of application programs of the service, thereby achieving the purpose of improving the running efficiency of application programs and avoiding resource waste.

[0110] Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes. Optionally, in the embodiment, the processor executes the method steps recorded in the above embodiments according to the program codes stored in the storage medium. Optionally, the specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, which will not be described here. Obviously, those skilled in the art should understand that the above modules or steps of the application can be realized by a general computing device, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be realized by program codes executable by the computing device, so that they can be stored in the storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the application is not limited to any specific hardware and software combination.

[0111] In addition, although the exemplary embodiments have been described herein, the scope of their protection is to be understood as including any and all equivalents based on the same basic concept embodied in the application. The language used in the claims in accordance with the language law of the United States shall be construed broadly and liberally to encompass all equivalent homeopathic remedies, modifications, permutations, adaptations, guides, or alterations of the embodiments set forth herein, unless the context clearly indicates otherwise. The examples are to be considered as non-exhaustive. Thus, the present description and examples are to be considered exemplary, the true scope and spirit being indicated by the full scope of the following claims, together with all equivalents to which they are entitled. The claims should not be considered as limited to the particular examples or embodiments described herein, as such examples and embodiments are intended to be illustrative only and not restrictive.

[0112] The above description is intended to be illustrative, and not restrictive. For example, the above-described examples (or one or more aspects thereof) can be used in combination with each other. Other embodiments can be used as well by those skilled in the art upon reading the above description. In addition, in the foregoing detailed description of embodiments, various features can be grouped together in one or more embodiments for the purpose of streamlining the disclosure. This should not be interpreted as a requirement that the claimed subject matter must claim such embodiments. Rather, the subject matter claimed herein can be less than all features of a particular embodiment. Accordingly, the claims are to be considered exemplary and illustrative and are not restrictive on the scope of the claimed subject matter. The claims should not be considered as limiting the disclosed subject matter to the particular embodiment or embodiments described, which are intended as examples only. The scope of the claimed subject matter is intended to cover any and all technical equivalents. Accordingly, the scope of the claimed subject matter is to be limited only by the claims that follow.

[0113] The above detailed description has shown, described, and pointed out, various embodiments of the application. Based upon the disclosure and teachings provided herein, a worker skilled in the art will appreciate that various changes can be made in the application without departing from the scope of the application in its aspects.

Claims

1.A method for processing container information, comprising: obtaining memory information of a target container; generating a simulated memory file based on the memory information using a pre-set generation rule, the simulated memory file corresponding to the target container uniquely; wherein the generation rule comprises at least memory quota, remaining memory and available memory of the target container; associating the simulated memory file with the target container, so that the target container reads the memory information through the simulated memory file. 2.The method of claim 1, wherein the obtaining memory information of a target container comprises: determining that the target container is configured with memory quota; obtaining memory quota information of the target container and host memory allocation information. 3.The method of claim 1, wherein the obtaining memory information of a target container further comprises: determining that the target container is not configured with memory quota; obtaining total memory of a host corresponding to the target container and fixed memory of the host, the fixed memory being memory used for running a system supported by the host. 4.The method of claim 1, wherein the generating a simulated memory file based on the memory information using a pre-set generation rule comprises: in a case where it is determined that a generation condition is met, generating the simulated memory file based on the memory information using the pre-set generation rule; wherein the generation condition comprises any one of a generation period, receiving a generation instruction and the memory information changing. 5.The method of claim 1, wherein the associating the simulated memory file with the target container comprises: mounting the simulated memory file as a memory file of the target container, the target container reading memory information from the memory file by default. 6.The method of claim 1, further comprising: in response to a running instruction, feeding back a simulated memory file of the target container corresponding to the running instruction, to determine whether the running instruction can be executed. 7.The method of claim 6, further comprising, before the responding to a running instruction: receiving a running instruction of a target application sent by a client, wherein the target application is an application supported by a current container to run. 8.An electronic device, comprising: an obtaining module configured to obtain memory information of a target container; a generating module configured to generate a simulated memory file based on the memory information using a pre-set generation rule, the simulated memory file corresponding to the target container uniquely; wherein the generation rule comprises at least memory quota, remaining memory and available memory of the target container; an associating module configured to associate the simulated memory file with the target container, so that the target container reads the memory information through the simulated memory file. 9.The electronic device of claim 8, wherein the obtaining module is specifically configured to: determine that the target container is configured with memory quota; obtain memory quota information of the target container and host memory allocation information. 10.The electronic device of claim 8, wherein the obtaining module is further configured to: determine that the target container is not configured with a memory quota; and obtain total memory of a host machine corresponding to the target container and fixed memory of the host machine, the fixed memory being memory used by the host machine to support system operation. ​ ​

Citation Information

Patent Citations

  • Containerization-based secret key storage method and system

    CN111859428A