Access control method and apparatus
By dividing multiple sub-storage spaces and generating updated access credentials in a distributed computing scenario, the problem of inflexible access control in the existing technology is solved, and flexible access control of smaller-granularity storage spaces and access in multi-user scenarios are achieved. Permission management.
Patent Information
- Application Number
- PCT/CN2023/123447
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-10-08
- Publication Date
- 2024-09-06
AI Technical Summary
In a distributed computing scenario, access control in the existing technology is not flexible enough to effectively control access permissions to smaller-granularity storage spaces, and the operation is complicated when adjusting access types in user mode, and when a user's access permissions are terminated , all users' permissions will be terminated.
By dividing multiple sub-storage spaces in the first storage space, each sub-storage space corresponds to one or more access types, the first node controls the second node's access to the sub-storage space according to the access space information and access type, and in the user state Adjust access types, generate and update access credentials for flexible access control.
It implements flexible access control of smaller-granularity storage space, simplifies operations in user mode, and ensures that the access rights of other users continue to be valid when the access rights of some users are terminated in multi-user scenarios.
Smart Images

Figure CN2023123447_06092024_PF_FP
Abstract
Description
Access control method and device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 27, 2023, with application number 202310209421.4 and application name “Access Control Method and Device,” the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of computer technology, and in particular to an access control method and apparatus. Background Art
[0003] In distributed computing scenarios, large amounts of data sharing are often required between different nodes. For example, if a second node accesses the storage space of a first node, the first node registers the storage space the second node wants to access and sends verification information corresponding to the storage space to the second node. The first node then uses this verification information to control the second node's access to the storage space. Existing access control technologies suffer from insufficient flexibility.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide an access control method and apparatus, which solve the problem of insufficient flexibility of access control in the prior art.
[0006] To achieve the above objectives, the present invention adopts the following technical solutions:
[0007] In a first aspect, an access control method is provided, applied to a first node including a first storage space, the first storage space including multiple sub-storage spaces. The method comprises: the first node receiving an access request from a second node, the access request for accessing a first sub-storage space in the first storage space, the first sub-storage space being one of the multiple sub-storage spaces, the access request including access space information and a first access type, the access space information indicating the first storage space and the first sub-storage space. The first node controlling, based on the access space information and the first access type, access to the first sub-storage space by the second node.
[0008] In the above technical solution, the first storage space includes multiple sub-storage spaces, and the first node controls the second node's access to the first sub-storage space based on the second node's access request. On the one hand, because the granularity of the first sub-storage space is smaller than that of the first storage space, this method can control the second node's access to the storage space with smaller granularity. On the other hand, the first node can adjust the access type corresponding to multiple sub-storage spaces in user mode, which is simpler to operate. This makes access control more flexible.
[0009] In a possible implementation of the first aspect, each of the multiple sub-storage spaces corresponds to one or more access types, and the first node controls the second node's access to the target sub-storage space based on the access space information and the first access type, including: when the first storage space and the first sub-storage space indicated by the access space information are valid, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space. When the first storage space and the first sub-storage space indicated by the access space information are invalid, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space. In the above possible implementation, when the access space information is valid and the first access type belongs to the access type corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space; otherwise, the first node denies the second node access to the first sub-storage space. This provides a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0010] In a possible implementation of the first aspect, before the first node receives the access request from the second node, it also includes: the first node receives a registration request from the second node, the registration request is used to request to register a sub-storage space in the first node, the registration request includes a second access type, and the second access type includes the first access type. The first node sends a registration response to the second node, and the registration response is used to indicate the first storage space and the first sub-storage space. In the above possible implementation, the second node can register the first sub-storage space in the first node, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0011] In a possible implementation of the first aspect, each of the multiple sub-storage spaces corresponds to an access credential, and the access request also includes a first access credential. The method also includes: when the first access credential matches the access credential corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space. When the first access credential does not match the access credential corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space. In the above possible implementation, the first node can also control the second node's access to the first sub-storage space through the first access credential, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0012] In a possible implementation of the first aspect, before the first node receives the access request from the second node, the method further includes: the first node generating a first access credential for the first sub-storage space based on at least one of the following and sending it to the second node: the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number; the first access credential is a message authentication code or a key. In the above possible implementation, the first node generates the first access credential based on at least one of the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and the random number. The first access credential can be a message authentication code or a key, providing a basis for the first node to control the second node's access to the first sub-storage space. In this way, access control can be more flexible.
[0013] In a possible implementation of the first aspect, the first sub-storage space is registered by multiple second nodes, and the method further includes: when the access permission of at least one second node among the multiple second nodes to the first sub-storage space is terminated, the first node updates the first access credential to a second access credential. The first node sends the second access credential to the second nodes other than the at least one second node among the multiple second nodes. In the above possible implementation, when the first node terminates the access permission of at least one second node, it updates the access credential and sends the updated access credential to the second node that maintains the access permission. In this way, in a scenario where multiple users access the first sub-storage space at the same time, when the access permission of some users is terminated, other users can be guaranteed to continue to access. In this way, access control can be made more flexible.
[0014] In one possible implementation of the first aspect, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types. In this possible implementation, at least two sub-storage spaces correspond to different access types, so that different access types can be set for different smaller-granularity sub-storage spaces, thereby making access control more flexible.
[0015] According to a second aspect, an access control method is provided. The method includes: a second node sending an access request to a first node, the access request being for accessing a first sub-storage space in a first storage space, the first storage space being a storage space in the first node, the first storage space including multiple sub-storage spaces, the first sub-storage space being one of the multiple sub-storage spaces, the access request including access space information and a first access type, the access space information being used to indicate the first storage space and the first sub-storage space. When the first node permits access to the first sub-storage space, the second node accesses the first sub-storage space.
[0016] In the above technical solution, on the one hand, because the granularity of the first sub-storage space is smaller than that of the first storage space, this method can control the second node's access to the smaller-granularity storage space. On the other hand, the first node can adjust the access types corresponding to multiple sub-storage spaces in user mode, which is more simple to operate. This makes access control more flexible.
[0017] In a possible implementation of the second aspect, each of the multiple sub-storage spaces corresponds to one or more access types, and when the first node is allowed to access the first sub-storage space, the second node accesses the first sub-storage space, including: when the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the second node accesses the first sub-storage space. In the above possible implementation, when the access space information is legal and the first access type belongs to the access type corresponding to the first sub-storage space, the second node accesses the first sub-storage space. In this way, a basis is provided for the first node to control the second node's access to the first sub-storage space, which can make access control more flexible.
[0018] In a possible implementation of the second aspect, before the second node sends an access request to the first node, it also includes: the second node sends a registration request to the first node, the registration request is used to request to register a sub-storage space in the first node, the registration request includes a second access type, and the second access type includes the first access type. The second node receives a registration response from the first node, and the registration response is used to indicate the first storage space and the first sub-storage space. In the above possible implementation, the second node can register the first sub-storage space in the first node, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0019] In a possible implementation of the second aspect, each of the multiple sub-storage spaces corresponds to an access credential, the access request also includes a first access credential, and the method further includes: when the first access credential matches the access credential corresponding to the first sub-storage space, the second node accesses the first sub-storage space. In this possible implementation, the first node can also control the second node's access to the first sub-storage space using the first access credential, providing a basis for the first node to control the second node's access to the first sub-storage space. This allows for more flexible access control.
[0020] In a possible implementation of the second aspect, the method further includes: the second node receiving the first access credential from the first node, the first access credential being obtained based on at least one of the following: the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number; the first access credential being a message authentication code or a key. In the above possible implementation, the first access credential is generated based on at least one of the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and the random number. The first access credential can be a message authentication code or a key, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0021] In a possible implementation of the second aspect, the method further includes: the second node receiving a second access credential from the first node. The second node updating the first access credential to the second access credential. In the above possible implementation, when the first node terminates the access rights of at least one second node, it updates the access credential and sends the updated access credential to the second node that maintains the access rights. In this way, in a scenario where multiple users simultaneously access the first sub-storage space, when the access rights of some users are terminated, other users can continue to access. This makes access control more flexible.
[0022] In one possible implementation of the second aspect, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types. In this possible implementation, at least two sub-storage spaces correspond to different access types, so that different access types can be set for different smaller-granularity sub-storage spaces, thereby making access control more flexible.
[0023] According to a third aspect, an access control device is provided, wherein a first storage space in the device includes multiple sub-storage spaces. The device includes: a receiving unit configured to receive an access request from a second node, the access request being for accessing a first sub-storage space in the first storage space, the first sub-storage space being one of the multiple sub-storage spaces, the access request including access space information and a first access type, the access space information being used to indicate the first storage space and the first sub-storage space; and a processing unit configured to control the second node's access to the first sub-storage space based on the access space information and the first access type.
[0024] In a possible implementation of the third aspect, each of the multiple sub-storage spaces corresponds to one or more access types, and the processing unit is specifically configured to: when the first storage space and the first sub-storage space indicated by the access space information are valid, and the first access type belongs to one or more access types corresponding to the first sub-storage space, allow the second node to access the first sub-storage space; and when the first storage space and the first sub-storage space indicated by the access space information are invalid, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, deny the second node access to the first sub-storage space.
[0025] In a possible implementation of the third aspect, the apparatus further includes a sending unit. The receiving unit is further configured to receive a registration request from the second node, the registration request being configured to request registration of a sub-storage space in the first node, the registration request including a second access type, the second access type including the first access type. The sending unit is configured to send a registration response to the second node, the registration response indicating the first storage space and the first sub-storage space.
[0026] In a possible implementation of the third aspect, each of the multiple sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the processing unit is further configured to: when the first access credential matches the access credential corresponding to the first sub-storage space, allow the second node to access the first sub-storage space; and when the first access credential does not match the access credential corresponding to the first sub-storage space, deny the second node access to the first sub-storage space.
[0027] In a possible implementation of the third aspect, the processing unit is further configured to generate the first access credential for the first sub-storage space based on at least one of the following: the first storage space, an access type corresponding to the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number. The sending unit is further configured to send the first access credential to the second node. The first access credential is a message authentication code or a key.
[0028] In a possible implementation of the third aspect, the first sub-storage space is registered by multiple second nodes. The processing unit is further configured to, when access permission to the first sub-storage space granted to at least one second node among the multiple second nodes is terminated, update the first access credential to a second access credential by the first node. The sending unit is further configured to send the second access credential to second nodes among the multiple second nodes other than the at least one second node.
[0029] In a possible implementation manner of the third aspect, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
[0030] In a fourth aspect, an access control device is provided, the device comprising: a sending unit configured to send an access request to a first node, the access request being for accessing a first sub-storage space in a first storage space, the first storage space being a storage space in the first node, the first storage space including multiple sub-storage spaces, the first sub-storage space being one of the multiple sub-storage spaces, the access request including access space information and a first access type, the access space information being used to indicate the first storage space and the first sub-storage space; and a processing unit configured to access the first sub-storage space when the first node permits access to the first sub-storage space.
[0031] In a possible implementation of the fourth aspect, each sub-storage space in the multiple sub-storage spaces corresponds to one or more access types, and the processing unit is specifically used to: when the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the second node accesses the first sub-storage space.
[0032] In a possible implementation of the fourth aspect, the apparatus further includes a receiving unit; the sending unit is further configured to send a registration request to the first node, the registration request being configured to request registration of a sub-storage space in the first node, the registration request including a second access type, the second access type including the first access type; and the receiving unit is configured to receive a registration response from the first node, the registration response indicating the first storage space and the first sub-storage space.
[0033] In a possible implementation of the fourth aspect, each sub-storage space in the multiple sub-storage spaces corresponds to an access credential, the access request also includes a first access credential, and the processing unit is specifically used to: when the first access credential is consistent with the access credential corresponding to the first sub-storage space, access the first sub-storage space.
[0034] In a possible implementation of the fourth aspect, the receiving unit is further configured to receive the first access credential from the first node, where the first access credential is obtained based on at least one of the following: the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number. The first access credential is a message authentication code or a key.
[0035] In a possible implementation of the fourth aspect, the receiving unit is further configured to receive a second access credential from the first node, and the processing unit is further configured to update the first access credential to the second access credential.
[0036] In a possible implementation manner of the fourth aspect, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
[0037] In a fifth aspect, an access control device is provided, which includes a processor and a memory, wherein instructions are stored in the memory. When the processor executes the instructions, the device implements the access control method provided by the first aspect or any possible implementation of the first aspect.
[0038] In a sixth aspect, an access control device is provided, which includes a processor and a memory, wherein instructions are stored in the memory. When the processor runs the instructions, the device implements the access control method provided by the second aspect or any possible implementation of the second aspect.
[0039] In a seventh aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the access control method provided by the first aspect or any possible implementation of the first aspect is implemented.
[0040] In an eighth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the access control method provided by the second aspect or any possible implementation of the second aspect is implemented.
[0041] Another aspect of an embodiment of the present application provides an access control system, comprising a first node and a second node. The first node is configured to execute the access control method provided by the first aspect or any possible implementation of the first aspect, and the second node is configured to execute the access control method provided by the second aspect or any possible implementation of the second aspect.
[0042] In another aspect of the embodiments of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method provided by the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0043] It can be understood that the device, system, computer storage medium or computer program product of any access control method provided above is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] FIG1 is a schematic diagram of a communication network provided in an embodiment of the present application;
[0045] FIG2 is a schematic diagram of a requester and a responder provided in an embodiment of the present application;
[0046] FIG3 is a flowchart of an access control method according to an embodiment of the present application;
[0047] FIG4 is a schematic diagram of a first storage space provided in an embodiment of the present application;
[0048] FIG5 is a first schematic diagram of multiple storage spaces provided in an embodiment of the present application;
[0049] FIG6 is a second flow chart of the access control method provided in an embodiment of the present application;
[0050] FIG7 is a second schematic diagram of multiple storage spaces provided in an embodiment of the present application;
[0051] FIG8 is a schematic diagram of a first node sending a second access credential according to an embodiment of the present application;
[0052] FIG9 is a third flow chart of the access control method provided in an embodiment of the present application;
[0053] FIG10 is a fourth flow chart of the access control method provided in an embodiment of the present application;
[0054] FIG11 is a flow chart of another access control method provided in an embodiment of the present application;
[0055] FIG12 is a schematic diagram of an access control device provided in an embodiment of the present application;
[0056] FIG13 is a schematic diagram of another access control device provided in an embodiment of the present application;
[0057] FIG14 is a schematic diagram of another access control device provided in an embodiment of the present application;
[0058] FIG15 is a schematic diagram of another access control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c or a, b and c, where a, b and c can be single or multiple. In addition, in the embodiments of the present application, words such as "first" and "second" do not limit the quantity and order.
[0060] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0061] Before introducing the embodiments of the present application, the relevant technical background involved in the embodiments of the present application is first introduced and explained. In a distributed computing scenario, a large amount of data sharing is usually required between different nodes. Taking the second node accessing the storage space of the first node as an example, the first node registers the storage space that the second node wants to access, and sends the verification information corresponding to the storage space to the second node. The first node controls the second node's access to the storage space through the verification information. Taking network transmission protocols such as infinite bandwidth technology (infiniband, IB) or remote direct memory access (RDMA) as an example, multiple second nodes apply to the first node for access rights to the memory interval. The first node falls into kernel mode to register the memory interval and generates a key corresponding to the memory interval. The first node stores the identification information corresponding to the memory interval and the key in the permission table, and sends the key to the multiple second nodes. To prevent the key from being maliciously counterfeited, the key can be a random number with a certain width length.
[0062] The traditional method has at least the following problems: First, the above-mentioned memory interval is a memory interval of a larger preset granularity, and it is impossible to set different access types for the memory intervals with smaller granularity in the memory interval. Second, if the access type corresponding to the memory interval needs to be adjusted, the operation can be performed in kernel mode, but the operation is relatively complicated. If the access type corresponding to the memory interval needs to be adjusted in user mode, the memory interval needs to be bound to the memory window, but pre-registering memory windows consumes resources and is limited in number. Third, different second nodes use the same key to access the memory interval. If the access rights of one of the second nodes need to be invalidated, it is necessary to fall into kernel mode and invalidate the page table corresponding to the key. In this way, the access rights of all second nodes will be terminated. Other second nodes need to re-apply for access rights to the memory interval from the first node and receive the key before they can continue to access the memory interval of the first node. Therefore, the traditional method has the problem of insufficient flexibility in access control.
[0063] After introducing the relevant technical background involved in the embodiments of the present application, the applicable scenarios of the embodiments of the present application are described in detail below. The technical solutions provided in the embodiments of the present application can be applied to a communication network, which may include multiple network nodes, and the multiple network nodes can communicate with each other through a network (network), and the communication can be implemented using a network transmission protocol. For example, the communication network may include a data center network (DCN), a high performance computing (HPC) network, or a cloud network. The network nodes in the communication network may also be referred to as nodes, which may be computers, servers, etc.
[0064] Exemplarily, as shown in FIG1 , the communication network 110 includes a plurality of nodes 120, which are connected via the network 110. Different nodes 120 in the plurality of nodes 120 can share data, for example, packets can be transmitted between any two nodes 120 in the plurality of nodes 120. Each node 120 in the plurality of nodes 120 may include a host 121 and a network interface card (NIC), which may also be referred to as a network card 122. The host 121 may include a processor 123, a memory 124, and a memory management unit (MMU). In one example, the processor 123 may be a central processing unit (CPU), and the memory 124 may be an internal memory (which may be referred to as memory). Optionally, the memory may be a dynamic random access memory (DRAM) or a double data rate (DDR) memory.
[0065] In an embodiment of the present application, when data is shared between multiple nodes 120 included in the communication network 110, each of the multiple nodes 120 can allocate memory based on a command. In one possible embodiment, when a node 120 needs to share data with other nodes 120, the node 120 can request memory available for storing data from the other nodes 120 based on a command, and after obtaining the memory, can send a memory access request for accessing the memory.
[0066] As shown in Figure 2, when data is shared between two nodes in the communication network, the memory user (i.e., the node that initiates the memory access request) can be referred to as the requester 210, and the memory provider (i.e., the node that receives the memory access request) can be referred to as the responder 220. The responder can be the first node and the requester can be the second node. Exemplarily, the requester 210 can include a coupled central processing unit 211 and a network card 212, and the responder 220 can include a coupled central processing unit 221, a memory management unit 223, a memory 224, a system memory management unit 225 (SMMU), and a network card 222.
[0067] It will be understood that the structures of the requester 210 and the responder 220 shown in FIG2 are merely exemplary. In actual applications, the requester 210 and the responder 220 may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, etc. FIG2 does not limit the embodiments of the present application.
[0068] The following is a detailed description of the access control method in the embodiment of the present application. Figure 3 is a flow chart of the access control method provided in the embodiment of the present application. The method can be applied to a first node including a first storage space, the first storage space including multiple sub-storage spaces, and the method can include the following steps.
[0069] S110: The first node receives an access request from the second node, where the access request is used to access a first sub-storage space in the first storage space, where the first sub-storage space is one of the multiple sub-storage spaces. The access request includes access space information and a first access type, where the access space information is used to indicate the first storage space and the first sub-storage space.
[0070] Among them, the storage space can be a storage space in the memory. The address of the first storage space and the addresses of the multiple sub-storage spaces are virtual addresses. The first storage space can be a storage space of preset granularity. Figure 4 is a schematic diagram of the first storage space provided in an embodiment of the present application. The first storage space 310 may include a first sub-storage space 311 and a second sub-storage space 312, and may also include other sub-storage spaces. Optionally, the first storage space 310 may be registered by the first node in kernel mode, and the first sub-storage space 311, the second sub-storage space 312 and the other sub-storage spaces may be registered by the first node through user mode.
[0071] In addition, the first node may include multiple storage spaces, each storage space corresponds to a number. Figure 5 is a schematic diagram of multiple storage spaces provided in an embodiment of the present application. In Figure 5, the first storage space 310 corresponds to number 1, the second storage space 320 corresponds to number 2, and the third storage space 330 corresponds to number 3. Each storage space may include at least one sub-storage space. For example, the second storage space 320 includes a third sub-storage space 321, and the third storage space 330 includes a fourth sub-storage space 331. Optionally, the first node may also have a fourth storage space (not shown in Figure 5), and the fourth storage space does not include a sub-storage space.
[0072] Optionally, each sub-storage space in a storage space does not overlap with each other. For example, in FIG5 , in the first storage space 310 , the address in the first sub-storage space 311 is completely different from the address in the second sub-storage space 312 .
[0073] Optionally, there may be overlap between sub-storage spaces in different storage spaces. For example, in FIG5 , the address in the first sub-storage space 311 and the address in the third sub-storage space 321 are partially or completely the same.
[0074] In addition, the access space information may include a number corresponding to the first storage space and an address in the first sub-storage space. The first node may determine the first storage space based on the number corresponding to the first storage space, or the first node may determine the first sub-storage space based on the addresses in the first storage space and the first sub-storage space. Optionally, the address in the first sub-storage space may be an address of a portion of the first sub-storage space, or may be the entire address of the first sub-storage space.
[0075] S120: The first node controls the second node's access to the first sub-storage space according to the access space information and the first access type.
[0076] Among them, controlling the second node's access to the first sub-storage space may be: allowing or denying the second node's access to the first sub-storage space. For example, the first access type is writing data, and the first node allows the second node to access the first sub-storage space, which may be: the first node allows the second node to write the corresponding data in the first sub-storage space. The first node denies the second node's access to the first sub-storage space, which may be: the first node does not allow the second node to write the corresponding data in the first sub-storage space. The first access type is reading data, and the first node allows the second node to access the first sub-storage space, which may be: the first node allows the second node to read data in the first sub-storage space. The first node denies the second node's access to the first sub-storage space, which may be: the first node does not allow the second node to read data in the first sub-storage space.
[0077] In the access control method provided in an embodiment of the present application, a first storage space includes multiple sub-storage spaces, and a first node controls the second node's access to the first sub-storage space based on the second node's access request. On the one hand, because the granularity of the first sub-storage space is smaller than that of the first storage space, this method can control the second node's access to the storage space with a smaller granularity. On the other hand, the first node can adjust the access types corresponding to the multiple sub-storage spaces in user mode, making the operation simpler. In this way, access control can be made more flexible.
[0078] In a possible embodiment, each of the multiple sub-storage spaces corresponds to one or more access types, and S120 includes: when the first storage space and the first sub-storage space indicated by the access space information are valid, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space. When the first storage space and the first sub-storage space indicated by the access space information are invalid, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space.
[0079] The second node may pre-register a sub-storage space in the first node. The first storage space and the first sub-storage space are legal, which may be: the first storage space is consistent with the storage space where the sub-storage space registered by the second node is located, and the first sub-storage space is consistent with the sub-storage space registered by the second node. The first storage space and the first sub-storage space indicated by the access space information are illegal, which may be: the first storage space is inconsistent with the storage space where the sub-storage space registered by the second node is located, or the first sub-storage space is inconsistent with the sub-storage space registered by the second node.
[0080] Furthermore, each storage space may correspond to multiple access types. For example, in FIG5 , the access types corresponding to the first storage space 310 may be read data, write data, and prohibit access. Each sub-storage space may correspond to one or more access types. The access type corresponding to each sub-storage space belongs to the multiple access types of the storage space where the sub-storage space is located. For example, in FIG5 , the second access type corresponding to the first sub-storage space 311 may be read data and write data, and the third access type corresponding to the second sub-storage space 312 may be read data.
[0081] Furthermore, the first node may determine the access type corresponding to the first storage space according to the number corresponding to the first storage space, and may also determine one or more access types corresponding to the first sub-storage space according to the addresses in the first storage space and the first sub-storage space.
[0082] In the access control method provided in an embodiment of the present application, if the access space information is valid and the first access type belongs to the access type corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space. Otherwise, the first node denies the second node access to the first sub-storage space. This provides a basis for the first node to control the second node's access to the first sub-storage space, thus making access control more flexible.
[0083] In one possible embodiment, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces have different access types. The different access types corresponding to the at least two sub-storage spaces may mean that the access types corresponding to the at least two sub-storage spaces are not completely identical. For example, the second access type is for reading data and writing data, and the third access type is for reading data. Both the second access type and the third access type include reading data, but the third access type does not include writing data. Therefore, the second access type and the third access type are not completely identical.
[0084] In the access control method provided in the embodiment of the present application, there are at least two sub-storage spaces corresponding to different access types, so that different access types can be set for different sub-storage spaces of smaller granularity, thus making access control more flexible.
[0085] Since at least two of the multiple sub-storage spaces in the first storage space correspond to different access types, the access type corresponding to the sub-storage space in the first storage space is different from the access type corresponding to the first storage space.
[0086] In one possible embodiment, the access types corresponding to the sub-storage spaces in different storage spaces may be the same. For example, in FIG5 , the second access type may be read data and write data, and the fourth access type corresponding to the third sub-storage space 321 and the fifth access type corresponding to the fourth sub-storage space may also be read data and write data.
[0087] In one possible embodiment, before S110, the process further includes: the first node receiving a registration request from the second node, the registration request being used to request registration of a sub-storage space in the first node, the registration request including a second access type, the second access type including the first access type; and the first node sending a registration response to the second node, the registration response being used to indicate the first storage space and the first sub-storage space.
[0088] Figure 6 is a second flow diagram of the access control method provided in an embodiment of the present application. This is illustrated using the interaction between a first node 410 and a second node 421 as an example. First node 410 may pre-register a first storage space and store the first storage space's number, the first storage space's address, and multiple access types corresponding to the first storage space.
[0089] Furthermore, the second node 421 sends a registration request to the first node 410, and the first node 410 receives the registration request from the second node 421. The registration request may include a target size and is used to request registration of a sub-storage space of the target size. Based on the registration request, the first node 410 may register a first sub-storage space in the pre-registered first storage space, where the size of the first sub-storage space is the target size and the access type corresponding to the first sub-storage space is the second access type. The first node 410 stores the address of the first sub-storage space and the second access type in the first storage space.
[0090] Furthermore, the first node 410 sends a registration response to the second node 421. The registration response may include the address of the first storage space and the address of the first sub-storage space. The address of the first storage space may be used to indicate the first storage space, and the address of the first sub-storage space may be used to indicate the first sub-storage space. Optionally, the registration response may also include the number corresponding to the first storage space and the second access type.
[0091] Then, the second node 421 may send an access request to the first node 410. The first node 410 receives the access request from the second node 421 and controls the second node 421's access to the first sub-storage space according to the access space information and the first access type in the access request.
[0092] Optionally, the first node may further register a fifth sub-storage space in the first storage space according to the registration request of the third node, and the fifth sub-storage space does not overlap with other sub-storage spaces in the first storage space.
[0093] Optionally, when the third node needs to register a sub-storage space that overlaps with the first sub-storage space, the first node may re-register a fifth storage space and generate a number corresponding to the fifth storage space. The fifth storage space may overlap with the first storage space, and the access type corresponding to the fifth storage space may be the same as the access type corresponding to the first storage space. The first node may register a fifth sub-storage space within the fifth storage space, and the fifth sub-storage space may not overlap with other sub-storage spaces within the fifth storage space.
[0094] In the access control method provided in the embodiment of the present application, the second node can register the first sub-storage space in the first node, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0095] In one possible embodiment, each of the plurality of sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the method further includes: when the first access credential matches the access credential corresponding to the first sub-storage space, the first node permits the second node to access the first sub-storage space; when the first access credential does not match the access credential corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space.
[0096] Optionally, the first node allows the second node to access the first sub-storage space only when the access request meets three conditions. That is: when the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, and the first access credential matches the access credential corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space. When one condition of the access request is not met, the first node denies the second node access to the first sub-storage space. That is: when the first storage space and the first sub-storage space indicated by the access space information are illegal, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, or the first access credential does not match the access credential corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space.
[0097] In the access control method provided in the embodiment of the present application, the first node can also control the second node's access to the first sub-storage space through the first access credential, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0098] In one possible embodiment, before S110, the process may further include: the first node generating a first access credential for the first sub-storage space based on at least one of the following, and sending the first access credential to the second node: the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number. The first access credential may be a message authentication code or a key. Optionally, the first node may also generate the first access credential based on the number corresponding to the first storage space, or based on the number corresponding to the first storage space and at least one of the above information.
[0099] Optionally, the step of the first node generating the first access credential can be performed during the process of the first node registering the first sub-storage space for the second node. For example, when the first node registers the first sub-storage space according to the registration request, the first access credential is generated. When the first node stores the address of the first sub-storage space and the second access type in the first storage space, the first access credential is also stored. The step of the first node sending the first access credential to the second node can be performed when the first node sends a registration response to the second node. For example, the registration response sent by the first node to the second node may include the first access credential. Optionally, the password manager in the first node generates the first access credential.
[0100] Optionally, each sub-storage space in the first node corresponds to a random number. For example, in FIG5 , the first sub-storage space 311 corresponds to random number A, the second sub-storage space 312 corresponds to random number B, the third sub-storage space 321 corresponds to random number C, and the fourth sub-storage space 331 corresponds to random number D.
[0101] In a possible embodiment, the first access credential is a message authentication code. The first access credential is generated by a root key and a message authentication code calculation function based on at least one of: a number corresponding to the first storage space, the first storage space, an access type corresponding to the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number. The derived input of the root key can be the count value of a local counter (local count, local cnt). The message authentication code calculation function includes at least one of: a hash-based message authentication code (HMAC), a cipher-based message authentication code (CMAC), a Galois message authentication code (GMAC), and other calculation functions.
[0102] In this embodiment, the first access credential matches the access credential corresponding to the first sub-storage space, which may mean that the first access credential is consistent with the access credential corresponding to the first sub-storage space. The access credential corresponding to the first sub-storage space is generated using a root key and a message authentication code calculation function based on at least one of: the serial number corresponding to the first storage space, the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number. The access credential corresponding to the first sub-storage space may be regenerated by the first node after receiving the access request, or may be pre-generated and stored by the first node.
[0103] In another possible embodiment, the first access credential is a secret key. The first access credential is generated using a root key and a key derivation function based on at least one of the following: the serial number of the first storage space, the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number. The key derivation function includes at least one of a password-based key derivation function 2 (PBKDF2), an HMAC-based key derivation function (HKDF), and other calculation functions.
[0104] In this embodiment, the comparison information generated based on the first access credential can be represented by an integrity check value (ICV). The first access credential matches the access credential corresponding to the first sub-storage space, and the comparison information ICV1 generated based on the first access credential is consistent with the comparison information ICV2 generated based on the access credential corresponding to the first sub-storage space. ICV1 is generated using the first access credential and a message authentication code calculation function based on at least one of: the number corresponding to the first storage space, the address in the first sub-storage space in the access space information, the first access type, a parameter tag that changes with the access request message (such as time, access request message sequence number), and other fields in the access request message.
[0105] ICV2 is generated using the access credentials corresponding to the first sub-storage space and a message authentication code calculation function based on: the number corresponding to the first storage space, the address in the first sub-storage space within the access space information, the first access type, a parameter tag that varies with the access request message (such as the time or the access request message sequence number), and at least one of the other fields in the access request message. ICV2 can be generated by the first node after receiving the access request, or it can be pre-generated and stored by the first node.
[0106] In the access control method provided in the embodiment of the present application, the first node generates a first access credential based on the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and at least one of a random number. The first access credential can be a message authentication code or a key, which provides a basis for the first node to control the second node's access to the first sub-storage space. In this way, access control can be more flexible.
[0107] In one possible embodiment, the first sub-storage space is registered by a plurality of second nodes, and the method further includes: when access permission to the first sub-storage space of at least one second node among the plurality of second nodes is terminated, the first node updating the first access credential with a second access credential, and sending the second access credential to second nodes among the plurality of second nodes other than the at least one second node.
[0108] The first node updates the first access credential to the second access credential, which may be: the first access credential is generated based on a random number. Each sub-storage space may also correspond to a backup random number. The first node updates the currently used random number to the backup random number, thereby updating the first access credential to the second access credential. For example, random number A in Figure 5 is updated to random number E in Figure 7, where random number E is the backup random number, and the second access credential is then calculated based on random number E. Optionally, the first node may also update the backup random number from random number E to random number F.
[0109] Furthermore, the termination of access rights of at least one of the plurality of second nodes to the first sub-storage space may occur by: the at least one second node applying for access rights to the first sub-storage space for a target duration, and upon expiration of the target duration, the at least one second node's access rights to the first sub-storage space are terminated. Alternatively, the at least one second node's system is attacked, and the node sends permission termination information to the first node, whereupon the first node terminates the at least one second node's access rights to the first sub-storage space based on the permission termination information.
[0110] Figure 8 is a schematic diagram of a first node sending a second access credential according to an embodiment of the present application. The first sub-storage space is registered by second node 421, second node 422, and second node 423. The first node 410 sends the second access credential to a second node other than the at least one second node among the plurality of second nodes. This may be because the first node 410 needs to terminate the access rights of the second node 421 to the first sub-storage space and maintain the access rights of the second node 422 and the second node 423. The first node 410 sends the updated second access credential to the second node 422 and the second node 423.
[0111] Optionally, the first node 410 further sends update indication information to the second node 422 and the second node 423 , where the update indication information is used to instruct the second node 422 and the second node 423 to update the first access credential to the second access credential.
[0112] Optionally, the second node 422 and the second node 423 update the first access credential to the second access credential and send an update response to the first node 410. When the first node 410 receives the update response from the second node 422 and the second node 423, or when the waiting of the first node 410 times out, the first node 410 updates the access credential corresponding to the first sub-storage space to the second access credential.
[0113] The following describes the access process of the second node whose access rights to the first sub-storage space have not been terminated. Figure 9 is a flowchart diagram of the access control method provided by an embodiment of the present application. Before the first node 410 waits for a timeout and the first node 410 receives update responses from the second node 422 and the second node 423, the second node 422 can send an access request to the first node 410, and the access request includes access space information, a first access type, and a first access credential. The first node 410 controls the access of the second node 422 to the first sub-storage space based on the access space information, the first access type, and the first access credential.
[0114] After the waiting time of first node 410 times out or first node 410 receives update responses from second node 422 and second node 423, second node 422 sends an access request to first node 410. The access request includes access space information, the first access type, and the second access credential. First node 410 controls second node 422's access to the first sub-storage space based on the access space information, the first access type, and the second access credential.
[0115] Specifically, when the first storage space and the first sub-storage space indicated by the access space information are legal, the first access type belongs to one or more access types corresponding to the first sub-storage space, and the second access credential matches the access credential corresponding to the first sub-storage space, the first node 410 allows the second node 422 to access the first sub-storage space.
[0116] The second access credential matches the access credential corresponding to the first sub-storage space, which may be: the second access credential is a message authentication code, the second access credential is consistent with the access credential corresponding to the first sub-storage space, and the access credential corresponding to the first sub-storage space is generated based on the updated random number E.
[0117] Furthermore, the second access credential matches the access credential corresponding to the first sub-storage space. Alternatively, the second access credential is a key. Comparison information ICV1 generated based on the second access credential is consistent with comparison information ICV2 generated based on the access credential corresponding to the first sub-storage space. The access credential corresponding to the first sub-storage space is generated based on a random number E.
[0118] Optionally, as shown in FIG8 , first node 410 further sends invalidation indication information to second node 421, indicating that the first access credential is invalid. Second node 421 deletes the first access credential based on the invalidation indication information and sends an invalidation response to first node 410. When first node 410 receives the invalidation response from second node 421, the update response from second node 422 or second node 423, or when the waiting time of first node 410 times out, first node 410 updates the access credential corresponding to the first sub-storage space to the second access credential.
[0119] The following describes the access process of the second node whose access rights to the first sub-storage space have been terminated. Figure 10 is a flowchart diagram of the access control method provided by an embodiment of the present application. Before the first node 410 waits for a timeout and the first node 410 receives an invalid response from the second node 421, an update response from the second node 422 and the second node 423, the second node 421 can still send an access request to the first node, and the access request includes access space information, a first access type and a first access credential. The first node 410 controls the access of the second node 421 to the first sub-storage space based on the access space information, the first access type and the first access credential.
[0120] Optionally, second node 421 does not delete the first access credential. After first node 410 updates the first access credential to the second access credential, second node 421 sends an access request to first node 410. The access request includes access space information, the first access type, and the first access credential. Because the first access credential does not match the second access credential in first node 410, first node 410 denies second node 421 access to the first sub-storage space.
[0121] In the access control method provided in an embodiment of the present application, when a first node terminates access rights to at least one second node, it updates the access credentials and sends the updated access credentials to the second node that maintains access rights. This allows for continued access for other users while multiple users simultaneously access the first sub-storage space, even if access rights for some users are terminated. This makes access control more flexible.
[0122] The present application also provides another access control method. Figure 11 is a flow chart of another access control method provided by the present application. The method may include the following steps.
[0123] S210: The second node sends an access request to the first node, where the access request is used to access a first sub-storage space in a first storage space, where the first storage space is a storage space in the first node, where the first storage space includes multiple sub-storage spaces, where the first sub-storage space is one of the multiple sub-storage spaces, and where the access request includes access space information and a first access type, where the access space information is used to indicate the first storage space and the first sub-storage space.
[0124] S220: When the first node is allowed to access the first sub-storage space, the second node accesses the first sub-storage space.
[0125] Among them, the first storage space, the first sub-storage space, the access space information, the first access type and other contents can refer to the relevant contents in the above embodiments, and the embodiments of this application will not be repeated here.
[0126] In the access control method provided in the embodiments of the present application, since the granularity of the first sub-storage space is smaller than that of the first storage space, the method can control the second node's access to the storage space with the smaller granularity. Furthermore, the first node can adjust the access types corresponding to multiple sub-storage spaces in user mode, making the operation simpler. This makes access control more flexible.
[0127] In one possible embodiment, each of the multiple sub-storage spaces corresponds to one or more access types. S220 may include: when the first storage space and the first sub-storage space indicated by the access space information are valid, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the second node accesses the first sub-storage space. Regarding the validity of the access space information, reference may be made to the above embodiment and will not be repeated herein.
[0128] In the access control method provided in the embodiments of the present application, when the access space information is valid and the first access type belongs to the access type corresponding to the first sub-storage space, the second node accesses the first sub-storage space. This provides a basis for the first node to control the second node's access to the first sub-storage space, making access control more flexible.
[0129] In one possible embodiment, among the multiple sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types. For details on access types, please refer to the above embodiments, and the embodiments of this application will not be repeated here. In the access control method provided in the embodiments of this application, there are at least two sub-storage spaces corresponding to different access types, so that different access types can be set for different sub-storage spaces of smaller granularity, thereby making access control more flexible.
[0130] In one possible embodiment, S210 may also include: the second node sending a registration request to the first node, the registration request being used to request registration of a sub-storage space in the first node, the registration request including a second access type, the second access type including the first access type. The second node receiving a registration response from the first node, the registration response being used to indicate the first storage space and the first sub-storage space. The contents of the registration request, second access type, and registration response may refer to the above-described embodiments and are not further described in detail in this embodiment of the present application.
[0131] In the access control method provided in the embodiment of the present application, the second node can register the first sub-storage space in the first node, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0132] In one possible embodiment, each of the multiple sub-storage spaces corresponds to an access credential, the access request also includes a first access credential, and the method further includes: when the first access credential is consistent with the access credential corresponding to the first sub-storage space, the second node accesses the first sub-storage space. The first access credential, the access credential corresponding to the first sub-storage space, and other details can be found in the above-described embodiments and are not further described in detail in this embodiment of the present application.
[0133] In the access control method provided in the embodiment of the present application, the first node can also control the second node's access to the first sub-storage space through the first access credential, providing a basis for the first node to control the second node's access to the first sub-storage space, thereby making access control more flexible.
[0134] In one possible embodiment, the method further includes: the second node receiving the first access credential from the first node, where the first access credential is obtained based on at least one of the following: the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number. The first access credential is a message authentication code or a key. The generation method and format of the first access credential can be referred to in the above embodiment and will not be further described in this embodiment.
[0135] In the access control method provided in the embodiment of the present application, the first access credential is generated based on the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and at least one of a random number. The first access credential can be a message authentication code or a key, which provides a basis for the first node to control the second node's access to the first sub-storage space. In this way, access control can be more flexible.
[0136] In one possible embodiment, the method further includes: the second node receiving a second access credential from the first node. The second node updating the first access credential to the second access credential. The second access credential and other contents can refer to the above embodiment and are not further described in detail in this embodiment of the present application.
[0137] In the access control method provided in an embodiment of the present application, when a first node terminates access rights to at least one second node, it updates the access credentials and sends the updated access credentials to the second node that maintains access rights. This allows for continued access for other users while multiple users simultaneously access the first sub-storage space, even if access rights for some users are terminated. This makes access control more flexible.
[0138] The above mainly introduces the access control method. The access control device corresponding to the access control method is introduced below. The embodiment of the present application can divide the functional modules according to the access control device corresponding to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0139] FIG12 shows a schematic diagram of a possible structure of the access control device involved in the above embodiment, where each functional module is divided according to its function. The access control device 500 can serve as a first node. The first storage space in the access control device 500 includes multiple sub-storage spaces. The device includes a receiving unit 510 and a processing unit 520. The receiving unit 510 can be used to support the device in executing S110 of the method embodiment. The processing unit 520 can be used to support the device in executing S120 of the method embodiment.
[0140] Exemplarily, each of the multiple sub-storage spaces corresponds to one or more access types, and the processing unit 520 is specifically configured to: when the first storage space and the first sub-storage space indicated by the access space information are valid, and the first access type belongs to one or more access types corresponding to the first sub-storage space, allow the second node to access the first sub-storage space; and when the first storage space and the first sub-storage space indicated by the access space information are invalid, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, deny the second node access to the first sub-storage space.
[0141] Illustratively, the apparatus includes a first permission registration unit, which may include a receiving unit and a sending unit; the receiving unit is configured to receive a registration request from the second node, the registration request being configured to request registration of a sub-storage space, the registration request including a second access type, the second access type including the first access type; and the sending unit is further configured to send a registration response to the second node, the registration response indicating the first storage space and the first sub-storage space.
[0142] Exemplarily, each of the multiple sub-storage spaces corresponds to an access credential, and the access request further includes a first access credential. The processing unit 520 is further configured to: when the first access credential matches the access credential corresponding to the first sub-storage space, allow the second node to access the first sub-storage space; and when the first access credential does not match the access credential corresponding to the first sub-storage space, deny the second node access to the first sub-storage space.
[0143] Illustratively, the processing unit is further configured to generate the first access credential for the first sub-storage space based on at least one of the following: the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number. The sending unit is further configured to send the first access credential to the second node. The first access credential is a message authentication code or a key.
[0144] Exemplarily, the first sub-storage space is registered with multiple second nodes, and the processing unit is further configured to: update the first access credential to a second access credential when at least one of the multiple second nodes terminates access to the first sub-storage space. The sending unit is further configured to send the second access credential to any second node other than the at least one second node in the multiple second nodes. Exemplarily, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces have different access types.
[0145] It is understandable that the various components of the access control device 500 can be used to implement the corresponding steps in the aforementioned method embodiment. Since the various steps have been described in detail in the aforementioned access control method embodiment, they will not be repeated here.
[0146] FIG13 shows another possible structural diagram of the access control device involved in the above embodiment. The access control device 600 can serve as a second node and includes a sending unit 610 and a processing unit 620. The sending unit 610 can be used to support the device in executing S210 of the method embodiment. The processing unit 620 can be used to support the device in executing S220 of the method embodiment.
[0147] Exemplarily, each sub-storage space in the multiple sub-storage spaces corresponds to one or more access types, and the processing unit 620 is specifically used to: access the first sub-storage space when the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space.
[0148] Exemplarily, the apparatus further includes a second permission registration unit, which may include a sending unit and a receiving unit. The sending unit is configured to send a registration request to the first node, the registration request being configured to request registration of a sub-storage space in the first node, the registration request including a second access type, the second access type including the first access type. The receiving unit is further configured to receive a registration response from the first node, the registration response being configured to indicate the first storage space and the first sub-storage space.
[0149] Exemplarily, each of the multiple sub-storage spaces corresponds to an access credential, and the access request also includes a first access credential. The processing unit 620 is specifically used to: access the first sub-storage space when the first access credential is consistent with the access credential corresponding to the first sub-storage space.
[0150] Illustratively, the receiving unit is further configured to: receive the first access credential from the first node, where the first access credential is obtained based on at least one of the following: the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number. The first access credential is a message authentication code or a key.
[0151] Exemplarily, the receiving unit is further configured to receive a second access credential from the first node. The processing unit is further configured to update the first access credential to the second access credential. Exemplarily, among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces have different access types.
[0152] It is understandable that the various components of the access control device 600 can be used to implement the corresponding steps in the aforementioned method embodiment. Since each step has been described in detail in the aforementioned access control method embodiment, it will not be repeated here.
[0153] The above describes an access control device in an embodiment of the present application from the perspective of a modular functional entity. The following describes an access control device in an embodiment of the present application from the perspective of hardware processing. The present application also provides an access control device, the structure of which can be shown in Figure 14. The access control device 700 can serve as a first node. The device includes: a processor 701, and can also include a memory 702, a communication interface 703, and a bus 704. The processor 701, memory 702, and communication interface 703 are connected via the bus 704.
[0154] The processor 701 is used to control and manage the actions of the device, and is used to execute one or more steps in the above-mentioned method embodiments, or other technical processes described herein. The communication interface 703 is used to support the device in communicating, such as supporting the device in communicating with a second node. In the embodiments of the present application, the processor 701 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 704 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the above figure uses only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0155] It is understandable that the various components of the access control device 700 can be used to implement the corresponding steps in the aforementioned method embodiment. Since each step has been described in detail in the aforementioned access control method embodiment, it will not be repeated here.
[0156] The present application also provides an access control device, the structure of which may be as shown in FIG15 . The access control device may serve as a second node, and includes a processor 801 , a memory 802 , a communication interface 803 , and a bus 804 , wherein the processor 801 , the memory 802 , and the communication interface 803 are connected via the bus 804 .
[0157] Among them, the processor 801 is used to control and manage the actions of the device. In one possible embodiment, the processor 801 can be used to support the device to execute one or more steps of the above-mentioned method embodiment, as well as other technical processes described herein. The communication interface 803 is used to support the device to communicate, such as supporting the device to communicate with the first node. In the embodiment of the present application, the processor 801 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0158] Bus 804 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industrial Standard Architecture (EISA) bus. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the above figure shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0159] It is understandable that the various components of the access control device 800 can be used to implement the corresponding steps in the aforementioned method embodiment. Since each step has been described in detail in the aforementioned access control method embodiment, it will not be repeated here.
[0160] In another aspect of the present application, an access control system is provided, comprising a first node and a second node. The first node may be the first node provided in the aforementioned apparatus embodiment, configured to execute the steps of the first node in the method embodiment. The second node may be the second node provided in the aforementioned apparatus embodiment, configured to execute the steps of the second node in the method embodiment. Since each step has been described in detail in the aforementioned access control method embodiment, it will not be repeated here.
[0161] In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the steps of the first node in the above method embodiment are implemented.
[0162] In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the steps of the second node in the above method embodiment are implemented.
[0163] In another aspect of the embodiments of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute the steps of the first node in the above method embodiment.
[0164] In another aspect of the embodiments of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute the steps of the second node in the above method embodiment.
[0165] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0166] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0167] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the part of the technical solution of the embodiment of the present application that contributes in essence or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
[0169] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An access control method, characterized in that: Applied to a first node including a first storage space, the first storage space including a plurality of sub-storage spaces, the method comprising: The first node receives an access request from the second node, the access request is used to access a first sub-storage space in the first storage space, the first sub-storage space is one of the multiple sub-storage spaces, the access request includes access space information and a first access type, the access space information is used to indicate the first storage space and the first sub-storage space; The first node controls the access of the second node to the first sub-storage space according to the access space information and the first access type.
2. The method according to claim 1, characterized in that Each of the plurality of sub-storage spaces corresponds to one or more access types, and the first node controls the access of the second node to the first sub-storage space according to the access space information and the first access type, including: When the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space; When the first storage space and the first sub-storage space indicated by the access space information are illegal, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, the first node denies the second node's access to the first sub-storage space.
3. The method according to claim 1 or 2, characterized in that: Before the first node receives the access request from the second node, the method further includes: The first node receives a registration request from the second node, the registration request is used to request to register a sub-storage space in the first node, the registration request includes a second access type, and the second access type includes the first access type; The first node sends a registration response to the second node, where the registration response is used to indicate the first storage space and the first sub-storage space.
4. The method according to any one of claims 1 to 3, characterized in that: Each of the plurality of sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the method further includes: When the first access credential matches the access credential corresponding to the first sub-storage space, the first node allows the second node to access the first sub-storage space; When the first access credential does not match the access credential corresponding to the first sub-storage space, the first node denies the second node access to the first sub-storage space.
5. The method according to claim 4, characterized in that Before the first node receives the access request from the second node, the method further includes: The first node generates the first access credential for the first sub-storage space according to at least one of the following, and sends the first access credential to the second node: the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number; The first access credential is a message authentication code or a key.
6. The method according to claim 5, characterized in that The first sub-storage space is registered by a plurality of second nodes, and the method further comprises: When the access permission of at least one second node among the plurality of second nodes to the first sub-storage space is terminated, the first node updates the first access credential to a second access credential; The first node sends the second access credential to a second node other than the at least one second node among the plurality of second nodes.
7. The method according to any one of claims 1 to 6, characterized in that: Among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
8. An access control method, characterized in that: The method comprises: The second node sends an access request to the first node, wherein the access request is used to access a first sub-storage space in a first storage space, wherein the first storage space is a storage space in the first node, and the first storage space includes a plurality of sub-storage spaces. The first sub-storage space is one of the multiple sub-storage spaces, the access request includes access space information and a first access type, and the access space information is used to indicate the first storage space and the first sub-storage space; When the first node is allowed to access the first sub-storage space, the second node accesses the first sub-storage space.
9. The method according to claim 8, characterized in that Each of the plurality of sub-storage spaces corresponds to one or more access types, and when the first node is allowed to access the first sub-storage space, the second node accesses the first sub-storage space, including: When the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the second node accesses the first sub-storage space.
10. The method according to claim 8 or 9, characterized in that: Before the second node sends the access request to the first node, the method further includes: The second node sends a registration request to the first node, where the registration request is used to request to register a sub-storage space in the first node, the registration request includes a second access type, and the second access type includes the first access type; The second node receives a registration response from the first node, where the registration response is used to indicate the first storage space and the first sub-storage space.
11. The method according to any one of claims 8 to 10, characterized in that: Each of the plurality of sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the method further includes: When the first access credential is consistent with the access credential corresponding to the first sub-storage space, the second node accesses the first sub-storage space.
12. The method according to claim 11, characterized in that The method further comprises: The second node receives the first access credential from the first node, where the first access credential is obtained according to at least one of the following: the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number; The first access credential is a message authentication code or a key.
13. The method according to claim 12, characterized in that The method further comprises: The second node receives a second access credential from the first node; The second node updates the first access credential to the second access credential.
14. The method according to any one of claims 8 to 13, characterized in that Among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
15. An access control device, characterized in that: The first storage space in the device includes a plurality of sub-storage spaces, and the device includes: a receiving unit, configured to receive an access request from a second node, wherein the access request is used to access a first sub-storage space in the first storage space, the first sub-storage space being one of the plurality of sub-storage spaces, the access request comprising access space information and a first access type, the access space information being used to indicate the first storage space and the first sub-storage space; A processing unit is used to control the access of the second node to the first sub-storage space according to the access space information and the first access type.
16. The device according to claim 15, characterized in that Each of the plurality of sub-storage spaces corresponds to one or more access types, and the processing unit is specifically configured to: When the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, allowing the second node to access the first sub-storage space; When the first storage space and the first sub-storage space indicated by the access space information are illegal, or the first access type does not belong to one or more access types corresponding to the first sub-storage space, the second node is denied access to the first sub-storage space.
17. The device according to claim 15 or 16, characterized in that The device also includes a sending unit; The receiving unit is further configured to receive a registration request from the second node, wherein the registration request is used to request registration of a a sub-storage space, the registration request including a second access type, the second access type including the first access type; The sending unit is used to send a registration response to the second node, where the registration response is used to indicate the first storage space and the first sub-storage space.
18. The device according to any one of claims 15 to 17, characterized in that Each of the plurality of sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the processing unit is further configured to: When the first access credential matches the access credential corresponding to the first sub-storage space, allowing the second node to access the first sub-storage space; When the first access credential does not match the access credential corresponding to the first sub-storage space, the second node is denied access to the first sub-storage space.
19. The device according to claim 18, characterized in that The processing unit is further configured to generate the first access credential for the first sub-storage space according to at least one of the following: the first storage space, the access type corresponding to the first storage space, the first sub-storage space, the access type corresponding to the first sub-storage space, and a random number; The sending unit is further configured to send the first access credential to the second node; The first access credential is a message authentication code or a key.
20. The device according to claim 19, characterized in that The first sub-storage space is registered by a plurality of second nodes; The processing unit is further configured to update the first access credential to a second access credential when the access permission of at least one second node among the plurality of second nodes to the first sub-storage space is terminated; The sending unit is further used to send the second access credential to a second node other than the at least one second node among the multiple second nodes.
21. The device according to any one of claims 15 to 20, characterized in that Among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
22. An access control device, characterized in that: The device comprises: a sending unit, configured to send an access request to a first node, wherein the access request is used to access a first sub-storage space in a first storage space, the first storage space being a storage space in the first node, the first storage space including a plurality of sub-storage spaces, the first sub-storage space being one of the plurality of sub-storage spaces, the access request including access space information and a first access type, the access space information being used to indicate the first storage space and the first sub-storage space; The processing unit is configured to access the first sub-storage space when the first node is allowed to access the first sub-storage space.
23. The device according to claim 22, characterized in that Each of the plurality of sub-storage spaces corresponds to one or more access types, and the processing unit is specifically configured to: When the first storage space and the first sub-storage space indicated by the access space information are legal, and the first access type belongs to one or more access types corresponding to the first sub-storage space, the first sub-storage space is accessed.
24. The device according to claim 22 or 23, characterized in that The device also includes a receiving unit; The sending unit is further used to send a registration request to the first node, the registration request is used to request to register a sub-storage space in the first node, the registration request includes a second access type, and the second access type includes the first access type; The receiving unit is used to receive a registration response from the first node, where the registration response is used to indicate the first storage space and the first sub-storage space.
25. The device according to any one of claims 22 to 24, characterized in that Each of the plurality of sub-storage spaces corresponds to an access credential, the access request further includes a first access credential, and the processing unit is further configured to: When the first access credential is consistent with the access credential corresponding to the first sub-storage space, the first sub-storage space is accessed.
26. The device according to claim 25, characterized in that The receiving unit is also used for: receiving the first access credential from the first node, where the first access credential is obtained according to at least one of the following: the first storage space, the first sub-storage space, an access type corresponding to the first sub-storage space, and a random number; The first access credential is a message authentication code or a key.
27. The device according to claim 26, characterized in that The receiving unit is further configured to receive a second access credential from the first node; The processing unit is further configured to update the first access credential to the second access credential.
28. The device according to any one of claims 22 to 27, characterized in that Among the multiple sub-storage spaces in the first storage space, at least two sub-storage spaces correspond to different access types.
29. An access control device, characterized in that: The device includes a processor and a memory, wherein instructions are stored in the memory. When the processor executes the instructions, the device implements the access control method according to any one of claims 1 to 14.
30. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the access control method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Shared space access method and device and permission management method and device
CN109787946A
Resource sharing method and device, computer readable storage medium and computer equipment
CN111327589A
Access control systems, devices, and methods therefor
US11551496B1
Time-based data placement in a distributed storage system
US20160173620A1
Managing access to resources
US20170180335A1
