Access control method and device
By dividing the storage space into multiple sub-storage spaces and managing their access types in a distributed computing scenario, the problem of inflexible access control in the existing technology is solved, and flexible access and efficient management of smaller-granularity storage spaces are achieved.
Patent Information
- Application Number
- CN202310209421.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
The existing technology is not flexible enough in access control in distributed computing scenarios and cannot effectively manage smaller-granularity storage space and adjust access types in user mode, resulting in complex and inflexible operations.
By dividing the storage space into multiple sub-storage spaces in the first node, each sub-storage space corresponds to one or more access types, using the access space information and access types to control the access permissions of the second node, and by generating and updating access credentials to manage access rights.
It realizes flexible access control of smaller granular storage space, simplifies the adjustment of access types in user mode, and improves the flexibility and efficiency of access control.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an access control method and device. Background Art
[0002] In a distributed computing scenario, a large amount of data sharing is usually required between different nodes. For example, when a second node accesses the storage space of a first node, 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. The existing technology has the problem that access control is not flexible enough. Summary of the invention
[0003] The embodiments of the present application provide an access control method and device, which solve the problem that access control in the prior art is not flexible enough.
[0004] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, an access control method is provided, which is 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 receiving an access request from a second node, the access request being 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. 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.
[0006] 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 according to the access request of the second node. On the one hand, 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 a smaller granularity. On the other hand, the first node can adjust the access types corresponding to multiple sub-storage spaces in user mode, which makes the operation simpler. In this way, access control can be made more flexible.
[0007] 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 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. 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 first node allows the second node to access the first sub-storage space, otherwise, the first node denies the second node's access to 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, so that access control can be made more flexible.
[0008] 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, so that access control can be more flexible.
[0009] 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, so that access control can be 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 generates the first access credential for the first sub-storage space according to at least one of the following, and sends 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 according to 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 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, so that access control can be more flexible.
[0011] 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 the second access credential. The first node sends the second access credential to the second nodes among the multiple second nodes except the at least one second node. 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.
[0012] In a possible implementation of the first aspect, among the multiple sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types. In the above possible implementation, there are at least two sub-storage spaces corresponding to different access types, so that different access types can be set for sub-storage spaces of different smaller granularities, so that access control can be made more flexible.
[0013] In a second aspect, an access control method is provided, the method comprising: a second node sends an access request to a first node, the access request is used to access a first sub-storage space in a first storage space, the first storage space is a storage space in the first node, the first storage space includes multiple 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, the access space information is used to indicate the first storage space and the first sub-storage space. When the first node allows access to the first sub-storage space, the second node accesses the first sub-storage space.
[0014] In the above technical solution, on the one hand, 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 a smaller granularity. On the other hand, the first node can adjust the access types corresponding to multiple sub-storage spaces in the user state, which is simpler to operate. In this way, access control can be made more flexible.
[0015] 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, so that access control can be more flexible.
[0016] 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, so that access control can be more flexible.
[0017] 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 is consistent with the access credential corresponding to the first sub-storage space, the second node accesses 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, so that access control can be made more flexible.
[0018] In a possible implementation of the second aspect, the method further includes: the second node receives the first access credential from the first node, and the first access credential is obtained according to 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. In the above possible implementation, the first access credential is generated according to 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 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, so that access control can be more flexible.
[0019] In a possible implementation of the second aspect, the method further includes: 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. 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 access the first sub-storage space at the same time, when the access rights of some users are terminated, other users can be guaranteed to continue to access. In this way, access control can be made more flexible.
[0020] In a possible implementation of the second aspect, among the multiple sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types. In the above possible implementation, 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, so that access control can be made more flexible.
[0021] In a third aspect, an access control device is provided, wherein a 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, the access request being 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 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 according to the access space information and the first access type.
[0022] 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 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, allow 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, deny the second node access to the first sub-storage space.
[0023] In a possible implementation of the third aspect, the device further includes a sending unit. The receiving unit is further configured to receive 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. The sending unit is configured to send a registration response to the second node, the registration response being used to indicate the first storage space and the first sub-storage space.
[0024] 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. 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.
[0025] 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 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.
[0026] In a possible implementation of the third aspect, the first sub-storage space is registered by a plurality of second nodes. The processing unit is further configured to, when at least one second node among the plurality of second nodes terminates access to the first sub-storage space, update the first access credential by the first node to a second access credential. The sending unit is further configured to send the second access credential to a second node among the plurality of second nodes other than the at least one second node.
[0027] 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.
[0028] 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 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 comprising a plurality of sub-storage spaces, 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, configured to access the first sub-storage space when the first node allows access to the first sub-storage space.
[0029] In a possible implementation of the fourth aspect, each sub-storage space of 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.
[0030] In a possible implementation manner of the fourth aspect, the device further includes a receiving unit; the sending unit is further configured 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 configured to receive a registration response from the first node, the registration response is used to indicate the first storage space and the first sub-storage space.
[0031] In a possible implementation of the fourth aspect, each sub-storage space of 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.
[0032] In a possible implementation manner 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 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.
[0033] In a possible implementation manner of the fourth aspect, 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.
[0034] In a possible implementation manner of the fourth aspect, among the multiple sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types.
[0035] In a fifth aspect, an access control device is provided, which includes a processor and a memory, wherein instructions are stored in the memory, and 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.
[0036] In a sixth aspect, an access control device is provided, the device comprising a processor and a memory, the memory storing instructions, and when the processor executes the instructions, the device implements the access control method provided by the second aspect or any possible implementation of the second aspect.
[0037] 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 method of the first aspect is implemented.
[0038] 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.
[0039] In another aspect of an embodiment of the present application, an access control system is provided, the control system comprising a first node and a second node. The first node is used to execute the access control method provided by the first aspect or any possible implementation of the first aspect, and the second node is used to execute the access control method provided by the second aspect or any possible implementation of the second aspect.
[0040] According to 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 executes 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.
[0041] 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
[0042] Figure 1 A schematic diagram of a communication network provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a requester and a responder provided in an embodiment of the present application;
[0044] Figure 3 Schematic diagram of the access control method provided in the embodiment of the present application Figure 1 ;
[0045] Figure 4 A schematic diagram of a first storage space provided in an embodiment of the present application;
[0046] Figure 5 Schematic diagram of multiple storage spaces provided in the embodiment of the present application Figure 1 ;
[0047] Figure 6 Schematic diagram of the access control method provided in the embodiment of the present application Figure 2 ;
[0048] Figure 7 Schematic diagram of multiple storage spaces provided in the embodiment of the present application Figure 2 ;
[0049] Figure 8 A schematic diagram of a first node sending a second access credential provided in an embodiment of the present application;
[0050] Fig. 9 Schematic diagram of the access control method provided in the embodiment of the present application Figure 3 ;
[0051] Fig.10 Schematic diagram of the access control method provided in the embodiment of the present application Figure 4 ;
[0052] Fig.11 A flowchart of another access control method provided in an embodiment of the present application;
[0053] Fig.12 A schematic diagram of an access control device provided in an embodiment of the present application;
[0054] Fig.13 A schematic diagram of another access control device provided in an embodiment of the present application;
[0055] Fig.14 A schematic diagram of another access control device provided in an embodiment of the present application;
[0056] Fig.15 A schematic diagram of another access control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The technical scheme in the embodiment of the present application will be described below in conjunction with the accompanying drawings in the embodiment of the present application. In the embodiment of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there may be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists 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 its similar expressions refers to any combination of these items, including any combination of single items 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 embodiment of the present application, the words "first", "second" and the like do not limit the quantity and order.
[0058] It should be noted that in the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0059] 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, and 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 (remote direct memory access, RDMA) as an example, multiple second nodes apply to the first node for access rights to the memory interval, and the first node falls into kernel state to register the memory interval and generate the 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.
[0060] The traditional method has at least the following problems: First, the above-mentioned memory interval is a memory interval with a larger preset granularity, and it is impossible to set different access types for the memory interval with a smaller granularity in the memory interval. Second, if the access type corresponding to the memory interval needs to be adjusted, it can be operated in kernel state, but the operation is relatively complicated. If the access type corresponding to the memory interval needs to be adjusted in user state, the memory interval needs to be bound to the memory window, but pre-registering the memory window consumes resources and the number is limited. 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 state to 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 the access rights of 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 that access control is not flexible enough.
[0061] 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 solution 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 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 (data center network, DCN), a high performance computing (high performance computing, HPC) network or a cloud network. The network node in the communication network may also be referred to as a node, which may be a computer, a server, or the like.
[0062] For example, Figure 1 As shown, the communication network 110 includes a plurality of nodes 120, and the plurality of nodes 120 are connected through the network 110. Data can be shared between different nodes 120 in the plurality of nodes 120, for example, data 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 (memory), and a memory management unit (MMU), etc. In an 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 for short). Optionally, the memory may be a dynamic random access memory (DRAM) or a double data rate (DDR) memory.
[0063] In the embodiment of the present application, when data is shared between the multiple nodes 120 included in the communication network 110, each of the multiple nodes 120 can allocate memory based on commands. In a possible embodiment, when a node 120 needs to share data with other nodes 120, the node 120 can apply to other nodes 120 for memory that can be used to store data based on commands, and after applying for the memory, a memory access request for accessing the memory can be sent.
[0064] like Figure 2 As shown, when data is shared between two nodes in the communication network, the user of the memory (i.e., the node that initiates the memory access request) can be called the requester 210 (requester), and the provider of the memory (i.e., the node that receives the memory access request) can be called the responder 220 (responder), wherein 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 central processing unit 221, a memory management unit 223, a memory 224, a system memory management unit 225 (system memory management unit, SMMU) and a network card 222 coupled in sequence.
[0065] It is understandable that the above Figure 2 The structures of the requester 210 and the responder 220 shown are only exemplary. In actual applications, the requester 210 and the responder 220 may include more or fewer components than those shown in the figure, or may combine certain components, or arrange the components differently. Figure 2 It does not limit the embodiments of the present application.
[0066] The specific contents of the access control method in the embodiment of the present application are described in detail below. Figure 3 Schematic diagram of the access control method provided in the embodiment of the present application Figure 1 The method may be applied to a first node including a first storage space, the first storage space including a plurality of sub-storage spaces, and the method may include the following steps.
[0067] 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, and 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.
[0068] The storage space may be a storage space in a memory. The address of the first storage space and the addresses of the plurality of sub-storage spaces are virtual addresses. The first storage space may be a storage space of a preset granularity. Figure 4 A schematic diagram of a 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 other sub-storage spaces may be registered by the first node through user mode.
[0069] Furthermore, the first node may include a plurality of storage spaces, and each storage space corresponds to a number. Figure 5 Schematic diagram of multiple storage spaces provided in the embodiment of the present application Figure 1 .exist Figure 5 In the example, 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 ( Figure 5 (not shown in the figure), the fourth storage space does not include a sub-storage space.
[0070] Optionally, each sub-storage space in a storage space does not overlap with each other. Figure 5 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 .
[0071] Optionally, sub-storage spaces in different storage spaces may overlap. Figure 5 In the embodiment, the address in the first sub-storage space 311 and the address in the third sub-storage space 321 are partially the same or completely the same.
[0072] 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 according to the number corresponding to the first storage space, and the first node may determine the first sub-storage space according to the first storage space and the address in 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.
[0073] 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.
[0074] 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 the 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 the data in the first sub-storage space.
[0075] In the access control method provided in the embodiment of the present application, 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 according to the access request of the second node. On the one hand, 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 of smaller granularity. On the other hand, the first node can adjust the access types corresponding to the multiple sub-storage spaces in the user state, which makes the operation simpler. In this way, access control can be made more flexible.
[0076] 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 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 access to the first sub-storage space.
[0077] 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.
[0078] And, each storage space can correspond to multiple access types. For example, in Figure 5 In the example, the access type 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 Figure 5 In the example, the second access type corresponding to the first sub-storage space 311 may be reading data and writing data, and the third access type corresponding to the second sub-storage space 312 may be reading data.
[0079] Furthermore, the first node may determine the access type corresponding to the first storage space according to the serial 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.
[0080] In the access control method provided by the embodiment of the present application, 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 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. In this way, a basis is provided for the first node to control the second node's access to the first sub-storage space, and in this way, access control can be made more flexible.
[0081] In a 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. The different access types corresponding to at least two sub-storage spaces may be: the access types corresponding to at least two sub-storage spaces are not completely the same. For example, the second access type is read data and write data, and the third access type is read data. Both the second access type and the third access type include read data, but the third access type does not include write data. The second access type and the third access type are not completely the same.
[0082] 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 sub-storage spaces of different smaller granularities, thus making access control more flexible.
[0083] 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.
[0084] In a possible embodiment, the access types corresponding to the sub-storage spaces in different storage spaces may be the same. Figure 5 In the example, the second access type may be reading data and writing 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 reading data and writing data.
[0085] In a possible embodiment, before S110, the method 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. 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.
[0086] in, Figure 6 Schematic diagram of the access control method provided in the embodiment of the present application Figure 2 The interaction between the first node 410 and the second node 421 is taken as an example for description. The first node 410 may pre-register a first storage space and store the number of the first storage space, the address of the first storage space, and multiple access types corresponding to the first storage space.
[0087] And, 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 the registration request is used to request the registration of a sub-storage space of the target size. The first node 410 can register a first sub-storage space in a pre-registered first storage space according to the registration request, 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 in the first storage space and the second access type.
[0088] Furthermore, the first node 410 sends a registration response to the second node 421, and 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.
[0089] 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.
[0090] Optionally, the first node may also 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.
[0091] Optionally, when the third node needs to register a sub-storage space that overlaps with the first sub-storage space, the first node can re-register the fifth storage space and generate a number corresponding to the fifth storage space. The fifth storage space can overlap with the first storage space, and the access type corresponding to the fifth storage space can be the same as the access type corresponding to the first storage space. The first node can register a fifth sub-storage space in the fifth storage space, and the fifth sub-storage space does not overlap with other sub-storage spaces in the fifth storage space.
[0092] 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.
[0093] In a possible embodiment, each of the multiple 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.
[0094] 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.
[0095] 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.
[0096] In a possible embodiment, before S110, it may also include: the first node generates the first access credential for the first sub-storage space according to at least one of the following, and sends 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. Optionally, the first node may also generate the first access credential according to the number corresponding to the first storage space, or according to the number corresponding to the first storage space and at least one of the above information.
[0097] Optionally, the step of the first node generating a first access credential may 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 may 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.
[0098] Optionally, each sub-storage space in the first node corresponds to a random number. Figure 5 In the example, the first sub-storage space 311 corresponds to the random number A, the second sub-storage space 312 corresponds to the random number B, the third sub-storage space 321 corresponds to the random number C, and the fourth sub-storage space 331 corresponds to the random number D.
[0099] 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.
[0100] In this embodiment, the first access credential matches the access credential corresponding to the first sub-storage space, which may be: 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 by 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.
[0101] In another possible embodiment, the first access credential is a key. The first access credential is generated by a root key and a key derivation function based on at least one of: 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 the like.
[0102] 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 can be: 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. Among them, ICV1 is generated by the first access credential and the message authentication code calculation function based on: 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, the parameter tag (tag) that changes with the access request message (such as time, access request message sequence number), and at least one of the other fields in the access request message.
[0103] ICV2 is generated by the access credential corresponding to the first sub-storage space and the message authentication code calculation function according to: 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, the parameter tag that changes with the access request message (such as time, access request message sequence number), and at least one of the other fields in the access request message. ICV2 can be regenerated by the first node after receiving the access request, or it can be pre-generated and stored by the first node.
[0104] 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 verification 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.
[0105] In a possible embodiment, the first sub-storage space is registered by a plurality of second nodes, and the method further includes: when at least one second node among the plurality of second nodes terminates access to the first sub-storage space, 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 among the plurality of second nodes other than the at least one second node.
[0106] The first node updates the first access credential to the second access credential, which may be: the first access credential is generated according to a random number. Each sub-storage space may also correspond to a backup random number, and the first node updates the random number in use to the backup random number, thereby updating the first access credential to the second access credential. Figure 5 The random number A in is updated to Figure 7 The random number E in the random number is a backup random number, and the second access credential is calculated according to the random number E. Optionally, the first node may also update the backup random number from the random number E to the random number F.
[0107] Furthermore, the termination of the access right of at least one of the plurality of second nodes to the first sub-storage space may be: the at least one second node applies for the access right of the first sub-storage space for a target duration, and after the target duration ends, the access right of the at least one second node to the first sub-storage space is terminated. Alternatively, the system of the at least one second node is attacked, and the node sends a permission termination message to the first node, and the first node terminates the access right of the at least one second node to the first sub-storage space according to the permission termination message.
[0108] Figure 8 A schematic diagram of a first node sending a second access credential provided in an embodiment of the present application. The first sub-storage space is registered by a second node 421, a second node 422, and a 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 multiple second nodes, which may be: the first node 410 needs to terminate the access right of the second node 421 to the first sub-storage space, and the first node 410 needs to maintain the access right 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.
[0109] 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.
[0110] 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 first node 410 waits for a timeout, the first node 410 updates the access credential corresponding to the first sub-storage space to the second access credential.
[0111] The access process of the second node whose access right to the first sub-storage space has not been terminated is introduced below. Fig. 9 Schematic diagram of the access control method provided in the embodiment of the present application Figure 3 Before the first node 410 waits for a timeout and receives update responses from the second node 422 and the second node 423, the second node 422 may send an access request to the first node 410, the access request including the access space information, the first access type, and the first access credential. The first node 410 controls the second node 422's access to the first sub-storage space according to the access space information, the first access type, and the first access credential.
[0112] After the first node 410 times out or the first node 410 receives update responses from the second node 422 and the second node 423, the second node 422 sends an access request to the first node 410, the access request including the access space information, the first access type and the second access credential. The first node 410 controls the second node 422's access to the first sub-storage space according to the access space information, the first access type and the second access credential.
[0113] 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.
[0114] 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 according to the updated random number E.
[0115] Furthermore, the second access credential matches the access credential corresponding to the first sub-storage space, and it can also be that: the second access credential is a key. The comparison information ICV1 generated based on the second access credential is consistent with the 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 the random number E.
[0116] Optional, such as Figure 8 As shown, the first node 410 also sends invalid indication information to the second node 421, and the invalid indication information is used to indicate that the first access credential of the second node 421 is invalid. The second node 421 deletes the first access credential according to the invalid indication information and sends an invalid response to the first node 410. When the first node 410 receives the invalid response from the second node 421, the update response from the second node 422 and the second node 423, or when the first node 410 waits for a timeout, the first node 410 updates the access credential corresponding to the first sub-storage space to the second access credential.
[0117] The access process of the second node whose access permission to the first sub-storage space is terminated is introduced below. Fig.10 Schematic diagram of the access control method provided in the embodiment of the present application Figure 4 Before the first node 410 does not wait for a timeout and the first node 410 receives an invalid response from the second node 421 and 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 the access space information, the first access type, and the first access credential. The first node 410 controls the second node 421's access to the first sub-storage space according to the access space information, the first access type, and the first access credential.
[0118] Optionally, the second node 421 does not delete the first access credential. After the first node 410 updates the first access credential to the second access credential, the second node 421 sends an access request to the first node 410, the access request including the access space information, the first access type, and the first access credential. Since the first access credential does not match the second access credential in the first node 410, the first node 410 denies the second node 421 access to the first sub-storage space.
[0119] In the access control method provided by the embodiment of the present application, when the first node terminates the access rights of at least one second node, the first node updates the access credentials and sends the updated access credentials to the second node that maintains the access rights. In this way, in the 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. In this way, access control can be made more flexible.
[0120] The embodiment of the present application also provides another access control method. Fig.11 A flowchart of another access control method provided by an embodiment of the present application. The method may include the following steps.
[0121] 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.
[0122] S220: When the first node is allowed to access the first sub-storage space, the second node accesses the first sub-storage space.
[0123] 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 the present application will not be repeated here.
[0124] In the access control method provided in the embodiment of the present application, on the one hand, since the granularity of the first sub-storage space is smaller than that of the first storage space, the method can control the access of the second node to the storage space of smaller granularity. On the other hand, the first node can adjust the access types corresponding to multiple sub-storage spaces in the user state, which is simpler to operate. In this way, access control can be made more flexible.
[0125] In a possible embodiment, each of the multiple sub-storage spaces corresponds to one or more access types, and S220 may include: 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. The content of the legality of the access space information can refer to the above embodiment, and the embodiment of the present application will not be repeated here.
[0126] In the access control method provided in the embodiment of the present application, 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, making access control more flexible.
[0127] In a 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. Among them, the content related to the access type can refer to the above embodiment, and the embodiment of the present application will not be repeated here. 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, so that access control can be made more flexible.
[0128] In a possible embodiment, before S210, it may also include: 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. Among them, the contents such as the registration request, the second access type, and the registration response can refer to the above embodiment, and the embodiments of the present application will not be repeated here.
[0129] 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.
[0130] In a 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 contents can refer to the above embodiment, and the embodiments of the present application will not be repeated here.
[0131] 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.
[0132] In a possible embodiment, the method further includes: the second node receives the first access credential from the first node, and the first access credential is obtained according to 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, form, and other contents of the first access credential can refer to the above embodiment, and the embodiment of the present application will not be repeated here.
[0133] 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 verification 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, thereby making access control more flexible.
[0134] In a 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 may refer to the above embodiment, and the embodiment of the present application will not be repeated here.
[0135] In the access control method provided by the embodiment of the present application, when the first node terminates the access rights of at least one second node, the first node updates the access credentials and sends the updated access credentials to the second node that maintains the access rights. In this way, in the 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. In this way, access control can be made more flexible.
[0136] The above mainly introduces the access control method. The following introduces the access control device corresponding to the access control method. 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.
[0137] In the case of dividing each functional module into corresponding functional modules, Fig.12 A possible structural diagram of the access control device involved in the above embodiment is shown. The access control device 500 can be used as a first node, and 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 to execute S110 in the method embodiment. The processing unit 520 can be used to support the device to execute S120 in the method embodiment.
[0138] Exemplarily, each of the multiple sub-storage spaces corresponds to one or more access types, and the processing unit 520 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, allow 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, deny the second node access to the first sub-storage space.
[0139] Exemplarily, the device includes a first permission registration unit, which may include the receiving unit and the sending unit; the receiving unit is used to receive a registration request from the second node, the registration request is used to request registration of a sub-storage space, the registration request includes a second access type, and the second access type includes the first access type. The sending unit is also used to send a registration response to the second node, the registration response is used to indicate the first storage space and the first sub-storage space.
[0140] Exemplarily, each of the multiple sub-storage spaces corresponds to an access credential, and the access request further includes a first access credential, and the processing unit 520 is further specifically 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. 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.
[0141] Exemplarily, 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.
[0142] Exemplarily, the first sub-storage space is registered by a plurality of second nodes, and the processing unit is further used to: when at least one second node among the plurality of second nodes terminates the access right to the first sub-storage space, update the first access credential to a second access credential. The sending unit is further used to send the second access credential to a second node among the plurality of second nodes other than the at least one second node. Exemplarily, among the plurality of sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types.
[0143] It can be understood that the various components of the access control device 500 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.
[0144] Fig.13 Another possible structural diagram of the access control device involved in the above embodiment is shown. The access control device 600 can be used as a second node, and the access control device 600 includes a sending unit 610 and a processing unit 620. The sending unit 610 can be used to support the device to execute S210 in the method embodiment. The processing unit 620 can be used to support the device to execute S220 in the method embodiment.
[0145] 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.
[0146] Exemplarily, the device further includes a second permission registration unit, which may include the sending unit and the receiving unit. The sending unit is 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 also used to receive a registration response from the first node, the registration response is used to indicate the first storage space and the first sub-storage space.
[0147] 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.
[0148] Exemplarily, the receiving unit is further used to: receive 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.
[0149] Exemplarily, the receiving unit is further used to: receive a second access credential from the first node. The processing unit is further used to update the first access credential to the second access credential. Exemplarily, among the multiple sub-storage spaces in the first storage space, there are at least two sub-storage spaces corresponding to different access types.
[0150] It can be understood 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.
[0151] The above describes an access control device in the embodiment of the present application from the perspective of modular functional entities. The following describes an access control device in the embodiment of the present application from the perspective of hardware processing. The embodiment of the present application also provides an access control device. The structure of the access control device can be as follows: Fig.14The access control device 700 can be used as a first node, and the device includes: a processor 701 , and can also include a memory 702 , a communication interface 703 and a bus 704 , wherein the processor 701 , the memory 702 and the communication interface 703 are connected via the bus 704 .
[0152] Among them, the processor 701 is used to control and manage the actions of the device, and the processor 701 is used to execute one or more steps in the above method embodiment, or other technical processes described in this article. The communication interface 703 is used to support the device to communicate, such as supporting the device to communicate with the second node. In the embodiment 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 devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the embodiment of the present application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The bus 704 can be a peripheral component interconnect standard (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 representation, only one thick line is used in the above figure, but it does not mean that there is only one bus or one type of bus.
[0153] It can be understood 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.
[0154] The embodiment of the present application also provides an access control device. The structure of the access control device can be as follows: Fig.15 The access control device can be used as a second node, and the device includes: a processor 801 , and may also include 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 .
[0155] Among them, the processor 801 is used to control and manage the actions of the device. In a possible embodiment, the processor 801 can be used to support the device to perform one or more steps of the above-mentioned method embodiment and 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 an 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 devices, transistor logic devices, hardware components 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 a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0156] The bus 804 may be a PCI bus or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the above figure only uses one thick line, but it does not mean that there is only one bus or one type of bus.
[0157] It can be understood that the various components of the above-mentioned access control device 800 can be used to implement the corresponding steps in the above-mentioned method embodiment respectively. Since each step has been described in detail in the above-mentioned access control method embodiment, it will not be repeated here.
[0158] In another aspect of the embodiment of the present application, an access control system is provided, the access control system comprising a first node and a second node. The first node may be the first node provided in the above-mentioned device embodiment, and is used to execute the steps of the first node in the method embodiment. The second node may be the second node provided in the above-mentioned device embodiment, and is used 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.
[0159] 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.
[0160] 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.
[0161] 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 instruction), which, when executed, enables a computer to execute the steps of the first node in the above method embodiment.
[0162] 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 instruction), which, when executed, enables a computer to execute the steps of the second node in the above method embodiments.
[0163] 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.
[0164] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0166] 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 essentially 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 a device (which can be a single-chip microcomputer, chip, etc.) or a processor to perform 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.
[0167] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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, the access request is used to access a first sub-storage space in a first storage space, the first storage space is a storage space in the first node, the first storage space includes multiple 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, 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, the registration request being used to request registration of a sub-storage space, the registration request including a second access type, and 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
Cited By
Access control method and apparatus
EP4654526A1
