CN112799740B - Control method and device and electronic equipment - Google Patents

Control method and device and electronic equipment Download PDF

Info

Publication number
CN112799740B
CN112799740B CN202110173068.XA CN202110173068A CN112799740B CN 112799740 B CN112799740 B CN 112799740B CN 202110173068 A CN202110173068 A CN 202110173068A CN 112799740 B CN112799740 B CN 112799740B
Authority
CN
China
Prior art keywords
target container
directory
data
container
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110173068.XA
Other languages
Chinese (zh)
Other versions
CN112799740A (en
Inventor
陈旭
王奇刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202110173068.XA priority Critical patent/CN112799740B/en
Publication of CN112799740A publication Critical patent/CN112799740A/en
Application granted granted Critical
Publication of CN112799740B publication Critical patent/CN112799740B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44557Code layout in executable memory
    • G06F9/44563Sharing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a control method, a control device and electronic equipment, wherein the method comprises the following steps: in the container operation process in a server, acquiring a catalog processing request aiming at a target container, wherein the catalog processing request at least represents a data catalog to be processed; in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container.

Description

Control method and device and electronic equipment
Technical Field
The present application relates to the field of docker technologies, and in particular, to a control method and apparatus, and an electronic device.
Background
In a node server cluster created with one or more containers, a user can mount a data directory on the container to realize data sharing.
However, in this sharing scheme, when the user shares or cancels the sharing, the container must be restarted, which cannot guarantee the stability of the service in the container and the security of the data.
Disclosure of Invention
In view of the above, the present application provides a control method, an apparatus and an electronic device, as follows:
a method of controlling, the method comprising:
in the container operation process in a server, acquiring a directory processing request aiming at a target container, wherein the directory processing request at least represents a data directory to be processed;
in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container.
In the above method, preferably, the processing the data directory in the target container includes:
in the case that the directory processing request characterizes sharing of the data directory, mounting the data directory to a first location of the target container so that the data directory is in a visible state in the target container;
wherein the first location is a location in the target container where the directory mounted therein can be accessed.
In the above method, preferably, in the target container, the processing of the data directory includes:
under the condition that the directory processing request represents that the data directory is subjected to the de-sharing, a target file which is consistent with the directory name of the data directory is created at a second position of the target container, so that the data directory is in a hidden state in the target container;
wherein the second location is a location in the target container where the hidden directory is stored.
Preferably, the method for mounting the data directory to the first location of the target container includes:
judging whether the target equipment where the data directory is located is mounted to a third position of the target container, wherein the third position is used for mounting equipment where the directory belongs;
under the condition that the target equipment where the data directory is located is not mounted to the third position of the target container, mounting the target equipment where the data directory is located to the third position of the target container, and mounting the data directory to the first position of the target container;
and under the condition that the target equipment where the data directory is located is mounted to the third position of the target container, mounting the data directory to the first position of the target container.
The above method, preferably, further comprises:
monitoring whether a directory matched with the first equipment exists at the first position of the target container or not aiming at the first equipment mounted at the third position of the target container;
uninstalling the first appliance in a third location of the target container in the event that there is no directory in the first location of the target container that matches the first appliance.
The above method, preferably, obtaining a catalog processing request for a target container, includes:
and obtaining a catalog processing request matched with the target container from the requests received by the control center of the cluster where the server is located.
The above method, preferably, after obtaining the catalog processing request matched with the target container, further includes:
and sending a reply message to the control center to trigger the control center to delete the directory processing request matched with the target container.
The above method, preferably, further comprises:
and creating a target process on the server so as to obtain a catalog processing request for a target container by using the target process and process the data catalog in the target container.
A control device, the device comprising:
the request obtaining unit is used for obtaining a directory processing request aiming at a target container in the container operation process in the server, wherein the directory processing request at least represents a data directory to be processed;
and the catalog processing unit is used for processing the data catalog in the target container so that the data catalog is in a visible state or a hidden state in the target container.
An electronic device, comprising:
the memory is used for storing an application program and data generated by the operation of the application program;
a processor for executing the application to implement:
in the container operation process in a server, acquiring a directory processing request aiming at a target container, wherein the directory processing request at least represents a data directory to be processed;
in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container.
According to the above scheme, in the control method, the control device and the electronic device provided by the application, in the container operation process in the server, after the directory processing request at least representing the data directory to be processed for the target container is obtained, the data directory is processed in the target container, so that the data directory is in a visible state or a hidden state in the target container. Therefore, the data directory can be shared or shared back without restarting the container in the processing process, and the situations of poor stability and low data safety caused by restarting the container are avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a control method according to an embodiment of the present application;
FIG. 2 is an architecture diagram of a cluster;
fig. 3 is another flowchart of a control method according to an embodiment of the present application;
fig. 4 is a partial flowchart of a control method according to an embodiment of the present disclosure;
fig. 5 is another partial flowchart of a control method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a control device according to a second embodiment of the present application;
fig. 7-fig. 8 are schematic structural diagrams of another control device according to a second embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
FIG. 10 is a diagram illustrating an example of data sharing implemented by a container in a node server;
fig. 11 is an exemplary diagram illustrating that a container in a node server implements data sharing according to the embodiment of the present application;
fig. 12-18 are diagrams illustrating an example of implementing container data sharing and revocation sharing in practical applications.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an implementation flowchart of a control method provided in an embodiment of the present application is shown, where the method may be applied to an electronic device with a container created therein, and the electronic device may be a node device in a cluster, such as a node server, as shown in fig. 2, where the cluster where the servers are located includes multiple servers and a control center, each server may have one or more containers created therein, and the control center of the cluster is also implemented as a server with a computing function. The technical scheme in the embodiment is mainly used for improving the stability of service in the container and the safety of data in the process of processing the data directory in the container.
Specifically, the method in this embodiment may include the following steps:
step 101: in the container operation process in the server, a catalog processing request for a target container is obtained.
And at least representing the data directory to be processed in the directory processing request.
It should be noted that the server in this embodiment is a server created with a container, and one or more applications may be created in the container in the server, and one or more data directories of users may also be shared.
In one case, the directory processing request may include a directory identifier of the data directory to be shared, such as a directory name, etc., so as to characterize that the data directory corresponding to the directory identifier is requested to be shared in the directory container;
in another case, the directory processing request may include a directory identifier of a data directory to be revoked, so as to characterize that the request cancels the sharing of the data directory corresponding to the directory identifier in the target container.
It should be noted that the data directory in the present application refers to a directory corresponding to file data, for example, a directory/opt is a directory of a folder containing one or more file data.
Specifically, in the embodiment, when a directory processing request for a target container is obtained, the following manner may be implemented:
and obtaining a directory processing request matched with the target container from the requests received by the control center of the cluster where the server is located.
With reference to the architecture shown in fig. 2, a directory processing request issued by a user to a server is first received by a control center of a cluster to form a request set, where the request set may include one or more directory processing requests, and these directory processing requests may be for any server in the cluster and may be for any container in the server.
In specific implementation, in this embodiment, each request received by the control center of the cluster where the server is located may be compared with the target container, so as to screen out the directory processing request matching the target container. For example, in this embodiment, each request received by the control center of the cluster where the server is located is checked with the container identifier of the target container or other information characterizing the target container, so that the request passing the check is used as a catalog processing request for the target container.
Further, in this embodiment, after the directory processing request matched with the target container is obtained, a reply message is also sent to the control center to trigger the control center to delete the directory processing request matched with the target container. For example, after acquiring the directory processing request from the control center, the current server where the target container is located sends a reply message to the control center to notify the control center that the acquired directory processing request has been processed by the server, at this time, the control center may delete the directory processing request acquired by the server after receiving the reply message from the server, so as to avoid repeated acquisition of the directory processing request by the server.
In addition, the received requests may be cleared at regular intervals in the control center, for example, by emptying the request set every 24 hours.
Step 102: in the target container, the data directory is processed such that the data directory is in a visible state or in a hidden state in the target container.
The data directory processed in step 102 is the data directory which needs to be processed and is characterized by the directory processing request for the target container.
Specifically, in this embodiment, the data directory may be subjected to sharing processing or sharing cancellation processing in the target container, so that the data directory is in a visible state or a hidden state in the target container, and the target container is in a normal operating state in this process and does not need to be restarted.
As can be seen from the foregoing solution, in a control method provided in an embodiment of the present application, in a container operation process in a server, after a directory processing request that at least characterizes a data directory to be processed for a target container is obtained, a data directory is processed in the target container, so that the data directory is in a visible state or in a hidden state in the target container. Therefore, in the embodiment, the data directory can be shared or shared under the condition of cancelling without restarting the container, so that the conditions of poor stability and low data security caused by restarting the container are avoided.
In one implementation, when the data directory is processed in the target container in step 102, the following may be specifically implemented:
first, a determination is made as to the type of processing characterized by the directory processing request to determine whether the directory processing request requests sharing or revoking sharing of the data directory characterized by the directory processing request.
Specifically, the directory processing request includes, in addition to a directory identifier of a data directory to be processed, a processing identifier for processing the data directory, where the processing identifier represents that the directory processing request is to share or cancel sharing the data directory corresponding to the directory identifier.
In one case, in the case that the directory processing request characterizes the sharing of the data directory, the following steps may be performed in the present embodiment, as shown in fig. 3:
step 121: the data directory is mounted to a first location of the target container such that the data directory is visible in the target container.
Wherein the first location is a location where the directory mounted in the target container can be accessed. That is, the data directory mounted on the first location is visible to a user of the target container, such that the user of the target container may gain access to the data directory mounted on the target container by accessing the first location.
For example, when the file system built in the target container is an overlay file system, the first position is a merged layer in the overlay file system, the data directories mounted to the merged layer are in a visible state for a user of the target container, and the user can access the data directories at this time.
In another case, in a case where the directory processing request represents a revocation share of the data directory, the following steps may be performed in this embodiment:
step 122: and creating a target file consistent with the directory name of the data directory on a second position of the target container so that the data directory is in a hidden state in the target container.
Wherein, the second location is a location storing the hidden directory in the target container, and may also be understood as: the second position is the position of storing the file with the same name corresponding to the hidden directory in the target container. That is to say, the second location may store the target file, and if the target file with the same name is stored in the second location, the data directory mounted in the first location is in a hidden state at this time, and based on this, the data directory in the hidden state is invisible to the user of the target container, so that the user of the target container cannot access the data directory already in the hidden state in the first location, thereby implementing revocation of sharing of the data directory.
For example, when the file system built in the target container is an overlay file system, the first location is a merge layer in the overlay file system, the second location is a diff folder in the overlay file system, and the data directories mounted on the merge layer are in a visible state for a user of the target container, but at the same time, the data directories corresponding to the files with the same name in the diff folder are no longer in a visible state but in a hidden state in the merge layer, and at this time, the user cannot see the data directories and cannot access the data directories.
Based on the above implementation, when the data directory is mounted to the first location of the target container in step 121, the following steps may be specifically implemented, as shown in fig. 4:
step 401: and judging whether the target device where the data directory is located is mounted to the third position of the target container, if so, executing the step 402, otherwise, executing the step 403.
The third location is used to mount the device to which the directory belongs, and specifically, the third location is used to store the device identifier, such as the device name, to which the data directory to be mounted belongs.
Based on this, in this embodiment, it may be found in the third location whether there is a device name that matches the target device, if a name that is consistent with the device name of the target device where the data directory is located is found in the third location, it is characterized that the target device has been mounted to the third location of the target container, and if not found, it is characterized that the target device has not been mounted to the third location of the target container.
For example, in the case where the file system built in the target container is an overlay file system, the third location is namespace in the target container, and the device storing the device name in the namespace indicates that it has been mounted in the namespace of the target container.
Step 402: the data directory is mounted to a first location of the target container.
Specifically, in this embodiment, the directory name of the data directory may also be understood as the first location where the data saving path is written to the target container. For example, a data directory "/opt" is added to the merged layer.
Step 403: and mounting the target equipment where the data directory is located to the third position of the target container, and mounting the data directory to the first position of the target container.
Specifically, in this embodiment, the device name of the target device may be written into the third location of the target container, and the directory name of the data directory may be written into the first location of the target container. For example, target device x is added to namespace and data directory "/opt" is added to the merged layer.
Based on the above implementation, the present embodiment may further include the following steps, as shown in fig. 5:
step 103: and monitoring whether a catalogue matched with the first equipment exists at the first position of the target container or not aiming at the first equipment mounted at the third position of the target container.
In this embodiment, the device where the data directory mounted in the first location is located may be compared with the first device mounted in the third location, and if there is no device where any data directory is located in the first location and the first device mounted in the third location are matched, it indicates that there is no directory matched with the first device in the first location of the target container, that is, the data directory mounted in the first location once is hidden by creating a file with the same name in the second location, and at this time, all data directories mounted in the first location by the first device mounted in the third location are in a hidden state;
if the device with one or more data directories in the first location matches the first device mounted in the third location, it indicates that there is a directory matching the first device in the first location of the target container, that is, the data directories mounted in the first location are not all created with the same name in the second location and are hidden, and at this time, there are still data directories in the data directories mounted in the first location by the first device mounted in the third location.
It should be noted that the first device may be the same device as the target device, or may be a different device, and the first device and the target device are used for distinguishing.
Step 104: in the event that there is no directory in the first location of the target container that matches the first device, the first device is uninstalled in a third location of the target container.
Specifically, in this embodiment, the device name of the first device may be deleted in the third location of the target container to indicate that the first device is uninstalled. For example, target device x is deleted from namespace.
After the first device is uninstalled, all data directories corresponding to the first device are deleted at the first location, and the files with the same name corresponding to all data directories corresponding to the first device are deleted at the second location.
It should be noted that, in this embodiment, after performing the shared revocation processing of the data directory each time, the step 103 and the step 104 may be executed once by taking the device where the revoked data directory is located as the first device, or in this embodiment, each device where the target container is mounted at the third location is taken as the first device every predetermined time, and the step 103 and the step 104 are executed once, so as to clean the device mounted on the third device.
In an implementation manner, to implement the technical solution in this embodiment, a target process may be created on a server, so as to obtain a directory processing request for a target container by using the target process and process a data directory in the target container.
The target process runs on a server where the target container is located, and may also be referred to as a daemon process.
In a specific implementation, in this embodiment, the target process may be triggered, so that the target process obtains a directory processing request matched with the target container from requests received by the control center of the cluster where the server is located, and after the directory processing request is obtained, the target process sends a reply message to the control center, so as to trigger the control center to delete the directory processing request matched with the target container.
Further, in this embodiment, when the target process is used to share the data directory in the directory processing request representation, the data directory is mounted to the first location of the target container, so that the data directory is in a visible state in the target container; and under the condition that the data directory is subjected to revocation sharing by utilizing the target process under the directory processing request characterization, creating a target file consistent with the directory name of the data directory at a second position of the target container so as to enable the data directory to be in a hidden state in the target container.
In addition, in this embodiment, the target process is used to determine whether the target device where the data directory is located is mounted to the third location of the target container, mount the target device where the data directory is located to the third location of the target container and mount the data directory to the first location of the target container under the condition that the target device where the data directory is located is not mounted to the third location of the target container, and mount the data directory to the first location of the target container under the condition that the target device where the data directory is located is mounted to the third location of the target container.
Meanwhile, in this embodiment, the target process is used to monitor whether a directory matching the first device exists in the first location of the target container for the first device mounted in the third location of the target container, and unload the first device in the third location of the target container when there is no directory matching the first device in the first location of the target container.
Referring to fig. 6, a schematic structural diagram of a control apparatus provided in the second embodiment of the present application is shown, where the apparatus may be configured in an electronic device that creates a container docker, and the electronic device may be a node device in a cluster, such as a node server, as shown in fig. 2. The technical scheme in the embodiment is mainly used for improving the stability of service in the container and the safety of data in the process of processing the data directory in the container.
Specifically, the apparatus in this embodiment may include the following units:
a request obtaining unit 601, configured to obtain a directory processing request for a target container in a container operation process in a server, where the directory processing request at least represents a data directory to be processed;
a directory processing unit 602, configured to process, in the target container, the data directory so that the data directory is in a visible state or in a hidden state in the target container.
As can be seen from the foregoing solution, in the control device provided in the second embodiment of the present application, in the container operation process in the server, after the directory processing request at least representing the to-be-processed data directory for the target container is obtained, the data directory is processed in the target container, so that the data directory is in a visible state or in a hidden state in the target container. Therefore, in the embodiment, the data directory can be shared or shared back without restarting the container, so that the situations of poor stability and low data security caused by restarting the container are avoided.
In one implementation, the directory processing unit 602 is specifically configured to: in the case that the catalog processing request characterizes sharing of the data catalog, mounting the data catalog to a first location of the target container so that the data catalog is in a visible state in the target container; wherein the first location is a location where a directory mounted in the target container can be accessed.
In one implementation, the directory processing unit 602 is specifically configured to: under the condition that the directory processing request represents that the data directory is subjected to the de-sharing, a target file which is consistent with the directory name of the data directory is created at a second position of the target container, so that the data directory is in a hidden state in the target container; wherein the second location is a location in the target container where the hidden directory is stored.
In an implementation manner, when the data directory is mounted to the first location of the target container, the directory processing unit 602 is specifically configured to: judging whether the target equipment where the data directory is located is mounted to a third position of the target container, wherein the third position is used for mounting equipment where the directory belongs; under the condition that the target equipment where the data directory is located is not mounted to the third position of the target container, mounting the target equipment where the data directory is located to the third position of the target container, and mounting the data directory to the first position of the target container; and under the condition that the target equipment where the data directory is located is mounted to the third position of the target container, mounting the data directory to the first position of the target container.
In one implementation, the apparatus in this embodiment may further include the following units, as shown in fig. 7:
an equipment cleaning unit 603 configured to: monitoring whether a directory matched with the first equipment exists at the first position of the target container or not aiming at the first equipment mounted at the third position of the target container; in the event that there is no directory in the first location of the target container that matches the first device, the first device is unloaded in a third location of the target container.
In one implementation, the request obtaining unit 601 is specifically configured to: and obtaining a directory processing request matched with the target container from the requests received by the control center of the cluster where the server is located.
In one implementation, the request obtaining unit 601 is further configured to: and sending a reply message to the control center to trigger the control center to delete the directory processing request matched with the target container.
In one implementation, the apparatus in this embodiment may further include the following units, as shown in fig. 8:
a process creation unit 604 for: and creating a target process on the server so as to obtain a catalog processing request for a target container by using the target process and process the data catalog in the target container.
It should be noted that, for specific implementation of each unit in the present embodiment, reference may be made to corresponding contents in the foregoing, and details are not described here.
Referring to fig. 9, a schematic structural diagram of an electronic device according to a third embodiment of the present application is provided, where the electronic device may be an electronic device created with a container docker, and the electronic device may be a node device in a cluster, such as a node server, as shown in fig. 2. The technical scheme in the embodiment is mainly used for improving the stability of service in the container and the safety of data in the process of processing the data directory in the container.
Specifically, the electronic device in this embodiment may include the following structure:
a memory 901 for storing an application program and data generated by the application program;
a processor 902 for executing the application to implement: in the container operation process in a server, acquiring a catalog processing request aiming at a target container, wherein the catalog processing request at least represents a data catalog to be processed; in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container.
As can be seen from the foregoing solutions, in an electronic device provided in the third embodiment of the present application, in a container operation process in a server, after a directory processing request that at least characterizes a data directory to be processed for a target container is obtained, a data directory is processed in the target container, so that the data directory is in a visible state or a hidden state in the target container. Therefore, in the embodiment, the data directory can be shared or shared back without restarting the container, so that the situations of poor stability and low data security caused by restarting the container are avoided.
Taking a cluster of containers constructed in a network file system as an example, users mount the same directory as a means for sharing data. The inventor of the present application found in the process of sharing data directories using a container that when a user shares or cancels the sharing, the container must be restarted as shown in fig. 10, but this does not guarantee the stability of the service in the container and the security of the data.
In view of the above problems, the inventors of the present application have further studied and proposed a technical scheme for dynamically mounting and hiding files between Docker containers, where an overlay file system is used when a Docker container is started, and a daemon capable of sensing a directory sharing (i.e., sharing) state is run on a node where the container is located. And when data are shared, the daemon process searches for a container matched with the node and dynamically mounts the shared data. When the sharing action is cancelled, the daemon process searches for the container matched with the node and hides or unloads the data. Without the container needing to be restarted in this process.
With reference to the node server architecture shown in fig. 11, first, a description is given of a dynamic mount flow, as shown in fig. 12:
1. when a user shares a data directory to a specific user, a directory processing request is sent to a Metaserver of a control center of a cluster.
2. The Daemon process Daemon obtains a data sharing request from the Metaserver in real time, and once the request is updated, whether the request is matched with the current node server or not is verified.
3. The Daemon dynamic mount process is as follows:
and 3.1, judging that the device of the data directory needing to be mounted is the Namespace mounted in the container, and if the device is not the Namespace mounted in the container, carrying out mounting operation in the Namespace of the container.
3.2, mounting the data directory to be shared into a merge layer, namely a visible layer, of the overlay file system of the container, so that the data directory is in a visible state, and at this time, the data directory appears in the container, as shown in fig. 13, the directory appears in the container: the values of/home,/lib,/opt,/usr.
The flow of hidden uninstall is explained as follows, as shown in fig. 14:
1. and the user cancels the data sharing, the request is sent to the central Metaservice, and the Daemon process acquires the request matched with the node from the Metaservice.
2. The Daemon process flow is as follows:
2.1, creating a mask file corresponding to a directory in a diff folder of an overlay file system of a corresponding container, wherein data in a merged folder is not visible according to the characteristics of the overlay file system, as shown in fig. 15, after adding/opt to the diff folder, only the directory in a container: the name,/lib,/usr.
And 2.2, judging that the Device does not have a catalogue which needs to expose the container, and unloading the Device from the container.
The following example is taken for sharing data between the user a and the user B through a container:
as shown in fig. 16, a user a shares data with a user B, at this time, a sharing record is saved in Metaservice, a Daemon process in a corresponding node server scans a container meeting a condition, that is, a request record belonging to the Daemon process is checked for the container, and then the Daemon process dynamically mounts a Namespace driven to the container and exposes a folder to a merger of an overlay of the container.
As shown in fig. 17, a user a revokes data shared by a user B, at this time, the sharing record is saved in the Metaservice, the Daemon process in the corresponding node server detects a container of the current machine (node server), and then the data in the container is unloaded or hidden.
For the user B, as shown in fig. 18, after the user B starts the container, in the using process of the container, the user a may dynamically load data when sharing data to the user B, at this time, the shared data is visible, the user B may operate the shared data, and the user a may dynamically unload data when revoking the sharing, at this time, the shared data is invisible.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method of controlling, the method comprising:
in the container operation process in a server, acquiring a catalog processing request aiming at a target container, wherein the catalog processing request at least represents a data catalog to be processed;
in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container;
wherein, in the target container, processing the data directory includes:
in the case that the catalog processing request characterizes sharing of the data catalog, mounting the data catalog to a first location of the target container so that the data catalog is in a visible state in the target container;
wherein the first location is a location where a directory mounted in the target container can be accessed.
2. The method of claim 1, in the target container, processing the data catalog, comprising:
under the condition that the directory processing request represents that the data directory is subjected to the de-sharing, a target file which is consistent with the directory name of the data directory is created at a second position of the target container, so that the data directory is in a hidden state in the target container;
wherein the second location is a location in the target container where a hidden directory is stored.
3. The method of claim 1 or 2, mounting the data directory to a first location of the target container, comprising:
judging whether the target equipment where the data directory is located is mounted to a third position of the target container, wherein the third position is used for mounting equipment where the directory belongs;
under the condition that the target equipment where the data directory is located is not mounted to the third position of the target container, mounting the target equipment where the data directory is located to the third position of the target container, and mounting the data directory to the first position of the target container;
and under the condition that the target equipment where the data directory is located is mounted to the third position of the target container, mounting the data directory to the first position of the target container.
4. The method of claim 3, further comprising:
monitoring whether a directory matched with a first device exists at a first position of the target container or not aiming at the first device mounted at a third position of the target container;
in the event that there is no directory in the first location of the target container that matches the first device, the first device is unloaded in a third location of the target container.
5. The method of claim 1, obtaining a catalog processing request for a target container, comprising:
and obtaining a directory processing request matched with the target container from the requests received by the control center of the cluster where the server is located.
6. The method of claim 5, after obtaining a catalog processing request that matches the target container, the method further comprising:
and sending a reply message to the control center to trigger the control center to delete the directory processing request matched with the target container.
7. The method of claim 1, further comprising:
and creating a target process on the server so as to obtain a catalog processing request for a target container by using the target process and process the data catalog in the target container.
8. A control device, the device comprising:
the request obtaining unit is used for obtaining a catalog processing request aiming at a target container in the container operation process in the server, wherein the catalog processing request at least represents a data catalog to be processed;
the directory processing unit is used for processing the data directory in the target container so that the data directory is in a visible state or a hidden state in the target container;
wherein the catalog processing unit is specifically configured to: in the case that the catalog processing request characterizes sharing of the data catalog, mounting the data catalog to a first location of the target container so that the data catalog is in a visible state in the target container; wherein the first location is a location where a directory mounted in the target container can be accessed.
9. An electronic device, comprising:
the memory is used for storing an application program and data generated by the running of the application program;
a processor for executing the application to implement:
in the container operation process in a server, acquiring a catalog processing request aiming at a target container, wherein the catalog processing request at least represents a data catalog to be processed;
in the target container, processing the data directory so that the data directory is in a visible state or in a hidden state in the target container;
wherein, in the target container, processing the data directory includes:
in the case that the catalog processing request characterizes sharing of the data catalog, mounting the data catalog to a first location of the target container so that the data catalog is in a visible state in the target container;
wherein the first location is a location in the target container where the directory mounted therein can be accessed.
CN202110173068.XA 2021-02-08 2021-02-08 Control method and device and electronic equipment Active CN112799740B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110173068.XA CN112799740B (en) 2021-02-08 2021-02-08 Control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110173068.XA CN112799740B (en) 2021-02-08 2021-02-08 Control method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112799740A CN112799740A (en) 2021-05-14
CN112799740B true CN112799740B (en) 2022-07-26

Family

ID=75814866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110173068.XA Active CN112799740B (en) 2021-02-08 2021-02-08 Control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112799740B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064594B (en) * 2021-11-22 2023-09-22 马上消费金融股份有限公司 Data processing method and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104283941A (en) * 2014-09-16 2015-01-14 深圳市同洲电子股份有限公司 Data access method, device and system
CN106209741A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 A kind of fictitious host computer and partition method, resource access request processing method and processing device
CN106970822A (en) * 2017-02-20 2017-07-21 阿里巴巴集团控股有限公司 A kind of container creation method and device
CN108205623A (en) * 2016-12-16 2018-06-26 杭州华为数字技术有限公司 For the method and apparatus of share directory
CN109739619A (en) * 2018-12-12 2019-05-10 咪咕文化科技有限公司 A kind of processing method, device and storage medium based on containerization application
CN109936571A (en) * 2019-02-22 2019-06-25 全球能源互联网研究院有限公司 A kind of mass data sharing method, opening and shares platform and electronic equipment
US10417190B1 (en) * 2014-09-25 2019-09-17 Amazon Technologies, Inc. Log-structured file system for zone block devices with small zones
CN110597568A (en) * 2019-08-30 2019-12-20 深圳市宏电技术股份有限公司 Plug-in deployment method, system and terminal
CN110888852A (en) * 2019-11-11 2020-03-17 北京宝兰德软件股份有限公司 Method and device for mounting host machine catalog in container environment
CN111782339A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Container creation method and device, electronic equipment and storage medium
CN111913665A (en) * 2020-07-30 2020-11-10 星辰天合(北京)数据科技有限公司 Mounting method and device of storage volume and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525624B (en) * 2017-09-20 2022-01-04 腾讯科技(深圳)有限公司 Container login method and device and storage medium
CN108170514A (en) * 2017-12-19 2018-06-15 中国科学院声学研究所 A kind of container operation method and device
US11301428B2 (en) * 2018-06-22 2022-04-12 Red Hat, Inc. Filesystem pass-through on lightweight virtual machine containers
CN110276194B (en) * 2019-06-21 2021-06-15 联想(北京)有限公司 Information processing method, information processing apparatus, and electronic device
CN110659246B (en) * 2019-09-26 2022-05-03 北京百度网讯科技有限公司 Container-based file mounting method and device and electronic equipment
CN110688174A (en) * 2019-09-30 2020-01-14 李福帮 Container starting method, storage medium and electronic device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104283941A (en) * 2014-09-16 2015-01-14 深圳市同洲电子股份有限公司 Data access method, device and system
US10417190B1 (en) * 2014-09-25 2019-09-17 Amazon Technologies, Inc. Log-structured file system for zone block devices with small zones
CN106209741A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 A kind of fictitious host computer and partition method, resource access request processing method and processing device
CN108205623A (en) * 2016-12-16 2018-06-26 杭州华为数字技术有限公司 For the method and apparatus of share directory
CN106970822A (en) * 2017-02-20 2017-07-21 阿里巴巴集团控股有限公司 A kind of container creation method and device
CN109739619A (en) * 2018-12-12 2019-05-10 咪咕文化科技有限公司 A kind of processing method, device and storage medium based on containerization application
CN109936571A (en) * 2019-02-22 2019-06-25 全球能源互联网研究院有限公司 A kind of mass data sharing method, opening and shares platform and electronic equipment
CN110597568A (en) * 2019-08-30 2019-12-20 深圳市宏电技术股份有限公司 Plug-in deployment method, system and terminal
CN110888852A (en) * 2019-11-11 2020-03-17 北京宝兰德软件股份有限公司 Method and device for mounting host machine catalog in container environment
CN111782339A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Container creation method and device, electronic equipment and storage medium
CN111913665A (en) * 2020-07-30 2020-11-10 星辰天合(北京)数据科技有限公司 Mounting method and device of storage volume and electronic equipment

Also Published As

Publication number Publication date
CN112799740A (en) 2021-05-14

Similar Documents

Publication Publication Date Title
US9294505B2 (en) System, method, and computer program product for preventing a modification to a domain name system setting
US7617309B2 (en) Network system, information management server, and information management method
US20060075504A1 (en) Threat protection network
US7379918B2 (en) Method and system for single reactivation of software product licenses
US8037290B1 (en) Preboot security data update
US7933979B2 (en) Identification information creating method, information processing apparatus, computer program product, recording device monitoring method, terminal apparatus management method, and communication network system
KR101150146B1 (en) System and method for managing cached objects using notification bonds
CA2604199A1 (en) System and method for detecting peer-to-peer network software
US20020078142A1 (en) Method and system for enabling offline detection of software updates
US20090083852A1 (en) Whitelist and Blacklist Identification Data
EP1171817A2 (en) Data distribution in a server cluster
CN104536792A (en) Method and device for eliminating application program residual files
CN110795395B (en) File deployment system and file deployment method
CN112799740B (en) Control method and device and electronic equipment
CN110825400B (en) Certificate updating method and system of application program client
CN110968478A (en) Log collection method, server and computer storage medium
CN113360913A (en) Malicious program detection method and device, electronic equipment and storage medium
CN113032050A (en) Configuration center access method, system, electronic device and storage medium
US20070265976A1 (en) License distribution in a packet data network
US20060212940A1 (en) System and method for removing multiple related running processes
CN106850877A (en) The method to set up and device of the virtual IP address in distributed memory system
US20050132237A1 (en) Method, apparatus and program storage device for providing a remote power reset at a remote server through a network connection
CN113486277A (en) Web application access method and device, electronic equipment and storage medium
JP7255681B2 (en) Execution control system, execution control method, and program
CN111104376A (en) Resource file query method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant