CN113347242B - Cross-device resource access method and device, storage medium and electronic device - Google Patents

Cross-device resource access method and device, storage medium and electronic device Download PDF

Info

Publication number
CN113347242B
CN113347242B CN202110594355.8A CN202110594355A CN113347242B CN 113347242 B CN113347242 B CN 113347242B CN 202110594355 A CN202110594355 A CN 202110594355A CN 113347242 B CN113347242 B CN 113347242B
Authority
CN
China
Prior art keywords
resource
server
access
account
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110594355.8A
Other languages
Chinese (zh)
Other versions
CN113347242A (en
Inventor
裴广涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110594355.8A priority Critical patent/CN113347242B/en
Publication of CN113347242A publication Critical patent/CN113347242A/en
Application granted granted Critical
Publication of CN113347242B publication Critical patent/CN113347242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a cross-device resource access method, a device, a storage medium and an electronic device, wherein the method comprises the following steps: the method comprises the steps of logging in an account to a server through a host application, obtaining accessible resource information authorized for the account from the server, generating a resource access request according to the accessible resource information, sending the resource access request to the server through the host application, receiving an access token returned by the server, establishing connection with a target device according to the resource identifier, and accessing resources to the target device through the access token. According to the method and the device, manual connection equipment is not needed, connection is automatically established after the resources needing to be accessed are selected, the resources are accessed quickly, and the efficiency of the resource access is effectively improved.

Description

Cross-device resource access method and device, storage medium and electronic device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for accessing a cross-device resource, a storage medium, and an electronic device.
Background
With the rapid development of internet software and hardware in recent years, electronic devices with different functions, such as mobile phones, flat panels, televisions, electronic watches, and the like, surround users. The technology for resource access among the devices can enable the connection among the devices to be tighter, and is also an important technical means for realizing the strategic goal of mutual integration of everything.
In the prior art, for cross-device sharing of resources, a general main processing flow can be summarized into the following three steps: 1. selecting files to be shared, such as pictures, documents and the like; 2. selecting a sharing mode, such as NFC, bluetooth and the like; 3. and selecting the devices to be shared from the discovered device list, and sharing after connection is established. However, the applicant finds that the existing scheme not only needs a user to manually select resources, but also needs to manually connect other devices and perform a series of authorization settings before sharing, so that the user has an obvious device separation feeling due to the complex operation, and the efficiency of resource access is greatly reduced.
Disclosure of Invention
The application provides a cross-device resource access method, a device, a storage medium and an electronic device, which can automatically establish connection after selecting a resource to be accessed, quickly access the resource and effectively improve the efficiency of resource access.
In a first aspect, an embodiment of the present application provides a cross-device resource access method, including:
performing account login to a server through a host application;
obtaining accessible resource information which authorizes the account from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with the target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
In a second aspect, an embodiment of the present application provides a cross-device resource access apparatus, including:
the login module is used for logging in an account to the server through the host application;
the generation module is used for acquiring accessible resource information which authorizes the account from the server and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier;
the sending module is used for sending the resource access request to the server through the host application and receiving an access token returned by the server;
and the access module is used for establishing connection with the target equipment according to the resource identifier and carrying out resource access to the target equipment through the access token.
In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the above cross-device resource access method.
In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions in the memory to perform the following steps:
performing account login to a server through a host application;
obtaining accessible resource information which authorizes the account from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with the target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
The cross-device resource access method provided by the embodiment of the application can perform account login to a server through a host application, acquire accessible resource information authorized by the account from the server, and generate a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier, the resource access request is sent to the server through the host application, an access token returned by the server is received, connection with a target device is established according to the resource identifier, and resource access is performed to the target device through the access token. According to the method and the device, manual connection equipment is not needed, connection is automatically established after the resources needing to be accessed are selected, the resources are accessed quickly, and the efficiency of the resource access is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a cross-device resource access method provided in an embodiment of the present application.
Fig. 2 is a schematic general structural diagram of a distributed device according to an embodiment of the present application.
Fig. 3 is another schematic flow chart of the cross-device resource access method provided in the embodiment of the present application.
Fig. 4 is a schematic diagram of a login binding process of the cross-device resource access method provided in the embodiment of the present application.
Fig. 5 is a schematic view of a connection service flow of the cross-device resource access method according to the embodiment of the present application.
Fig. 6 is a schematic structural diagram of a cross-device resource access apparatus according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of a cross-device resource access apparatus according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 9 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to herein, in several instances, as being performed by a computer, the computer performing operations including the processing of the computer by electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may be implemented in hardware.
The terms "first", "second", and "third", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but rather, some embodiments may include other steps or modules not listed or inherent to such process, method, article, or apparatus.
At present, intelligent devices are diversified, and the existing technical scheme cannot reasonably apply the advantages of distributed intelligent devices to reasonably and effectively access cross-device resources. The patent provides a cross-device resource access mode in a distributed multi-device scene.
Referring to fig. 1, fig. 1 is a schematic flowchart of a cross-device resource access method according to an embodiment of the present disclosure. The cross-device resource access method provided by the embodiment of the application is applied to the electronic device, and the specific flow can be as follows:
step 101, account login is performed to a server through a host application.
In the embodiment of the application, the current device and the target device to be accessed need to be associated through the cloud server, and the purpose of account login is to associate a plurality of devices with accounts and manage the devices in a service management center of the cloud server. In the embodiment of the present application, the cross-device resource access method is applied to distributed electronic devices, for example, a distributed system may include a plurality of electronic devices, and the plurality of electronic devices may all perform cross-device access.
Referring to fig. 2 in detail, fig. 2 is a schematic diagram of an overall structure of a distributed device according to an embodiment of the present disclosure. For example, a distributed system may include multiple electronic devices, such as device a, device B, etc., and cross-device resource access may be performed among the multiple electronic devices. The device a and the device B may be network-enabled devices such as a mobile phone, a personal computer, and a television. The equipment A and the equipment B both need account login and are managed in an account center of the cloud server, and after login is completed, the equipment A can access resources to the equipment B. In this example, the device a, that is, the party initiating the resource access, is taken as the execution subject in the embodiment of the present application.
Further, the device performs account login to the server through the host application, and the host application may be a host application on the device, where the host application refers to an application for distributed management on an operating system, and the host application may perform unified management on account login, registration, authority configuration, verification, and the like on the device. Devices that need access to the distributed service or devices that provide the capabilities of the distributed service must install a host application. After the host application is started, the user can log in the account, and the login state of the account can be synchronized in an account center of the cloud server.
And 102, obtaining accessible resource information authorized for the account number from a server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier.
In the embodiment of the present application, after the current device logs in the server, the accessible resource information authorized for the account number may be obtained. For example, after the device a and the device B log in the same account, and the device B registers and authorizes the resource with the server, the device a may obtain the resource list authorized by the device B from the server.
In an embodiment, the authorized object may be an account, and may also be a device, an application, a service, and the like. For example, a login account, an application, and a service on the device B are authorized to a current account, the accessible resource list acquired by the device a that also logs in the account through the server includes all applications and services on the device B. If the device B authorizes only one application to the current account, the device a that also logs in the account only has the application through the accessible resource list acquired by the server. If the device B only authorizes the application to the device a under the current account, only the device a logging in the account may acquire the accessible resource list, that is, the application, and other devices that also log in the account may not acquire the accessible resource list.
It should be noted that resource access authorization of devices under the same account is provided. The devices under the same account number have access rights to resources on other devices under the default condition, and the user can also configure the access rights of a certain device, application and service according to the requirement. And resource access authorization of the equipment under different accounts. Devices under different accounts are invisible under default conditions, cross-device resource access can be realized only after authorization of a user, for example, the device A logs in the account 1, the device B logs in the account 2, and the device A can realize cross-device resource access on the device B only if the resource of the account 2 is authorized to the account 1.
After the current device obtains the accessible resource list, the resource needing to be accessed can be selected from the total resources and the electronic device is operated to generate a resource access request. The resources may include file resources or application resources, and the like, where the file resources may include music, video, pictures, and the like, and the application resources may include application installation packages, application icons, application tags, and the like. The resource access request carries a resource identifier, and the resource identifier can indicate a target resource. The resource identifier may be a unique identifier stored in the server in advance and corresponding to each resource. The resources stored in the server may include, but are not limited to, file resources, application resources, and the like.
In an embodiment, the resource identifier carried in the resource access request may also be used to characterize identity information of an initiator of the resource access request. The identity information of the initiator may be attribute information of a hardware device initiating the resource access request, that is, a network address, a unique device identifier, and the like of the electronic device a, or may be a user name of the user. For example, the resource identifier carries the network address of the hardware device, i.e., the electronic device a, which requests access.
In an embodiment, after the resource access request is generated, it is further determined whether the resource requested by the user is a local resource, and if the resource is determined to be a local resource, the resource may be directly accessed and acquired from a resource system service of the current electronic device, and a result is returned and presented to the user. If the requested resource is not the local resource, the subsequent steps can be continuously executed.
In an embodiment, the local resource of the current electronic device may also be searched according to the resource identifier, and if a resource with the same resource identifier is found, the requested resource is determined to be the local resource. Furthermore, the type of the requested resource can be determined before searching, for example, the resource access request carries a resource identifier which can represent the type information of the requested resource, and then the requested resource is searched in the same local resource of the type in the electronic equipment, so that the searching efficiency can be greatly improved. For example, if the requested resource is a piece of music, the resource identifier carried in the resource access request generated for the requested resource may include song name information, and then the requested resource may be searched for in the local music of the current electronic device according to the song name information without searching for other types of resources, so that the speed of searching for the resource may be increased.
And 103, sending the resource access request to the server through the host application, and receiving an access token returned by the server.
Specifically, if the current device wants to access the service provided by the remote device, it needs to search the service from the cloud server first, and select the service that wants to access from the searched service list, and perform cross-device access. The query function of the service is provided by a host application in the device, the current device transmits a URN (Uniform Resource Name) of the service which the current device wants to access to the host application, the latter initiates a query request to a governance center of the cloud server, and the cloud server returns service information which is matched and has access right.
In an embodiment, when performing connection service on a target device to be accessed subsequently, the target device needs to perform service access permission verification on the current device, the current device obtains an access token from a cloud server authorization center through host application, and the authorization center issues the token and returns the token to the current device for subsequent use. The access token in the application is a token which is generated by a server according to information authorized by a server and used as a request of a client. After the client logs in for the first time for access, the server can generate an accesstocken and return the accesstocken and the user service related information (such as a user name or a user identifier, user gender, user province and the like) to the client. After that, when the client accesses the server, the access request of the client can carry the accesstocken without using the user name and the password again. Therefore, for the user, the access operation can be reduced, and the user experience can be improved. For the server, frequent user name and password inquiry is reduced, so that the operations of comparison and judgment and corresponding prompt are performed, the pressure of the server is reduced, and the robustness of the server is improved.
And step 104, establishing connection with the target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
In an embodiment, the resource identification may be parsed to determine an access address of the target device to be accessed. The Identifier of the target device may further include a Universal Unique Identifier (UUID). The universal unique identification code can enable all elements in the distributed system to have unique identification information, and the identification information does not need to be specified through a central control terminal. The universal unique identification code is generated based on data calculation such as the current time, a counter and a hardware identifier (generally, a MAC address of a wireless network card), can be independently created by anyone, and has a repetition probability of almost zero. Alternatively, the universal unique identifier generation algorithm may include a time-based universal unique identifier generation algorithm, a name-based generation algorithm, a Distributed Computing Environment (DCE) security-based generation algorithm, a random number-based generation algorithm, and the like. In this embodiment, the unique identifier generated by the universal unique identification code generation algorithm is set as the identification code of the device.
In an embodiment, when the connection is established with the target device, the target device may access the resource system service, and return the resource to be accessed to the sender, that is, the request device, and the request device may further store the resource as the local resource after receiving the resource.
Further, after the service connection channel is established, the client, that is, the current device, may invoke the method of the server, that is, the target device, through the channel, and on top of this, it is also necessary to add the access token information acquired from the cloud server and perform verification, so as to ensure that the invoking party has the right. The security and timeliness of the access token can be verified respectively, if the verification fails, the target device can directly refuse the resource access request of the initiator, and access error information can be returned to prompt the user. If the verification is successful, the current equipment can access the resources in a remote calling mode. The Remote invocation mode adopted in the embodiment of the application is a gRPC (Google Remote Procedure Call), the gRPC is a high-performance Remote Procedure invocation framework sourced by Google corporation, and a high-performance source-opening software framework loaded based on an HTTP 2.0 transport layer protocol provides a method for supporting multiple programming languages and configuring and managing network equipment. Because of the open source framework, two communication parties can carry out secondary development, so that the communication between the client and the server can be more concentrated on the content of a business layer, and the attention to the underlying communication realized by the gRPC framework is reduced.
As can be seen from the above, the cross-device resource access method provided in this embodiment of the present application may perform account login to a server through a host application, obtain accessible resource information authorized for the account from the server, and generate a resource access request according to the accessible resource information, where the resource access request carries a resource identifier, send the resource access request to the server through the host application, receive an access token returned by the server, establish a connection with a target device according to the resource identifier, and perform resource access to the target device through the access token. According to the method and the device, manual connection equipment is not needed, connection is automatically established after the resources needing to be accessed are selected, the resources are accessed quickly, and the efficiency of the resource access is effectively improved.
The cross-device resource access method of the present application will be further described below on the basis of the method described in the above embodiments. Referring to fig. 3, fig. 3 is another schematic flow chart of a cross-device resource access method provided in the embodiment of the present application, where the cross-device resource access method includes:
step 201, account login is performed to a server through a host application.
In the embodiment of the present application, the cross-device resource access method is applied to a distributed electronic device, for example, a distributed system may include a plurality of electronic devices, and the plurality of electronic devices may all perform cross-device access. The current device and the target device to be accessed need to be associated through a cloud server, and the purpose of account login is to associate a plurality of devices with accounts and manage the devices in a service administration center of the cloud server.
Step 202, acquiring identification codes of other devices to be bound, analyzing the identification codes through a host application to obtain device information of the devices to be bound, and binding the device information with an account so that the devices to be bound have the authority of the account.
In the embodiment of the application, for a device without a login function, the device with the login account can be bound through the device with the login account, so that the device with the login account has the same authority. Specifically, referring to fig. 4, fig. 4 is a schematic diagram illustrating a login binding process of the cross-device resource access method according to the embodiment of the present application. For a device capable of logging in, such as a mobile phone in the figure, account login can be performed to a cloud server by using an account login function, and the server can manage all logged accounts in the system through an account center. Aiming at equipment which cannot be logged in, such as a PC (personal computer) in a figure, equipment with a logged-in account is required to be bound, a specific binding method is provided by services, for example, a two-dimensional code generated by scanning the PC by using a mobile phone is used, host application in the mobile phone binds equipment information (equipment ID) obtained by scanning with the logged-in account of the mobile phone, then the equipment information is issued in a cloud server, and further the cloud server pushes an event of binding the equipment to the PC, so that the PC performs equipment binding callback.
Step 203, obtaining the service resource in the current device through the host application, registering the service resource in the server, and performing authorization setting on the service resource in the server.
In order to realize cross-device service access, relevant information of the service must be registered in a service management center of a cloud server side for management. Further, the device resource can be registered to the server through host application by the device of the login account or the device bound with other accounts. The information such as account number, service, application and the like in the device can be registered.
In an embodiment, after the account is successfully logged in, host application searches for a service configuration file of an application on the device, analyzes service information and registers the service information to a cloud server, or actively registers the service to the cloud server by the application. The service information may include an account number, a device, an application, a service type, a device IP address, and the like.
After registering the service resource in the server, authorization setting can be performed on the service resource in the server.
And 204, obtaining accessible resource information authorized for the account number from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier.
It should be noted that the target device to be accessed to the resource also registers the resource on the device after logging in the account, and sets the authorization information of the device. Therefore, the current device can obtain the accessible resource information authorized for the account number after logging in. For example, after the device a and the device B log in the same account, and the device B registers and authorizes the resource with the server, the device a may obtain the resource list authorized by the device B from the server.
After the current device obtains the accessible resource list, resources needing to be accessed can be selected from the total resources and the electronic device is operated to generate a resource access request. The resource access request carries a resource identifier, and the resource identifier can indicate a target resource. In another embodiment, the resource identifier carried in the resource access request may also be used to characterize identity information of an initiator of the resource access request.
Step 205, sending the resource access request to the server through the host application, and receiving an access token returned by the server.
Specifically, if the current device wants to access the service provided by the remote device, it needs to search the service from the cloud server first, and select the service that wants to access from the searched service list, and perform cross-device access. The query function of the service is provided by host application in the device, the host application initiates a query request to a management center of the cloud server, and the cloud server returns the matched service information with the access right.
In an embodiment, when performing a subsequent connection service on a target device to be accessed, the target device needs to perform service access permission verification on a current device, and the current device obtains an access token from a cloud server authorization center through host application.
Step 206, determining the network protocol address of the target device according to the resource identifier, calling the host application of the target device to create the port number of the target device, and establishing connection with the current device based on the network protocol address and the port number of the target device.
Step 207, sending the access token to the target device, so that the target device performs permission verification on the access token through the server.
In the embodiment of the application, the purpose of connecting the services is to implement that a client (current device) can call a service of a server (target device) across devices, so that a connection channel between the client and the target device must be established before the call, the establishment of the connection channel needs to depend on an Internet Protocol (IP) and a port number of the server, and the IP can take device information of the service when the client obtains the service information from a cloud server, and the device information includes the IP. The acquisition of the port number requires the creation after the service is started. Since the device IP and host application port number are known, the host application of the client can call the host application of the server to restart the service of the server to create the service port number. After the service is started, an access token brought by the client is taken to the cloud for verification and authentication, whether the client has authority to access or not is determined, and if the verification is passed, the client is informed that the service connection is successful.
And step 208, receiving the authority verification result returned by the target equipment, and if the authority verification result is verified to be passed, performing resource access to the target equipment based on remote process call.
The security and timeliness of the access token can be verified respectively, and if the verification fails, the server side can directly refuse the resource access request of the initiator and can return access error information to prompt the user. If the verification is successful, the client can access the resources in a remote calling mode. Among other things, embodiments of the present application enable programs to utilize other programs or computer-processed processes through remote procedure calls. Client/server mode computing combines remote procedure calls with other technologies (e.g., messaging) as a mechanism for intersystem communication.
Therefore, after the connection with the target device is established, the target device can access the resource system service and return the resource to be accessed to the sender, that is, the request device, and the request device can further store the resource as the local resource after receiving the resource.
For example, referring to fig. 5, fig. 5 is a schematic view illustrating a connection service flow of the cross-device resource access method according to the embodiment of the present application. After the non-login device (PC) and the login device (mobile phone) are both online, the PC can register the service resource in the server through host application and perform authorization setting on the service resource in the server. And then, when the server is queried, the service list corresponding to the current account can be queried, namely, the accessible resource information authorized for the account is obtained. When resource access is subsequently carried out, a service needing to be accessed can be selected through the operation of a user, the device needs to acquire an access token from a cloud server authorization center through host application, a connection channel can be established through a network protocol and a port number after the access token is issued, the access token is sent to the target device through the channel after the establishment is successful, verification is carried out, and if the verification is passed, the resource access can be carried out on the target device.
Through the scheme provided by the embodiment of the application, cross-device service access under the same account can be realized. For example, both device a (mobile phone) and device B (TV) log in the same account, and the devices a and B can access services on the other device, such as playing a song or video on the device a through the device B, and can play the song or video without transmitting a file through bluetooth or WiFi. In addition, cross-account and cross-device service access can be realized. For example, device a (cell phone) and device B (TV) are each logged into a different account, and device a can access the services of device B, authorized by the user of device B. The authorized object may be an account, device, application, service, etc.
Furthermore, the single sign-on method of the single device can be realized through the method, for example, after one APP on the current device logs in the account, cross-device service access can be realized without repeatedly logging in the account by other APPs. In addition, a cross-device single sign-on method can be realized, so that cross-device service calling can be realized after devices which cannot log in the account are bound by devices of other loginable accounts. For example, the device a (mobile phone) has an account login function, the device B (PC) does not have an account login function, and after the device a logs in an account, the device B can be bound to the same account by scanning a two-dimensional code and the like, so that the devices a and B can access services on the other device. The method provided by the user can also realize that the authorization service is customized by the terminal user, and the user can customize the terminal APP and the service of the equipment accessing other equipment.
As can be seen from the above, the cross-device resource access method provided in this embodiment of the present application may perform account login to a server through a host application, obtain identification codes of other devices to be bound, obtain device information of the devices to be bound through analysis of the identification codes by the host application, bind the device information with the account, so that the devices to be bound have the authority of the account, obtain a service resource in a current device through the host application, register the service resource in the server, perform authorization setting on the service resource in the server, obtain accessible resource information authorized by the account from the server, generate a resource access request according to the accessible resource information, where the resource access request carries a resource identifier, send the resource access request to the server through the host application, receive an access token returned by the server, determine a network protocol address of a target device according to the resource identifier, call a host application of the target device to create a port number of the target device, establish a connection with the current device based on the network protocol address and the port number of the target device, send the access token to the target device, so that the target device performs verification on the access token, receive a verification result returned by the network protocol address and perform a remote verification process based on the target device.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a cross-device resource access apparatus according to an embodiment of the present disclosure. Wherein the cross-device resource access apparatus 30 includes:
a login module 301, configured to perform account login to a server through a host application;
a generating module 302, configured to obtain accessible resource information that authorizes the account from the server, and generate a resource access request according to the accessible resource information, where the resource access request carries a resource identifier;
a sending module 303, configured to send the resource access request to the server through the host application, and receive an access token returned by the server;
and the access module 304 is configured to establish a connection with a target device according to the resource identifier, and perform resource access to the target device through the access token.
In an embodiment, please refer to fig. 7, wherein the cross-device resource access apparatus 30 may further include:
a first obtaining module 305, configured to obtain identification codes of other devices to be bound after the login module 301 performs account login to a server through a host application;
the binding module 306 is configured to analyze the identifier code through a host application to obtain device information of the device to be bound, and bind the device information and the account, so that the device to be bound has the authority of the account.
In an embodiment, the cross-device resource access apparatus 30 may further include:
a second obtaining module 307, configured to obtain, by a host application, a service resource in a current device after the login module 301 performs account login to a server through the host application;
a registering module 308, configured to register the service resource in the server, and perform authorization setting on the service resource in the server.
In an embodiment, the access module 304 is specifically configured to determine a network protocol address of the target device according to the resource identifier; invoking a host application of the target device to create a port number of the target device; and establishing connection with the current equipment based on the network protocol address and the port number of the target equipment.
In an embodiment, the access module 304 is further specifically configured to send the access token to the target device, so that the target device performs permission check on the access token through the server; receiving an authority verification result returned by the target equipment; and if the permission verification result is that the permission verification is passed, performing resource access to the target equipment based on remote process call.
As can be seen from the above, the cross-device resource access apparatus 30 according to the embodiment of the present application may perform account login to a server through a host application, acquire accessible resource information authorized for the account from the server, and generate a resource access request according to the accessible resource information, where the resource access request carries a resource identifier, send the resource access request to the server through the host application, receive an access token returned by the server, establish connection with a target device according to the resource identifier, and perform resource access to the target device through the access token. According to the method and the device, manual connection equipment is not needed, connection is automatically established after the resources needing to be accessed are selected, the resources are accessed quickly, and the efficiency of the resource access is effectively improved.
In the embodiment of the present application, the cross-device resource access apparatus and the cross-device resource access method in the above embodiments belong to the same concept, and any method provided in the cross-device resource access method embodiment may be run on the cross-device resource access apparatus, and a specific implementation process thereof is detailed in the embodiment of the cross-device resource access method, and is not described herein again.
The term "module" as used herein may be considered a software object executing on the computing system. The different components, modules, engines, and services described herein may be considered as implementation objects on the computing system. The apparatus and method described herein may be implemented in software, but may also be implemented in hardware, and are within the scope of the present application.
An embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the above cross-device resource access method.
The embodiment of the application also provides an electronic device, such as a tablet computer, a mobile phone and the like. The processor in the electronic device loads instructions corresponding to processes of one or more application programs into the memory according to the following steps, and the processor runs the application programs stored in the memory, so that various functions are realized:
performing account login to a server through a host application;
obtaining accessible resource information which authorizes the account from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 8, the electronic device 400 includes a processor 401 and a memory 402. The processor 401 is electrically connected to the memory 402.
The processor 400 is a control center of the electronic device 400, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 400 by running or loading a computer program stored in the memory 402 and calling data stored in the memory 402, and processes the data, thereby monitoring the electronic device 400 as a whole.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the computer programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
In this embodiment, the processor 401 in the electronic device 400 loads instructions corresponding to one or more processes of the computer program into the memory 402 according to the following steps, and the processor 401 runs the computer program stored in the memory 402, so as to implement various functions, as follows:
performing account login to a server through a host application;
obtaining accessible resource information which authorizes the account from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
Referring to fig. 9, in some embodiments, the electronic device 400 may further include: a display 403, radio frequency circuitry 404, audio circuitry 405, and a power supply 406. The display 403, the rf circuit 404, the audio circuit 405, and the power source 406 are electrically connected to the processor 401.
The display 403 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 403 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The rf circuit 404 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices through wireless communication, and for transceiving signals with the network device or other electronic devices. In general, radio frequency circuit 501 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
The audio circuit 405 may be used to provide an audio interface between the user and the electronic device through a speaker, microphone. The audio circuit 506 may convert the received audio data into an electrical signal, transmit the electrical signal to a speaker, and convert the electrical signal to an audio signal for output by the speaker.
The power supply 406 may be used to power various components of the electronic device 400. In some embodiments, power supply 406 may be logically coupled to processor 401 via a power management system, such that functions to manage charging, discharging, and power consumption management are performed via the power management system. The power supply 406 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 9, the electronic device 400 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the cross-device resource access method in the embodiment of the present application, it may be understood by a person of ordinary skill in the art that all or part of a process of implementing the cross-device resource access method in the embodiment of the present application may be implemented by controlling related hardware through a computer program, where the computer program may be stored in a computer-readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and the process of executing the process may include, for example, the process of implementing the cross-device resource access method. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
For the cross-device resource access apparatus in the embodiment of the present application, each functional module may be integrated in one processing chip, or each module may exist alone physically, or two or more modules are integrated in one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk.
The method, the apparatus, the storage medium, and the electronic device for accessing a cross-device resource provided by the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (8)

1. A cross-device resource access method is applied to distributed electronic devices, wherein the distributed electronic devices comprise a plurality of electronic devices, and the electronic devices perform cross-device access in an account login mode, and the method comprises the following steps:
performing account login to a server through a host application;
acquiring identification codes of other devices to be bound;
analyzing the identification code through a host application to obtain equipment information of the equipment to be bound, and binding the equipment information with the account so that the equipment to be bound has the authority of the account;
obtaining accessible resource information which authorizes the account number from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier, and the electronic devices logging in the same account number have access rights of the accessible resource information;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with the target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
2. The cross-device resource access method of claim 1, wherein after an account login to a server by a host application, the method further comprises:
acquiring service resources in the current equipment through the host application;
and sending the service resource to the server for registration, and performing authorization setting on the service resource.
3. The cross-device resource access method according to claim 1, wherein the step of establishing a connection with a target device according to the resource identifier comprises:
determining a network protocol address of the target equipment according to the resource identifier;
invoking a host application of the target device to create a port number of the target device;
and establishing connection with the current equipment based on the network protocol address and the port number of the target equipment.
4. The cross-device resource access method of claim 1, wherein the step of accessing the resource to the target device through the access token comprises:
sending the access token to the target device so that the target device can perform authority verification on the access token through the server;
receiving an authority verification result returned by the target equipment;
and if the permission verification result is that the permission passes the verification, performing resource access to the target equipment based on remote process call.
5. A cross-device resource access device is applied to distributed electronic equipment, wherein the distributed electronic equipment comprises a plurality of electronic devices, and the electronic devices perform cross-device access in an account login mode, and the device comprises:
the login module is used for performing account login to the server through the host application;
the first acquisition module is used for acquiring identification codes of other devices to be bound after the login module logs in an account to the server through the host application;
the binding module is used for analyzing the identification code through a host application to obtain the equipment information of the equipment to be bound, and binding the equipment information with the account number to enable the equipment to be bound to have the authority of the account number;
the generation module is used for acquiring accessible resource information which authorizes the account number from the server and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier, the electronic equipment logging in the same account number has access authority of the accessible resource information;
the sending module is used for sending the resource access request to the server through the host application and receiving an access token returned by the server;
and the access module is used for establishing connection with the target equipment according to the resource identifier and carrying out resource access to the target equipment through the access token.
6. The cross-device resource access apparatus of claim 5, further comprising:
the second acquisition module is used for acquiring service resources in the current equipment through the host application after the login module logs in an account to the server through the host application;
and the registration module is used for sending the service resources to the server for registration and carrying out authorization setting on the service resources.
7. A storage medium having stored thereon a computer program, which, when run on a computer, causes the computer to execute the cross device resource access method of any one of claims 1 to 4.
8. An electronic device comprising a processor and a memory, wherein the memory stores a plurality of instructions, and is applied to a distributed electronic device, the distributed electronic device comprises a plurality of electronic devices, the plurality of electronic devices perform cross-device access by means of account login, and the processor loads the instructions in the memory to perform the following steps:
performing account login to a server through a host application;
acquiring identification codes of other devices to be bound;
analyzing the identification code through a host application to obtain equipment information of the equipment to be bound, and binding the equipment information with the account so that the equipment to be bound has the authority of the account;
obtaining accessible resource information which authorizes the account from the server, and generating a resource access request according to the accessible resource information, wherein the resource access request carries a resource identifier, logs in the electronic equipment with the same account, and has access authority of the accessible resource information;
sending the resource access request to the server through the host application, and receiving an access token returned by the server;
and establishing connection with the target equipment according to the resource identifier, and performing resource access to the target equipment through the access token.
CN202110594355.8A 2021-05-28 2021-05-28 Cross-device resource access method and device, storage medium and electronic device Active CN113347242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110594355.8A CN113347242B (en) 2021-05-28 2021-05-28 Cross-device resource access method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110594355.8A CN113347242B (en) 2021-05-28 2021-05-28 Cross-device resource access method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113347242A CN113347242A (en) 2021-09-03
CN113347242B true CN113347242B (en) 2023-04-18

Family

ID=77472054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110594355.8A Active CN113347242B (en) 2021-05-28 2021-05-28 Cross-device resource access method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113347242B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090975A (en) * 2021-10-28 2022-02-25 青岛海尔科技有限公司 Cloud database resource processing method and device, electronic equipment and storage medium
CN114222003A (en) * 2021-12-06 2022-03-22 Oppo广东移动通信有限公司 Service calling method, system, device, equipment and storage medium
CN114697075A (en) * 2022-02-24 2022-07-01 智己汽车科技有限公司 Resource allocation method and device, server and storage medium
CN114884668B (en) * 2022-03-17 2024-09-10 阿里巴巴(中国)有限公司 Resource management method and computer readable storage medium
CN115412347A (en) * 2022-08-31 2022-11-29 建信金融科技有限责任公司 Device login method, device and storage medium
WO2024102385A1 (en) * 2022-11-09 2024-05-16 Mastercard International Incorporated Systems and methods for use in securing open service connections
CN116233215B (en) * 2023-05-06 2023-08-08 杭州筋斗腾云科技有限公司 Processing method for secure access and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777699A (en) * 2018-04-13 2018-11-09 西安电子科技大学 A kind of application cross-domain access method under the domain collaborative multi framework based on Internet of Things

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102142143B1 (en) * 2013-08-20 2020-08-06 삼성전자주식회사 System, apparaus and method for sharing electronic device
EP3047626B1 (en) * 2013-09-20 2017-10-25 Oracle International Corporation Multiple resource servers with single, flexible, pluggable oauth server and oauth-protected restful oauth consent management service, and mobile application single sign on oauth service
CN107567009B (en) * 2017-09-28 2020-04-10 北京地平线机器人技术研发有限公司 Bluetooth device sharing request and control method and device, and computer storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108777699A (en) * 2018-04-13 2018-11-09 西安电子科技大学 A kind of application cross-domain access method under the domain collaborative multi framework based on Internet of Things

Also Published As

Publication number Publication date
CN113347242A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
CN113347242B (en) Cross-device resource access method and device, storage medium and electronic device
US10257183B2 (en) Method and apparatus for identity federation gateway
US11064569B2 (en) Network sharing method, network accessing method and system
CN110869907B (en) Method and terminal for browsing application page
CN108293181B (en) Processing method for binding communication identifier and terminal
CN107784221B (en) Authority control method, service providing method, device and system and electronic equipment
KR20110008272A (en) Methods, apparatuses, and computer program products for providing a single service sign-on
EP2771803A1 (en) File fetch from a remote client device
WO2018000370A1 (en) Mobile terminal authentication method and mobile terminal
US10694381B1 (en) System and method for authentication and sharing of subscriber data
US20230100148A1 (en) Electronic device for performing edge computing service, and operating method of electronic device
WO2022143130A1 (en) Application program login method and system
CN112585981A (en) Method for content playback with continuity and electronic device thereof
CN112380552A (en) Data processing method and device, storage medium and computer equipment
US11947640B2 (en) Adaptive, multi-channel, embedded application programming interface (API)
EP4310693A1 (en) Evaluating the quality of integrations for executing searches using application programming interfaces
CN113242314B (en) Cross-terminal resource access method and device, storage medium and electronic equipment
WO2019161600A1 (en) Method, device, server and medium for adding member to community
CN115412920A (en) Internet of things equipment binding system, method and device and electronic equipment
CN110765445B (en) Method and device for processing request
KR102072003B1 (en) Method and device for resource sharing between devices
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
CN115550415B (en) Device connection method and electronic device
CN117278323B (en) Third party information acquisition method, electronic equipment and readable storage medium
US20240323186A1 (en) Integrated system, interface calling method, authentication method, and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant