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

Control method and device and electronic equipment Download PDF

Info

Publication number
CN112799740A
CN112799740A CN202110173068.XA CN202110173068A CN112799740A CN 112799740 A CN112799740 A CN 112799740A CN 202110173068 A CN202110173068 A CN 202110173068A CN 112799740 A CN112799740 A CN 112799740A
Authority
CN
China
Prior art keywords
directory
target container
data
target
container
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.)
Granted
Application number
CN202110173068.XA
Other languages
Chinese (zh)
Other versions
CN112799740B (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 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.

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, users 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 where a directory mounted in the target container can be accessed.
In the above method, preferably, the processing the data directory in the target container 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.
The method preferably further comprises the step of mounting the data directory to a first position of the target container, including:
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;
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.
The above method, preferably, obtaining a catalog processing request for a target container, includes:
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.
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 directory processing request aiming at a target container by utilizing the target process and process the data directory 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 running 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 scheme, in the control method, the control device and the electronic equipment, in the container operation process of 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 application;
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-8 are schematic structural diagrams of another control device according to a second embodiment of the present disclosure;
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 a container in a node server according to an embodiment of the present application implementing data sharing;
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 applicable to an electronic device with a container created therein, where the electronic device may be a node device in a cluster, such as a node server, and as shown in fig. 2, the cluster where the servers are located includes a plurality of 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 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 this embodiment, when obtaining a directory processing request for a target container, the following method 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 made 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 a specific implementation, each request received by the control center of the cluster where the server is located may be compared with the target container, and then the directory processing request matched with the target container is screened out. For example, in this embodiment, each request received by the control center of the cluster where the server is located is checked against the container identifier of the target container or other information characterizing the target container, so that a request passing the check is used as a directory 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, and 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 the server from repeatedly acquiring the directory processing request.
In addition, the received requests may be cleared at regular intervals in the control center, for example, 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 this 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 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 de-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 location is a merge layer in the overlay file system, and the data directories mounted to the merge layer are in a visible state for a user of the target container, and at this time, the user can access the data directories.
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 in 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, the target file may be stored in the second location, 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, and otherwise, executing the step 403.
The third location is used for mounting the device to which the directory belongs, and specifically, the third location is used for storing 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 at the first position matches the first device mounted at the third position, it indicates that there are directories at the first position of the target container that match the first device, that is, all the data directories mounted at the first position are not hidden by creating the same-name file at the second position, and at this time, there are data directories in the data directories mounted at the first position by the first device mounted at the third position.
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 unloaded 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 process 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 the withdrawal sharing by utilizing the target process and the directory processing request representation, a target file 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.
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, and when the target device where the data directory is located is not mounted to the third location of the target container, the target device where the data directory is located is mounted to the third location of the target container, and the data directory is mounted to the first location of the target container, and when the target device where the data directory is located is mounted to the third location of the target container, the data directory is mounted to the first 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 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, the directory processing unit 602 is specifically configured to: 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 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 directory processing unit 602 mounts the data directory to the first location of the target container, it 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:
a device 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 directory processing request aiming at a target container by utilizing the target process and process the data directory in the target container.
It should be noted that, for the specific implementation of each unit in the present embodiment, reference may be made to the corresponding content in the foregoing, and details are not described here.
Referring to fig. 9, a schematic structural diagram of an electronic device provided in the third embodiment of the present application is shown, where the electronic device may be 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 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 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.
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 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.
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 a container matched with the node and hides or unloads data. Without the container needing to be restarted in this process.
With reference to the node server architecture shown in fig. 11, a description will be first 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 Metaserver in real time, and once the request is updated, whether the request is matched with the current node server is checked.
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 merged 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 sharing data, the request is sent to the central Metaserver, and the Daemon process acquires the request matched with the node from the Metaserver.
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: ,/home,/lib,/usr.
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, stores a sharing record in Metaservice, detects a container of a current machine (node server) by a Daemon process in a corresponding node server, and then unloads or hides data in the container.
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 when the user a cancels the sharing, the user a may dynamically unload the data, 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 elements 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 various illustrative components and steps 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 implementation. 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 (10)

1. 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.
2. The method of claim 1, in the target container, processing the data catalog, comprising:
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 where a directory mounted in the target container can be accessed.
3. 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 the hidden directory is stored.
4. The method of claim 2 or 3, 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.
5. The method of claim 4, further comprising:
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.
6. 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.
7. The method of claim 6, 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.
8. The method of claim 1, further comprising:
and creating a target process on the server so as to obtain a directory processing request aiming at a target container by utilizing the target process and process the data directory in the target container.
9. 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.
10. 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 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.
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 true CN112799740A (en) 2021-05-14
CN112799740B 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)

Cited By (1)

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

Citations (17)

* 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
CN108170514A (en) * 2017-12-19 2018-06-15 中国科学院声学研究所 A kind of container operation method and device
CN108205623A (en) * 2016-12-16 2018-06-26 杭州华为数字技术有限公司 For the method and apparatus of share directory
CN109525624A (en) * 2017-09-20 2019-03-26 腾讯科技(深圳)有限公司 A kind of container login method, device and storage medium
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
CN110276194A (en) * 2019-06-21 2019-09-24 联想(北京)有限公司 Information processing method, information processing unit and electronic equipment
CN110597568A (en) * 2019-08-30 2019-12-20 深圳市宏电技术股份有限公司 Plug-in deployment method, system and terminal
US20190392050A1 (en) * 2018-06-22 2019-12-26 Red Hat, Inc. Filesystem pass-through on lightweight virtual machine containers
CN110659246A (en) * 2019-09-26 2020-01-07 北京百度网讯科技有限公司 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
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

Patent Citations (17)

* 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
CN109525624A (en) * 2017-09-20 2019-03-26 腾讯科技(深圳)有限公司 A kind of container login method, device and storage medium
CN108170514A (en) * 2017-12-19 2018-06-15 中国科学院声学研究所 A kind of container operation method and device
US20190392050A1 (en) * 2018-06-22 2019-12-26 Red Hat, Inc. Filesystem pass-through on lightweight virtual machine containers
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
CN110276194A (en) * 2019-06-21 2019-09-24 联想(北京)有限公司 Information processing method, information processing unit and electronic equipment
CN110597568A (en) * 2019-08-30 2019-12-20 深圳市宏电技术股份有限公司 Plug-in deployment method, system and terminal
CN110659246A (en) * 2019-09-26 2020-01-07 北京百度网讯科技有限公司 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
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN112799740B (en) 2022-07-26

Similar Documents

Publication Publication Date Title
CA2604199C (en) System and method for detecting peer-to-peer network software
US9294505B2 (en) System, method, and computer program product for preventing a modification to a domain name system setting
US8468208B2 (en) System, method and computer program to block spam
US10348577B2 (en) Discovering and monitoring server clusters
US7933979B2 (en) Identification information creating method, information processing apparatus, computer program product, recording device monitoring method, terminal apparatus management method, and communication network system
US9424266B2 (en) Efficient file hash identifier computation
US8214895B2 (en) Whitelist and blacklist identification data
US20060075504A1 (en) Threat protection network
KR101150146B1 (en) System and method for managing cached objects using notification bonds
US20020116627A1 (en) Software audit system
US20100332593A1 (en) Systems and methods for operating an anti-malware network on a cloud computing platform
CN107682172B (en) Control center device, service system processing method and medium
CN110795395B (en) File deployment system and file deployment method
CN112799740B (en) Control method and device and electronic equipment
CN113360913A (en) Malicious program detection method and device, electronic equipment and storage medium
US20060212940A1 (en) System and method for removing multiple related running processes
CN111240892A (en) Data backup method and device
CN110825400A (en) Certificate updating method and system for application program client
CN111538566A (en) Mirror image file processing method, device and system, electronic equipment and storage medium
CN101729569B (en) Distributed Denial of Service (DDOS) attack protection method, device and system
JP7255681B2 (en) Execution control system, execution control method, and program
CN115905271B (en) Virus library updating method and device and multi-engine detection system
CN115904417A (en) Method and device for preventing uninstalled software from being repeatedly installed and electronic equipment
CN109639509B (en) Network equipment configuration method and device
CN113507439A (en) JSP file security monitoring method and system

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