Disclosure of Invention
The invention provides a container management method and a system, aiming at the problems that an access authority distribution mechanism of the existing container management system is easy to collapse and the data security in a container is seriously influenced.
In one aspect, the present invention provides a container management method, including:
receiving a container creation request sent by a first user, wherein the container creation request comprises authority information and requirement information;
creating a container according to the authority information and the requirement information;
registering the container to obtain a container registration information list;
receiving an access request sent by a second user to the target container;
determining the authority information of the target container according to the access request and the container registration information list;
and executing the access request according to the authority information of the target container.
Further, the creating a container according to the authority information and the requirement information includes:
encrypting the authority information to obtain container annotation information;
and creating a container copy according to the requirement information, and packaging the container annotation information and the container copy to obtain the container.
Further, the container registration information list includes container identifiers and corresponding container addresses of the containers; the access request includes a target container identification;
correspondingly, the determining the authority information of the target container according to the access request and the container registration information list includes:
determining the container address of the target container according to the target container identifier and the container identifier of each container in the container registration information list;
pulling up the target container according to the container address of the target container and acquiring container annotation information of the target container;
and decrypting the container annotation information of the target container to obtain the authority information of the target container.
Further, before the receiving the container creation request sent by the first user, the method further includes:
receiving an identity authentication request sent by a first user, and performing security authentication on the user identity of the first user; when the user identity authentication request of the first user passes, sending an authentication passing message to the first user, so that the first user sends the container creation request after receiving the authentication passing message;
before receiving the access request sent by the second user, the method further includes:
receiving an identity authentication request sent by a second user, and performing security authentication on the user identity of the second user; and when the user identity authentication request of the second user passes, sending an authentication passing message to the second user, so that the second user sends the access request after receiving the authentication passing message.
Further, the authority information includes user identifications and corresponding operation authorities; the access request comprises a second user identification and an access operation;
correspondingly, the executing the access request according to the authority information of the target container includes:
judging whether a target user identifier matched with a second user identifier exists in all user identifiers of the authority information of the target container;
if so, judging whether the access operation of the second user is matched with the operation authority corresponding to the target user identification; and if so, executing the access operation.
Further, the requirement information includes a container copy number and/or a container configuration parameter.
The invention also provides a container resource management system, comprising:
the receiving and sending unit is used for receiving a container creating request sent by a first user, wherein the container creating request comprises authority information and requirement information; the system is also used for receiving an access request sent by a second user to the target container;
the container creating unit is used for creating a container according to the authority information and the requirement information; registering the container to obtain a container registration information list;
the container access unit is used for determining the authority information of the target container according to the access request and the container registration information list; and executing the access request according to the authority information of the target container.
Further, the container creating unit is specifically configured to:
encrypting the authority information to obtain container annotation information;
and creating a container copy according to the requirement information, and packaging the container annotation information and the container copy to obtain the container.
Further, the container registration information list includes container identifiers and corresponding container addresses of the containers; the access request includes a target container identification;
correspondingly, the container access unit is specifically configured to: determining the container address of the target container according to the target container identifier and the container identifier of each container in the container registration information list; pulling up the target container according to the container address of the target container and acquiring container annotation information of the target container; and decrypting the container annotation information of the target container to obtain the authority information of the target container.
Further, the container resource management system further includes: an identity authentication unit;
the identity authentication unit is used for carrying out security authentication on the user identity of the first user; the system is also used for carrying out security authentication on the user identity of the second user;
correspondingly, the transceiver unit is further configured to receive an identity authentication request sent by the first user before receiving the container creation request sent by the first user; when the identity authentication unit determines that the user identity authentication request of the first user passes, the transceiver unit is further configured to send an authentication passing message to the first user, so that the first user sends the container creation request after receiving the authentication passing message;
the receiving and sending unit is further used for receiving an identity authentication request sent by the second user before receiving the access request sent by the second user; when the identity authentication unit determines that the user identity authentication request of the second user passes, the transceiver unit is further configured to send an authentication passing message to the second user, so that the second user sends the access request after receiving the authentication passing message.
Further, the authority information includes user identifications and corresponding operation authorities; the access request comprises a second user identification and an access operation;
correspondingly, the container access unit is specifically configured to: judging whether a target user identifier matched with a second user identifier exists in all user identifiers of the authority information of the target container; if so, judging whether the access operation of the second user is matched with the operation authority corresponding to the target user identification; and if so, executing the access operation.
Further, the requirement information includes a container copy number and/or a container configuration parameter.
The method and the system for managing the container resources provided by the invention receive a container creation request sent by a first user, wherein the container creation request comprises authority information and demand information, create a container according to the authority information and the demand information, register the container to obtain a container registration information list, receive an access request sent by a second user to a target container, determine the authority information of the target container according to the access request and the container registration information list, and execute the access request according to the authority information of the target container. Therefore, when the container is created, the authority information of the container can be directly packaged in the container, and then when a user accesses the container, the user can directly perform access according to the authority information in the container, so that the problem that in the prior art, the authority of the container is allocated to the user by a container resource management system, once the authority allocation mechanism collapses, the user access mechanism is disordered is solved, and the data security in the container is ensured.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.
Fig. 1 is a schematic flowchart of a container resource management method according to an embodiment of the present invention, and as shown in fig. 1, the container resource management method according to the embodiment of the present invention includes the following steps:
step 101, receiving a container creation request sent by a first user, wherein the container creation request comprises authority information and requirement information.
The execution body of the present invention may specifically be a container management system, and the physical form of the execution body may be a terminal device composed of hardware such as a processor, a memory, a logic circuit, and an electronic chip.
Specifically, the container management system may receive a container creation request sent by a first user, the container creation request including rights information of a container to be created and requirement information of the container to be created. The authority information may specifically be information or identification indicating that the container has access authority, container modification authority, and the like related to container management authority, and the requirement information may specifically be inherent attributes of the container, such as the number of copies of the container, and/or configuration parameters of the container.
In addition, the receiving mode for receiving the container creation request sent by the first user can be realized by adopting a mode of receiving instruction input, for example, a visual interaction interface is provided for the first user, so that the first user can input related information at a specified position of the visual interaction interface; it is also possible to receive, for example, directly an instruction code input by the first user; the receiving of the container creation request sent by the first user may also be implemented by those skilled in the art in other ways, and the invention is not limited to this.
And 102, creating a container according to the authority information and the requirement information.
And 103, registering the container to obtain a container registration information list.
Specifically, the authority of the created container may be determined according to authority information input by the first user, and the container matched with the requirement information may be created according to the requirement information. Subsequently, the created container is registered, and a container registration information list is obtained. The container registration information list not only includes information of the container created by the first user, but also includes information of containers created by other users.
And 104, receiving an access request sent by a second user to the target container.
In particular, the container management system may receive an access request for a target container sent by a second user. The access request may specifically be a request for performing operations such as data storage, data reading, container status checking, container configuration modification, and container deletion on the target container. In addition, the second user may be the same user as the first user or a different user from the first user, which is not limited in the present invention.
In addition, the receiving mode for receiving the access request sent by the second user can be realized by adopting a mode of receiving instruction input, for example, a visual interactive interface is provided for the second user, so that the second user can input the related access request at the specified position of the visual interactive interface; it is also possible to receive, for example, directly an instruction code input by the second user; the receiving of the container creation request sent by the second user may also be implemented by those skilled in the art in other ways, and the invention is not limited to this.
And step 105, determining the authority information of the target container according to the access request and the container registration information list.
And 106, executing the access request according to the authority information of the target container.
Specifically, according to the received access request of the second user to the target container, the information of the corresponding target container may be queried and found in the container registration information list, and then the authority information of the target container may be obtained according to the information of the target container. And then, judging whether the second user has the authority to access the target container according to the authority information of the target container, if so, executing the access request, and if not, returning a message of denying access to the second user.
That is to say, in the container resource management method provided in the first embodiment of the present invention, after receiving an access request of a second user to a target container, right information prestored in the target container may be directly obtained, and whether to execute the access request of the second user is determined according to the right information, so as to avoid a data security risk caused by that, in the prior art, after receiving the access request of the second user to the target container, a container right needs to be allocated to the second user in a system layer to determine whether the second user has a right to access the container.
Preferably, to further ensure data security, before receiving the container creation request sent by the first user in step 101, the identity of the first user may also be securely authenticated. Specifically, the method comprises the following steps: receiving an identity authentication request sent by a first user, and performing security authentication on the user identity of the first user; and when the user identity authentication request of the first user passes, sending an authentication passing message to the first user, so that the first user sends a container creation request after receiving the authentication passing message.
Further, the authentication mode may specifically adopt certificate authentication or key authentication, for example, the container resource management system may send a user certificate or a user key to the user for the user to complete identity authentication by using the user certificate or the user key, or the third-party authentication system may send the user certificate or the user key to the user, and send a system certificate or a system key matched with the user certificate to the container resource management system for the container resource management system to complete identity authentication of the user. Further, when the first user is authenticated, an authentication pass message may be sent to the first user for the first user to send a container creation request after receiving the authentication pass message; when the first user is not authenticated, an authentication failure message can be sent to the first user, and the first user can reinitiate the identity authentication request according to the authentication failure message.
Preferably, to further ensure data security, before receiving the access request sent by the second user in step 104, the method may further include: receiving an identity authentication request sent by a second user, and performing security authentication on the user identity of the second user; and when the user identity authentication request of the second user passes, sending an authentication passing message to the second user, so that the second user sends an access request after receiving the authentication passing message.
Similarly, the authentication mode may specifically adopt certificate authentication or key authentication, for example, the container resource management system may send a user certificate or a user key to the user for the user to complete identity authentication by using the user certificate or the user key, or the third-party authentication system may send the user certificate or the user key to the user, and send a system certificate or a system key matched with the user certificate to the container resource management system for the container resource management system to complete identity authentication of the user. Further, when the second user is authenticated, an authentication pass message may be sent to the second user for the second user to send an access request after receiving the authentication pass message; when the second user is not authenticated, an authentication failure message can be sent to the second user, and the second user can reinitiate the identity authentication request according to the authentication failure message.
In the container resource management method provided by the embodiment of the invention, a container creation request sent by a first user is received, wherein the container creation request includes authority information and requirement information, a container is created according to the authority information and the requirement information, a container registration information list is obtained by registering the container, an access request sent by a second user to a target container is received, the authority information of the target container is determined according to the access request and the container registration information list, and the access request is executed according to the authority information of the target container. Therefore, when the container is created, the authority information of the container can be directly packaged in the container, and then when a user accesses the container, the user can directly perform access according to the authority information in the container, so that the problem that in the prior art, the authority of the container is allocated to the user by a container resource management system, once the authority allocation mechanism collapses, the user access mechanism is disordered is solved, and the data security in the container is ensured.
On the basis of the first embodiment, in order to further explain the container resource management method provided by the present invention, fig. 2 is a schematic flow chart of a container resource management method provided by a second embodiment of the present invention.
As shown in fig. 2, the container resource management method includes:
step 201, receiving a container creation request sent by a first user, wherein the container creation request includes authority information and requirement information.
Similar to the embodiment, the container management system may receive a container creation request sent by the first user, where the container creation request includes rights information of a container to be created and requirement information of the container to be created. The authority information may specifically be information or identification indicating that the container has access authority, container modification authority, and the like related to container management authority, and the requirement information may specifically be inherent attributes of the container, such as the number of copies of the container, and/or configuration parameters of the container.
In addition, the receiving mode for receiving the container creation request sent by the first user can be realized by adopting a mode of receiving instruction input, for example, a visual interaction interface is provided for the first user, so that the first user can input related information at a specified position of the visual interaction interface; it is also possible to receive, for example, directly an instruction code input by the first user; the receiving of the container creation request sent by the first user may also be implemented by those skilled in the art in other ways, and the invention is not limited to this.
Step 202, encrypting the authority information to obtain the container annotation information.
Step 203, creating a container copy according to the requirement information, and encapsulating the container annotation information and the container copy to obtain a container.
Specifically, the authority information may be encrypted by using an encryption technique to generate the container annotation information, for example, an encryption technique such as symmetric key encryption or asymmetric key encryption may be used, which is not limited in the present invention.
In addition, a container copy is created according to the requirement information, and the container annotation information and the container copy are packaged to obtain the container.
For example, when the requirement information includes the number of container copies, container copies with the same number as the number of the container copies may be created, and the container annotation information and each container copy are encapsulated to obtain a container; when the requirement information includes container configuration parameters, container copies may be created according to the container configuration parameters, where the container configuration parameters may specifically be container storage capacity, container thread number, and the like, and the container annotation information and each container copy are encapsulated to obtain a container.
Step 204, registering the containers to obtain a container registration information list, wherein the container registration information list comprises container identifications and corresponding container addresses of the containers.
Specifically, the created container is registered, and a container registration information list is obtained. The container registration information list not only includes information of the container created by the first user, but also includes information of containers created by other users, wherein the information of the container includes a container identifier and a container address, and in addition, the information obtained by extracting keywords from container annotation information can be included.
Step 205, receiving an access request to the target container sent by the second user, wherein the access request includes the target container identifier.
In particular, the container management system may receive an access request for a target container sent by a second user. Wherein, the access request includes the target container identifier. In addition, the access request is a request for performing operations such as data storage, data reading, container status checking, container configuration modification, container deletion and the like on the target container. In addition, the second user may be the same user as the first user or a different user from the first user, which is not limited in the present invention.
In addition, the receiving mode for receiving the access request sent by the second user can be realized by adopting a mode of receiving instruction input, for example, a visual interactive interface is provided for the second user, so that the second user can input the related access request at the specified position of the visual interactive interface; it is also possible to receive, for example, directly an instruction code input by the second user; the receiving of the container creation request sent by the second user may also be implemented by those skilled in the art in other ways, and the invention is not limited to this.
Step 206, determining the container address of the target container according to the target container identifier and the container identifier of each container in the container registration information list.
And step 207, pulling up the target container according to the container address of the target container and acquiring the container annotation information of the target container.
And step 208, decrypting the container annotation information of the target container to obtain the authority information of the target container.
Specifically, in steps 206 to 208, after receiving the access request for the target container sent by the second user, the container resource management system compares the target container identifier in the access request with the container identifiers of the containers in the container registration information list one by one, and determines, in the container registration information list, the container address corresponding to the container identifier matching the target container identifier, where the container address is the container address of the target container. According to the acquired container address of the target container, the target container can be pulled up from the container resource pool, and the container annotation information packaged in the target container is read. The container annotation information is decrypted using a decryption technique that matches the encryption technique in step 202 and rights information for the target container is obtained.
And step 209, executing the access request according to the authority information of the target container.
Specifically, whether the second user has the right to access the target container is judged according to the right information of the target container, if so, the access request can be executed, and if not, a message of denying access can be returned to the second user.
Further, the authority information may specifically include each user identifier and corresponding operation authority, for example, the first user identifier and corresponding authority to modify and delete the container, and to store and read the data in the container, and also includes a third user identifier and corresponding authority to read the data in the container, and in addition, the user identifiers may adopt a single user identifier manner, that is, one identifier for one user, or a group identifier manner, that is, a plurality of users share one group identifier, which is not limited in this invention. Correspondingly, the access request further includes a second user identifier and an access operation, where the access operation may specifically be operations of storing data, reading data, deleting a container, modifying a container, and the like. Step 209 may specifically be to determine whether there is a target user identifier matching the second user identifier in the user identifiers of the authority information of the target container. If the authority information of the target container has a target user identifier matched with the second user identifier, acquiring an operation authority corresponding to the target user identifier, and judging whether the access operation of the second user is matched with the operation authority corresponding to the target user identifier; and if so, executing the access operation.
Preferably, in order to facilitate management of each container, the present invention further receives container operation state information sent by the container, so that the container resource management system counts and summarizes the operation state of the container to the user, thereby facilitating the user to manage the container.
Preferably, to further ensure data security, before receiving the container creation request sent by the first user in step 201, the method may further include: receiving an identity authentication request sent by a first user, and performing security authentication on the user identity of the first user; and when the user identity authentication request of the first user passes, sending an authentication passing message to the first user, so that the first user sends a container creation request after receiving the authentication passing message.
Further, the authentication mode may specifically adopt certificate authentication or key authentication, for example, the container resource management system may send a user certificate or a user key to the user for the user to complete identity authentication by using the user certificate or the user key, or the third-party authentication system may send the user certificate or the user key to the user, and send a system certificate or a system key matched with the user certificate to the container resource management system for the container resource management system to complete identity authentication of the user. Further, when the first user is authenticated, an authentication pass message may be sent to the first user for the first user to send a container creation request after receiving the authentication pass message; when the first user is not authenticated, an authentication failure message can be sent to the first user, and the first user can reinitiate the identity authentication request according to the authentication failure message.
Preferably, to further ensure data security, before receiving the access request sent by the second user in step 205, the method may further include: receiving an identity authentication request sent by a second user, and performing security authentication on the user identity of the second user; and when the user identity authentication request of the second user passes, sending an authentication passing message to the second user, so that the second user sends an access request after receiving the authentication passing message.
Similarly, the authentication mode may specifically adopt certificate authentication or key authentication, for example, the container resource management system may send a user certificate or a user key to the user for the user to complete identity authentication by using the user certificate or the user key, or the third-party authentication system may send the user certificate or the user key to the user, and send a system certificate or a system key matched with the user certificate to the container resource management system for the container resource management system to complete identity authentication of the user. Further, when the second user is authenticated, an authentication pass message may be sent to the second user for the second user to send an access request after receiving the authentication pass message; when the second user is not authenticated, an authentication failure message can be sent to the second user, and the second user can reinitiate the identity authentication request according to the authentication failure message.
The container resource management method provided by the second embodiment of the present invention receives a container creation request sent by a first user, where the container creation request includes authority information and requirement information, creates a container according to the authority information and the requirement information, registers the container, obtains a container registration information list, receives an access request sent by a second user for a target container, determines authority information of the target container according to the access request and the container registration information list, and executes the access request according to the authority information of the target container. Therefore, when the container is created, the authority information of the container can be directly packaged in the container, and then when a user accesses the container, the user can directly perform access according to the authority information in the container, so that the problem that in the prior art, the authority of the container is allocated to the user by a container resource management system, once the authority allocation mechanism collapses, the user access mechanism is disordered is solved, and the data security in the container is ensured.
Fig. 3 is a schematic structural diagram of a container management system according to a third embodiment of the present invention, which is used to solve the problem that an access right allocation mechanism in the prior art is prone to collapse and seriously affects data security in a container.
As shown in fig. 3, the container management system includes:
the transceiving unit 10 is configured to receive a container creation request sent by a first user, where the container creation request includes authority information and requirement information; and is also used for receiving an access request sent by a second user to the target container.
The container creating unit 20 is configured to create a container based on the authority information and the requirement information; and registering the container to obtain a container registration information list.
The container access unit 30 is used for determining the authority information of the target container according to the access request and the container registration information list; and executing the access request according to the authority information of the target container.
Preferably, the container creation unit 20 is specifically configured to: encrypting the authority information to obtain container annotation information; and creating a container copy according to the requirement information, and packaging the container annotation information and the container copy to obtain the container.
Preferably, the container registration information list includes a container identifier and a corresponding container address of each container; the access request includes a target container identification; the container access unit 30 is specifically configured to determine a container address of the target container according to the target container identifier and the container identifier of each container in the container registration information list; pulling up the target container according to the container address of the target container and acquiring container annotation information of the target container; and decrypting the container annotation information of the target container to obtain the authority information of the target container.
Preferably, the authority information includes each user identifier and corresponding operation authority; the access request comprises a second user identification and an access operation; the container access unit 30 is specifically configured to determine whether a target user identifier matching the second user identifier exists in each user identifier of the authority information of the target container; if so, judging whether the access operation of the second user is matched with the operation authority corresponding to the target user identification; and if so, executing the access operation.
Preferably, the requirement information comprises a container copy number and/or a container configuration parameter.
Further, in order to further ensure data security, the container resource management system provided by the invention further comprises an identity authentication unit;
the identity authentication unit is used for carrying out security authentication on the user identity of the first user; the system is also used for carrying out security authentication on the user identity of the second user;
correspondingly, the transceiver unit 10 is further configured to receive an identity authentication request sent by the first user before receiving the container creation request sent by the first user; when the identity authentication unit determines that the user identity authentication request of the first user passes, the transceiving unit 10 is further configured to send an authentication passing message to the first user, so that the first user sends a container creation request after receiving the authentication passing message;
the transceiving unit 10 is further configured to receive an identity authentication request sent by the second user before receiving the access request sent by the second user; when the identity authentication unit determines that the user identity authentication request of the second user passes, the transceiving unit 10 is further configured to send an authentication pass message to the second user, so that the second user sends the access request after receiving the authentication pass message.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process and corresponding beneficial effects of the system described above may refer to the corresponding process in the foregoing method embodiments, and are not described herein again.
The method and the system for managing the container resources provided by the invention receive a container creation request sent by a first user, wherein the container creation request comprises authority information and requirement information, create a container according to the authority information and the requirement information, register the container to obtain a container registration information list, receive an access request sent by a second user for a target container, determine the authority information of the target container according to the access request and the container registration information list, and execute the access request according to the authority information of the target container. Therefore, when the container is created, the authority information of the container can be directly packaged in the container, and then when a user accesses the container, the user can directly perform access according to the authority information in the container, so that the problem that in the prior art, the authority of the container is allocated to the user by a container resource management system, once the authority allocation mechanism collapses, the user access mechanism is disordered is solved, and the data security in the container is ensured.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.