WO2020248284A1 - Method and apparatus for access control, and storage medium - Google Patents

Method and apparatus for access control, and storage medium Download PDF

Info

Publication number
WO2020248284A1
WO2020248284A1 PCT/CN2019/091410 CN2019091410W WO2020248284A1 WO 2020248284 A1 WO2020248284 A1 WO 2020248284A1 CN 2019091410 W CN2019091410 W CN 2019091410W WO 2020248284 A1 WO2020248284 A1 WO 2020248284A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
group
user group
access
server
Prior art date
Application number
PCT/CN2019/091410
Other languages
French (fr)
Chinese (zh)
Inventor
张军
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN201980079278.3A priority Critical patent/CN113169970B/en
Priority to CN202311284666.XA priority patent/CN117336053A/en
Priority to PCT/CN2019/091410 priority patent/WO2020248284A1/en
Publication of WO2020248284A1 publication Critical patent/WO2020248284A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Abstract

A method for access control, comprising: a server (304) receiving an access request for accessing a target device that is sent from a first access device (301) on the basis of a first user identification; according to at least one user group, the server determining access rights of the first user identification for the target device (S404); and the server processing the access request according to the access rights (S405).

Description

一种访问控制方法、装置及存储介质Access control method, device and storage medium 技术领域Technical field
本发明涉及物联网(Internet of Things,IoT)技术,尤其涉及一种方访问控制方法、装置及存储介质。The invention relates to the Internet of Things (IoT) technology, and in particular to a method, device and storage medium for party access control.
背景技术Background technique
开放连接基金会(Open Connectivity Foundation,OCF)采用RESTful架构,通过资源来表述物联网实体设备,以及设备所提供的功能服务和设备的状态等信息。提供资源的是服务端,访问资源的是客户端。OCF中定义的客户端和服务端是逻辑功能实体,每个设备可以是客户端、服务端、或既是客户端又是服务端。例如,实现某项最基本功能的设备(例如灯泡)可以只做服务端,提供给客户端进行查询和控制,本身无控制或者查询其他设备的需求。The Open Connectivity Foundation (Open Connectivity Foundation, OCF) uses a RESTful architecture to represent physical Internet of Things devices through resources, as well as information such as the functional services provided by the devices and the status of the devices. The resource is provided by the server, and the resource is accessed by the client. The client and server defined in OCF are logical functional entities, and each device can be a client, a server, or both a client and a server. For example, a device (such as a light bulb) that implements a certain basic function can only be used as a server, and it can be provided to the client for query and control. It has no control or needs to query other devices.
客户端和服务端的业务交互是通过对资源进行RESTful操作,也就是创建(Create)、读取(Retrieve)、更新(Update)、删除(Delete)和通知(Notify)这些CRUDN操作方法而实现。客户端是RESTful操作的发起方,服务端是RESTful操作的响应方,客户端向服务端发送资源操作请求,请求对服务端上的资源进行操作,服务端执行资源操作,并向客户端返回响应,响应中携带资源的内容及描述信息。The business interaction between the client and the server is realized by performing RESTful operations on resources, that is, CRUDN operation methods of Create, Retrieve, Update, Delete, and Notify. The client is the initiator of the RESTful operation, and the server is the responder of the RESTful operation. The client sends a resource operation request to the server, requesting to operate the resource on the server, the server performs the resource operation, and returns a response to the client , The response carries the content and description of the resource.
不在同一个本地网络中的设备可以通过云端互相通信。云端将属于同一个用户的设备分组到同一个云端创建的用户ID下。注册到云端并且属于同一用户ID的所有设备可以按设备授权云的权限策略(例如:ACE2策略)进行通信。因此,设备只能由一个用户通过云平台远程访问,无法满足多用户的应用场景。Devices that are not in the same local network can communicate with each other through the cloud. The cloud groups devices belonging to the same user under the same user ID created in the cloud. All devices registered to the cloud and belonging to the same user ID can communicate according to the device authorization cloud permission policy (for example: ACE2 policy). Therefore, the device can only be remotely accessed by one user through the cloud platform, which cannot meet the multi-user application scenario.
发明内容Summary of the invention
为解决上述技术问题,本发明实施例提供一种访问控制方法、装置及存储介质,能够将设备的远端访问权限分享给其他用户,实现多用户的访问。In order to solve the above technical problems, embodiments of the present invention provide an access control method, device, and storage medium, which can share the remote access authority of the device with other users, and realize multi-user access.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is realized as follows:
第一方面,本发明实施例提供一种访问控制方法,包括:In the first aspect, an embodiment of the present invention provides an access control method, including:
服务器接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;The server receives an access request sent by the first access device to access the target device based on the first user identifier;
所述服务器根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;Determining, by the server, the access authority of the first user identifier to the target device according to at least one user group;
所述服务器根据所述访问权限对所述访问请求进行处理。The server processes the access request according to the access authority.
第二方面,本发明实施例提供一种访问控制方法,包括:In the second aspect, an embodiment of the present invention provides an access control method, including:
第一访问设备确定接收的选择操作所选取的目标设备;The first access device determines the target device selected by the received selection operation;
所述第一访问设备基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器,使得所述服务器根据至少一个用户组确定所述第一访问设备所使用的第一用户标识对所述目标设备的访问权限。The first access device generates an access request based on the device identifier corresponding to the target device, and sends the access request to a server, so that the server determines the first user used by the first access device according to at least one user group Identify the access authority to the target device.
第三方面,本发明实施例提供一种访问控制方法,包括:In a third aspect, an embodiment of the present invention provides an access control method, including:
第二访问设备基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述 服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。The second access device sends an update request to the server based on the second user ID. The update request is used to cause the server to generate a user group, and the generated user group is used to determine whether the first access device using the first user ID has a connection to the target device. Access authority, the second user identifier has a binding relationship with the target device.
第四方面,本发明实施例提供一种服务器,包括:In a fourth aspect, an embodiment of the present invention provides a server, including:
接收单元,配置为接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;A receiving unit configured to receive an access request for accessing the target device sent by the first access device based on the first user identifier;
权限单元,配置为根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;An authority unit configured to determine the access authority of the first user identifier to the target device according to at least one user group;
处理单元,配置为根据所述访问权限对所述访问请求进行处理。The processing unit is configured to process the access request according to the access authority.
第五方面,本发明实施例提供一种访问设备,包括:In a fifth aspect, an embodiment of the present invention provides an access device, including:
选择单元,被配置为确定接收的选择操作所选取的目标设备;The selection unit is configured to determine the target device selected by the received selection operation;
第一发送单元,被配置为基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器,使得所述服务器根据至少一个用户组确定所述访问设备所使用的第一用户标识对所述目标设备的访问权限。The first sending unit is configured to generate an access request based on the device identifier corresponding to the target device, and send the access request to a server, so that the server determines the first user used by the access device according to at least one user group Identify the access authority to the target device.
第六方面,本发明实施例提供一种访问设备,包括:组建立单元,被配置为基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。In a sixth aspect, an embodiment of the present invention provides an access device, including: a group establishment unit configured to send an update request to a server based on a second user identifier, the update request being used for causing the server to generate a user group, The user group is used to determine the access authority of the first access device using the first user identifier to the target device, and the second user identifier has a binding relationship with the target device.
第七方面,本发明实施例提供一种服务器,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述服务器执行的访问控制方法的步骤。In a seventh aspect, an embodiment of the present invention provides a server, including: a processor and a memory configured to store a computer program that can run on the processor, wherein the processor is configured to execute the server when the computer program is running. The steps of the access control method performed.
第八方面,本发明实施例提供一种访问设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述第一访问设备执行的访问控制方法的步骤。In an eighth aspect, an embodiment of the present invention provides an access device, including: a processor and a memory configured to store a computer program that can run on the processor, wherein the processor is configured to execute the above-mentioned computer program when the computer program is running. Steps of the access control method executed by the first access device.
第九方面,本发明实施例提供一种访问设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述第二访问设备执行的访问控制方法的步骤。In a ninth aspect, an embodiment of the present invention provides an access device, including: a processor and a memory configured to store a computer program that can run on the processor, wherein the processor is configured to execute the above-mentioned computer program when the computer program is running. Steps of the access control method executed by the second access device.
第十方面,本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述服务器执行的访问控制方法。In a tenth aspect, an embodiment of the present invention provides a storage medium storing an executable program, and when the executable program is executed by a processor, the access control method executed by the server is implemented.
第十一方面,本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述第一访问设备执行的访问控制方法。In an eleventh aspect, an embodiment of the present invention provides a storage medium that stores an executable program, and when the executable program is executed by a processor, it implements the access control method executed by the first access device.
第十二方面,本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述第二访问设备执行的访问控制方法。In a twelfth aspect, an embodiment of the present invention provides a storage medium that stores an executable program, and when the executable program is executed by a processor, the above-mentioned access control method executed by the second access device is implemented.
本发明实施例提供的访问控制方法,包括:服务器接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;所述服务器根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;所述服务器根据所述访问权限对所述访问请求进行处理。由于在服务器中设置了用户组,当第一用户标识访问目标设备时,可基于设置的用户组判断第一用户标识是否对目标设备具有访问权限,从而基于用户组实现不同用户标识的访问权限的控制,能够将不受目标设备仅受具有绑定关系的用户标识的访问的限制,实现多用户的访问。The access control method provided in the embodiment of the present invention includes: a server receives an access request for accessing a target device sent by a first access device based on a first user identity; the server determines that the first user identity is The access authority of the target device; the server processes the access request according to the access authority. Since the user group is set in the server, when the first user ID accesses the target device, it can be judged based on the set user group whether the first user ID has access authority to the target device, so as to realize the access authority of different user IDs based on the user group The control can realize multi-user access without being restricted by the access of the target device only by the user ID with the binding relationship.
附图说明Description of the drawings
图1是本发明实施例提供物联网系统的一个可选的结构示意图;FIG. 1 is an optional structural diagram of an Internet of Things system provided by an embodiment of the present invention;
图2是本发明实施例提供的访问控制方法的一个可选的流程示意图;FIG. 2 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图3是本发明实施例提供的物联网系统的一个可选的结构示意图;FIG. 3 is an optional structural diagram of the Internet of Things system provided by an embodiment of the present invention;
图4是本发明实施例提供的访问控制方法的一个可选的流程示意图;FIG. 4 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图5是本发明实施例提供的访问控制方法的一个可选的流程示意图;FIG. 5 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图6是本发明实施例提供的访问控制方法的一个可选的流程示意图;Fig. 6 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图7是本发明实施例提供的访问控制方法的一个可选的流程示意图;Fig. 7 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图8是本发明实施例提供的访问控制方法的一个可选的流程示意图;FIG. 8 is an optional flowchart of an access control method provided by an embodiment of the present invention;
图9是本发明实施例提供的服务器的一个可选的结构示意图;FIG. 9 is an optional structural diagram of a server provided by an embodiment of the present invention;
图10A是本发明实施例提供的访问设备的一个可选的结构示意图;FIG. 10A is a schematic diagram of an optional structure of an access device provided by an embodiment of the present invention;
图10B是本发明实施例提供的访问设备的一个可选的结构示意图FIG. 10B is a schematic diagram of an optional structure of an access device provided by an embodiment of the present invention
图11是本发明实施例提供的电子设备的一个可选的结构示意图。FIG. 11 is a schematic diagram of an optional structure of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,所描述的实施例不应视为对本发明的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. Those of ordinary skill in the art have not made All other embodiments obtained under the premise of creative work belong to the protection scope of the present invention.
在对本发明实施例提供的访问控制方法进行详细说明之前,先对物联网系统的访问控制进行简要说明。Before describing in detail the access control method provided by the embodiment of the present invention, a brief description of the access control of the Internet of Things system will be given first.
物联网系统的结构如图1所示,包括:客户端101、服务端102和云端103。客户端101访问服务端102的资源,服务端102提供客户端101访问的资源。且客户端101和服务端102通过云端103相互通信。The structure of the Internet of Things system is shown in Figure 1, including: client 101, server 102 and cloud 103. The client 101 accesses resources of the server 102, and the server 102 provides the resources accessed by the client 101. And the client 101 and the server 102 communicate with each other through the cloud 103.
当客户端101向云端103承载的资源Links引用的资源请求执行CRUDN操作时,客户端101向云端103发送CRUDN请求,云端103将客户端101的CRUDN请求转发给实际承载资源的服务端102,服务端102对云端103的CRUDN请求进行响应,云端103再将服务端102的响应转发给客户端101,即通信路径是客户端101->云端103->服务端102->云端103->客户端101。When the client 101 requests a CRUDN operation to the resource referenced by the resource Links carried by the cloud 103, the client 101 sends a CRUDN request to the cloud 103, and the cloud 103 forwards the CRUDN request of the client 101 to the server 102 that actually carries the resource. The terminal 102 responds to the CRUDN request of the cloud 103, and the cloud 103 forwards the response of the server 102 to the client 101, that is, the communication path is client 101->cloud 103->server 102->cloud 103->client 101.
示例性地,云端103可包括三个功能实体:Exemplarily, the cloud 103 may include three functional entities:
云端接口1031:云上锚点,负责服务端的接入管理,客户端和服务端远程通信的消息路由,云端接口对外提供一个统一的地址和端口号,如coaps+tcp://example.com:443。Cloud interface 1031: Anchor on the cloud, responsible for server access management, and message routing for remote communication between the client and server. The cloud interface provides a unified address and port number, such as coaps+tcp://example.com: 443.
授权服务器1032:负责服务端注册、对客户端和服务端的鉴权。Authorization server 1032: Responsible for server registration and authentication of the client and server.
资源目录1033:服务端资源的索引,客户端通过检索资源目录可以获取目标设备的资源。Resource catalog 1033: the index of the server resources, the client can obtain the resources of the target device by searching the resource catalog.
其中,授权服务器1032可与云端为同一物理实体,也可为不同的物理实体。The authorization server 1032 and the cloud may be the same physical entity, or may be different physical entities.
其中,每个设备可以是客户端、服务端、或既是客户端又是服务端。Among them, each device can be a client, a server, or both a client and a server.
设备在云端的注册流程如图2所示,包括:The device registration process in the cloud is shown in Figure 2, including:
步骤S201、配置器从授权服务器获取用户的访问令牌(Access Token)。Step S201: The configurator obtains the access token (Access Token) of the user from the authorization server.
用户APP中提供配置器(Mediator)功能,用于配置设备连接云端。配置器中配置了云端接入统一资源定位符(Uniform Resource Locator,URL),用户已注册用户名和密码,使得授权服务器可以对用户进行授权,向配置器返回访问令牌。其中,用户APP可位于作为客户端的设备上。The Mediator function is provided in the user APP to configure the device to connect to the cloud. The configurator is configured with a uniform resource locator (URL) for cloud access, and the user has registered a user name and password, so that the authorization server can authorize the user and return an access token to the configurator. Among them, the user APP can be located on the device as the client.
步骤S202、配置器在云端注册。Step S202: The configurator is registered in the cloud.
配置器向云端提供访问令牌进行配置器注册,云端验证配置器提供的Access Token并分配一个用户标识User ID。同一个用户用不同的配置器,授权服务器会提供不同的Access Token,但同一个用户用任何配置器都与同一个User ID关联。The configurator provides an access token to the cloud for configurator registration, and the cloud verifies the Access Token provided by the configurator and assigns a user ID. If the same user uses different configurators, the authorization server will provide different Access Tokens, but any configurator used by the same user is associated with the same User ID.
步骤S203、配置器连接至设备,对设备进行配置。Step S203: The configurator is connected to the device to configure the device.
配置器通过正常的设备发现流程连接到设备,然后从云端为所配置的设备请求 Access Token。配置器使用从云端授权的Access Token、云端接入统一资源标识(Uniform Resource Identifier,URI)和云端通用唯一识别码(Universally Unique Identifier,UUID)更新设备上的进行云端信息配置的云配置资源如:“oic.r.coapcloudconf”资源。云端提供的该Access Token用于设备向云端进行初始注册时使用。The configurator connects to the device through the normal device discovery process, and then requests an Access Token from the cloud for the configured device. The configurator uses the Access Token authorized from the cloud, the Uniform Resource Identifier (URI) and the Universal Unique Identifier (UUID) of the cloud to update the cloud configuration resources on the device for cloud information configuration, such as: "Oic.r.coapcloudconf" resource. The Access Token provided by the cloud is used when the device performs initial registration with the cloud.
步骤S204、设备与云端建立传输层安全协议(Transport Layer Security,TLS)连接。Step S204: The device establishes a Transport Layer Security (TLS) connection with the cloud.
配置器配置了设备的配置资源后,设备使用预置的数字证书和云端建立TLS连接。预置的数字证书包括:设备的制造商证书、信任锚证书(trust anchor certificate)。After the configurator configures the configuration resources of the device, the device uses a preset digital certificate to establish a TLS connection with the cloud. The preset digital certificates include: the manufacturer's certificate of the device and the trust anchor certificate.
步骤S205、设备在云端注册。Step S205: The device is registered in the cloud.
设备要在云端注册,需要向云端上账号资源发送更新(UPDATE)操作请求,资源更新请求中包括了云配置资源中所配置的Access Token以及User ID。云端为每个设备维护账号资源的唯一实例。其中,账号资源可为“/oic/sec/account”资源。To register in the cloud, a device needs to send an update (UPDATE) operation request to the account resource on the cloud. The resource update request includes the Access Token and User ID configured in the cloud configuration resource. The cloud maintains a unique instance of account resources for each device. Among them, the account resource can be the "/oic/sec/account" resource.
步骤S206至步骤S207、云端验证设备提供的Access Token。Step S206 to step S207, the access token provided by the cloud verification device.
云端将设备提供的User ID和Access Token发送至授权服务器,当授权服务器成功验证该更新操作请求后,云端进行更新操作的响应,该响应会为设备提供一个更新的Access Token以及Access Token的有效期。另外,云端还记录了与此设备关联即具有绑定关系的User ID。The cloud sends the User ID and Access Token provided by the device to the authorization server. When the authorization server successfully verifies the update operation request, the cloud responds to the update operation. The response will provide the device with an updated Access Token and the validity period of the Access Token. In addition, the cloud also records the User ID that is associated with this device, that is, has a binding relationship.
需要说明的是,当云端集成有授权服务器,在云端与配置器之间完成步骤S201,且不需要步骤S207。It should be noted that when the cloud is integrated with an authorization server, step S201 is completed between the cloud and the configurator, and step S207 is not required.
设备需要在云端登录才能在设备和云端之间传输数据,设备向云端的会话资源发送更新(UPDATE)操作请求。云端成功验证更新操作请求后,设备和云端建立了TLS连接,可以开始交换数据。其中,会话资源可为“/oic/sec/session”资源。The device needs to log in to the cloud to transfer data between the device and the cloud, and the device sends an update (UPDATE) operation request to the cloud session resource. After the cloud successfully verifies the update operation request, the device and the cloud establish a TLS connection, and data can be exchanged. Among them, the session resource can be a "/oic/sec/session" resource.
图2中的设备可为客户端,也可为服务端。如果设备作为服务端,设备和云端建立TLS连接后,设备在云端的资源目录中公开其承载的资源,以便于对客户端这些资源进行远程访问。The device in Figure 2 can be a client or a server. If the device is used as a server, after the device establishes a TLS connection with the cloud, the device discloses the resources it carries in the resource directory of the cloud, so as to facilitate remote access to these resources of the client.
不在同一个本地网络中的设备可以通过云端,使用基于传输控制协议(Transmission Control Protocol,TCP)的受限应用(CoAP over TCP)协议互相通信。云端将属于同一个User ID的设备分组到同一个User ID下。注册到云端并且属于同一User ID的所有设备可以按设备授权云的ACE2策略进行通信。在本发明实施例中,将一User ID下的设备称为与该User ID具有绑定关系的设备。Devices that are not in the same local network can communicate with each other through the cloud using a restricted application (CoAP over TCP) protocol based on the Transmission Control Protocol (TCP). The cloud groups devices belonging to the same User ID under the same User ID. All devices registered to the cloud and belonging to the same User ID can communicate according to the ACE2 policy of the device authorization cloud. In the embodiment of the present invention, a device under a User ID is referred to as a device that has a binding relationship with the User ID.
但是,这种方案中,只有关联相同的User ID的设备之间才能够互相访问,则设备只能由一个User ID通过云平台远程访问。在一个多成员的家庭中,这种方案限制了只能有一个User ID控制家庭中的设备,其他家庭成员也只能用同一User ID登录。若多个家庭成员分别在云平台注册了User ID,则只能各自控制自身User ID所管理的设备,无法通过云平台控制家庭中其他User ID下所关联的设备,无法满足多用户的应用场景。However, in this solution, only devices associated with the same User ID can access each other, and the devices can only be remotely accessed by one User ID through the cloud platform. In a multi-member family, this solution restricts only one User ID to control the devices in the family, and other family members can only log in with the same User ID. If multiple family members have registered User IDs on the cloud platform, they can only control the devices managed by their User IDs, and cannot control the devices associated with other User IDs in the family through the cloud platform, which cannot meet the multi-user application scenario .
基于上述问题,本发明提供一种访问控制方法,本发明实施例的访问控制入方法可以应用于图3所示的物联网系统300,包括:第一访问设备301、第二访问设备302、目标设备303和服务器304;其中,第一访问设备301和第二访问设备为客户端,目标设备为服务端,服务器304为云端。客户端基于云端访问服务端的资源。Based on the above problems, the present invention provides an access control method. The access control entry method of the embodiment of the present invention can be applied to the Internet of Things system 300 shown in FIG. 3, including: a first access device 301, a second access device 302, and a target Device 303 and server 304; among them, the first access device 301 and the second access device are clients, the target device is the server, and the server 304 is the cloud. The client accesses the resources of the server based on the cloud.
第一访问设备301以第一用户标识登陆服务器304,第二访问设备302以第二用户标识登陆服务器304。第一用户标识与目标设备未关联,第二用户标识与目标设备关联,也就是说,第一访问设备和目标设备不是同一用户标识下的设备,第二访问设备和目标设备为同一用户标识下的设备。The first access device 301 logs in to the server 304 with the first user ID, and the second access device 302 logs in to the server 304 with the second user ID. The first user ID is not associated with the target device, and the second user ID is associated with the target device, that is, the first access device and the target device are not devices under the same user ID, and the second access device and the target device are under the same user ID device of.
物联网系统300中的客户端、服务端和云端可基于各种通信系统进行通信,例如: 全球移动通讯(Global System of Mobile communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、通用分组无线业务(General Packet Radio Service,GPRS)、长期演进(Long Term Evolution,LTE)系统、LTE频分双工(Frequency Division Duplex,FDD)系统、LTE时分双工(Time Division Duplex,TDD)、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、全球互联微波接入(Worldwide Interoperability for Microwave Access,WiMAX)通信系统或5G系统等。The client, server, and cloud in the IoT system 300 can communicate based on various communication systems, such as: Global System of Mobile Communication (GSM) system, Code Division Multiple Access (CDMA) System, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, LTE Frequency Division Duplex (Frequency Division) Duplex (FDD) system, LTE Time Division Duplex (TDD), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX) communication system or 5G system Wait.
第一访问设备301和第二访问设备可为终端设备,终端设备可以指接入终端、用户设备(User Equipment,UE)、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。接入终端可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备、5G网络中的终端设备或者未来演进的PLMN中的终端设备等。The first access device 301 and the second access device can be terminal devices, which can refer to access terminals, user equipment (UE), user units, user stations, mobile stations, mobile stations, remote stations, remote terminals, Mobile device, user terminal, terminal, wireless communication device, user agent or user device. The access terminal can be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital processing (Personal Digital Assistant, PDA), with wireless communication Functional handheld devices, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, terminal devices in 5G networks, or terminal devices in the future evolution of PLMN, etc.
目标设备可以为传感器、激光扫描系统和智能家电等物联网设备。The target device can be IoT devices such as sensors, laser scanning systems, and smart home appliances.
图3示例性地示出了一个服务端和两个客户端,可选地,该物联网系统300可以包括多个服务端以及与服务端具有绑定关系的客户端或与服务端不具有绑定关系的客户端,本发明实施例对此不做限定。Figure 3 exemplarily shows one server and two clients. Optionally, the IoT system 300 may include multiple servers and clients that have a binding relationship with the server or do not have a binding relationship with the server. Clients that define a relationship are not limited in this embodiment of the present invention.
本发明实施例提供的访问控制方法的一种可选的处理流程,如图4所示,包括以下步骤:An optional processing flow of the access control method provided by the embodiment of the present invention, as shown in FIG. 4, includes the following steps:
步骤S401、第一访问设备确定接收的选择操作所选取的目标设备;Step S401: The first access device determines the target device selected by the received selection operation;
当使用第一访问设备的用户对物联网系统中的目标设备进行控制时,第一访问设备接收到用户的选择操作,选择操作的操作对象为目标设备的设备标识。When the user using the first access device controls the target device in the Internet of Things system, the first access device receives the user's selection operation, and the operation object of the selection operation is the device identification of the target device.
在本发明实施例中,第一访问设备以第一用户标识登陆服务器,与服务器建立会话,在第一访问设备中展示有与第一用户标识具有绑定关系的设备的设备标识,以及与第一用户标识不具有绑定关系的设备的设备标识。与第一用户标识具有绑定关系的设备与第一访问设备为关联相同的用户ID的设备;与第一用户标识不具有绑定关系的设备与第一访问设备为未关联相同的用户ID的设备。第一用户标识可为注册用户名,也可为服务器为注册用户名分配的User ID,且注册用户名与User ID具有一一对应的关系。当第一用户标识为User ID,第一访问设备以第一用户标识登陆服务器可以理解为:第一访问设备以注册用户名为登陆账号登陆到服务器,服务器识别第一访问设备使用注册用户名对应的User ID登陆至服务器。In the embodiment of the present invention, the first access device uses the first user ID to log in to the server, establishes a session with the server, and displays the device ID of the device that has a binding relationship with the first user ID and the first user ID A device ID of a device whose user ID does not have a binding relationship. The device that has a binding relationship with the first user ID and the first access device are devices that are associated with the same user ID; the device that does not have a binding relationship with the first user ID and the first access device are not associated with the same user ID equipment. The first user identifier may be a registered user name, or a User ID assigned by the server to the registered user name, and the registered user name and User ID have a one-to-one correspondence relationship. When the first user ID is User ID, the first access device uses the first user ID to log in to the server, which can be understood as: the first access device logs in to the server with the registered user name and the login account, and the server identifies the first access device using the registered user name to correspond Login to the server with your User ID.
步骤S402、第一访问设备基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器。Step S402: The first access device generates an access request based on the device identifier corresponding to the target device, and sends the access request to the server.
第一访问设备根据目标设备的设备标识生成访问请求。其中,访问请求中携带目标设备的设备标识,使得服务器确定第一访问设备所使用的第一用户标识对所述目标设备的访问权限。The first access device generates an access request according to the device identification of the target device. Wherein, the access request carries the device identification of the target device, so that the server determines the access authority of the first user identification used by the first access device to the target device.
访问请求中可携带第一用户标识,也可不携带第一用户标识。当访问请求中未携带第一用户标识时,服务器基于与第一访问设备所建立的会话连接确定第一访问设备所使用的第一用户标识。The access request may or may not carry the first user identification. When the access request does not carry the first user identification, the server determines the first user identification used by the first access device based on the session connection established with the first access device.
在目标设备与第一用户标识具有绑定关系的情况下,访问请求中还可包括与第一用户标识关联的访问令牌。In the case that the target device has a binding relationship with the first user identification, the access request may further include an access token associated with the first user identification.
可选的,访问请求以更新(Update)请求的形式发送。Optionally, the access request is sent in the form of an Update request.
步骤S403、服务器接收第一访问设备基于第一用户标识发送的访问目标设备的访 问请求。Step S403: The server receives an access request for accessing the target device sent by the first access device based on the first user identifier.
当访问请求中携带第一用户标识,服务器通过对访问请求的解析得到第一用户标识。当访问请求中未携带第一用户标识,服务器通过第一访问设备与服务器所建立的会话得到第一用户标识。When the access request carries the first user ID, the server obtains the first user ID by analyzing the access request. When the access request does not carry the first user identification, the server obtains the first user identification through the session established by the first access device and the server.
步骤S404、所述服务器根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限。Step S404: The server determines the access authority of the first user identifier to the target device according to at least one user group.
服务器中设置有对应不同用户标识的用户组,一个用户组标识可对一个或多个用户组。同一用户标识对应的多个用户组中,不同的用户组以不同的用户组名称进行区分。The server is provided with user groups corresponding to different user IDs, and one user group ID can correspond to one or more user groups. Among multiple user groups corresponding to the same user ID, different user groups are distinguished by different user group names.
用户组的组信息包括:组名称、组成员的标识和共享设备的设备标识。组名称是一个字符串,由用户进行设置。组成员是一个列表,包含每个组成员的用户标识(用户ID),其中,一个用户组至少包括有一个组成员。共享设备也是一个列表,包含组内共享设备的设备标识(device ID)。一个用户组至少包括一个共享设备。The group information of the user group includes: the group name, the ID of the group member, and the device ID of the shared device. The group name is a string and is set by the user. The group member is a list containing the user identification (user ID) of each group member, wherein a user group includes at least one group member. Shared devices are also a list, including device IDs of shared devices in the group. A user group includes at least one shared device.
可选地,组成员中包括第二用户标识,第二用户标识与目标设备具有绑定关系。比如:第二用户标识为U2,一个用户组的组信息如下:组名称:family,组成员包括:U2、U1,共享设备的设备标识:D1,则表征基于用户组family将与U2具有绑定关系的设备D1共享给与设备D1不具有绑定关系的U1。Optionally, the group members include a second user identifier, and the second user identifier has a binding relationship with the target device. For example: the second user ID is U2, and the group information of a user group is as follows: group name: family, group members include: U2, U1, and the device ID of the shared device: D1, which means that the user group family will have binding with U2 The related device D1 is shared with U1 that does not have a binding relationship with the device D1.
当组成员中包括第二用户标识时,服务器可仅根据用户组确定第一用户标识对目标设备的访问权限。When the group members include the second user ID, the server may only determine the access authority of the first user ID to the target device according to the user group.
可选地,组成员中不包括第二用户标识。又比如:第二用户标识为U2对应的一个用户组的组信息如下:组名称:family,组成员包括:U1,共享设备的设备标识:D1,则表征基于用户组family将与U2具有绑定关系的设备D1共享给与设备D1不具有绑定关系的U1。Optionally, the group members do not include the second user identifier. For another example: the group information of a user group corresponding to U2 as the second user ID is as follows: group name: family, group members include: U1, device ID of the shared device: D1, the characterization is based on the user group family will be bound to U2 The related device D1 is shared with U1 that does not have a binding relationship with the device D1.
当组成员中不包括第二用户标识时,服务器根据用户组和第二用户标识确定第一用户标识对目标设备的访问权限。When the group members do not include the second user ID, the server determines the access authority of the first user ID to the target device according to the user group and the second user ID.
可选地,用户组的组信息还可包括:有效期。有效期是用户组的存活时间,可以秒为单位计数,值为-1时表示永久有效。当一用户组的创建时间达到有效期时,服务器将该用户组删除。Optionally, the group information of the user group may further include: validity period. The validity period is the survival time of the user group, which can be counted in seconds. A value of -1 means permanent validity. When the creation time of a user group reaches the validity period, the server deletes the user group.
在一示例中,一个用户组的表示形式为:In an example, the representation of a user group is:
Figure PCTCN2019091410-appb-000001
Figure PCTCN2019091410-appb-000001
上述示例中,组名称gn是family,包含两个组成员,组成员的用户标识gmids分别为U001和U002。共享设备的设备标识dids为0685B960-736F-46F7-BEC0-9E6CBD61ADC1。用户组的有效期expiresin为10000秒,云平台从创建用户组的时刻起开始计时,10000秒后自动删除该用户组。In the above example, the group name gn is family, which contains two group members, and the user identifiers gmids of the group members are U001 and U002 respectively. The device identifier dids of the shared device is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1. The validity period of a user group expires in 10000 seconds. The cloud platform starts counting from the moment the user group is created, and automatically deletes the user group after 10000 seconds.
在本发明实施例中,服务器基于用户标识为不同的用户标识分配不同的用户组资源即用户空间,将每一用户标识对应的用户组管理在为该用户标识分配的用户空间中。每一用户空间中包括一个或多个用户组。服务器根据用户标识查找该用户标识对应的用户空间,得到该用户标识对应的用户组。In the embodiment of the present invention, the server allocates different user group resources, namely user spaces, to different user IDs based on user IDs, and manages the user group corresponding to each user ID in the user space allocated for the user ID. Each user space includes one or more user groups. The server searches for the user space corresponding to the user ID according to the user ID, and obtains the user group corresponding to the user ID.
示例性地,包括两个用户组的用户空间可如下所示:Exemplarily, the user space including two user groups may be as follows:
Figure PCTCN2019091410-appb-000002
Figure PCTCN2019091410-appb-000002
Figure PCTCN2019091410-appb-000003
Figure PCTCN2019091410-appb-000003
其中,该用户的用户标识uid为U001,访问令牌accesstoken为XXXXXXXXXX,groups为该用户对应的用户组的列表。Among them, the user identification uid of the user is U001, the access token accesstoken is XXXXXXXXXX, and groups is a list of user groups corresponding to the user.
在上例中,用户U001创建了两个用户组:family和guest。用户组family的组成员包括:U001和U002,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1,有效期为永久有效。用户组guest的组成员包括:U001和U002,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为1000秒。In the above example, user U001 created two user groups: family and guest. The group members of the user group family include: U001 and U002, the device identifier of the shared device is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1, and the validity period is permanent. The group members of the user group guest include: U001 and U002. The device identifiers of the shared device are 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the validity period is 1000 seconds.
基于上述例子,表征用户U001在云平台创建了一个家庭组,将设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1分享给了U002。该家庭组永久有效。此外,用户U001又为访客U003创建了一个访客组,临时分享了设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为10000秒。Based on the above example, the characterization user U001 created a family group on the cloud platform and shared the device 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 with U002. The family group is permanently valid. In addition, user U001 created a visitor group for visitor U003, and temporarily shared the devices 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, with a valid period of 10,000 seconds.
这里,U002可为用户U001所在的家庭的家庭成员,U004可为访客。Here, U002 may be a family member of the household where the user U001 is located, and U004 may be a visitor.
服务器所设置的至少一个用户组中,是否包括目标用户组,以确定第一用户标识对目标设备的访问权限,其中,将所查找的用户组中,组成员包括第一用户标识且共享设备包括目标设备的用户组称为目标用户组。In at least one user group set by the server, whether the target user group is included to determine the access authority of the first user ID to the target device, wherein, in the searched user group, the group members include the first user ID and the shared device includes The user group of the target device is called the target user group.
当所述至少一个用户组中包括的目标用户组,的组成员包括所述第一用户标识且共享设备的设备标识包括所述目标设备的设备标识,也就是说,至少一个用户组中包括目标用户组,服务器确定所述第一用户标识对目标设备的访问权限为允许访问。When the target user group included in the at least one user group, the group members include the first user ID and the device ID of the shared device includes the device ID of the target device, that is, at least one user group includes the target device For the user group, the server determines that the access authority of the first user identifier to the target device is allowed to access.
当所述至少一个用户组中每一用户组的组成员不包括第一用户标识,或每一用户组的组成员共享设备的设备标识不包括目标设备的设备标识,或当所述至少一个用户组中,组成员不包括所述第一用户标识的用户组与共享设备的设备标识不包括所述目标设备的设备标识的用户组不是同一用户组,也就是说,至少一个用户组中不包括目标用户组,服务器确定第一用户标识对目标设备的访问权限为禁止访问,即认为第一用户标识无法访问目标设备的资源。When the group members of each user group in the at least one user group do not include the first user ID, or the device ID of the shared device of each user group does not include the device ID of the target device, or when the at least one user In the group, the user group whose members do not include the first user ID and the user group whose device ID of the shared device does not include the device ID of the target device are not the same user group, that is, at least one user group does not include For the target user group, the server determines that the access permission of the first user ID to the target device is forbidden, that is, it is considered that the first user ID cannot access the resources of the target device.
在实际应用中,服务器可以第二用户标识为关键字或以目标设备的设备标识为关键字从至少一个用户组中查找候选用户组,根据候选用户组确定第一用户标识对目标设备的访问权限,从而缩小目标用户组的查找范围,提高访问控制的处理速度。In practical applications, the server can search for candidate user groups from at least one user group using the second user ID as a keyword or the device ID of the target device as a keyword, and determine the access authority of the first user ID to the target device according to the candidate user group. , Thereby narrowing the search scope of the target user group and improving the processing speed of access control.
当所述用户组的组成员的用户标识不包括与所述目标设备之间具有绑定关系的用 户标识,且所述第一用户标识与所述设备不具有绑定关系,根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限。When the user IDs of group members of the user group do not include user IDs that have a binding relationship with the target device, and the first user ID does not have a binding relationship with the device, according to at least one user group To determine the access authority of the first user identifier to the target device.
这里,当用户组的组成员的用户标识中不包括第二用户标识,判断第一用户标识是否与目标设备具有绑定关系,当第一用户标识与目标设备具有绑定关系,确定所述访问权限为允许访问。当第一用户标识与目标设备不具有绑定关系,根据至少一个用户组确定第一用户标识对目标设备的访问权限。Here, when the user ID of the group member of the user group does not include the second user ID, it is determined whether the first user ID has a binding relationship with the target device, and when the first user ID has a binding relationship with the target device, the access is determined The permission is to allow access. When the first user identifier does not have a binding relationship with the target device, the access authority of the first user identifier to the target device is determined according to at least one user group.
在实际应用中,可基于绑定关系和用户组并列判断第一用户标识的访问权限,当所述第一用户标识与目标设备具有绑定关系,或当至少一个用户组中包括目标用户组时,确定所述访问权限为允许访问,当所述第一用户标识与目标设备不具有绑定关系,且所述至少一个用户组中不包括目标用户组时,确定访问权限为禁止访问。In practical applications, the access authority of the first user ID can be judged based on the binding relationship and the user group side by side, when the first user ID has a binding relationship with the target device, or when at least one user group includes the target user group , It is determined that the access permission is access permitted, and when the first user identifier does not have a binding relationship with the target device, and the target user group is not included in the at least one user group, the access permission is determined to be access prohibited.
步骤S405、所述服务器根据所述访问权限对所述访问请求进行处理。Step S405: The server processes the access request according to the access authority.
当所述访问权限为允许访问,服务器将所述访问请求转发至所述目标设备;当所述访问权限为禁止访问,服务器拒绝所述访问请求。When the access permission is allowed to access, the server forwards the access request to the target device; when the access permission is forbidden to access, the server rejects the access request.
在本发明实施例中,第二访问设备第二访问设备基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。以新用户组的创建和更新为例,服务器接收第二访问设备基于所述第二用户标识发送的更新请求;所述服务器根据所述更新请求,得到对应所述第二用户标识的新用户组。In the embodiment of the present invention, the second access device sends an update request to the server based on the second user identifier. The update request is used to make the server generate a user group, and the generated user group is used to determine whether to use the first The first access device identified by the user has access authority to the target device, and the second user identifier has a binding relationship with the target device. Taking the creation and update of a new user group as an example, the server receives an update request sent by the second access device based on the second user ID; the server obtains a new user group corresponding to the second user ID according to the update request .
第二访问设备以第二用户标识登陆服务器,并配置新用户组的组信息,基于新用户组的组信息生成更新请求,将生成的更新请求发送至服务器。其中,新用户组的组信息至少包括:用户组名称、组成员的标识和共享设备的设备标识。The second access device logs in to the server with the second user ID, configures the group information of the new user group, generates an update request based on the group information of the new user group, and sends the generated update request to the server. Among them, the group information of the new user group includes at least: the user group name, the identifier of the group member and the device identifier of the shared device.
可选地,组成员的标识包括:第一用户标识,共享设备包括:目标设备。此时,服务创建的新用户组为目标用户组。Optionally, the identity of the group member includes: the first user identity, and the shared device includes: the target device. At this time, the new user group created by the service is the target user group.
可选地,组成员的标识还包括:第二用户标识。Optionally, the identity of the group member further includes: a second user identity.
第二访问设备以第二用户标识登陆服务器的登陆方式同第一访问设备以第一用户标识登陆服务器,这里不再赘述。The second access device uses the second user ID to log in to the server in the same manner as the first access device uses the first user ID to log in to the server, which will not be repeated here.
在一些实施例中,第二访问设备配置新用户组的组信息可以执行为:所述第二访问设备获取新用户组的组信息;将所述新用户组的组信息携带在所述更新请求中。In some embodiments, configuring the group information of the new user group by the second access device may be performed as follows: the second access device obtains the group information of the new user group; and includes the group information of the new user group in the update request in.
第二访问设备获取待配置到新用户组的组成员的标识,并获取待配置到新用户组的共享设备的设备标识。其中,所述组成员的标识可包括第一用户标识,所获取的共享设备可包括目标设备。第二访问设备可通过局域网传输、二维码扫描等方式获取组成员的标识。第二访问设备可通过局域网传输的方式获取共享设备的标识,或从服务器中配置的与第二用户标识具有绑定关系的设备的标识中获取目标设备的标识。The second access device obtains the identity of the group member to be configured to the new user group, and obtains the device identity of the shared device to be configured to the new user group. Wherein, the identifier of the group member may include the first user identifier, and the acquired shared device may include the target device. The second access device can obtain the group member's identities by means of LAN transmission, QR code scanning, etc. The second access device may obtain the identity of the shared device by way of local area network transmission, or obtain the identity of the target device from the identity of the device configured in the server that has a binding relationship with the second user identity.
基于更新请求中携带的信息的不同,服务器根据更新请求得到新用户组的方式包括以下两种方式:Based on the difference in the information carried in the update request, the server obtains the new user group according to the update request in the following two ways:
方式一method one
更新请求中仅携带本次待创建的新用户组的组信息,比如:本次待创建的新用户组为用户组family时,则在更新消息中仅携带新用户组family的组信息。The update request only carries the group information of the new user group to be created this time. For example, when the new user group to be created this time is the user group family, only the group information of the new user group family is carried in the update message.
在方式一中,服务器接收到更新请求后,根据所述更新请求,得到对应所述第二用户标识的新用户组,包括:In mode 1, after receiving the update request, the server obtains the new user group corresponding to the second user identifier according to the update request, including:
当不存在对应所述第二用户标识的已有的用户组,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中不包括所述更新请求携带 的新用户组的用户组名称,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中包括所述更新请求携带的新用户组的用户组名称,以所述新用户组的用户组名称对应的用户组为参考用户组,根据所述更新请求携带的组成员的标识和共享设备的设备标识,对所述参考用户组的组信息进行更新,得到新用户组。When there is no existing user group corresponding to the second user ID, create a new user group according to the user group name of the new user group, the ID of the group member, and the device ID of the shared device carried in the update request; when there is The existing user group corresponding to the second user identifier, and the group name of the existing user group does not include the user group name of the new user group carried in the update request, according to the new user group carried in the update request Create a new user group with the name of the user group, the ID of the group member, and the device ID of the shared device; when there is an existing user group corresponding to the second user ID, and the group name of the existing user group includes the The user group name of the new user group carried in the update request, using the user group corresponding to the user group name of the new user group as the reference user group, and according to the group member identification and the device identification of the shared device carried in the update request, The group information of the reference user group is updated to obtain a new user group.
方式二Way two
更新请求中可携带创建用户组后的用户组groups的组信息。比如:创建的用户组family的已有的用户组guest的组信息。The update request may carry the group information of the user group groups after the user group is created. For example: the group information of the existing user group guest of the created user group family.
在方式二中,所述第二访问设备向所述服务器查询对应所述第二用户标识的已有的用户组的组信息,将所获取的已有用户组的组信息携带在所述更新请求中。这里,更新请求中携带的信息新用户组的组信息和从服务器所查询的已有的用户组的组信息。In the second manner, the second access device queries the server for the group information of the existing user group corresponding to the second user identifier, and carries the obtained group information of the existing user group in the update request in. Here, the information carried in the update request is the group information of the new user group and the group information of the existing user group queried from the server.
第二访问设备可向服务器发送查询请求,获取第二用户标识对应的已有的用户组。第二访问设备获取第二用户标识已有的用户组后,对已有的用户组进行更新,得到更新后的用户组。所述更新后的用户组包括新用户组和第二用户标识对应的已有的用户组。The second access device may send a query request to the server to obtain the existing user group corresponding to the second user identifier. After acquiring the existing user group of the second user identifier, the second access device updates the existing user group to obtain the updated user group. The updated user group includes a new user group and an existing user group corresponding to the second user identifier.
可选地,新用户组为新添加的用户组或对所述已有的用户组中的参考用户组进行更新得到的用户组。Optionally, the new user group is a newly added user group or a user group obtained by updating a reference user group in the existing user group.
可基于已有的用户组中是否包括与新用户组的组名称相同的用户组,对已有的用户组进行更新,得到更新后的用户组。当已有的用户组中不包括与新用户组的组名称相同的用户组,则创建新用户组,此时新用户组为新添加的用户组。当已有的用户组中包括与新用户组的组名称相同的用户组,将与新用户组的组名称相同的用户组称为参考用户组,对参考用户组的组信息进行更新,更新为新用户组,此时,新用户组为对所述已有的用户组中的参考用户组进行更新得到的用户组。Based on whether the existing user group includes a user group with the same group name as the new user group, the existing user group can be updated to obtain the updated user group. When the existing user group does not include a user group with the same group name as the new user group, a new user group is created, and the new user group is the newly added user group. When an existing user group includes a user group with the same group name as the new user group, the user group with the same group name as the new user group is called the reference user group, and the group information of the reference user group is updated to New user group. At this time, the new user group is a user group obtained by updating the reference user group in the existing user group.
在方式二中,服务器接收到更新请求后,所述根据所述更新请求,得到对应所述第二用户标识的新用户组,包括:根据所述更新后的至少一个用户组的组信息,对所述第二用户标识对应的已有的用户组的组信息进行覆盖,得到更新后的至少一个用户组。In the second manner, after the server receives the update request, the obtaining a new user group corresponding to the second user identifier according to the update request includes: according to the updated group information of at least one user group, The group information of the existing user group corresponding to the second user identifier is overwritten to obtain at least one updated user group.
在本发明实施例中,服务器接收到第二访问设备发送的更新请求之后,根据更新请求携带的第二用户标识检测共享设备与第二用户标识的关系;当与所述共享设备具有绑定关系的用户标识为所述第二用户标识,根据所述更新请求,得到对应所述第二用户标识的新用户组。这里,只有当第二用户设备为与共享设备关联的用户标识,表征第二用户标识为共享设备的管理员账号,能够根据更新请求对第二用户标识对应的用户组进行更新。In the embodiment of the present invention, after receiving the update request sent by the second access device, the server detects the relationship between the shared device and the second user identity according to the second user identity carried in the update request; when it has a binding relationship with the shared device The user ID of is the second user ID, and a new user group corresponding to the second user ID is obtained according to the update request. Here, only when the second user equipment is a user identification associated with the shared device, which characterizes that the second user identification is an administrator account of the shared device, the user group corresponding to the second user identification can be updated according to the update request.
本发明实施例中,服务器基于更新请求创建的新用户组除目标用户组之外,还可包括其他用户组,且基于一条更新请求可创建一个或多个新用户组。In the embodiment of the present invention, the new user group created by the server based on the update request may include other user groups in addition to the target user group, and one or more new user groups may be created based on one update request.
在本发明实施例中,在作为云端的服务器中创建用户组,基于用户组将第二用户标识对目标设备的资源的访问权限共享给第一用户标识,其中,第一用户标识与目标设备之间不具有绑定关系,第二用户标识与目标设备之间不具有绑定关系。当第一用户标识访问目标设备的资源时,服务器基于用户组确定第一用户标识对目标设备的访问权限为允许访问时,控制第一用户标识访问目标设备的资源。服务器基于用户组确定第一用户标识对目标设备的访问权限为禁止访问时,拒绝第一用户标识访问目标设备的资源。In the embodiment of the present invention, a user group is created in a server serving as a cloud, and based on the user group, the access authority of the second user ID to the resources of the target device is shared with the first user ID, where the first user ID is different from the target device There is no binding relationship between them, and there is no binding relationship between the second user identifier and the target device. When the first user identifier accesses the resources of the target device, the server determines based on the user group that the access permission of the first user identifier to the target device is allowed to access, and controls the first user identifier to access the resources of the target device. When the server determines, based on the user group, that the access permission of the first user identifier to the target device is forbidden, it denies the first user identifier to access the resources of the target device.
在本发明实施例中,服务器还可基于第二访问设备发送的查询请求查询第二用户标识对应的用户组。其中,查询的内容可为全部的用户组,也可基于查询请求中携带的组名称查询对应的用户组。In the embodiment of the present invention, the server may also query the user group corresponding to the second user identifier based on the query request sent by the second access device. The content of the query can be all user groups, or the corresponding user group can be queried based on the group name carried in the query request.
以查询的内容可为全部的用户组为例,所述服务器接收第二访问设备基于所述第二用户标识发送的查询请求;所述服务器基于所述查询请求获取所述第二用户标识对应的 全部的用户组的组信息;所述服务器将所述已有的用户组的组信息发送至所述第二访问设备。Taking the content of the query as an example of all user groups, the server receives the query request sent by the second access device based on the second user identifier; the server obtains the query corresponding to the second user identifier based on the query request Group information of all user groups; the server sends the group information of the existing user groups to the second access device.
以查询的内容可为查询请求中携带的组名称对应的用户组为例,所述服务器接收第二访问设备基于所述第二用户标识发送的查询请求;所述查询请求中携带待查询的用户组的用户组名称;所述服务器基于所述查询请求获取所述待查询的用户组的组信息;所述服务器将所述待查询的用户组的组信息发送至所述第二访问设备。Taking the content of the query as an example of the user group corresponding to the group name carried in the query request, the server receives the query request sent by the second access device based on the second user identifier; the query request carries the user to be queried The user group name of the group; the server obtains the group information of the user group to be queried based on the query request; the server sends the group information of the user group to be queried to the second access device.
在本发明实施例中,服务器还可基于第二访问设备发送的删除请求删除第二用户标识对应的用户组。其中,删除的内容可为全部的用户组,也可基于查询请求中携带的组名称删除对应的用户组。In the embodiment of the present invention, the server may also delete the user group corresponding to the second user identifier based on the delete request sent by the second access device. The content to be deleted may be all user groups, or the corresponding user group may be deleted based on the group name carried in the query request.
以删除的内容可为全部的用户组为例,所述服务器接收第二访问设备基于所述第二用户标识发送的删除请求;所述服务器根据所述删除请求删除所述第二用户组对应的全部的用户组。。Taking the deleted content as an example of all user groups, the server receives a delete request sent by the second access device based on the second user ID; the server deletes the corresponding user group according to the delete request. All user groups. .
以删除的内容可为删除请求中携带的组名称对应的用户组为例,所述服务器接收第二访问设备基于所述第二用户标识发送的删除请求;所述删除请求携带待删除的用户组的用户组名称;所述服务器根据所述删除请求从所述第二用户组对应的至少一个用户组中删除所述待删除的用户组的组信息。Taking the deleted content may be a user group corresponding to the group name carried in the delete request as an example, the server receives a delete request sent by the second access device based on the second user identifier; the delete request carries the user group to be deleted The name of the user group; the server deletes the group information of the user group to be deleted from at least one user group corresponding to the second user group according to the deletion request.
下面再结合具体实施例对本发明进行详细描述。其中,云平台为作为云端的服务器中的控制系统。The present invention will be described in detail below in conjunction with specific embodiments. Among them, the cloud platform is a control system in a server as a cloud.
实例一Example one
在云平台中增加创建用户组的资源接口,云平台注册用户可以通过创建用户组的资源接口创建共享设备的用户组。例如,云平台提供一个资源接口(也可称为资源链接)/group/gen,云平台注册用户通过资源接口更新对应的用户组的信息,便可在云平台上创建一个用户组。A resource interface for creating user groups is added to the cloud platform. Registered users of the cloud platform can create user groups for shared devices through the resource interface for creating user groups. For example, the cloud platform provides a resource interface (also referred to as a resource link) /group/gen, and a registered user of the cloud platform updates the information of the corresponding user group through the resource interface to create a user group on the cloud platform.
用户组以一个组名称进行标识,用户组包含:组成员、共享设备以及可选地,还包含有效期。组名称是一个字符串,可由用户进行设置。组成员是一个User ID的列表,包含每个组成员的User ID,其中,一个用户组至少包括有一个组成员。共享设备是一个设备标识(device ID)的列表,包含组内共享设备的设备标识。一个用户组的共享设备至少包括一个设备。有效期是用户组的存活时间,以秒为单位计数,值为-1时表示永久有效。The user group is identified by a group name, and the user group includes: group members, shared devices, and optionally, a validity period. The group name is a string and can be set by the user. Group members are a list of User IDs, including the User ID of each group member. Among them, a user group includes at least one group member. The shared device is a list of device IDs, including the device IDs of the shared devices in the group. The shared device of a user group includes at least one device. The validity period is the survival time of the user group, which is counted in seconds. A value of -1 means permanent validity.
下例是一个用户组的表示形式:The following example is a representation of a user group:
Figure PCTCN2019091410-appb-000004
Figure PCTCN2019091410-appb-000004
上述例子中,组名称gn是family,包含两个成员:用户标识gmids分别为U001和U002。该两位用户共享一个设备,设备标识dids为0685B960-736F-46F7-BEC0-9E6CBD61ADC1。用户组的有效期expiresin是10000秒,云平台从创建用户组的时刻起开始计时,10000秒后自动删除该用户组。In the above example, the group name gn is family, and contains two members: the user identifiers gmids are U001 and U002 respectively. The two users share a device, and the device identifier dids is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1. The validity period of a user group expiresin is 10,000 seconds. The cloud platform starts counting from the moment the user group is created, and automatically deletes the user group after 10,000 seconds.
一个云平台用户可以创建多个用户组。云平台将这些用户组都管理在为该用户分配的空间中,以该用户的用户ID进行标识。一个创建了两个组的用户的空间如下例所示:A cloud platform user can create multiple user groups. The cloud platform manages these user groups in the space allocated for the user, and identifies the user with the user ID of the user. The space for a user who created two groups is shown in the following example:
Figure PCTCN2019091410-appb-000005
Figure PCTCN2019091410-appb-000005
Figure PCTCN2019091410-appb-000006
Figure PCTCN2019091410-appb-000006
其中,该用户的用户标识uid为U001,访问令牌access token为XXXXXXXXXX,groups为该用户对应的用户组的列表。Among them, the user identification uid of the user is U001, the access token is XXXXXXXXXX, and groups is a list of user groups corresponding to the user.
在上例中,用户U001创建了两个用户组:family和guest。用户组family的组成员包括:U001和U002,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1,有效期为永久有效。用户组guest的组成员包括:U001和U003,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为1000秒。In the above example, user U001 created two user groups: family and guest. The group members of the user group family include: U001 and U002, the device identifier of the shared device is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1, and the validity period is permanent. The group members of the user group guest include: U001 and U003. The device identifiers of the shared devices are 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the validity period is 1000 seconds.
基于上述例子,表征用户U001在云平台创建了一个家庭组,将设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1分享给了U002。该家庭组永久有效。此外,用户U001又为访客U003创建了一个访客组,临时分享了设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为10000秒。Based on the above example, the characterization user U001 created a family group on the cloud platform and shared the device 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 with U002. The family group is permanently valid. In addition, user U001 created a visitor group for visitor U003, and temporarily shared the devices 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, with a valid period of 10,000 seconds.
这里,U002可为用户U001所在的家庭的家庭成员,U004可为访客。Here, U002 may be a family member of the household where the user U001 is located, and U004 may be a visitor.
下面分别对用户组的创建、查询和删除进行说明。The following describes the creation, query, and deletion of user groups.
(1)、创建和更新用户组(1), create and update user groups
假设用户A已经注册了云平台的账号userA_ID,并且将一台设备配置连接云平台,用户A为该设备在云平台上的管理员。此时,有另一在云平台上注册的用户B也想通过云平台控制该设备。用户A创建用户组将该设备分享给用户B。具体操作步骤,如图5所示,包括:Assume that user A has registered the account userA_ID of the cloud platform, and configured a device to connect to the cloud platform, and user A is the administrator of the device on the cloud platform. At this time, another user B who is registered on the cloud platform also wants to control the device through the cloud platform. User A creates a user group to share the device with user B. The specific operation steps, as shown in Figure 5, include:
步骤S501、用户A使用客户端A(ClientA)通过局域网传输、扫二维码等方式获取用户B的终端客户端B(ClientB)中存储的User ID(userB_ID)。Step S501: The user A uses the client A (Client A) to obtain the User ID (userB_ID) stored in the user B's terminal client B (Client B) by means of LAN transmission, scanning a QR code, and the like.
其中,客户端A的User ID为userA_ID)。Among them, the User ID of client A is userA_ID).
步骤S502、ClientA通过局域网或者云平台获取待配置到用户组中的目标设备的device ID。由于用户A是目标设备的管理员,也可能ClientA在配置设备后就一直保存有目标设备的device ID,此时,步骤S502可略过。Step S502: Client A obtains the device ID of the target device to be configured in the user group through the local area network or the cloud platform. Since user A is the administrator of the target device, it is also possible that Client A has always stored the device ID of the target device after configuring the device. In this case, step S502 can be skipped.
步骤S503、ClientA向云平台的资源接口发送更新请求,更新请求中携带的参数包括userA_ID、访问令牌access token、组名称group name、组成员的用户ID(包括:userA_ID和userB_ID)、组中的共享设备的device ID、以及有效期expiration。其中,组中的共享设备为目标设备。资源接口的地址可为固定地址,如/group/gen。Step S503: ClientA sends an update request to the resource interface of the cloud platform. The parameters carried in the update request include userA_ID, access token, group name, group name, user ID of group members (including: userA_ID and userB_ID), The device ID and expiration of the shared device. Among them, the shared device in the group is the target device. The address of the resource interface can be a fixed address, such as /group/gen.
步骤S504、云平台收到ClientA的更新请求后,通过存储于云平台的User ID和访 问令牌的对应关系校验userA_ID与访问令牌,当验证通过后,确认用户A为合法用户。Step S504: After receiving the update request from ClientA, the cloud platform verifies the userA_ID and the access token based on the corresponding relationship between the User ID and the access token stored on the cloud platform, and confirms that User A is a legitimate user after the verification is passed.
步骤S505、云平台根据userA ID与设备的绑定关系检查更新请求中的目标设备与用户A的绑定关系,即检查目标设备是否为用户A所管理的设备。Step S505: The cloud platform checks the binding relationship between the target device and user A in the update request according to the binding relationship between userA's ID and the device, that is, checks whether the target device is a device managed by user A.
在实际应用中,当用户组中包括多个共享设备时,云平台根据userA_ID与设备的绑定关系检查更新请求中的每一设备与用户A的绑定关系,即检查每一设备是否为用户A所管理的设备。其中,对于每一设备及其管理员用户,云平台存储用户ID与设备的绑定关系。In practical applications, when the user group includes multiple shared devices, the cloud platform checks the binding relationship between each device in the update request and user A according to the binding relationship between userA_ID and the device, that is, it checks whether each device is a user Equipment managed by A. Among them, for each device and its administrator user, the cloud platform stores the binding relationship between the user ID and the device.
步骤S506、云平台根据userA_ID查找用户A对应的用户组。Step S506: The cloud platform searches for the user group corresponding to user A according to userA_ID.
云平台根据userA_ID在用户组列表中查找用户A所对应的条目,并在条目中根据更新请求中携带的组名称查找用户组。其中,用户A对应的条目中包括用户A对应的全部的已有的用户组。The cloud platform finds the entry corresponding to user A in the user group list according to userA_ID, and finds the user group in the entry according to the group name carried in the update request. Among them, the entry corresponding to user A includes all existing user groups corresponding to user A.
步骤S507、若在用户A对应的条目中未找到该组名称对应的用户组,则云平台在用户A对应的条目下创建一个新的用户组,为目标用户组。其中,目标用户组以更新请求携带的组名称进行命名,组中的成员ID即为更新请求携带的userA_ID和userB_ID,组中的设备ID即为目标设备的设备ID。Step S507: If the user group corresponding to the group name is not found in the entry corresponding to user A, the cloud platform creates a new user group under the entry corresponding to user A, which is the target user group. The target user group is named after the group name carried in the update request, the member IDs in the group are userA_ID and userB_ID carried in the update request, and the device ID in the group is the device ID of the target device.
若用户A对应条目下已有该组名称的用户组,在用户A对应的条目中找到该组名称对应的用户组,以该用户组为参考用户组,若参考用户组的组成员中已包含userA_ID,则组成员的User ID增加userB_ID,组中共享的设备增加传入的目标设备的设备ID。If there is a user group with the group name under the corresponding entry of user A, find the user group corresponding to the group name in the entry corresponding to user A, and use the user group as the reference user group. If the group members of the reference user group already contain userA_ID, the User ID of the group members increases userB_ID, and the devices shared in the group increase the device ID of the incoming target device.
步骤S508、云平台成功建立用户组后,返回响应OK给ClientA。Step S508: After the cloud platform successfully establishes the user group, it returns a response OK to ClientA.
步骤S509、ClientB通过云平台访问目标设备。Step S509: Client B accesses the target device through the cloud platform.
步骤S5010、云平台判断用户B与被访问的目标设备是否在同一用户组中,若是,则云平台允许该访问请求,将该访问请求转发至目标设备;若否,则拒绝该访问请求。Step S5010: The cloud platform judges whether user B and the accessed target device are in the same user group. If so, the cloud platform allows the access request and forwards the access request to the target device; if not, it rejects the access request.
步骤S5011、若目标设备基于用户组已分享给用户B,则目标设备执行访问请求,执行步骤S5012向ClientB返回响应。Step S5011, if the target device has been shared with user B based on the user group, the target device executes an access request, and executes step S5012 to return a response to ClientB.
(2)、查看用户组(2) View user group
云平台创建用户组后,组管理员可以查看用户组。After the cloud platform creates a user group, the group administrator can view the user group.
用户A对云平台的资源接口发送查询请求RETRIEVE请求,并以uid=userA_ID为查询条件,例如:资源接口的地址为/group/gen,查询请求可为retrieve/group/gen?uid=U001。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时查询请求中可不带uid=userA_ID的查询条件。User A sends a query request RETRIEVE request to the resource interface of the cloud platform, and uses uid=userA_ID as the query condition. For example, the address of the resource interface is /group/gen, and the query request can be retrieve/group/gen? uid=U001. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in the query request.
云平台收到查询请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容作为响应返回给用户A。After the cloud platform receives the query request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the content of groups is returned to User A as a response.
若用户A想查询某一用户组,则发送的RETRIEVE请求以uid=userA_ID和gn=groupname为查询条件,例如:资源接口的地址为/group/gen时,查询请求可为retrieve/group/gen?uid=U001&gn=guest。If user A wants to query a user group, the sent RETRIEVE request uses uid=userA_ID and gn=groupname as the query conditions. For example, when the address of the resource interface is /group/gen, can the query request be retrieve/group/gen? uid=U001&gn=guest.
这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时查询请求中可不带uid=userA_ID的查询条件)Here, the cloud platform can also determine the user ID by itself through the access information of user A, at this time, the query request may not include the query condition of uid=userA_ID)
云平台收到查询请求后,校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups中组名称为guest的用户组作为响应返回给用户A。After the cloud platform receives the query request, it verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the user group whose group name is guest in groups is returned to User A as a response.
(3)、删除用户组(3), delete user group
用户也可以删除所创建的用户组。The user can also delete the created user group.
用户A对云平台的资源接口发送删除请求DELETE请求,以uid=userA_ID为查询条件,例如:资源接口的地址为/group/gen时,删除请求可为delete/group/gen?uid=U001。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时可不带uid=userA_ID 的查询条件。User A sends a delete request DELETE request to the resource interface of the cloud platform, with uid=userA_ID as the query condition. For example, when the address of the resource interface is /group/gen, can the delete request be delete/group/gen? uid=U001. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included.
云平台收到删除请求后,首先校验用A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容清空,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the User ID of A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the contents of the groups are cleared, and a response to the successful operation of User A is returned.
若用户A想删除某一用户组,则发送的DELETE请求以uid=userA_ID和gn=groupname为查询条件,例如:资源接口的地址为/group/gen时,删除请求可为delete/group/gen?uid=U001&gn=guest。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时可不带uid=userA_ID的查询条件。If user A wants to delete a user group, he sends a DELETE request with uid=userA_ID and gn=groupname as the query conditions. For example, when the address of the resource interface is /group/gen, can the delete request be delete/group/gen? uid=U001&gn=guest. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in this case.
云平台收到删除请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups中组名称为guest的用户组删除,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, delete the user group whose group name is guest in groups, and return to User A a successful response.
实例二Example two
在云平台中增加创建用户组的资源接口,云平台注册用户可以通过创建用户组的资源接口创建共享设备的用户组。例如,云平台提供一个资源接口/group/gen,云平台注册用户通过资源接口更新对应的用户组的信息,便可在云平台上创建一个用户组。A resource interface for creating user groups is added to the cloud platform. Registered users of the cloud platform can create user groups for shared devices through the resource interface for creating user groups. For example, the cloud platform provides a resource interface /group/gen. Registered users of the cloud platform update the information of the corresponding user group through the resource interface, and then create a user group on the cloud platform.
用户组以一个组名称进行标识,用户组包含:组成员、共享设备以及可选地,还包含有效期。组名称是一个字符串,可由用户进行设置。组成员是一个User ID的列表,包含每个组成员的User ID,其中,一个用户组至少包括有一个组成员。共享设备也是一个设备标识(device ID)列表,包含组内共享设备的设备标识,其中,一个用户组的共享设备至少包括一个设备。有效期是用户组的存活时间,以秒为单位计数,值为-1时表示永久有效。The user group is identified by a group name, and the user group includes: group members, shared devices, and optionally, a validity period. The group name is a string and can be set by the user. Group members are a list of User IDs, including the User ID of each group member. Among them, a user group includes at least one group member. The shared device is also a device ID (device ID) list, which contains the device IDs of the shared devices in the group. Among them, the shared device of a user group includes at least one device. The validity period is the survival time of the user group, which is counted in seconds. A value of -1 means permanent validity.
下例是一个用户组的表示形式:The following example is a representation of a user group:
Figure PCTCN2019091410-appb-000007
Figure PCTCN2019091410-appb-000007
上述例子中,组名称gn是family,包含的组成员的用户标识gmids为U002。该用户与设备的管理员共享一个设备,设备标识dids为0685B960-736F-46F7-BEC0-9E6CBD61ADC1。用户组的有效期expiresin是10000秒,云平台从创建用户组的时刻起开始计时,10000秒后自动删除该用户组。In the above example, the group name gn is family, and the user identifier gmids of the group members included is U002. The user shares a device with the device administrator, and the device identifier dids is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1. The validity period of a user group expiresin is 10,000 seconds. The cloud platform starts counting from the moment the user group is created, and automatically deletes the user group after 10,000 seconds.
一个云平台用户可以创建多个用户组。云平台将这些用户组都管理在为该用户分配的空间中,以该用户的用户ID进行标识。一个创建了两个组的用户的空间如下例所示:A cloud platform user can create multiple user groups. The cloud platform manages these user groups in the space allocated for the user, and identifies the user with the user ID of the user. The space for a user who created two groups is shown in the following example:
Figure PCTCN2019091410-appb-000008
Figure PCTCN2019091410-appb-000008
Figure PCTCN2019091410-appb-000009
Figure PCTCN2019091410-appb-000009
其中,该用户的用户标识uid为U001,访问令牌access token为XXXXXXXXXX,groups为该用户对应的用户组的列表。Among them, the user identification uid of the user is U001, the access token is XXXXXXXXXX, and groups is a list of user groups corresponding to the user.
在上例中,用户U001创建了两个用户组:family和guest,其中,用户组family的组成员包括:U002和U003,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1,有效期为永久有效。用户组guest的组成员包括:U004,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为1000秒。In the above example, user U001 created two user groups: family and guest. Among them, the group members of user group family include: U002 and U003, and the device ID of the shared device is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1, and the validity period is Permanent. The group members of the user group guest include: U004, the device identifiers of the shared device are 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the validity period is 1000 seconds.
基于上述例子,表征用户U001在云平台创建了一个家庭组,将设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1分享给了U002和U003。该家庭组永久有效。此外,用户U001又为访客U004创建了一个访客组,临时分享了设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效时间为10000秒。Based on the above example, the characterization user U001 created a family group on the cloud platform and shared the device 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 to U002 and U003. The family group is permanently valid. In addition, user U001 created a visitor group for visitor U004 and temporarily shared the devices 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the effective time is 10,000 seconds.
这里,U002和U003可为用户U001所在的家庭的家庭成员,U004可为访客。Here, U002 and U003 may be family members of the household where the user U001 is located, and U004 may be a visitor.
下面分别对用户组的创建、查询和删除进行说明。The following describes the creation, query, and deletion of user groups.
(1)、创建和更新用户组(1), create and update user groups
假设用户A已经注册了云平台的账号userA_ID,并且将一台设备配置连接云平台,用户A为该设备在云平台上的管理员。此时,有另一在云平台上注册的用户B也想通过云平台控制该设备。用户A创建用户组将该设备分享给用户B。具体操作步骤,如图6所示,包括:Assume that user A has registered the account userA_ID of the cloud platform, and configured a device to connect to the cloud platform, and user A is the administrator of the device on the cloud platform. At this time, another user B who is registered on the cloud platform also wants to control the device through the cloud platform. User A creates a user group to share the device with user B. The specific operation steps, as shown in Figure 6, include:
步骤S601、用户A使用客户端A(ClientA)通过局域网传输、扫二维码等方式获取用户B的终端客户端B(ClientB)中存储的User ID(userB_ID)。In step S601, the user A uses the client A (ClientA) to obtain the User ID (userB_ID) stored in the user B's terminal client B (ClientB) by means of local area network transmission, scanning the QR code, etc.
其中,客户端A的User ID为userA_ID)。Among them, the User ID of client A is userA_ID).
步骤S602、ClientA通过局域网或者云平台获取待配置到用户组中的目标设备的device ID。由于用户A是目标设备的管理员,也可能ClientA在配置设备后就一直保存有设备的device ID,步骤S602可略过。Step S602: Client A obtains the device ID of the target device to be configured in the user group through the local area network or the cloud platform. Since user A is the administrator of the target device, it is also possible that Client A has always stored the device ID of the device after configuring the device, and step S602 can be skipped.
步骤S603、ClientA向云平台的资源接口发送更新请求,更新请求中携带参数包括userA_ID、访问令牌、组名称、组成员ID(userB_ID)、组中共享设备的device ID、以及有效期expiration。其中,组中的共享设备为目标设备。Step S603: ClientA sends an update request to the resource interface of the cloud platform. The update request carries parameters including userA_ID, access token, group name, group member ID (userB_ID), device ID of the shared device in the group, and expiration of the validity period. Among them, the shared device in the group is the target device.
步骤S604、云平台收到ClientA的更新请求后,通过存储于云平台的UserID和访问令牌对应关系校验userA_ID与访问令牌,当验证通过后,确认用户A为合法用户。Step S604: After receiving the update request from ClientA, the cloud platform verifies the userA_ID and the access token through the corresponding relationship between the UserID and the access token stored in the cloud platform, and confirms that the user A is a legitimate user after the verification is passed.
步骤S605、云平台根据userA ID与设备的绑定关系检查更新请求中的目标设备与用户A的绑定关系,即检查目标设备是否为用户A所管理的设备。Step S605: The cloud platform checks the binding relationship between the target device and user A in the update request according to the binding relationship between userA's ID and the device, that is, checks whether the target device is a device managed by user A.
在实际应用中,当用户组中包括多个共享设备时,云平台根据userA_ID与设备的绑定关系检查更新请求中的每一设备与用户A的绑定关系,即检查每一设备是否为用户A所管理的设备。其中,对于每一设备及其管理员用户,云平台存储用户ID与设备的绑定关系。In practical applications, when the user group includes multiple shared devices, the cloud platform checks the binding relationship between each device in the update request and user A according to the binding relationship between userA_ID and the device, that is, it checks whether each device is a user Equipment managed by A. Among them, for each device and its administrator user, the cloud platform stores the binding relationship between the user ID and the device.
步骤S606、云平台根据userA_ID查找用户A对应的用户组。Step S606: The cloud platform searches for the user group corresponding to user A according to userA_ID.
云平台根据userA_ID在用户组列表中查找用户A所对应的条目,并在条目中根据更新请求中携带的组名称查找用户组。其中,用户A对应的条目中包括用户A对应的 全部的已有的用户组。The cloud platform finds the entry corresponding to user A in the user group list according to userA_ID, and finds the user group in the entry according to the group name carried in the update request. Among them, the entry corresponding to user A includes all existing user groups corresponding to user A.
步骤S607、若在用户A对应的条目中未找到该组名称对应的用户组,则云平台在用户A对应的条目下创建一个新的用户组,即目标用户组。其中,目标用户组以更新请求携带的组名称进行命名,组中的成员ID即为更新请求携带的userB_ID,组中的设备ID即为更新请求携带的目标设备的设备ID。Step S607: If the user group corresponding to the group name is not found in the entry corresponding to user A, the cloud platform creates a new user group under the entry corresponding to user A, that is, the target user group. Among them, the target user group is named after the group name carried in the update request, the member ID in the group is the userB_ID carried in the update request, and the device ID in the group is the device ID of the target device carried in the update request.
若用户A对应条目下已有该组名称的用户组,则在用户A对应的条目中找到该组名称对应的用户组,以该用户组为参考用户组,在参考用户组的组成员中userB_ID,组中共享的设备增加传入的设备ID。If there is a user group with the group name under the corresponding entry of user A, find the user group corresponding to the group name in the entry corresponding to user A, and use the user group as the reference user group, in the group members of the reference user group userB_ID , The devices shared in the group increase the incoming device ID.
步骤S608、云平台成功建立用户组后,返回响应OK给ClientA。Step S608: After the cloud platform successfully establishes the user group, it returns a response OK to ClientA.
步骤S609、ClientB通过云平台访问目标设备。Step S609: Client B accesses the target device through the cloud platform.
步骤S6010、云平台检查ClientB与目标设备的绑定关系,若绑定关系成立则直接允许访问请求。由于目标设备与ClientA绑定,则ClientB与目标设备的绑定关系不成立,需要进一步通过查看组权限判断是否能够访问。Step S6010: The cloud platform checks the binding relationship between ClientB and the target device, and if the binding relationship is established, the access request is directly allowed. Since the target device is bound to ClientA, the binding relationship between ClientB and the target device is not established, and it is necessary to further check whether the group permissions can be accessed.
步骤S6011、云平台判断用户B与被访问的目标设备是否在同一用户组中,若是,则云平台允许该访问请求,将该访问请求转发至目标设备;若否,则拒绝该访问请求。Step S6011, the cloud platform judges whether the user B and the accessed target device are in the same user group, if yes, the cloud platform allows the access request and forwards the access request to the target device; if not, it rejects the access request.
步骤S6012、若目标设备基于用户组已分享给用户B,则目标设备执行访问请求,执行步骤S6013向ClientB返回响应。Step S6012, if the target device has been shared with user B based on the user group, the target device executes an access request, and executes step S6013 to return a response to Client B.
(2)、查看用户组(2) View user group
云平台创建用户组后,组管理员可以查看用户组。After the cloud platform creates a user group, the group administrator can view the user group.
用户A对云平台的资源接口发送查询请求RETRIEVE请求,并以uid=userA_ID为查询条件,例如:资源接口的地址为:/group/gen,则查询请求可为:retrieve/group/gen?uid=U001。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时查询请求中可不带uid=userA_ID的查询条件。User A sends a query request RETRIEVE request to the resource interface of the cloud platform, and uses uid=userA_ID as the query condition. For example, if the address of the resource interface is: /group/gen, the query request can be: retrieve/group/gen? uid=U001. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in the query request.
云平台收到查询请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容作为响应返回给用户A。After the cloud platform receives the query request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the content of groups is returned to User A as a response.
若用户A想查询某一用户组,则发送的RETRIEVE请求以uid=userA_ID和gn=groupname为查询条件,例如:retrieve/group/gen?uid=U001&gn=guest。If user A wants to query a certain user group, the sent RETRIEVE request uses uid=userA_ID and gn=groupname as the query conditions, for example: retrieve/group/gen? uid=U001&gn=guest.
这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时查询请求中可不带uid=userA_ID的查询条件)Here, the cloud platform can also determine the user ID by itself through the access information of user A, at this time, the query request may not include the query condition of uid=userA_ID)
云平台收到查询请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups中组名称为guest的用户组作为响应返回给用户A。After the cloud platform receives the query request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the user group whose group name is guest in groups is returned to User A as a response.
(3)、删除用户组(3), delete user group
用户也可以删除所创建的用户组。The user can also delete the created user group.
用户A对云平台的资源接口发送删除请求DELETE请求,以uid=userA_ID为查询条件,例如:资源接口的地址为:/group/gen,则删除请求可为:delete/group/gen?uid=U001。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时可不带uid=userA_ID的查询条件。User A sends a delete request DELETE request to the resource interface of the cloud platform, with uid=userA_ID as the query condition. For example, if the address of the resource interface is: /group/gen, the delete request can be: delete/group/gen? uid=U001. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in this case.
云平台收到删除请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容清空,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the contents of the groups are cleared, and a response to the successful operation of User A is returned.
若用户A想删除某一用户组,则发送的DELETE请求以uid=userA_ID和gn=groupname为查询条件,例如:资源接口的地址为:/group/gen,则删除请求可为:delete/group/gen?uid=U001&gn=guest。这里,也可由云平台通过用户A的接入信息自行 判断用户ID,此时可不带uid=userA_ID的查询条件。If user A wants to delete a user group, the sent DELETE request uses uid=userA_ID and gn=groupname as the query conditions, for example: the address of the resource interface is: /group/gen, the delete request can be: delete/group/ gen? uid=U001&gn=guest. Here, the cloud platform can also determine the user ID by itself through user A's access information, and the query condition of uid=userA_ID can be omitted.
云平台收到删除请求后,首先校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups中组名称为guest的用户组删除,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, delete the user group whose group name is guest in groups, and return to User A a successful response.
实例三Example three
在云平台中增加创建用户组的资源接口,云平台注册用户可以通过创建用户组的资源接口创建共享设备的用户组。例如,云平台提供一个资源接口/group/gen,云平台注册用户通过资源接口更新对应的用户组的信息,便可在云平台上创建一个用户组。A resource interface for creating user groups is added to the cloud platform. Registered users of the cloud platform can create user groups for shared devices through the resource interface for creating user groups. For example, the cloud platform provides a resource interface /group/gen. Registered users of the cloud platform update the information of the corresponding user group through the resource interface, and then create a user group on the cloud platform.
用户组以一个组名称进行标识,用户组包含:组成员、共享设备以及可选地,还包含有效期。组名称是一个字符串,可由用户进行设置。组成员是一个User ID的列表,包含每个组成员的User ID,其中,一个用户组至少包括有一个组成员。共享设备也是一个设备标识(device ID)列表,包含组内共享设备的设备标识,其中,一个用户组的共享设备至少包括一个设备。有效期是用户组的存活时间,以秒为单位计数,值为-1时表示永久有效。The user group is identified by a group name, and the user group includes: group members, shared devices, and optionally, a validity period. The group name is a string and can be set by the user. Group members are a list of User IDs, including the User ID of each group member. Among them, a user group includes at least one group member. The shared device is also a device ID (device ID) list, which contains the device IDs of the shared devices in the group. Among them, the shared device of a user group includes at least one device. The validity period is the survival time of the user group, which is counted in seconds. A value of -1 means permanent validity.
下例是一个用户组的表示形式:The following example is a representation of a user group:
Figure PCTCN2019091410-appb-000010
Figure PCTCN2019091410-appb-000010
上述例子中,组名称gn是family,包含两个成员:用户标识gmids分别为U001和U002。该两位用户共享一个设备,设备标识dids为0685B960-736F-46F7-BEC0-9E6CBD61ADC1。用户组的有效期expiresin是10000秒,云平台从创建用户组的时刻起开始计时,10000秒后自动删除该用户组。In the above example, the group name gn is family, and contains two members: the user identifiers gmids are U001 and U002 respectively. The two users share a device, and the device identifier dids is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1. The validity period of a user group expiresin is 10,000 seconds. The cloud platform starts counting from the moment the user group is created, and automatically deletes the user group after 10,000 seconds.
一个云平台用户可以创建多个用户组。云平台将这些用户组都管理在为该用户分配的空间中,以该用户的用户ID进行标识。一个创建了两个组的用户的空间如下例所示:A cloud platform user can create multiple user groups. The cloud platform manages these user groups in the space allocated for the user, and identifies the user with the user ID of the user. The space for a user who created two groups is shown in the following example:
Figure PCTCN2019091410-appb-000011
Figure PCTCN2019091410-appb-000011
其中,该用户的用户标识uid为U001,访问令牌accesstoken为XXXXXXXXXX,groups为该用户对应的用户组的列表。Among them, the user identification uid of the user is U001, the access token accesstoken is XXXXXXXXXX, and groups is a list of user groups corresponding to the user.
在上例中,用户U001创建了两个用户组:family和guest,其中,用户组family的组成员包括:U001和U002,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1,有效期为永久有效。用户组guest的组成员包括:U001和U003,共享设备的设备标识为0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效期为1000秒。In the above example, user U001 created two user groups: family and guest. Among them, the group members of user group family include: U001 and U002, and the device identifier of the shared device is 0685B960-736F-46F7-BEC0-9E6CBD61ADC1, and the validity period is Permanent. The group members of the user group guest include: U001 and U003. The device identifiers of the shared devices are 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the validity period is 1000 seconds.
基于上述例子,表征用户U001在云平台创建了一个家庭组,将设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1分享给了U002。该家庭组永久有效。此外,用户U001又为访客U003创建了一个访客组,临时分享了设备0685B960-736F-46F7-BEC0-9E6CBD61ADC1和E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9,有效时间为10000秒。Based on the above example, the characterization user U001 created a family group on the cloud platform and shared the device 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 with U002. The family group is permanently valid. In addition, user U001 created a visitor group for visitor U003 and temporarily shared the devices 0685B960-736F-46F7-BEC0-9E6CBD61ADC1 and E61C3E6B-9C54-4B81-8CE5-F9039C1D04D9, and the effective time was 10,000 seconds.
这里,U002可为用户U001所在的家庭的家庭成员,U004可为访客。Here, U002 may be a family member of the household where the user U001 is located, and U004 may be a visitor.
下面分别对用户组的创建、查询和删除进行说明。The following describes the creation, query, and deletion of user groups.
(1)、创建用户组(1), create a user group
假设用户A已经注册了云平台的账号userA_ID,并且将一台设备配置连接云平台,用户A为该设备在云平台上的管理员。此时,有另一在云平台上注册的用户B也想通过云平台控制该设备。用户A创建用户组将该设备分享给用户B。具体操作步骤,如图7所示,包括:Assume that user A has registered the account userA_ID of the cloud platform, and configured a device to connect to the cloud platform, and user A is the administrator of the device on the cloud platform. At this time, another user B who is registered on the cloud platform also wants to control the device through the cloud platform. User A creates a user group to share the device with user B. The specific operation steps, as shown in Figure 7, include:
步骤S701、用户A使用ClientA通过局域网传输、扫二维码等方式获取用户B的终端ClientB中存储的用户ID(userB_ID)。Step S701: User A uses ClientA to obtain the user ID (userB_ID) stored in the terminal ClientB of user B through LAN transmission, scanning a two-dimensional code, etc.
其中,Client A的User ID为userA_ID)。Among them, the User ID of Client A is userA_ID).
步骤S702.ClientA通过局域网或者云平台获取待配置到组中的设备的device ID。由于用户A是目标设备的管理员,也可能ClientA在配置设备后就一直保存有目标设备的device ID,此时,步骤S702可略过。Step S702. Client A obtains the device ID of the device to be configured into the group through the local area network or the cloud platform. Since user A is the administrator of the target device, it is also possible that Client A has always stored the device ID of the target device after configuring the device. In this case, step S702 can be skipped.
步骤S703、ClientA向云平台的资源接口发送查询请求。Step S703: ClientA sends a query request to the resource interface of the cloud platform.
这里,当资源接口的地址为/group/gen时,查询请求可为retrieve/group/gen。Here, when the address of the resource interface is /group/gen, the query request can be retrieve/group/gen.
步骤S704、云平台收到请查询求后,校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容作为响应返回给用户。groups的内容包括每个用户组的组名称、组成员ID、共享设备的设备ID以及有效期。Step S704: After receiving the inquiry request, the cloud platform verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the content of groups is returned to the user as a response. The content of groups includes the group name of each user group, the group member ID, the device ID of the shared device, and the validity period.
步骤S705、ClientA在查询得到的groups中新增加一个用户组得到更新后的groups,新增加的用户组的组信息包含组名称、组成员ID(userA_ID和userB_ID)、目标设备的device ID、以及有效期。Step S705: ClientA adds a new user group to the groups obtained by the query to obtain the updated groups. The group information of the newly added user group includes the group name, group member ID (userA_ID and userB_ID), the device ID of the target device, and the validity period. .
步骤S706、ClientA向云平台的资源接口发送更新请求中携带参数包括userA_ID和访问令牌、以及更新后的groups。Step S706: ClientA sends an update request to the resource interface of the cloud platform. The parameters included in the update request include userA_ID, access token, and updated groups.
步骤S707、云平台收到更新请求后,通过存储于云平台的用户ID和访问令牌对应关系校验用userA_ID与访问令牌,当验证通过后,确认用户A为合法用户。Step S707: After receiving the update request, the cloud platform verifies the userA_ID and the access token through the corresponding relationship between the user ID and the access token stored in the cloud platform, and confirms that the user A is a legitimate user after the verification is passed.
步骤S708、云平台根据userA_ID与设备的绑定关系检查新增加的目标设备与用户A的绑定关系,即检查新增加的目标设备是否为用户A所管理的设备。Step S708: The cloud platform checks the binding relationship between the newly added target device and the user A according to the binding relationship between the userA_ID and the device, that is, checks whether the newly added target device is a device managed by the user A.
在实际应用中,当用户组中包括多个共享设备时,云平台根据userA_ID与设备的绑定关系检查更新请求中的每一新增加的设备与用户A的绑定关系,即检查每一新增加的设备是否为用户A所管理的设备。其中,对于每一设备及其管理员用户,云平台存储用户ID与设备的绑定关系。In practical applications, when the user group includes multiple shared devices, the cloud platform checks the binding relationship between each newly added device in the update request and user A according to the binding relationship between userA_ID and the device, that is, checking each new Whether the added device is a device managed by user A. Among them, for each device and its administrator user, the cloud platform stores the binding relationship between the user ID and the device.
步骤S709、云平台更新用户A对应groups。Step S709: The cloud platform updates the groups corresponding to user A.
步骤S7010、云平台成功建立用户组后,返回响应OK给ClientA。Step S7010: After the cloud platform successfully establishes the user group, it returns a response OK to ClientA.
步骤S7011.ClientB通过云平台访问目标设备。Step S7011. Client B accesses the target device through the cloud platform.
步骤S7012、云平台判断用户B与被访问设备是否在同一组中,若是,则云平台允许该访问请求,将该访问请求转发至目标设备;若否,则拒绝该访问请求。In step S7012, the cloud platform judges whether the user B and the accessed device are in the same group. If so, the cloud platform allows the access request and forwards the access request to the target device; if not, it rejects the access request.
步骤S7013、若目标设备基于用户组已分享给用户B,则目标设备执行访问请求,执行步骤S7014向ClientB返回响应。Step S7013: If the target device has been shared with user B based on the user group, the target device executes an access request, and executes step S7014 to return a response to Client B.
(2)、更新用户组(2) Update user group
用户A基于已有的用户组更新用户组将该目标设备分享给用户B。具体操作步骤,如图8所示,包括:User A updates the user group based on the existing user group and shares the target device with user B. The specific operation steps, as shown in Figure 8, include:
步骤S801、用户A使用ClientA通过局域网传输、扫二维码等方式获取用户B的终端ClientB中存储的用户ID(userB_ID)。In step S801, the user A uses Client A to obtain the user ID (userB_ID) stored in the terminal ClientB of the user B through LAN transmission, scanning a two-dimensional code, or the like.
其中,Client A的User ID为userA_ID)。Among them, the User ID of Client A is userA_ID).
步骤S802.ClientA通过局域网或者云平台获取待配置到组中的设备的device ID。由于用户A是目标设备的管理员,也可能ClientA在配置设备后就一直保存有目标设备的device ID,此时,步骤S702可略过。Step S802. Client A obtains the device ID of the device to be configured into the group through the local area network or the cloud platform. Since user A is the administrator of the target device, it is also possible that Client A has always stored the device ID of the target device after configuring the device. In this case, step S702 can be skipped.
步骤S803、ClientA向云平台的资源接口发送查询请求。Step S803: ClientA sends a query request to the resource interface of the cloud platform.
例如,当固定地址为/group/gen,则查询请求可为retrieve/group/gen。For example, when the fixed address is /group/gen, the query request can be retrieve/group/gen.
步骤S804、云平台收到请查询求后,校验用户A的User ID。User ID校验通过后,在用户A的User ID对应的条目下,将groups的内容作为响应返回给用户。groups的内容包括每个用户组的组名称、组成员ID、共享设备的设备ID以及有效期。Step S804: After receiving the inquiry request, the cloud platform verifies the User ID of user A. After the User ID verification is passed, under the entry corresponding to User A's User ID, the content of groups is returned to the user as a response. The content of groups includes the group name of each user group, the group member ID, the device ID of the shared device, and the validity period.
步骤S805、ClientA在查询得到的groups中一个已存在的组中增加组成员ID(userB ID)和目标设备(device ID),得到更新后的groups。Step S805: Client A adds a group member ID (userB ID) and a target device (device ID) to an existing group in the groups obtained by the query, to obtain the updated groups.
步骤S806、ClientA向云平台的资源接口发送更新请求,更新请求中携带参数包括userA_ID和访问令牌、以及更新后的groups。Step S806: ClientA sends an update request to the resource interface of the cloud platform. The update request carries parameters including userA_ID, access token, and updated groups.
步骤S807、云平台收到更新请求后,通过存储于云平台的用户ID和访问令牌对应关系校验userA_ID与访问令牌,当验证通过后,确认用户A为合法用户。Step S807: After the cloud platform receives the update request, it verifies the userA_ID and the access token through the corresponding relationship between the user ID and the access token stored in the cloud platform, and confirms that the user A is a legitimate user after the verification is passed.
步骤S808、云平台根据userA_ID与设备的绑定关系检查新增加的目标设备与用户A的绑定关系,即检查新增加的目标设备是否为用户A所管理的设备。Step S808: The cloud platform checks the binding relationship between the newly added target device and the user A according to the binding relationship between the userA_ID and the device, that is, checks whether the newly added target device is a device managed by the user A.
在实际应用中,当用户组中包括多个共享设备时,云平台根据userA_ID与设备的绑定关系检查更新请求中的每一新增加的设备与用户A的绑定关系,即检查每一新增加的设备是否为用户A所管理的设备。其中,对于每一设备及其管理员用户,云平台存储用户ID与设备的绑定关系。In practical applications, when the user group includes multiple shared devices, the cloud platform checks the binding relationship between each newly added device in the update request and user A according to the binding relationship between userA_ID and the device, that is, checking each new Whether the added device is a device managed by user A. Among them, for each device and its administrator user, the cloud platform stores the binding relationship between the user ID and the device.
步骤S809、云平台更新用户A对应的groups。Step S809: The cloud platform updates the groups corresponding to user A.
步骤S8010、云平台成功建立用户组后,返回响应OK给ClientA。Step S8010: After the cloud platform successfully establishes the user group, it returns a response OK to ClientA.
步骤S8011、ClientB通过云平台访问目标设备。Step S8011, ClientB accesses the target device through the cloud platform.
步骤S8012、云平台判断用户B与被访问的目标设备是否在同一组中,若是,则云平台允许该访问请求,将该访问请求转发至目标设备;若否,则拒绝该访问请求。Step S8012, the cloud platform judges whether the user B and the accessed target device are in the same group, if so, the cloud platform allows the access request and forwards the access request to the target device; if not, it rejects the access request.
步骤S8013、若设备基于用户组已分享给用户B,则设备执行访问请求,执行步骤S8014向ClientB返回响应。Step S8013: If the device has been shared with user B based on the user group, the device executes an access request, and executes step S8014 to return a response to Client B.
(3)、删除用户组(3), delete user group
用户也可以删除所创建的用户组。The user can also delete the created user group.
用户A对云平台的资源接口发送删除请求DELETE请求,以uid=userA_ID为查询条件,例如:资源接口为/group/gen时,delete/group/gen?uid=U001。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时可不带uid=userA_ID的查询条件。User A sends a delete request DELETE request to the resource interface of the cloud platform, with uid=userA_ID as the query condition, for example: when the resource interface is /group/gen, delete/group/gen? uid=U001. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in this case.
云平台收到删除请求后,首先校验用户A的userID。userID校验通过后,在用户A的userID对应的条目下,将groups的内容清空,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the userID of user A. After the userID verification is passed, the content of the groups is cleared under the entry corresponding to the userID of user A, and a response to the successful operation of user A is returned.
若用户A想删除某一用户组,则发送的DELETE请求以uid=userA_ID和gn=groupname为查询条件,例如:delete/group/gen?uid=U001&gn=guest。这里,也可由云平台通过用户A的接入信息自行判断用户ID,此时可不带uid=userA_ID的查询条件。If user A wants to delete a certain user group, the DELETE request sent uses uid=userA_ID and gn=groupname as the query conditions, for example: delete/group/gen? uid=U001&gn=guest. Here, the cloud platform can also determine the user ID by itself through the access information of user A, and the query condition of uid=userA_ID may not be included in this case.
云平台收到删除请求后,首先校验用户A的userID。userID校验通过后,在用户A的userID对应的条目下,将groups中组名称为guest的用户组删除,并返回给用户A操作成功的响应。After the cloud platform receives the delete request, it first verifies the userID of user A. After the userID verification is passed, under the entry corresponding to user A's userID, delete the user group whose group name is guest in groups, and return to user A a successful response.
为实现上述访问控制方法,本发明实施例还提供一种服务器,所述服务器的组成结构,如图9所示,服务器304包括:In order to implement the above access control method, an embodiment of the present invention also provides a server. The composition structure of the server is as shown in FIG. 9, and the server 304 includes:
接收单元901,配置为接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;The receiving unit 901 is configured to receive an access request sent by the first access device to access the target device based on the first user identifier;
权限单元902,配置为根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;The authority unit 902 is configured to determine the access authority of the first user identifier to the target device according to at least one user group;
处理单元903,配置为根据所述访问权限对所述访问请求进行处理。The processing unit 903 is configured to process the access request according to the access authority.
本发明实施例中,所述访问权限包括:允许访问和禁止访问;处理单元903,配置为:In the embodiment of the present invention, the access authority includes: access permitted and access prohibited; the processing unit 903 is configured to:
当所述访问权限为允许访问,将所述访问请求转发至所述目标设备;When the access authority is permission to access, forward the access request to the target device;
当所述访问权限为禁止访问,拒绝所述访问请求。When the access authority is forbidden, the access request is rejected.
本发明实施例中,权限单元902,被配置为:In the embodiment of the present invention, the authority unit 902 is configured as:
当所述至少一个用户组中包括目标用户组,所述服务器确定所述第一用户标识的访问权限为允许访问;所述目标用户组的组成员包括所述第一用户标识,且所述目标用户组中的共享设备的设备标识包括所述目标设备的设备标识,。When the at least one user group includes a target user group, the server determines that the access authority of the first user ID is permission to access; the group members of the target user group include the first user ID, and the target The device identifier of the shared device in the user group includes the device identifier of the target device.
本发明实施例中,权限单元902,被配置为:In the embodiment of the present invention, the authority unit 902 is configured as:
当所述至少一个用户组中每一用户组的组成员不包括所述第一用户标识,所述服务器确定所述第一用户标识的访问权限为禁止访问;或When the group members of each user group in the at least one user group do not include the first user ID, the server determines that the access authority of the first user ID is forbidden; or
当所述至少一个用户组中每一用户组的共享设备的设备标识不包括所述目标设备的设备标识,所述服务器确定所述第一用户标识的访问权限为禁止访问;或When the device identification of the shared device of each user group in the at least one user group does not include the device identification of the target device, the server determines that the access authority of the first user identification is forbidden; or
当所述至少一个用户组中,组成员不包括所述第一用户标识的用户组与共享设备的设备标识不包括所述目标设备的设备标识的用户组不是同一用户组,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问。When in the at least one user group, the user group whose group members do not include the first user ID and the user group whose device ID of the shared device does not include the device ID of the target device are not the same user group, the server determines The access authority of the first user identifier to the target device is forbidden.
本发明实施例中,权限单元902,还被配置为:In the embodiment of the present invention, the authority unit 902 is further configured as:
所述用户组的组成员的用户标识不包括与所述目标设备之间具有绑定关系的用户标识,且所述第一用户标识与所述设备不具有绑定关系,根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限。The user IDs of the group members of the user group do not include user IDs that have a binding relationship with the target device, and the first user ID does not have a binding relationship with the device, according to at least one user group, Determine the access authority of the first user identifier to the target device.
本发明实施例中,服务器304还包括:更新单元,被配置为:In the embodiment of the present invention, the server 304 further includes: an update unit configured to:
接收第二访问设备基于所述第二用户标识发送的更新请求;Receiving an update request sent by the second access device based on the second user identifier;
根据所述更新请求,得到对应所述第二用户标识的新用户组。According to the update request, a new user group corresponding to the second user identifier is obtained.
本发明实施例中,所述更新请求携带的所述新用户组的组信息,所述组信息至少包括:用户组名称、组成员的标识和共享设备的设备标识。In the embodiment of the present invention, the group information of the new user group carried in the update request includes at least: the user group name, the identifier of the group member, and the device identifier of the shared device.
本发明实施例中,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。In the embodiment of the present invention, the identifier of the group member includes: the first user identifier, and the sharing device includes: the target device.
本发明实施例中,所述组成员的标识还包括:所述第二用户标识。In the embodiment of the present invention, the identity of the group member further includes: the second user identity.
本发明实施例中,更新单元,还被配置为:In the embodiment of the present invention, the updating unit is further configured as:
当不存在对应所述第二用户标识的已有的用户组,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is no existing user group corresponding to the second user ID, create a new user group according to the user group name of the new user group, the ID of the group member, and the device ID of the shared device carried in the update request;
当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中不包括所述更新请求携带的新用户组的用户组名称,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is an existing user group corresponding to the second user ID, and the group name of the existing user group does not include the user group name of the new user group carried in the update request, according to the new user group carried in the update request The user group name of the user group, the ID of the group member and the device ID of the shared device, create a new user group;
当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中包括所述更新请求携带的新用户组的用户组名称,以所述新用户组的用户组名称对应的用户组为参考用户组,根据所述更新请求携带的组成员的标识和共享设备的设备标识,对所述参考用户组的组信息进行更新,得到新用户组。When there is an existing user group corresponding to the second user identifier, and the group name of the existing user group includes the user group name of the new user group carried in the update request, the user group of the new user group The user group corresponding to the name is a reference user group, and the group information of the reference user group is updated according to the group member identification and the device identification of the shared device carried in the update request to obtain a new user group.
本发明实施例中,更新请求携带更新后的至少一个用户组的组信息;所述更新后的至少一个用户组包括:新用户组和所述第二用户标识对应的已有的用户组;所述更新单元,还被配置为:In the embodiment of the present invention, the update request carries the updated group information of at least one user group; the updated at least one user group includes: a new user group and an existing user group corresponding to the second user identifier; The update unit is also configured as:
根据所述更新后的至少一个用户组的组信息,对所述第二用户标识对应的已有的用户组的组信息进行覆盖,得到更新后的至少一个用户组。According to the updated group information of the at least one user group, the group information of the existing user group corresponding to the second user identifier is overwritten to obtain the updated at least one user group.
本发明实施例中,所述新用户组为新添加的用户组或对所述已有的用户组中的参考用户组进行更新得到的用户组。In the embodiment of the present invention, the new user group is a newly added user group or a user group obtained by updating a reference user group in the existing user group.
本发明实施例中,所述新用户组的组信息包括:用户组名称、组成员的标识和共享设备的设备标识;In the embodiment of the present invention, the group information of the new user group includes: the user group name, the identifier of the group member, and the device identifier of the shared device;
本发明实施例中,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。In the embodiment of the present invention, the identifier of the group member includes: the first user identifier, and the sharing device includes: the target device.
本发明实施例中,所述组成员的标识还包括:所述第二用户标识。In the embodiment of the present invention, the identity of the group member further includes: the second user identity.
本发明实施例中,所述更新单元,还被配置为:In the embodiment of the present invention, the updating unit is further configured to:
当与所述共享设备具有绑定关系的用户标识为所述第二用户标识,根据所述更新请求,得到对应所述第二用户标识的新用户组。When the user identifier that has a binding relationship with the shared device is the second user identifier, a new user group corresponding to the second user identifier is obtained according to the update request.
本发明实施例中,所述新用户组的组信息还包括:有效期;所述服务器还包括:第一删除单元,被配置为当所述新用户组的创建时间达到所述有效期,所述服务器将所述新用户组删除。In the embodiment of the present invention, the group information of the new user group further includes: a validity period; the server further includes: a first deleting unit configured to, when the creation time of the new user group reaches the validity period, the server Delete the new user group.
本发明实施例中,所述服务器还包括:第一查询单元,被配置为:In the embodiment of the present invention, the server further includes: a first query unit configured to:
接收第二访问设备基于所述第二用户标识发送的查询请求;Receiving a query request sent by the second access device based on the second user identifier;
基于所述查询请求获取所述第二用户标识对应的全部的用户组的组信息;Acquiring group information of all user groups corresponding to the second user identifier based on the query request;
将所述已有的用户组的组信息发送至所述第二访问设备。Sending the group information of the existing user group to the second access device.
本发明实施例中,所述服务器还包括:第二查询单元,被配置为:In the embodiment of the present invention, the server further includes: a second query unit configured to:
接收第二访问设备基于所述第二用户标识发送的查询请求;所述查询请求中携带待查询的用户组的用户组名称;Receiving a query request sent by the second access device based on the second user identifier; the query request carries the user group name of the user group to be queried;
基于所述查询请求获取所述待查询的用户组的组信息;Acquiring the group information of the user group to be queried based on the query request;
将所述待查询的用户组的组信息发送至所述第二访问设备。Sending the group information of the user group to be queried to the second access device.
本发明实施例中,所述服务器还包括:第二删除单元,被配置为:In the embodiment of the present invention, the server further includes: a second deleting unit configured to:
接收第二访问设备基于所述第二用户标识发送的删除请求;Receiving a deletion request sent by the second access device based on the second user identifier;
根据所述删除请求删除所述第二用户组对应的全部的用户组。Deleting all user groups corresponding to the second user group according to the deletion request.
本发明实施例中,所述服务器还包括:第三删除单元,被配置为:In the embodiment of the present invention, the server further includes: a third deleting unit configured to:
接收第二访问设备基于所述第二用户标识发送的删除请求;所述删除请求携带待删除的用户组的用户组名称;Receiving a deletion request sent by the second access device based on the second user identifier; the deletion request carrying the user group name of the user group to be deleted;
根据所述删除请求从所述第二用户组对应的至少一个用户组中删除所述待删除的用户组的组信息。Delete the group information of the user group to be deleted from at least one user group corresponding to the second user group according to the deletion request.
本发明实施例还提供一种访问设备1000,作为图3中的第一访问设备301,所述访问设备的组成结构示意图,如图10A所示,包括:The embodiment of the present invention also provides an access device 1000, as the first access device 301 in FIG. 3, the structure diagram of the access device, as shown in FIG. 10A, includes:
选择单元1001,被配置为确定接收的选择操作所选取的目标设备;The selection unit 1001 is configured to determine the target device selected by the received selection operation;
第一发送单元1002,被配置为基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器,使得所述服务器根据至少一个用户组确定所述访问设备所使用的第一用户标识对所述目标设备的访问权限。The first sending unit 1002 is configured to generate an access request based on the device identifier corresponding to the target device, and send the access request to a server, so that the server determines the first access device used by the access device according to at least one user group. The user identifies the access authority to the target device.
本发明实施例中,访问设备1000还包括:第二发送单元,被配置为将所述第一用户标识发送至使用所述第二用户标识的第二访问设备,使得所述第二访问设备基于所述第一用户标识生成更新请求,所述更新请求用于所述服务器建立新用户组,所述新用户组的组成员包括所述第一访问设备。In the embodiment of the present invention, the access device 1000 further includes: a second sending unit configured to send the first user identification to a second access device using the second user identification, so that the second access device is based on The first user identifier generates an update request, and the update request is used by the server to establish a new user group, and group members of the new user group include the first access device.
本发明实施例还提供一种访问设备1010,作为图3中的第二访问设备302,所述访问设备的组成结构示意图,如图10B所示,包括:The embodiment of the present invention also provides an access device 1010, as the second access device 302 in FIG. 3, the structure diagram of the access device, as shown in FIG. 10B, includes:
组建立单元1011,被配置为基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。The group establishing unit 1011 is configured to send an update request to the server based on the second user ID, the update request is used to make the server generate a user group, and the generated user group is used to determine the first access device using the first user ID For access rights to the target device, the second user identifier has a binding relationship with the target device.
本发明实施例中,访问设备1010还包括:In the embodiment of the present invention, the access device 1010 further includes:
第一获取单元,被配置为获取新用户组的组信息,将所述新用户组的组信息携带在所述更新请求中。The first acquiring unit is configured to acquire group information of a new user group, and carry the group information of the new user group in the update request.
本发明实施例中,访问设备1010还包括:第二获取单元,被配置向所述服务器查询对应所述第二用户标识的已有的用户组的组信息,将所获取的已有用户组的组信息携带在所述更新请求中。In the embodiment of the present invention, the access device 1010 further includes: a second obtaining unit configured to query the server for the group information of the existing user group corresponding to the second user identifier, and obtain the information of the existing user group The group information is carried in the update request.
本发明实施例中,访问设备1010还包括:In the embodiment of the present invention, the access device 1010 further includes:
组更新单元,被配置为当所述已有的用户组的用户组名称中包括所述新用户组的用户组名称,将所述新用户组的用户组名对应的已有用户组作为参考用户组,通过所述新用户组的组信息对所述参考用户组的组信息进行更新。The group update unit is configured to use the existing user group corresponding to the user group name of the new user group as the reference user when the user group name of the existing user group includes the user group name of the new user group Group, the group information of the reference user group is updated through the group information of the new user group.
本发明实施例还提供一种服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述服务器执行的访问控制方法的步骤。An embodiment of the present invention also provides a server, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is used to execute the access control performed by the server when the computer program is running. Method steps.
本发明实施例还提供一种访问设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述访问设备1000执行的访问控制方法的步骤。An embodiment of the present invention also provides an access device, including a processor and a memory for storing a computer program that can run on the processor, wherein, when the processor is used to run the computer program, the access device 1000 executes The steps of the access control method.
本发明实施例还提供一种访问设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述访问设备1010执行的访问控制方法的步骤An embodiment of the present invention also provides an access device, including a processor and a memory for storing a computer program that can run on the processor. When the processor is used to run the computer program, the access device 1010 executes Steps of the access control method
图11是本发明实施例的电子设备(访问设备或服务器)的硬件组成结构示意图,电子设备1100包括:至少一个处理器1101、存储器1102和至少一个网络接口1104。电子设备1100中的各个组件通过总线系统1105耦合在一起。可理解,总线系统1105用于实现这些组件之间的连接通信。总线系统1105除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图11中将各种总线都标为总线系统1105。11 is a schematic diagram of the hardware composition structure of an electronic device (access device or server) according to an embodiment of the present invention. The electronic device 1100 includes: at least one processor 1101, a memory 1102, and at least one network interface 1104. The various components in the electronic device 1100 are coupled together through the bus system 1105. It can be understood that the bus system 1105 is used to implement connection and communication between these components. In addition to the data bus, the bus system 1105 also includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus system 1105 in FIG. 11.
可以理解,存储器1102可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是ROM、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically  Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器1102旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 1102 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. Among them, the non-volatile memory may be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and electrically erasable Programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), magnetic random access memory (FRAM, ferromagnetic random access memory), flash memory (Flash Memory), magnetic surface memory, optical disk, or CD-ROM -ROM, Compact Disc Read-Only Memory); Magnetic surface memory can be disk storage or tape storage. The volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (SRAM, Static Random Access Memory), synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), and dynamic random access Memory (DRAM, Dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), enhanced -Type synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), synchronous connection dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, Direct Rambus Random Access Memory) ). The memory 1102 described in the embodiment of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
本发明实施例中的存储器1102用于存储各种类型的数据以支持电子设备1100的操作。这些数据的示例包括:用于在电子设备1100上操作的任何计算机程序,如应用程序11021。实现本发明实施例方法的程序可以包含在应用程序11021中。The memory 1102 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 1100. Examples of these data include: any computer program used to operate on the electronic device 1100, such as an application program 11021. The program for implementing the method of the embodiment of the present invention may be included in the application program 11021.
上述本发明实施例揭示的方法可以应用于处理器1101中,或者由处理器1101实现。处理器1101可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1101中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1101可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器1101可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器1102,处理器1101读取存储器1102中的信息,结合其硬件完成前述方法的步骤。The method disclosed in the foregoing embodiment of the present invention may be applied to the processor 1101 or implemented by the processor 1101. The processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 1101 or instructions in the form of software. The aforementioned processor 1101 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the like. The processor 1101 may implement or execute various methods, steps, and logical block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium. The storage medium is located in the memory 1102. The processor 1101 reads the information in the memory 1102, and completes the steps of the foregoing method in combination with its hardware.
在示例性实施例中,电子设备1100可以被一个或多个应用专用集成电路(ASIC,Application Specific Integrated Circuit)、DSP、可编程逻辑器件(PLD,Programmable Logic Device)、复杂可编程逻辑器件(CPLD,Complex Programmable Logic Device)、FPGA、通用处理器、控制器、MCU、MPU、或其他电子元件实现,用于执行前述方法。In an exemplary embodiment, the electronic device 1100 may be used by one or more application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), and complex programmable logic device (CPLD). , Complex Programmable Logic Device), FPGA, general-purpose processor, controller, MCU, MPU, or other electronic components to implement the foregoing method.
本发明实施例还提供了一种存储介质,用于存储计算机程序。The embodiment of the present invention also provides a storage medium for storing computer programs.
可选的,该存储介质可应用于本发明实施例中的服务器,并且该计算机程序使得计算机执行本发明实施例的各个方法中的相应流程,为了简洁,在此不再赘述。Optionally, the storage medium can be applied to the server in the embodiment of the present invention, and the computer program causes the computer to execute the corresponding process in each method of the embodiment of the present invention. For brevity, details are not described herein again.
可选的,该存储介质可应用于本发明实施例中的访问设备,并且该计算机程序使得计算机执行本发明实施例的各个方法中的相应流程,为了简洁,在此不再赘述。Optionally, the storage medium can be applied to the access device in the embodiment of the present invention, and the computer program causes the computer to execute the corresponding process in each method of the embodiment of the present invention. For brevity, details are not repeated here.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
以上所述,仅为本发明的实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和范围之内所作的任何修改、等同替换和改进等,均包含在本发明的保护范围之内。The above are only the embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are all included in the protection scope of the present invention.

Claims (60)

  1. 一种访问控制方法,包括:An access control method, including:
    服务器接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;The server receives an access request sent by the first access device to access the target device based on the first user identifier;
    所述服务器根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;Determining, by the server, the access authority of the first user identifier to the target device according to at least one user group;
    所述服务器根据所述访问权限对所述访问请求进行处理。The server processes the access request according to the access authority.
  2. 根据权利要求1所述的方法,所述访问权限包括:允许访问和禁止访问;所述根据所述访问权限对所述访问请求进行处理,包括:The method according to claim 1, wherein the access authority includes: permitting access and prohibiting access; and processing the access request according to the access authority includes:
    当所述访问权限为允许访问,将所述访问请求转发至所述目标设备;When the access authority is permission to access, forward the access request to the target device;
    当所述访问权限为禁止访问,拒绝所述访问请求。When the access authority is forbidden, the access request is rejected.
  3. 根据权利要求2所述的方法,所述根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限,包括:The method according to claim 2, wherein the determining the access authority of the first user identifier to the target device according to at least one user group comprises:
    当所述至少一个用户组中包括目标用户组,所述服务器确定所述第一用户标识对目标设备的访问权限为允许访问;所述目标用户组的组成员包括所述第一用户标识,且所述目标用户组中的共享设备的设备标识包括所述目标设备的设备标识。When the at least one user group includes a target user group, the server determines that the access authority of the first user ID to the target device is allowed to access; the group members of the target user group include the first user ID, and The device identifier of the shared device in the target user group includes the device identifier of the target device.
  4. 根据权利要求2所述的方法,所述根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限,包括:The method according to claim 2, wherein the determining the access authority of the first user identifier to the target device according to at least one user group comprises:
    当所述至少一个用户组中每一用户组的组成员不包括所述第一用户标识,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问;或When the group members of each user group in the at least one user group do not include the first user ID, the server determines that the access authority of the first user ID to the target device is forbidden; or
    当所述至少一个用户组中每一用户组的共享设备的设备标识不包括所述目标设备的设备标识,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问;或当所述至少一个用户组中,组成员不包括所述第一用户标识的用户组与共享设备的设备标识不包括所述目标设备的设备标识的用户组不是同一用户组,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问。When the device ID of the shared device of each user group in the at least one user group does not include the device ID of the target device, the server determines that the access authority of the first user ID to the target device is forbidden; or when In the at least one user group, the user group whose group members do not include the first user ID and the user group whose device ID of the shared device does not include the device ID of the target device are not the same user group, and the server determines that the The access authority of the first user identifier to the target device is forbidden.
  5. 根据权利要求1所述的方法,所述根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限,包括:The method according to claim 1, wherein the determining the access authority of the first user identifier to the target device according to at least one user group comprises:
    当所述用户组的组成员的用户标识不包括与所述目标设备之间具有绑定关系的用户标识,且所述第一用户标识与所述设备不具有绑定关系,根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限。When the user IDs of group members of the user group do not include user IDs that have a binding relationship with the target device, and the first user ID does not have a binding relationship with the device, according to at least one user group To determine the access authority of the first user identifier to the target device.
  6. 根据权利要求1至5任一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 5, further comprising:
    所述服务器接收第二访问设备基于第二用户标识发送的更新请求;所述第二用户标识与所述目标设备之间具有绑定关系;Receiving, by the server, an update request sent by the second access device based on a second user ID; the second user ID has a binding relationship with the target device;
    所述服务器根据所述更新请求,得到对应所述第二用户标识的新用户组。The server obtains a new user group corresponding to the second user identifier according to the update request.
  7. 根据权利要求6所述的方法,所述更新请求携带的所述新用户组的组信息,所述组信息至少包括:用户组名称、组成员的标识和共享设备的设备标识。The method according to claim 6, wherein the group information of the new user group carried in the update request, the group information includes at least: a user group name, an identifier of a group member, and a device identifier of a shared device.
  8. 根据权利要求7所述的方法,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。The method according to claim 7, wherein the identification of the group member includes: the first user identification, and the sharing device includes: the target device.
  9. 根据权利要求8所述的方法,所述组成员的标识还包括:所述第二用户标识。According to the method of claim 8, the identification of the group member further comprises: the second user identification.
  10. 根据权利要求7至9任一项所述的方法,所述根据所述更新请求,得到对应所述第二用户标识的新用户组,包括:The method according to any one of claims 7 to 9, wherein the obtaining a new user group corresponding to the second user identifier according to the update request includes:
    当不存在对应所述第二用户标识的已有的用户组,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is no existing user group corresponding to the second user ID, create a new user group according to the user group name of the new user group, the ID of the group member, and the device ID of the shared device carried in the update request;
    当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中不包括 所述更新请求携带的新用户组的用户组名称,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is an existing user group corresponding to the second user ID, and the group name of the existing user group does not include the user group name of the new user group carried in the update request, according to the new user group carried in the update request The user group name of the user group, the ID of the group member and the device ID of the shared device, create a new user group;
    当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中包括所述更新请求携带的新用户组的用户组名称,以所述新用户组的用户组名称对应的用户组为参考用户组,根据所述更新请求携带的组成员的标识和共享设备的设备标识,对所述参考用户组的组信息进行更新,得到新用户组。When there is an existing user group corresponding to the second user identifier, and the group name of the existing user group includes the user group name of the new user group carried in the update request, the user group of the new user group The user group corresponding to the name is a reference user group, and the group information of the reference user group is updated according to the group member identification and the device identification of the shared device carried in the update request to obtain a new user group.
  11. 根据权利要求6所述的方法,所述更新请求携带更新后的至少一个用户组的组信息;所述更新后的至少一个用户组包括:新用户组和所述第二用户标识对应的已有的用户组;所述根据所述更新请求,得到对应所述第二用户标识的新用户组,包括:The method according to claim 6, wherein the update request carries the updated group information of at least one user group; the updated at least one user group includes: a new user group and an existing user group corresponding to the second user ID The user group; the obtaining a new user group corresponding to the second user identifier according to the update request includes:
    根据所述更新后的至少一个用户组的组信息,对所述第二用户标识对应的已有的用户组的组信息进行覆盖,得到更新后的至少一个用户组。According to the updated group information of the at least one user group, the group information of the existing user group corresponding to the second user identifier is overwritten to obtain the updated at least one user group.
  12. 根据权利要求11所述的方法,所述新用户组为新添加的用户组或对所述已有的用户组中的参考用户组进行更新得到的用户组。According to the method of claim 11, the new user group is a newly added user group or a user group obtained by updating a reference user group in the existing user group.
  13. 根据权利要求11或12所述的方法,所述新用户组的组信息至少包括:用户组名称、组成员的标识和共享设备的设备标识。According to the method according to claim 11 or 12, the group information of the new user group includes at least: the user group name, the identification of the group member, and the device identification of the shared device.
  14. 根据权利要求13所述的方法,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。The method according to claim 13, wherein the identity of the group member includes: the first user identity, and the shared device includes: the target device.
  15. 根据权利要求14所述的方法,所述组成员的标识还包括:所述第二用户标识。According to the method of claim 14, the identification of the group member further comprises: the second user identification.
  16. 根据权利要求7或13所述的方法,根据所述更新请求,得到对应所述第二用户标识的新用户组,包括:According to the method of claim 7 or 13, obtaining a new user group corresponding to the second user identifier according to the update request, including:
    当与所述共享设备具有绑定关系的用户标识为所述第二用户标识,根据所述更新请求,得到对应所述第二用户标识的新用户组。When the user identifier that has a binding relationship with the shared device is the second user identifier, a new user group corresponding to the second user identifier is obtained according to the update request.
  17. 根据权利要求7或16所述的方法,所述新用户组的组信息还包括:有效期;所述方法还包括:According to the method of claim 7 or 16, the group information of the new user group further includes: a validity period; the method further includes:
    当所述新用户组的创建时间达到所述有效期,所述服务器将所述新用户组删除。When the creation time of the new user group reaches the validity period, the server deletes the new user group.
  18. 根据权利要求1至17任一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 17, further comprising:
    所述服务器接收第二访问设备基于所述第二用户标识发送的查询请求;Receiving, by the server, a query request sent by the second access device based on the second user identifier;
    所述服务器基于所述查询请求获取所述第二用户标识对应的全部的用户组的组信息;Obtaining, by the server, group information of all user groups corresponding to the second user identifier based on the query request;
    所述服务器将所述已有的用户组的组信息发送至所述第二访问设备。The server sends the group information of the existing user group to the second access device.
  19. 根据权利要求1至17任一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 17, further comprising:
    所述服务器接收第二访问设备基于所述第二用户标识发送的查询请求;所述查询请求中携带待查询的用户组的用户组名称;The server receives a query request sent by the second access device based on the second user identifier; the query request carries the user group name of the user group to be queried;
    所述服务器基于所述查询请求获取所述待查询的用户组的组信息;Obtaining, by the server, the group information of the user group to be queried based on the query request;
    所述服务器将所述待查询的用户组的组信息发送至所述第二访问设备。The server sends the group information of the user group to be queried to the second access device.
  20. 根据权利要求1至17任一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 17, further comprising:
    所述服务器接收第二访问设备基于所述第二用户标识发送的删除请求;Receiving, by the server, a deletion request sent by the second access device based on the second user identifier;
    所述服务器根据所述删除请求删除所述第二用户组对应的全部的用户组。The server deletes all user groups corresponding to the second user group according to the deletion request.
  21. 根据权利要求1至17任一项所述的方法,所述方法还包括:The method according to any one of claims 1 to 17, further comprising:
    所述服务器接收第二访问设备基于所述第二用户标识发送的删除请求;所述删除请求携带待删除的用户组的用户组名称;Receiving, by the server, a deletion request sent by the second access device based on the second user identifier; the deletion request carries the user group name of the user group to be deleted;
    所述服务器根据所述删除请求从所述第二用户组对应的至少一个用户组中删除所述待删除的用户组的组信息。The server deletes the group information of the user group to be deleted from at least one user group corresponding to the second user group according to the deletion request.
  22. 一种访问控制方法,所述方法包括:An access control method, the method includes:
    第一访问设备确定接收的选择操作所选取的目标设备;The first access device determines the target device selected by the received selection operation;
    所述第一访问设备基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器,使得所述服务器根据至少一个用户组确定所述第一访问设备所使用的第一用户标识对所述目标设备的访问权限。The first access device generates an access request based on the device identifier corresponding to the target device, and sends the access request to a server, so that the server determines the first user used by the first access device according to at least one user group Identify the access authority to the target device.
  23. 根据权利要求22所述的方法,所述方法还包括:The method according to claim 22, further comprising:
    所述第一访问设备将所述第一用户标识发送至使用所述第二用户标识的第二访问设备,使得所述第二访问设备基于所述第一用户标识生成更新请求,所述更新请求用于所述服务器建立新用户组,所述新用户组的组成员包括所述第一访问设备。The first access device sends the first user identification to a second access device using the second user identification, so that the second access device generates an update request based on the first user identification, the update request Used by the server to establish a new user group, and group members of the new user group include the first access device.
  24. 一种访问控制方法,所述方法包括:An access control method, the method includes:
    第二访问设备基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。The second access device sends an update request to the server based on the second user ID. The update request is used to cause the server to generate a user group, and the generated user group is used to determine whether the first access device using the first user ID has a target device Access authority, the second user identifier has a binding relationship with the target device.
  25. 根据权利要求24所述的方法,所述方法还包括:The method according to claim 24, further comprising:
    所述第二访问设备获取新用户组的组信息;将所述新用户组的组信息携带在所述更新请求中。The second access device obtains the group information of the new user group; and carries the group information of the new user group in the update request.
  26. 根据权利要求25所述的方法,所述方法还包括:The method according to claim 25, further comprising:
    所述第二访问设备向所述服务器查询对应所述第二用户标识的已有的用户组的组信息,将所获取的已有用户组的组信息携带在所述更新请求中。The second access device queries the server for the group information of the existing user group corresponding to the second user identifier, and carries the obtained group information of the existing user group in the update request.
  27. 根据权利要求26所述的方法,所述方法还包括:The method according to claim 26, further comprising:
    当所述已有的用户组的用户组名称中包括所述新用户组的用户组名称,所述第二访问设备将所述新用户组的用户组名对应的已有用户组作为参考用户组,通过所述新用户组的组信息对所述参考用户组的组信息进行更新。When the user group name of the existing user group includes the user group name of the new user group, the second access device uses the existing user group corresponding to the user group name of the new user group as a reference user group , Updating the group information of the reference user group through the group information of the new user group.
  28. 一种服务器,包括:A server that includes:
    接收单元,配置为接收第一访问设备基于第一用户标识发送的访问目标设备的访问请求;A receiving unit configured to receive an access request for accessing the target device sent by the first access device based on the first user identifier;
    权限单元,配置为根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限;An authority unit configured to determine the access authority of the first user identifier to the target device according to at least one user group;
    处理单元,配置为根据所述访问权限对所述访问请求进行处理。The processing unit is configured to process the access request according to the access authority.
  29. 根据权利要求28所述的服务器,所述访问权限包括:允许访问和禁止访问;所述处理单元,配置为:The server according to claim 28, wherein the access authority includes: access allowed and access prohibited; and the processing unit is configured to:
    当所述访问权限为允许访问,将所述访问请求转发至所述目标设备;When the access authority is permission to access, forward the access request to the target device;
    当所述访问权限为禁止访问,拒绝所述访问请求。When the access authority is forbidden, the access request is rejected.
  30. 根据权利要求29所述的服务器,所述权限单元,被配置为:The server according to claim 29, wherein the authority unit is configured to:
    当所述至少一个用户组中包括目标用户组,所述服务器确定所述第一用户标识的访问权限为允许访问;所述目标用户组的组成员包括所述第一用户标识,且所述目标用户组中的共享设备的设备标识包括所述目标设备的设备标识。When the at least one user group includes a target user group, the server determines that the access authority of the first user ID is permission to access; the group members of the target user group include the first user ID, and the target user group The device identification of the shared device in the user group includes the device identification of the target device.
  31. 根据权利要求29所述的服务器,所述权限单元,被配置为:The server according to claim 29, wherein the authority unit is configured to:
    当所述至少一个用户组中每一用户组的组成员不包括所述第一用户标识,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问;或When the group members of each user group in the at least one user group do not include the first user ID, the server determines that the access authority of the first user ID to the target device is forbidden; or
    当所述至少一个用户组中每一用户组的共享设备的设备标识不包括所述目标设备的设备标识,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问;或当所述至少一个用户组中,组成员不包括所述第一用户标识的用户组与共享设备的设备标识不包括所述目标设备的设备标识的用户组不是同一用户组,所述服务器确定所述第一用户标识对目标设备的访问权限为禁止访问。When the device ID of the shared device of each user group in the at least one user group does not include the device ID of the target device, the server determines that the access authority of the first user ID to the target device is forbidden; or when In the at least one user group, the user group whose group members do not include the first user ID and the user group whose device ID of the shared device does not include the device ID of the target device are not the same user group, and the server determines that the The access authority of the first user identifier to the target device is forbidden.
  32. 根据权利要求28所述的服务器,所述权限单元,还被配置为:The server according to claim 28, wherein the authority unit is further configured to:
    当所述用户组的组成员的用户标识不包括与所述目标设备之间具有绑定关系的用户标识,且所述第一用户标识与所述设备不具有绑定关系,根据至少一个用户组,确定所述第一用户标识对所述目标设备的访问权限。When the user IDs of group members of the user group do not include user IDs that have a binding relationship with the target device, and the first user ID does not have a binding relationship with the device, according to at least one user group To determine the access authority of the first user identifier to the target device.
  33. 根据权利要求29至32任一项所述的服务器,所述服务器还包括:更新单元,被配置为:The server according to any one of claims 29 to 32, the server further comprising: an update unit configured to:
    接收第二访问设备基于所述第二用户标识发送的更新请求;Receiving an update request sent by the second access device based on the second user identifier;
    根据所述更新请求,得到对应所述第二用户标识的新用户组。According to the update request, a new user group corresponding to the second user identifier is obtained.
  34. 根据权利要求33所述的服务器,所述更新请求携带的所述新用户组的组信息,所述组信息至少包括:用户组名称、组成员的标识和共享设备的设备标识。The server according to claim 33, wherein the group information of the new user group carried in the update request, the group information includes at least: user group name, group member identification, and shared device identification.
  35. 根据权利要求34所述的服务器,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。The server according to claim 34, wherein the identification of the group member includes: the first user identification, and the shared device includes: the target device.
  36. 根据权利要求34所述的服务器,所述组成员的标识还包括:所述第二用户标识。The server according to claim 34, the identification of the group member further comprises: the second user identification.
  37. 根据权利要求34至36任一项所述的服务器,所述更新单元,还被配置为:The server according to any one of claims 34 to 36, the update unit is further configured to:
    当不存在对应所述第二用户标识的已有的用户组,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is no existing user group corresponding to the second user ID, create a new user group according to the user group name of the new user group, the ID of the group member, and the device ID of the shared device carried in the update request;
    当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中不包括所述更新请求携带的新用户组的用户组名称,根据所述更新请求携带的新用户组的用户组名称、组成员的标识和共享设备的设备标识,创建新用户组;When there is an existing user group corresponding to the second user ID, and the group name of the existing user group does not include the user group name of the new user group carried in the update request, according to the new user group carried in the update request The user group name of the user group, the ID of the group member and the device ID of the shared device, create a new user group;
    当存在对应第二用户标识的已有的用户组,且所述已有的用户组的组名称中包括所述更新请求携带的新用户组的用户组名称,以所述新用户组的用户组名称对应的用户组为参考用户组,根据所述更新请求携带的组成员的标识和共享设备的设备标识,对所述参考用户组的组信息进行更新,得到新用户组。When there is an existing user group corresponding to the second user identifier, and the group name of the existing user group includes the user group name of the new user group carried in the update request, the user group of the new user group The user group corresponding to the name is a reference user group, and the group information of the reference user group is updated according to the group member identification and the device identification of the shared device carried in the update request to obtain a new user group.
  38. 根据权利要求33所述的服务器,所述更新请求携带更新后的至少一个用户组的组信息;所述更新后的至少一个用户组包括:新用户组和所述第二用户标识对应的已有的用户组;所述更新单元,还被配置为:The server according to claim 33, wherein the update request carries the updated group information of at least one user group; the updated at least one user group includes: a new user group and an existing user group corresponding to the second user ID The user group; the update unit is also configured to:
    根据所述更新后的至少一个用户组的组信息,对所述第二用户标识对应的已有的用户组的组信息进行覆盖,得到更新后的至少一个用户组。According to the updated group information of the at least one user group, the group information of the existing user group corresponding to the second user identifier is overwritten to obtain the updated at least one user group.
  39. 根据权利要求38所述的服务器,所述新用户组为新添加的用户组或对所述已有的用户组中的参考用户组进行更新得到的用户组。The server according to claim 38, wherein the new user group is a newly added user group or a user group obtained by updating a reference user group in the existing user group.
  40. 根据权利要求38或39所述的服务器,所述新用户组的组信息包括:用户组名称、组成员的标识和共享设备的设备标识;The server according to claim 38 or 39, the group information of the new user group includes: user group name, group member identification, and device identification of the shared device;
  41. 根据权利要求40所述的服务器,所述组成员的标识包括:所述第一用户标识,所述共享设备包括:所述目标设备。The server according to claim 40, wherein the identity of the group member includes: the first user identity, and the shared device includes: the target device.
  42. 根据权利要求40所述的服务器,所述组成员的标识还包括:所述第二用户标识。The server according to claim 40, the identification of the group member further comprises: the second user identification.
  43. 根据权利要求34或40所述的服务器,所述更新单元,还被配置为:The server according to claim 34 or 40, wherein the updating unit is further configured to:
    当与所述共享设备具有绑定关系的用户标识为所述第二用户标识,根据所述更新请求,得到对应所述第二用户标识的新用户组。When the user identifier that has a binding relationship with the shared device is the second user identifier, a new user group corresponding to the second user identifier is obtained according to the update request.
  44. 根据权利要求34或43所述的服务器,所述新用户组的组信息还包括:有效期;所述服务器还包括:第一删除单元,被配置为当所述新用户组的创建时间达到所述有效期,所述服务器将所述新用户组删除。The server according to claim 34 or 43, wherein the group information of the new user group further includes: a validity period; the server further includes: a first deleting unit configured to when the creation time of the new user group reaches the During the validity period, the server deletes the new user group.
  45. 根据权利要求28至44任一项所述的服务器,所述服务器还包括:第一查询单 元,被配置为:The server according to any one of claims 28 to 44, the server further comprising: a first query unit configured to:
    接收第二访问设备基于所述第二用户标识发送的查询请求;Receiving a query request sent by the second access device based on the second user identifier;
    基于所述查询请求获取所述第二用户标识对应的全部的用户组的组信息;Acquiring group information of all user groups corresponding to the second user identifier based on the query request;
    将所述已有的用户组的组信息发送至所述第二访问设备。Sending the group information of the existing user group to the second access device.
  46. 根据权利要求28至44任一项所述的服务器,所述服务器还包括:第二查询单元,被配置为:The server according to any one of claims 28 to 44, the server further comprising: a second query unit configured to:
    接收第二访问设备基于所述第二用户标识发送的查询请求;所述查询请求中携带待查询的用户组的用户组名称;Receiving a query request sent by the second access device based on the second user identifier; the query request carries the user group name of the user group to be queried;
    基于所述查询请求获取所述待查询的用户组的组信息;Acquiring the group information of the user group to be queried based on the query request;
    将所述待查询的用户组的组信息发送至所述第二访问设备。Sending the group information of the user group to be queried to the second access device.
  47. 根据权利要求28至44任一项所述的服务器,所述服务器还包括:第二删除单元,被配置为:The server according to any one of claims 28 to 44, the server further comprising: a second deleting unit configured to:
    接收第二访问设备基于所述第二用户标识发送的删除请求;Receiving a deletion request sent by the second access device based on the second user identifier;
    根据所述删除请求删除所述第二用户组对应的全部的用户组。Deleting all user groups corresponding to the second user group according to the deletion request.
  48. 根据权利要求28至44任一项所述的服务器,所述服务器还包括:第三删除单元,被配置为:The server according to any one of claims 28 to 44, the server further comprising: a third deleting unit configured to:
    接收第二访问设备基于所述第二用户标识发送的删除请求;所述删除请求携带待删除的用户组的用户组名称;Receiving a deletion request sent by the second access device based on the second user identifier; the deletion request carrying the user group name of the user group to be deleted;
    根据所述删除请求从所述第二用户组对应的至少一个用户组中删除所述待删除的用户组的组信息。Delete the group information of the user group to be deleted from at least one user group corresponding to the second user group according to the deletion request.
  49. 一种访问设备,所述访问设备包括:An access device, the access device includes:
    选择单元,被配置为确定接收的选择操作所选取的目标设备;The selection unit is configured to determine the target device selected by the received selection operation;
    第一发送单元,被配置为基于所述目标设备对应的设备标识生成访问请求,将所述访问请求发送至服务器,使得所述服务器根据至少一个用户组确定所述访问设备所述使用的第一用户标识对所述目标设备的访问权限。The first sending unit is configured to generate an access request based on the device identifier corresponding to the target device, and send the access request to a server, so that the server determines the first used device of the access device according to at least one user group. The user identifies the access authority to the target device.
  50. 根据权利要求49所述的访问设备,所述访问设备还包括:The access device according to claim 49, the access device further comprising:
    第二发送单元,被配置为将所述第一用户标识发送至使用所述第二用户标识的第二访问设备,使得所述第二访问设备基于所述第一用户标识生成更新请求,所述更新请求用于所述服务器建立新用户组,所述新用户组的组成员包括所述第一访问设备。The second sending unit is configured to send the first user identification to a second access device using the second user identification, so that the second access device generates an update request based on the first user identification, the The update request is used by the server to establish a new user group, and group members of the new user group include the first access device.
  51. 一种访问设备,所述访问设备包括:An access device, the access device includes:
    组建立单元,被配置为基于第二用户标识向服务器发送更新请求,所述更新请求用于使所述服务器生成用户组,生成的用户组用于判断使用第一用户标识的第一访问设备对目标设备的访问权限,所述第二用户标识与所述目标设备具有绑定关系。The group establishing unit is configured to send an update request to the server based on the second user identifier, the update request is used to make the server generate a user group, and the generated user group is used to determine the pair of the first access device using the first user identifier The access authority of the target device, and the second user identifier has a binding relationship with the target device.
  52. 根据权利要求51所述的访问设备,所述访问设备还包括:The access device according to claim 51, the access device further comprising:
    第一获取单元,被配置为获取新用户组的组信息,将所述新用户组的组信息携带在所述更新请求中。The first acquiring unit is configured to acquire group information of a new user group, and carry the group information of the new user group in the update request.
  53. 根据权利要求52所述的访问设备,所述访问设备还包括:第二获取单元,被配置向所述服务器查询对应所述第二用户标识的已有的用户组的组信息,将所获取的已有用户组的组信息携带在所述更新请求中。The access device according to claim 52, the access device further comprising: a second obtaining unit configured to query the server for group information of an existing user group corresponding to the second user identifier, and to obtain The group information of the existing user group is carried in the update request.
  54. 根据权利要求53所述的访问设备,所述访问设备还包括:The access device according to claim 53, the access device further comprising:
    组更新单元,被配置为当所述已有的用户组的用户组名称中包括所述新用户组的用户组名称,将所述新用户组的用户组名对应的已有用户组作为参考用户组,通过所述新用户组的组信息对所述参考用户组的组信息进行更新。The group update unit is configured to use the existing user group corresponding to the user group name of the new user group as the reference user when the user group name of the existing user group includes the user group name of the new user group Group, the group information of the reference user group is updated through the group information of the new user group.
  55. 一种服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储 器,其中,A server including a processor and a memory for storing computer programs that can run on the processor, wherein
    所述处理器用于运行所述计算机程序时,执行权利要求1至21任一项所述的访问控制方法的步骤。When the processor is used to run the computer program, it executes the steps of the access control method according to any one of claims 1 to 21.
  56. 一种访问设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,An access device includes a processor and a memory for storing a computer program that can run on the processor, wherein:
    所述处理器用于运行所述计算机程序时,执行权利要求22至23任一项所述的访问控制方法的步骤。When the processor is used to run the computer program, it executes the steps of the access control method according to any one of claims 22 to 23.
  57. 一种访问设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,An access device includes a processor and a memory for storing a computer program that can run on the processor, wherein:
    所述处理器用于运行所述计算机程序时,执行权利要求24至27任一项所述的访问控制方法的步骤。When the processor is used to run the computer program, it executes the steps of the access control method according to any one of claims 24 to 27.
  58. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求1至21任一项所述的访问控制方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the access control method according to any one of claims 1 to 21 is implemented.
  59. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求22至23任一项所述的访问控制方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the access control method according to any one of claims 22 to 23 is implemented.
  60. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求24至27任一项所述的访问控制方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the access control method according to any one of claims 24 to 27 is implemented.
PCT/CN2019/091410 2019-06-14 2019-06-14 Method and apparatus for access control, and storage medium WO2020248284A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201980079278.3A CN113169970B (en) 2019-06-14 2019-06-14 Access control method, device and storage medium
CN202311284666.XA CN117336053A (en) 2019-06-14 2019-06-14 Access control method, device and storage medium
PCT/CN2019/091410 WO2020248284A1 (en) 2019-06-14 2019-06-14 Method and apparatus for access control, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/091410 WO2020248284A1 (en) 2019-06-14 2019-06-14 Method and apparatus for access control, and storage medium

Publications (1)

Publication Number Publication Date
WO2020248284A1 true WO2020248284A1 (en) 2020-12-17

Family

ID=73781922

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091410 WO2020248284A1 (en) 2019-06-14 2019-06-14 Method and apparatus for access control, and storage medium

Country Status (2)

Country Link
CN (2) CN117336053A (en)
WO (1) WO2020248284A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596092A (en) * 2021-06-28 2021-11-02 青岛海尔科技有限公司 Sharing method and system controlled by device cloud, intelligent device and storage medium
CN113630447A (en) * 2021-07-22 2021-11-09 济南浪潮数据技术有限公司 Web-based cloud service providing method, system and storage medium
CN113839949A (en) * 2021-09-26 2021-12-24 锐捷网络股份有限公司 Access right management and control system, method, chip and electronic equipment
CN114172687A (en) * 2021-11-03 2022-03-11 杭州涂鸦信息技术有限公司 Cloud connection method, method for auxiliary equipment to be connected with cloud and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309766B (en) * 2022-10-12 2023-03-24 北京奥星贝斯科技有限公司 Method and device for executing database service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170409A (en) * 2006-10-24 2008-04-30 华为技术有限公司 Method, system, service device and certification server for realizing device access control
CN103618706A (en) * 2013-11-19 2014-03-05 深圳Tcl新技术有限公司 Control system and method for mutual access of intelligent devices
CN105721420A (en) * 2015-12-11 2016-06-29 中国地质调查局发展研究中心 Access authority control method and reverse agent server
CN106385397A (en) * 2015-07-31 2017-02-08 腾讯科技(深圳)有限公司 Network access equipment access control and type configuration method and apparatus thereof

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8855067B2 (en) * 2010-04-02 2014-10-07 Marvell World Trade Ltd. Multi-user communication group management and signaling
CN102238656A (en) * 2010-04-28 2011-11-09 北京三星通信技术研究有限公司 Switching method for mobile communication system
CN101957774B (en) * 2010-09-21 2013-12-25 用友软件股份有限公司 Service operation modeling method and device
CA2881644C (en) * 2014-03-31 2023-01-24 Smart Technologies Ulc Defining a user group during an initial session
CN107786621B (en) * 2016-08-31 2020-10-16 阿里巴巴集团控股有限公司 User information management method, access processing method, device and system
CN107508892A (en) * 2017-08-29 2017-12-22 努比亚技术有限公司 A kind of page access method, server and computer-readable recording medium
CN109788005A (en) * 2017-11-10 2019-05-21 中兴通讯股份有限公司 Equipment control authority sharing method, device, system and computer storage medium
CN107995215B (en) * 2017-12-20 2020-09-01 青岛海信智慧家居系统股份有限公司 Control method and device of intelligent household equipment and cloud platform server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170409A (en) * 2006-10-24 2008-04-30 华为技术有限公司 Method, system, service device and certification server for realizing device access control
CN103618706A (en) * 2013-11-19 2014-03-05 深圳Tcl新技术有限公司 Control system and method for mutual access of intelligent devices
US20160072821A1 (en) * 2013-11-19 2016-03-10 Max Wu System and method for controlling mutual access of smart devices
CN106385397A (en) * 2015-07-31 2017-02-08 腾讯科技(深圳)有限公司 Network access equipment access control and type configuration method and apparatus thereof
CN105721420A (en) * 2015-12-11 2016-06-29 中国地质调查局发展研究中心 Access authority control method and reverse agent server

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596092A (en) * 2021-06-28 2021-11-02 青岛海尔科技有限公司 Sharing method and system controlled by device cloud, intelligent device and storage medium
CN113630447A (en) * 2021-07-22 2021-11-09 济南浪潮数据技术有限公司 Web-based cloud service providing method, system and storage medium
CN113630447B (en) * 2021-07-22 2023-04-07 济南浪潮数据技术有限公司 Web-based cloud service providing method, system and storage medium
CN113839949A (en) * 2021-09-26 2021-12-24 锐捷网络股份有限公司 Access right management and control system, method, chip and electronic equipment
CN113839949B (en) * 2021-09-26 2023-10-24 锐捷网络股份有限公司 Access right management and control system, method, chip and electronic equipment
CN114172687A (en) * 2021-11-03 2022-03-11 杭州涂鸦信息技术有限公司 Cloud connection method, method for auxiliary equipment to be connected with cloud and electronic equipment

Also Published As

Publication number Publication date
CN113169970B (en) 2023-10-27
CN113169970A (en) 2021-07-23
CN117336053A (en) 2024-01-02

Similar Documents

Publication Publication Date Title
WO2020248284A1 (en) Method and apparatus for access control, and storage medium
CN108140031B (en) Peer-to-peer synchronizable storage system
EP1942629B1 (en) Method and system for object-based multi-level security in a service oriented architecture
KR101962156B1 (en) Authorization processing method and apparatus
JP6355656B2 (en) Support method and system of multi-tenant function for corporate social business computing.
US8266671B2 (en) Policy-enabled aggregation of IM user communities
US10148637B2 (en) Secure authentication to provide mobile access to shared network resources
KR20160091314A (en) Method for service subscription resource-based authentication in wireless communication system
EP3226506A1 (en) Authorization processing method, device and system
TW201234904A (en) Client and server group SSO with local OpenID
WO2006084036A2 (en) System and method for providing peer-to-peer communication
WO2009133419A1 (en) Method, apparatus, and computer program product for providing a group based decentralized authorization mechanism
US11888851B2 (en) Identity proxy and access gateway
CN114363165A (en) Configuration method of electronic equipment, electronic equipment and server
CN113039745B (en) File system server, method applied to file system server, and computer-readable medium
CN112492592A (en) Authorization method under multiple NRF scenes
WO2017210914A1 (en) Method and apparatus for transmitting information
WO2021035740A1 (en) Access control method, server, access device and storage medium
JP5190922B2 (en) Community communication network and communication control method
WO2015021842A1 (en) Method and apparatus of accessing ott application and method and apparatus of pushing message by server
WO2020191639A1 (en) Communication method for device, device and storage medium
WO2017181775A1 (en) Distributed authorization management method and device
JP6920614B2 (en) Personal authentication device, personal authentication system, personal authentication program, and personal authentication method
WO2023284549A1 (en) User data management method and related device
WO2021226805A1 (en) Switching method and apparatus, and cloud platform and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19932738

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19932738

Country of ref document: EP

Kind code of ref document: A1