WO2017129016A1 - 一种资源访问方法、装置及*** - Google Patents

一种资源访问方法、装置及*** Download PDF

Info

Publication number
WO2017129016A1
WO2017129016A1 PCT/CN2017/071556 CN2017071556W WO2017129016A1 WO 2017129016 A1 WO2017129016 A1 WO 2017129016A1 CN 2017071556 W CN2017071556 W CN 2017071556W WO 2017129016 A1 WO2017129016 A1 WO 2017129016A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
target resource
type
target
domain
Prior art date
Application number
PCT/CN2017/071556
Other languages
English (en)
French (fr)
Inventor
吴凤元
李宁
贾香宏
Original Assignee
阿里巴巴集团控股有限公司
吴凤元
李宁
贾香宏
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 阿里巴巴集团控股有限公司, 吴凤元, 李宁, 贾香宏 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017129016A1 publication Critical patent/WO2017129016A1/zh
Priority to US16/041,356 priority Critical patent/US20190089810A1/en

Links

Images

Classifications

    • 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
    • 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
    • H04L67/63Routing a service request depending on the request content or context
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6236Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database between heterogeneous systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • 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
    • H04L63/101Access control lists [ACL]
    • 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
    • H04L63/102Entity profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a resource access method, apparatus, and system.
  • resource access based on Internet applications usually needs to carry the absolute path of the target resource in the resource access request to achieve access to the resource.
  • the resource storage structure of the Internet application is usually complicated, the directory hierarchy is large, and the absolute path of the resource is usually long, which is not conducive to resource access. For example, it is easy to cause resource access failure due to path error, and if the resource storage structure changes, It is easy to affect the access of resources due to the error of the absolute path.
  • the embodiment of the present application provides a resource access method, device, and system.
  • the identifier of the target resource includes indication information of a target resource type, where the type of the resource includes:
  • the first type is used to indicate that the resource is stored in an external memory
  • the second type is used to indicate that the resource is not stored in the external memory, and the resource is the resource of the application itself;
  • the third type is used to indicate that the resource is not stored in the external memory, and the resource is an application runtime resource.
  • the identifier of the target resource includes: a resource type domain, where the resource type domain includes a first field and a second field;
  • the second field is empty; otherwise, the value of the second field indicates that the type of the target resource is the second Type or third type.
  • generating the absolute path of the target resource according to the type of the target resource and the relative path including:
  • the indication information of the target resource type indicates that the type of the target resource is the first type, generating the target resource in the external memory according to the resource storage structure in the external storage and the relative path of the target resource.
  • the indication information of the target resource type indicates that the type of the target resource is the second type or the third type, generating an absolute path of the target resource locally according to the local resource storage structure and the relative path of the target resource. .
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs;
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs;
  • the indication information of the target resource type indicates that the type of the target resource is the second type, determining, according to the storage structure of the local application resource, the directory where the domain to which the target resource belongs, according to the directory and the target a relative path of the resource, generating an absolute path of the target resource locally;
  • the indication information of the target resource type indicates that the type of the target resource is the third type, determining, according to the storage structure of the local application runtime resource, the directory where the domain to which the target resource belongs, according to the directory and the A relative path of the target resource, generating an absolute path of the target resource locally.
  • the method further includes: performing legality verification on a format of the identifier of the target resource.
  • the identifier of the target resource includes indication information of a domain to which the target resource belongs, and the relative path obtained by the parsing is a path of the target resource in a domain; and/or an identifier of the target resource
  • the initiator user information of the resource access request is included.
  • the method further includes:
  • the access authority decision is performed on the resource access request.
  • the determining, according to the initiator user information of the resource access request, the indication information of the domain to which the target resource belongs, and the preset access authority decision rule, the access authority decision for the resource access request includes:
  • the accessing the target resource according to the absolute path of the target resource comprises: decrypting the target resource by using a pre-configured resource access key to obtain the decrypted target resource.
  • the method further includes the step of: initiating a resource synchronization process.
  • the resource identifier is a uniform resource identifier URI.
  • the URI includes the following information fields:
  • a resource type field configured to carry resource type indication information
  • the domain name domain is used to carry the indication information of the domain to which the resource belongs;
  • a path domain that is used to carry the path of a resource in its own domain is used to carry the path of a resource in its own domain.
  • the resource type field includes a first field and a second field. If the value of the first field indicates that the type of the target resource is the first type, the second field is empty; otherwise, the The value of the second field indicates that the type of the target resource is the second type or the third type.
  • the URI further includes one or a combination of the following information fields:
  • a user information field configured to carry information of a user who initiates a resource access request
  • a parameter field used to carry parameters is A parameter field used to carry parameters.
  • a parsing module configured to receive a resource access request, parse an identifier of the target resource carried in the resource access request, and obtain at least a type and a relative path of the target resource;
  • a generating module configured to generate an absolute path of the target resource according to the parsed information
  • an access management module configured to access the target resource according to an absolute path of the target resource.
  • the identifier of the target resource includes indication information of a target resource type, where the type of the resource includes:
  • the first type is used to indicate that the resource is stored in an external memory
  • the second type is used to indicate that the resource is not stored in the external memory, and the resource is the resource of the application itself;
  • the third type is used to indicate that the resource is not stored in the external memory, and the resource is an application runtime resource.
  • the identifier of the target resource includes: a resource type indication information field, where the resource type indication information field includes a first field and a second field;
  • the second field is empty; otherwise, the value of the second field indicates that the type of the target resource is the second Type or third type.
  • the generating module is specifically configured to:
  • the indication information of the target resource type indicates that the type of the target resource is the first type, generating the target resource in the external memory according to the resource storage structure in the external storage and the relative path of the target resource.
  • the indication information of the target resource type indicates that the type of the target resource is the second type or the third type, generating an absolute path of the target resource locally according to the local resource storage structure and the relative path of the target resource. .
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs;
  • the generating module is specifically configured to:
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs;
  • the generating module is specifically configured to:
  • the indication information of the target resource type indicates that the type of the target resource is the second type, determining, according to the storage structure of the local application resource, the directory where the domain to which the target resource belongs, according to the directory and the target The relative path of the resource, generating the target The absolute path of the resource locally;
  • the indication information of the target resource type indicates that the type of the target resource is the third type, determining, according to the storage structure of the local application runtime resource, the directory where the domain to which the target resource belongs, according to the directory and the A relative path of the target resource, generating an absolute path of the target resource locally.
  • the parsing module is further configured to perform legality verification on the format of the identifier of the target resource before parsing the identifier of the target resource.
  • the identifier of the target resource includes indication information of a domain to which the target resource belongs, and the relative path obtained by the parsing is a path of the target resource in a domain; and/or an identifier of the target resource
  • the initiator user information of the resource access request is included.
  • the access management module is further configured to: before the accessing the target resource according to the absolute path of the target resource, according to the initiator user information of the resource access request and the indication information of the domain to which the target resource belongs One or more combinations, and a preset access authority decision rule, perform an access authority decision on the resource access request.
  • the access management module is specifically configured to:
  • the access management module is specifically configured to: decrypt the target resource by using a pre-configured resource access key to obtain the decrypted target resource.
  • the access management module is further configured to: initiate a resource synchronization process if the access fails when accessing the target resource according to the absolute path of the target resource.
  • the resource identifier is a uniform resource identifier URI.
  • the URI includes the following information fields:
  • a resource type field configured to carry resource type indication information
  • the domain name domain is used to carry the indication information of the domain to which the resource belongs;
  • a path domain that is used to carry the path of a resource in its own domain is used to carry the path of a resource in its own domain.
  • the resource type field includes a first field and a second field. If the value of the first field indicates that the type of the target resource is the first type, the second field is empty; otherwise, the The value of the second field indicates that the type of the target resource is the second type or the third type.
  • the URI further includes one or a combination of the following information fields:
  • a user information field configured to carry information of a user who initiates a resource access request
  • a parameter field used to carry parameters is A parameter field used to carry parameters.
  • a memory for storing computer program instructions
  • a processor coupled to the memory for reading computer program instructions stored by the memory and, in response, performing the following operations:
  • the target resource identifier in the resource access request includes a relative path instead of an absolute path, and the relative path and the type of the target resource are obtained by parsing the target resource identifier, and the target is generated according to the parsed information.
  • the absolute path of the resource thereby accessing the target resource based on the absolute path. Since the target resource identifier does not need to carry an absolute path, the problem caused by the absolute path that needs to carry the target resource in the resource access request in the prior art is overcome.
  • FIG. 1 is a schematic structural diagram of a resource access system according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a resource access process according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • resources refer to data and resources of an application (English as Application).
  • the data includes static data and runtime data.
  • the resources may be local services (such as local system services or custom services), or It is a remote service (such as a cloud service).
  • the resources include the resources of the application itself and the resources of the application runtime.
  • the resources of the application itself may refer to the code of the application itself, such as the decompressed data of the application; the application runtime
  • the resource refers to the resource generated by the application runtime, such as the data processing result.
  • Page is called a service component, which is an abstraction of local services and remote services, that is, the basic unit of services. By encapsulating data and methods, various services can be provided.
  • a service scene can include multiple Pages.
  • a Page can be a UI (user interface), a photo or other service, or a background service, such as account authentication.
  • the running state Page is called the Page instance. It is the running carrier of the local service or the remote service. It can be created, scheduled, and managed by the DPMS (Dynamic Page Manager Service). The DPMS can maintain the life cycle of the Page instance.
  • DPMS Dynamic Page Manager Service
  • Each Page can be uniquely identified in YunOS, for example, a URI (Uniform Resource Identifier) can be used to identify the Page.
  • a URI can be understood as an address link by which a corresponding Page can be uniquely determined.
  • the URI assigned to the Page may optionally include related information of the service, such as a service name, a service content, a service provider, and the like.
  • Pages can interact with the user through the UI to provide services.
  • domain can be understood as a logical grouping of applications. Partitioning of domains facilitates privilege isolation and other administrative configuration operations.
  • a resource identifier format is defined in the embodiment of the present application.
  • the defined resource identifier format includes a path domain for carrying a relative path of the resource, and more specifically, the relative path refers to a path of the resource in the domain to which it belongs.
  • the defined resource identifier may further include a resource type field, which is used to carry indication information of the resource type, where the resource type is defined from the perspective of resource storage.
  • the resources stored in the external memory in the terminal belong to a type of resource, such as an external memory stored in the terminal, that is, a SIM (Subscriber Identity Module) card.
  • SIM Subscriber Identity Module
  • Resources (such as the cloud).
  • the SD card of the terminal usually only stores the runtime resources of the application, and the SIM card of the terminal can store the resources of the application itself and the resources of the runtime, and the resources and runtime resources of the application itself are usually Stored in a different directory.
  • the resource type may be further extended.
  • the type of the resource may include three types, namely, the first type and the second type. Type and third type:
  • the first type used to indicate that the resource is stored in an external memory
  • the second type is used to indicate that the resource is not stored in the external memory, such as stored locally, such as not stored in the external memory and stored in the SIM card, and the resource is a resource of the application itself, for example, after the application installation package is decompressed resource of;
  • the third type is used to indicate that the resource is not stored in the external memory, such as stored locally, such as not stored in the external memory and stored in the SIM card, and the resource is used by the application.
  • Line-time resources such as resources generated at runtime.
  • resource types can also include:
  • the fourth type is used to indicate that resources are stored on the network side (such as the cloud).
  • the resource type field may be defined in the resource identifier in the embodiment of the present application, and the three resource types are distinguished by different values.
  • the resource type field may be one field or multiple fields.
  • two resource identifier fields are included: a first field (hereinafter referred to as a "scheme” field) and a second field (below) Called the "subscheme” field). If the resource type is the first type, the value of the "scheme" field is "file".
  • the "subscheme” field is not required or the value of the "subscheme” field is null (empty); if the resource type is the second type For the type or the third type, the value of the "scheme” field is further defined by the value of the "subscheme” segment. Specifically, if the resource type is the second type, the "subscheme” field is used. The value of the subscheme field is "data”. If the resource type is the third type, the value of the subscheme field is "data”. Further, the value of the "scheme” field may also be "http” or "https", indicating that the resource stored on the network side, such as the resource in the cloud, is accessed.
  • the storage structure of the resource is set by the domain to which the resource belongs.
  • the resources belonging to the same domain are saved in the same directory, and the resources belonging to different domains are saved in different directories.
  • the resource identifier format defined by the embodiment of the present application may further include an information domain of the domain to which the resource belongs, and the indicator information of the domain to which the resource belongs may be, for example, a domain name.
  • the resource identification format defined in the embodiment of the present application may further include a user information field, which is used to carry user information, such as a user name, to indicate an application user.
  • user information field which is used to carry user information, such as a user name, to indicate an application user.
  • the user information included in the identifier of the requested target resource is the user information of the login user. For example, it can be the user name when the user logs in.
  • the resource identification format defined in the embodiment of the present application may further include a parameter.
  • the various information fields in the foregoing resource identifiers are pre-arranged in the location of the resource identifiers, which is not limited in this embodiment of the present application.
  • the embodiment of the present application uses a URI (Uniform Resource Identifier) to identify the resource.
  • the URI format conforms to the H5 protocol and is compatible with w3c HTTP (HyperText Transfer Protocol) and HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) protocols.
  • the format of a resource URI is exemplarily shown below:
  • the scheme field is a resource type field and is used to carry resource type indication information. This information field is mandatory. The value of this information field is page or file. If the value of the scheme field is file, the resource is of the first type. If the value of the scheme field is page, the type of the resource needs to be further determined according to the value of the subscheme field. The value of the scheme field can also be "http" or "https", indicating that the accessed resource is a cloud resource.
  • Subscheme field An extended resource type field used to carry extended indication information of a resource type. This information field is optional.
  • the URI does not include the subscheme field, or the value of the subscheme field is Null.
  • the URI includes the subscheme field.
  • the value of the subscheme field can be either asset or data. If the value of the subscheme field is asset, the resource is the resource of the application itself. If the value of the subscheme field is data, the resource is the running time of the application. Resources.
  • Username field information used to carry the user who initiated the resource access request, such as the username;
  • Domain indicates the information of the domain to which the resource belongs, such as the domain name.
  • Path field used to carry the path of the resource in its domain, that is, the relative path; the path can also contain "asset” or "data”, where the asset or data represents the structure of the relative path, such as the primary directory;
  • Param field used to carry parameters that need to be passed.
  • FIG. 1 is a schematic structural diagram of a resource access system according to an embodiment of the present application.
  • the system can be implemented on the terminal side, specifically by software, or by a combination of software and hardware. Specifically, the system can be implemented based on C++, node.js, js, and the like.
  • the resource access system 100 can include a parsing module 10, a generating module 20, and an access management module 30.
  • the parsing module 10 mainly provides resource identifier resolution capabilities, such as URIs for parsing resources; the generating module 20 mainly provides a function of generating an absolute path according to a relative path; and the access management module 30 mainly provides resource access and management capabilities.
  • the resource management capability of the access management module 30 may be implemented by managing a directory of resources, such as creating, modifying, or deleting a resource directory, and copying resources to different directories.
  • the parsing module 10 is configured to receive the resource access request, parse the identifier of the target resource carried in the resource access request, and obtain at least the type and relative path of the target resource; The information generates an absolute path of the target resource; the access management module 30 is configured to access the target resource according to the absolute path of the target resource. Further, after accessing the obtained resource, the access management module 30 may provide the obtained resource to the browser engine (Browser Engine) for page re-layout rendering refresh display.
  • the browser engine Bitser Engine
  • the access management module 30 can implement access operations such as opening, closing, reading and writing of resources based on the basic class library.
  • the base class library can be implemented based on a POSIX (Portable Operating System Interface) file.
  • POSIX Portable Operating System Interface
  • the POSIX standard defines the interface standard that the operating system should provide for applications.
  • the network service module 40 may be further included in the resource access system.
  • the access management module 30 fails to access the resource (if the target resource is not found)
  • the resource synchronization process is initiated by the network service module 40.
  • the network service module 40 can interact with the remote server to synchronize and update resources with the remote server through protocols such as HTTP or HTTPS.
  • FIG. 2 exemplarily shows the resource access procedure provided by the embodiment of the present application.
  • FIG. 2 is a schematic diagram of a resource access process provided by an embodiment of the present application.
  • the process can be implemented by the resource access system described above. As shown, the process can include the following steps:
  • Step 201 Receive a resource access request, where the resource access request carries an identifier of a target resource that is requested to be accessed.
  • the resource access request can be initiated by an application (such as an internet application).
  • the resource access request carries an identifier of the target resource that requests access, such as a URI of the target resource, and the format of the URI may be as described in the foregoing embodiment.
  • the resource access request may further carry operation type information, where the operation type includes, but is not limited to, one or more combinations of operations such as adding, modifying, deleting, and querying.
  • Step 202 Parse the identifier of the target resource, and at least obtain the type and relative path of the target resource. This step can be performed by the parsing module 10 in the resource access system 100.
  • the resource identifier includes at least the resource type indication information and the relative path, and thus the parsed information includes at least the type and relative path of the target resource. If the resource identifier further includes other information, such as one or more of a domain name of the domain to which the resource belongs, a user name, a parameter, and the like of the user who initiated the resource access request, the parsed information also includes the content included in the foregoing.
  • the format of the identifier of the target resource may be first verified. If the verification succeeds, the identifier of the target resource may be parsed and the subsequent steps may be performed. Otherwise, Indicates that the identifier of the target resource is an illegal identifier, and refuses to parse it, thereby refusing to respond to the resource access request.
  • the resource identifier uses a URI
  • the URI is formatted according to the rules defined above.
  • Step 203 Generate an absolute path of the target resource according to the parsed information. This step The execution may be performed by the generation module 20 in the resource access system 100.
  • Case 1 If the indication information of the target resource type indicates that the type of the target resource is the first type, the absolute storage of the target resource in the external storage may be generated according to the resource storage structure in the external storage and the relative path of the target resource. path.
  • the directory where the domain to which the target resource belongs may be determined according to the resource storage structure in the external storage, according to the directory and the target resource.
  • the relative path generates an absolute path of the target resource in the external memory.
  • the URI of the target resource carried in the resource access request is:
  • the directory where the resources of the tv.yunos.com domain in the terminal SD card are located is:
  • an absolute path of the target resource in the SD card is generated as follows:
  • the indication information of the target resource type indicates that the type of the target resource is the second type, determining a directory where the domain to which the target resource belongs according to the storage structure of the local application itself resource, according to the a directory and a relative path of the target resource, generating an absolute path of the target resource locally; if the indication information of the target resource type indicates that the type of the target resource is the third type, determining according to a storage structure of the local application runtime resource The directory where the target resource belongs is generated according to the directory and the relative path of the target resource, and the absolute path of the target resource locally is generated.
  • the URI of the target resource carried in the resource access request is:
  • the directory where the decompressed resources of the application of the tv.yunos.com domain in the terminal SIM card are located is:
  • the URI of the target resource carried in the resource access request is:
  • the directory where the application running resource of the tv.yunos.com domain in the terminal SIM card is located is:
  • Case 3 If the indication information of the target resource type indicates that the type of the target resource is the fourth type, the resource access request is sent to the network side (such as the cloud), and the resource access process may be implemented in an existing manner. Narration.
  • the resource includes a user name directory in an external storage or a local storage structure to store resources corresponding to different login users, respectively, correspondingly, when generating an absolute path of the resource, the user name to be parsed needs to be used as One of the basis for generating an absolute path to a resource.
  • the operating system supports multiple languages.
  • the storage structure of the resources is different in different language settings, or the resources of the same application are stored differently in different language settings.
  • the directory In the directory.
  • the absolute path of the target resource is generated in step 203, the current language setting needs to be considered. In the case of different language settings, the absolute path of the same target resource is different.
  • Step 204 Access the target resource according to an absolute path of the target resource. This step can be performed by the access management module 30 in the resource access system 100.
  • the DataManager JS API may be preset, and the API (Application Programming Interface) is a unified interface for accessing resources of the application itself and resources at runtime.
  • the access management module 30 can access the resources of the application itself or the resources of the application runtime through the DataManager JS API, and the DataManager JS API can be used to access the resources through the Node_DataManager.
  • Node_DataManger is an add-on implementation of the JS wrapper of the access management module 30.
  • the Data Manager JS API can be implemented directly based on the Node.js JS API, which avoids the complex and complex interface implementation of Node_DataManager, effectively multiplexes the interface of Node.js, and makes the design implementation more concise.
  • the access authority of the resource access request is determined according to a preset access permission decision rule, and if the access permission decision is passed, the resource access is performed, otherwise Refused to perform resource access.
  • the basis for making the access authority decision may include the domain to which the target resource belongs and/or the resource access request initiator user information.
  • a corresponding user list may be set in advance for different domains or different resource identifiers, and the user list may include one or more user information (such as a user name), where the user list The user has the right to access the corresponding resource (that is, the user list is a whitelisted user list), or the user in the user list does not have access to the corresponding resource (ie, the user list is a blacklisted user list).
  • the corresponding user list may be obtained according to the domain to which the target resource belongs or according to the identifier of the target resource, and the information of the user who initiated the resource access request according to the parsing may be combined and acquired.
  • the user list makes an access right decision. If the originating user belongs to the user in the list, if the user in the user list is authorized to access (that is, the user list is a whitelisted user list), the access authority verifies In the case that the user in the user list does not have access (ie, the user list is a blacklisted user list), the access authority decision does not pass.
  • the content of the above user list can also be set to "ALL" to indicate that the resource can be accessed by all users, or set to "NULL” to indicate that the resource cannot be used by the user. access.
  • a corresponding resource list may be set in advance for different users, where the resource list may include a URI of one or more resources and/or a domain to which the resource belongs, where the resource list
  • the resource can be accessed by the corresponding user (ie, the resource list is a whitelist resource list) or cannot be accessed by the corresponding user (ie, the resource list is a blacklist resource list).
  • the corresponding resource list may be obtained according to the information of the resource access request initiator user, according to the URI of the target resource or the domain to which the target resource is parsed, and combined with the obtained domain.
  • the resource list is subjected to an access authority decision.
  • the access permission decision is passed. In the case where the resource in the resource list has no right to be accessed (ie, the resource list is a blacklist resource list), the access authority decision does not pass.
  • the content of the above resource list may also be set to "ALL" to indicate that the user has access to all resources, or is set to "NULL" to indicate that the user has no access to all resources.
  • the resource access key may be pre-configured, and the stored resource is first encrypted and then stored.
  • the corresponding key is used for the decryption operation, and the resource access can be performed only after the decryption is successful.
  • the target resource can be decrypted by using a pre-configured resource access key to obtain the decrypted target resource; for the illegal user, the resource cannot be accessed because the key cannot be obtained, thereby Improve the security of resource access.
  • the resource access fails according to the absolute address of the target resource in step 204, that is, the resource requesting access is not obtained (this is usually because the resource requested to be accessed is not local but at another terminal)
  • the resource synchronization process can be performed to synchronize resources on other terminals or the cloud to the local.
  • the access management module 30 may send a resource synchronization request to the network service module 40, and receive resources returned by the network side according to the resource synchronization request, including the requested access target. Standard resources) to keep pace with resources on the network side.
  • the target resource identifier in the resource access request includes a relative path instead of an absolute path, and the relative path and the type of the target resource can be obtained by parsing the target resource identifier, according to The parsed information generates an absolute path of the target resource, thereby accessing the target resource according to the absolute path. Since the target resource identifier does not need to carry an absolute path, the problem caused by the absolute path that needs to carry the target resource in the resource access request in the prior art is overcome.
  • the target resource path included in the identifier in the resource access request is a relative path, for example, a path of the target resource in the domain to which the target resource belongs, when the directory of the domain to which the target resource belongs is changed. In the case, the resource can be accessed without changing the relative path of the target resource.
  • resource types to identify local (or non-external memory) resources, to facilitate different types of resources, and to facilitate local, external storage and cloud resource access;
  • the resource identifier is defined by the resource identifier defined in the embodiment of the present application;
  • the resource identifier defined in the embodiment of the present application is used to synchronize resources between the local and the cloud, and the resource synchronization between the terminal and the terminal is also implemented.
  • the embodiment of the present application further provides a terminal.
  • FIG. 3 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • the terminal may generally include a processor 301, a memory 302, and a display 303.
  • the processor 301 can be a general purpose processor (such as a microprocessor or any conventional processor, etc.), a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic. Devices, discrete hardware components.
  • Memory 302 may specifically include internal memory and/or external memory, such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like, which are well established in the art.
  • Display 303 can include touch screen control circuitry.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 301 and various circuits of memory represented by memory 302.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides an interface.
  • the processor 301 is responsible for managing the bus architecture and general processing, and the memory 302 can store data used by the processor 301 in performing operations.
  • the resource management process disclosed in the embodiment of the present application may be applied to the processor 301 or implemented by the processor 301.
  • each step of the picture search process may be completed by an integrated logic circuit of hardware in the processor 301 or an instruction in the form of software.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the processor 301 is coupled to the memory 302 for reading computer program instructions stored by the memory 302 and, in response, performing the following operations:
  • the resource identifier may be a resource URI.
  • a resource type field configured to carry resource type indication information
  • the domain name domain is used to carry the indication information of the domain to which the resource belongs;
  • a path domain that is used to carry the path of a resource in its own domain is used to carry the path of a resource in its own domain.
  • the resource type field includes a first field and a second field. If the value of the first field indicates that the type of the target resource is the first type, the second field is empty; otherwise, the The value of the second field indicates that the type of the target resource is the second type or the third type.
  • the URI further includes one or a combination of the following information fields:
  • a user information field configured to carry information of a user who initiates a resource access request
  • a parameter field used to carry parameters is A parameter field used to carry parameters.
  • the identifier of the target resource includes indication information of a target resource type, where the type of the resource includes:
  • the first type is used to indicate that the resource is stored in an external memory
  • the second type is used to indicate that the resource is not stored in the external memory, and the resource is the resource of the application itself;
  • the third type is used to indicate that the resource is not stored in the external memory, and the resource is an application runtime resource.
  • the identifier of the target resource includes: a resource type indication information field, where the resource type indication information field includes a first field and a second field;
  • the second field is empty; otherwise, the value of the second field indicates that the type of the target resource is Two types or a third type.
  • the processor 301 may be specifically configured to: if the indication information of the target resource type indicates that the type of the target resource is the first type, according to the resource in the external memory a storage structure and a relative path of the target resource, generating an absolute path of the target resource in the external memory; if the indication information of the target resource type indicates that the type of the target resource is a second type or a third type And generating an absolute path of the target resource locally according to the local resource storage structure and the relative path of the target resource.
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs.
  • the processor 301 may determine, according to the resource storage structure in the external memory, a directory in which the domain to which the target resource belongs, and generate the target resource in the external memory according to the directory and a relative path of the target resource. Absolute path.
  • the identifier of the target resource further includes indication information of a domain to which the target resource belongs.
  • the processor 301 may determine, according to a storage structure of the local application resource, the domain to which the target resource belongs. a directory, according to the directory and the relative path of the target resource, generating an absolute path of the target resource locally; if the indication information of the target resource type indicates that the type of the target resource is a third type, according to The storage structure of the local application runtime resource determines a directory where the domain to which the target resource belongs, and generates an absolute path of the target resource locally according to the directory and the relative path of the target resource.
  • the processor 301 may perform legality verification on the format of the identifier of the target resource before parsing the identifier of the target resource.
  • the identifier of the target resource includes indication information of a domain to which the target resource belongs, and the relative path obtained by the parsing is a path of the target resource in a domain; and/or an identifier of the target resource
  • the initiator user information of the resource access request is included.
  • the processor 301 may perform one or more of the initiator user information of the resource access request and the indication information of the domain to which the target resource belongs before accessing the target resource according to the absolute path of the target resource. Combination, and preset access decision rules,
  • the resource access request makes an access authority decision.
  • the processor 301 may obtain a corresponding pre-set resource list according to the initiator user information of the resource access request, and perform an access authority decision on the resource access request according to the initiator user information and the obtained resource list.
  • the resource in the resource list has the right or no right to be accessed by the user of the initiator; or, according to the target resource identifier carried in the resource access request or the domain to which the target resource belongs, the corresponding preset user list is obtained. And determining, according to the target resource identifier or the domain to which the target resource belongs, and the obtained user list, the access permission decision, wherein the user in the user list has the right or no right to access the target resource.
  • the processor 301 may perform decryption processing on the target resource by using a pre-configured resource access key to obtain the decrypted target resource when accessing the target resource according to the absolute path of the target resource.
  • the processor 301 may also initiate a resource synchronization process if the access fails when accessing the target resource according to the absolute path of the target resource.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. Instructions are provided for implementation The steps of a function specified in a block or blocks of a flow or a flow and/or a block diagram of a flow chart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Storage Device Security (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种资源访问方法、装置及***。该资源访问方法包括:接收资源访问请求,该资源访问请求中携带有所请求访问的目标资源的标识(201),解析该目标资源的标识,至少得到该目标资源的类型和相对路径(202),根据解析得到的信息,生成该目标资源的绝对路径(203),根据该绝对路径对该目标资源进行访问(204)。由于目标资源标识中无需携带绝对路径,从而克服了现有技术中需要在资源访问请求中携带目标资源的绝对路径所导致的问题。

Description

一种资源访问方法、装置及*** 技术领域
本申请涉及通信技术领域,尤其涉及一种资源访问方法、装置及***。
背景技术
随着通信技术的发展,为了满足日益增长和多种多样的业务需求,基于移动终端的互联网应用越来越多。
目前,基于互联网应用的资源访问通常需要将目标资源的绝对路径携带于资源访问请求中以实现资源的访问。互联网应用的资源存储结构通常较为复杂,目录层级较多,资源的绝对路径通常较长,因此不利于资源的访问,比如,容易因路径错误导致资源访问失败,另一方面如果资源存储结构改变,则容易因绝对路径的错误而影响资源的访问。
因此,亟需一种资源访问方案,以克服上述缺陷。
申请内容
本申请实施例提供了一种资源访问方法、装置及***。
本申请实施例提供的资源访问方法,包括:
接收资源访问请求,所述资源访问请求中携带有所请求访问的目标资源的标识;
解析所述目标资源的标识,至少得到所述目标资源的类型和相对路径;
根据解析得到的信息,生成所述目标资源的绝对路径;
根据所述目标资源的绝对路径对所述目标资源进行访问。
优选地,所述目标资源的标识中包含目标资源类型的指示信息,其中,资源的类型包括:
第一类型,用于表示资源存储于外部存储器;
第二类型,用于表示资源未存储于外部存储器,且资源为应用程序本身资源;
第三类型,用于表示资源未存储于外部存储器,且资源为应用程序运行时资源。
其中,所述目标资源的标识中包括:资源类型域,所述资源类型域包括第一字段和第二字段;
若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
相应地,所述至少根据所述目标资源的类型以及相对路径,生成所述目标资源的绝对路径,包括:
若所述目标资源类型的指示信息指示所述目标资源的类型为第一类型,则根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径;
若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型或第三类型,则根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
其中,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
所述根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径,包括:
根据外部存储器中的资源存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径。
优选地,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
所述根据本地资源存储结构以及所述目标资源的相对路径,生成所述 目标资源在本地的绝对路径,包括:
若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型,则根据本地的应用程序本身资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径;
若所述目标资源类型的指示信息指示所述目标资源的类型为第三类型,则根据本地的应用程序运行时资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
进一步地,解析所述目标资源的标识之前,还包括:对所述目标资源的标识的格式进行合法性验证。
优选地,所述目标资源的标识中包含所述目标资源所属域的指示信息,所述解析得到的相对路径为所述目标资源在所属域中的路径;和/或,所述目标资源的标识中包含所述资源访问请求的发起方用户信息。
其中,根据所述目标资源的绝对路径对所述目标资源进行访问之前,还包括:
根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息中的一种或多种组合,以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决。
其中,所述根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决,包括:
根据所述资源访问请求的发起方用户信息获取对应的预先设置的资源列表,根据所述发起方用户信息以及获取到的资源列表对所述资源访问请求进行访问权限判决,其中,所述资源列表中的资源有权或无权被所述发起方用户访问;或者,
根据所述资源访问请求中携带的目标资源标识或目标资源所属域获取对应的预先设置的用户列表,根据所述目标资源标识或目标资源所属域, 以及获取到的用户列表对所述资源访问请求进行访问权限判决,其中,所述用户列表中的用户有权或无权访问所述目标资源。
优选地,所述根据所述目标资源的绝对路径对所述目标资源进行访问,包括:使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源。
优选地,若根据所述目标资源的绝对路径对所述目标资源进行访问时访问失败,则还包括以下步骤:发起资源同步过程。
优选地,所述资源标识为统一资源标识符URI。
优选地,所述URI中包括以下信息域:
资源类型域,用于承载资源类型指示信息;
域名域,用于承载资源所属域的指示信息;
路径域,用于承载资源在其所属域中的路径。
其中,所述资源类型域包括第一字段和第二字段;若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
进一步地,所述URI中还包括以下信息域中的一种或组合:
用户信息域,用于承载发起资源访问请求的用户的信息;
参数域,用于承载参数。
本申请实施例提供的资源访问***,包括:
解析模块,用于接收资源访问请求,解析所述资源访问请求中携带的目标资源的标识,至少得到所述目标资源的类型和相对路径;
生成模块,用于根据解析得到的信息,生成所述目标资源的绝对路径;
访问管理模块,用于根据所述目标资源的绝对路径对所述目标资源进行访问。
优选地,所述目标资源的标识中包含目标资源类型的指示信息,其中,资源的类型包括:
第一类型,用于表示资源存储于外部存储器;
第二类型,用于表示资源未存储于外部存储器,且资源为应用程序本身资源;
第三类型,用于表示资源未存储于外部存储器,且资源为应用程序运行时资源。
其中,所述目标资源的标识中包括:资源类型指示信息域,所述资源类型指示信息域包括第一字段和第二字段;
若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
相应地,所述生成模块具体用于:
若所述目标资源类型的指示信息指示所述目标资源的类型为第一类型,则根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径;
若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型或第三类型,则根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
其中,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
所述生成模块具体用于:
根据外部存储器中的资源存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径。
优选地,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
所述生成模块具体用于:
若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型,则根据本地的应用程序本身资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标 资源在本地的绝对路径;
若所述目标资源类型的指示信息指示所述目标资源的类型为第三类型,则根据本地的应用程序运行时资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
优选地,所述解析模块还用于:解析所述目标资源的标识之前,对所述目标资源的标识的格式进行合法性验证。
优选地,所述目标资源的标识中包含所述目标资源所属域的指示信息,所述解析得到的相对路径为所述目标资源在所属域中的路径;和/或,所述目标资源的标识中包含所述资源访问请求的发起方用户信息。
相应地,所述访问管理模块还用于:根据所述目标资源的绝对路径对所述目标资源进行访问之前,根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息中的一种或多种组合,以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决。
其中,所述访问管理模块具体用于:
根据所述资源访问请求的发起方用户信息获取对应的预先设置的资源列表,根据所述发起方用户信息以及获取到的资源列表对所述资源访问请求进行访问权限判决,其中,所述资源列表中的资源有权或无权被所述发起方用户访问;或者,
根据所述资源访问请求中携带的目标资源标识或目标资源所属域获取对应的预先设置的用户列表,根据所述目标资源标识或目标资源所属域,以及获取到的用户列表对所述资源访问请求进行访问权限判决,其中,所述用户列表中的用户有权或无权访问所述目标资源。
优选地,所述访问管理模块具体用于:使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源。
优选地,所述访问管理模块还用于:若根据所述目标资源的绝对路径对所述目标资源进行访问时访问失败,则发起资源同步过程。
优选地,所述资源标识为统一资源标识符URI。
优选地,所述URI中包括以下信息域:
资源类型域,用于承载资源类型指示信息;
域名域,用于承载资源所属域的指示信息;
路径域,用于承载资源在其所属域中的路径。
其中,所述资源类型域包括第一字段和第二字段;若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
进一步地,所述URI中还包括以下信息域中的一种或组合:
用户信息域,用于承载发起资源访问请求的用户的信息;
参数域,用于承载参数。
本申请实施例提供的终端,包括:
存储器,用于存储计算机程序指令;
处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序指令,并作为响应,执行如下操作:
接收资源访问请求,所述资源访问请求中携带有所请求访问的目标资源的标识;
解析所述目标资源的标识,至少得到所述目标资源的类型和相对路径;
根据解析得到的信息,生成所述目标资源的绝对路径;
根据所述目标资源的绝对路径对所述目标资源进行访问。
本申请的上述实施例中,资源访问请求中的目标资源标识中包含相对路径而非绝对路径,通过解析该目标资源标识可得到该相对路径以及目标资源的类型,根据解析得到的信息生成该目标资源的绝对路径,从而根据该绝对路径访问目标资源。由于目标资源标识中无需携带绝对路径,因而克服了现有技术中需要在资源访问请求中携带目标资源的绝对路径所导致的问题。
附图说明
图1为本申请实施例提供的资源访问***的结构示意图;
图2为本申请实施例提供的资源访问流程示意图;
图3为本申请实施例提供的终端的结构示意图。
具体实施方式
下面首先对本申请实施例中涉及到的一些技术术语进行简要说明。
(1)资源
在操作***,比如YunOS***中,资源是指应用(英文为Application)的数据和资源,数据包括静态数据和运行时数据,资源可以是本地服务(比如本地***服务或自定义服务),也可以是远程服务(比如云端的服务)。
对于应用程序来说,资源包括应用程序本身的资源以及应用程序运行时的资源,其中,应用程序本身的资源可以是指应用程序自身的代码,比如应用程序解压缩后的数据;应用程序运行时的资源是指应用程序运行时生成的资源,比如可以是数据处理结果。
在云操作***,比如YunOS中,资源表现为Page。
Page称为服务组件,是对本地服务和远程服务的抽象,也即服务的基本单元,通过对数据和方法的封装,可以提供各种服务。一个服务场景可以包括多个Page。举例来说,一个Page可以是UI(用户界面)、拍照等服务,也可以是后台服务,如账户认证。运行态Page称为Page实例,是本地服务或远程服务的运行载体,可由DPMS(Dynamic Page Manager Service,动态Page管理服务)创建、调度、管理,DPMS可维护Page实例的生命周期。
每个Page可以在YunOS中被唯一标识,比如可以使用URI(Uniform Resource Identifier,唯一资源标识符)对Page进行标识。URI可以理解为一个地址链接,通过该URI可以唯一地确定出其对应的Page。例如,为了便于区分Page提供的服务,为该Page分配的URI中可以选择性地包括该服务的相关信息,例如:服务名称、服务内容、服务提供方等。
Page之间可以传递事件和/或数据,Page可以通过UI与用户进行交互,以提供服务。
(2)域
可称为“domain”,domain可以理解为应用程序的逻辑分组。进行域的划分有利于权限隔离以及其他管理配置操作。
为了提供统一的资源标识,以方便资源访问,本申请实施例中定义了资源标识格式。所定义的资源标识格式中包含路径域,用于承载资源的相对路径,更具体地,该相对路径是指资源在其所属域(domain)中的路径。
进一步地,所定义的资源标识中还可包括资源类型域,用于承载资源类型的指示信息,这里的资源类型是从资源存储的角度定义的。本申请实施例中,举例来说,存储在终端内的外部存储器中的资源属于一种类型的资源,比如存储于终端内的外部存储器,即除SIM(Subscriber Identity Module,用户识别模块)卡等用户身份识别卡以外的存储器,比如SD卡(Secure Digital Memory Card)上的资源为一种类型的资源,以区别于存储在移动终端SIM卡或类似用户身份识别卡中的资源或存储于网络侧(比如云端)的资源。
在一些情况中,终端的SD卡中通常只存储应用程序的运行时资源,而终端的SIM卡中可存储应用程序本身的资源以及运行时的资源,且应用程序本身的资源和运行时资源通常存储在不同的目录中。针对这种资源存储结构,为了进一步区分资源是应用程序本身的资源还是运行时的资源,可对资源类型进一步进行扩展,这样,资源的类型可包括三种,分别称为第一类型、第二类型和第三类型:
- 第一类型:用于表示资源存储于外部存储器;
- 第二类型:用于表示资源未存储于外部存储器,如存储于本地,比如未存储于外部存储器而存储于SIM卡中,且资源为应用程序本身的资源,比如,应用程序安装包解压后的资源;
- 第三类型:用于表示资源未存储于外部存储器,如存储于本地,比如未存储于外部存储器而存储于SIM卡中,且资源为应用程序运 行时的资源,比如,运行时产生的资源。
此外,资源类型还可以包括:
- 第四类型,用于表示资源存储于网络侧(如云端)。
针对上述三种资源类型,本申请实施例中可在资源标识中定义资源类型域,通过不同的取值来区分上述三种资源类型。该资源类型域可以是一个字段也可以是多个字段,在一种优选的资源标识格式中,包含2个资源标识字段:第一字段(以下称为“scheme”字段)和第二字段(以下称为“subscheme”字段)。其中,若资源类型为第一类型,则“scheme”字段的取值为“file”,此时无需“subscheme”字段或将“subscheme”字段取值为Null(空);若资源类型为第二类型或第三类型,则“scheme”字段的取值为“page”,此时需要通过“subscheme”段的取值进一步进行区分,具体地,若资源类型为第二类型,则“subscheme”字段的取值为“asset”,若资源类型为第三类型,则“subscheme”字段的取值为“data”。进一步地,“scheme”字段的取值还可以是“http”或“https”,表示访问的是网络侧存储的资源,比如云端的资源。
在一些情况中,以资源所属域(domain)来设置资源的存储结构,属于同一域的资源保存在相同目录下,属于不同域的资源保存在不同目录下。针对这种资源存储结构,本申请实施例所定义的资源标识格式中还可包括资源所属域的信息域,用于承载资源所属域的指示信息,比如可以是域名。
在一些情况中,针对同一应用程序,不同用户使用该应用程序时相关的资源保存不同用户的目录下,具体可用用户名来创建不同用户的目录,以保存不同用户相关的资源。针对这种资源存储结构,本申请实施例所定义的资源标识格式中还可包括用户信息域,用来承载用户信息,比如用户名,以指示应用程序使用者。举例来说,用户使用应用程序时首先进行登录,之后才能发起资源访问请求,针对发起的资源访问请求,其所请求的目标资源的标识中所包含的用户信息即为该登录用户的用户信息,比如可以是该用户登录时的用户名。
更进一步地,本申请实施例所定义的资源标识格式中还可包括参数 域,用来承载资源访问时需要传递的参数。比如,对于互联网支付应用程序来时,可将支付用的银行***作为参数承载于资源标识中的参数域。
上述资源标识中的各种信息域,其在资源标识中的位置预先约定,本申请实施例对此不作限制。
基于以上资源标识格式定义,优选地,本申请实施例使用URI(Uniform Resource Identifier,统一资源标识符)标识资源。该URI格式符合H5协议规定,可兼容w3c的HTTP(HyperText Transfer Protocol,超文本传输协议)和HTTPS(Hyper Text Transfer Protocol over Secure Socket Layer,超文本传输安全协议)等协议。下面示例性地示出了一种资源URI的格式:
scheme://username/domain/subscheme/path?param1=xxx&param2=xxx
上述URI格式中的各信息域的含义如下所述:
scheme域:资源类型域,用于承载资源类型指示信息。该信息域为必选项。该信息域的取值为page或file。若scheme域的取值为file,则表示该资源为第一类型;若scheme域的取值为page,则需要进一步依据subscheme域的取值确定资源的类型。scheme域的取值还可以是“http”或“https”,表示访问的资源为云端资源。
subscheme域:扩展的资源类型域,用于承载资源类型的扩展指示信息。该信息域为可选项。当scheme域的取值为file时,URI中不包括subscheme域,或subscheme域的取值为Null;当scheme域的取值为page时,URI中包括subscheme域。subscheme域的取值可以是asset或data,若subscheme域的取值为asset,则表示该资源为应用程序本身的资源,若subscheme域的取值为data,则表示该资源为应用程序运行时的资源。
username域:用于承载发起资源访问请求的用户的信息,比如用户名;
domain域:用于承载资源所属的域的指示信息,比如域名;
path域:用于承载资源在其所属域中的路径,即相对路径;path中也可以包含“asset”或“data”,这里的asset或data代表相对路径的结构,比如其中的一级目录;
param域:用于承载需要传递的参数。
以下示例性地示出了一个用于标识资源的URI的例子:
page://yongsheng/tv.yunos.com/data/document/test/test.html?name=”good”&value=”1”
上述URI表示:资源类型为第三类型(scheme域的取值为page,subscheme域的取值为data),该资源所属域为“tv.yunos.com”,该资源在其所属域中的路径为“document/test/test.html”,传递的参数包括name=”good”&value=”1”,发起资源访问请求的用户的用户名为“yongsheng”。
参见图1,为本申请实施例提供的资源访问***的结构示意图。该***可位于终端侧,具体可由软件实现,或者由软件和硬件相结合的方式实现,具体地,该***可基于C++、node.js、js等技术实现。
如图所示,资源访问***100可包括:解析模块10、生成模块20和访问管理模块30。
解析模块10主要提供资源标识解析能力,比如解析资源的URI;生成模块20主要提供根据相对路径生成绝对路径的功能;访问管理模块30主要提供资源访问以及管理能力。其中,访问管理模块30的资源管理能力可体现在对资源的目录进行管理,比如创建、修改或删除资源目录,还可以拷贝资源到不同目录等。
具体地,在资源访问过程中,解析模块10用于接收资源访问请求,解析该资源访问请求中携带的目标资源的标识,至少得到该目标资源的类型和相对路径;生成模块20根据解析得到的信息生成目标资源的绝对路径;访问管理模块30用于根据目标资源的绝对路径对该目标资源进行访问。进一步地,在访问得到资源后,访问管理模块30可将获得到的资源提供给浏览器引擎(Browser Engine)以进行页面重新布局渲染刷新显示。
其中,访问管理模块30可基于基本类库实现资源的打开、关闭、读写等访问操作。基本类库可基于POSIX(Portable Operating System Interface,可移植操作***接口)文件实现。POSIX标准定义了操作***应该为应用程序提供的接口标准。
进一步地,上述资源访问***中还可包括网络服务模块40。访问管理模块30在访问资源失败时(如未查找到目标资源),则通过网络服务模块40发起资源同步过程。网络服务模块40可与远程服务器交互,通过HTTP或HTTPS等协议与远端服务器进行资源同步和更新。
基于上述资源标识格式定义,图2示例性地示出了本申请实施例提供的资源访问流程。
参见图2,为本申请实施例提供的资源访问流程示意图。该流程可由上述资源访问***实现。如图所示,该流程可包括如下步骤:
步骤201:接收资源访问请求,该资源访问请求中携带有所请求访问的目标资源的标识。
其中,资源访问请求可由应用程序(如互联网应用程序)发起。资源访问请求中携带有所请求访问的目标资源的标识,如目标资源的URI,该URI的格式可如前述实施例所述。进一步地,资源访问请求中还可以携带操作类型信息,所述操作类型包括但不限于增加、修改、删除、查询等操作中的一种或多种组合。
步骤202:解析目标资源的标识,至少得到该目标资源的类型和相对路径。该步骤可由资源访问***100中的解析模块10执行。
如前所述,资源标识中至少包含有资源类型指示信息和相对路径,因此解析得到的信息中至少包括目标资源的类型和相对路径。如果资源标识中还包含其他信息,比如资源所属域的域名、发起资源访问请求的用户的用户名、参数等中的一种或多种,则解析出的信息中也包括上述所包含的内容。
进一步地,为提高安全性,在解析目标资源的标识之前,可首先对目标资源的标识的格式进行合法性验证,如果验证通过,则可对该目标资源的标识进行解析以及执行后续步骤,否则,表明该目标资源的标识为非法标识,拒绝对其进行解析,从而拒绝响应该资源访问请求。其中,若资源标识使用URI,则根据前述定义的规则对该URI进行格式验证。
步骤203:根据解析得到的信息,生成该目标资源的绝对路径。该步 骤可由资源访问***100中的生成模块20执行。
该步骤中,根据目标资源的数据类型的不同,生成目标资源的绝对路径时,可包括以下情况中的一种:
情况1:若目标资源类型的指示信息指示该目标资源的类型为第一类型,则可根据外部存储器中的资源存储结构以及该目标资源的相对路径,生成该目标资源在该外部存储器中的绝对路径。
更具体地,在目标资源的标识中还包含目标资源所属域的指示信息的情况下,可根据外部存储器中的资源存储结构确定该目标资源所属域所在的目录,根据该目录以及该目标资源的相对路径,生成该目标资源在该外部存储器中的绝对路径。
比如,资源访问请求中携带的目标资源的URI为:
file://yongsheng/tv.yunos.com/document/test/test.html
终端SD卡中tv.yunos.com域的资源所在的目录为:
pageresource/yongsheng/tv.yunos.com
则根据上述目标资源的URI以及SD卡中的资源存储结构,生成如下所示的目标资源在该SD卡中的绝对路径:
pageresource/yongsheng/tv.yunos.com/document/test/test.html
情况2:若目标资源类型的指示信息指示该目标资源的类型为第二类型或第三类型,则根据本地资源存储结构以及该目标资源的相对路径,生成该目标资源在本地的绝对路径。
更具体地,在情况2中,若目标资源类型的指示信息指示该目标资源的类型为第二类型,则根据本地的应用程序本身资源的存储结构确定该目标资源所属域所在的目录,根据该目录以及该目标资源的相对路径,生成该目标资源在本地的绝对路径;若目标资源类型的指示信息指示该目标资源的类型为第三类型,则根据本地的应用程序运行时资源的存储结构确定该目标资源所属域所在的目录,根据该目录以及该目标资源的相对路径,生成该目标资源在本地的绝对路径。
比如,资源访问请求中携带的目标资源的URI为:
page://yongsheng/tv.yunos.com/asset/document/test/test.html
终端SIM卡中tv.yunos.com域的应用程序解压缩后的资源所在的目录为:
pageresource/unzip/tv.yunos.com
则根据上述目标资源的URI以及SIM卡中的资源存储结构,生成如下所示的目标资源在该SIM卡中的绝对路径:
pageresource/unzip/tv.yunos.com/document/test/test.html
再比如,资源访问请求中携带的目标资源的URI为:
page://yongsheng/tv.yunos.com/data/document/test/test.html
终端SIM卡中tv.yunos.com域的应用程序运行时的资源所在的目录为:
pageresource/running/tv.yunos.com
则根据上述目标资源的URI以及SIM卡中的资源存储结构,生成如下所示的目标资源在该SIM卡中的绝对路径:
pageresource/running/tv.yunos.com/document/test/test.html
情况3:若目标资源类型的指示信息指示该目标资源的类型为第四类型,则向网络侧(比如云端)发送该资源访问请求,其资源访问过程可采用现有方式实现,在此不再赘述。
进一步地,如果资源在外部存储器或者本地的存储结构中,包含用户名目录以分别存储不同登录用户对应的资源,那么相应地,在生成资源的绝对路径时,还需要将解析得到的用户名作为生成资源绝对路径的依据之一。
进一步地,在一些实施例中,操作***支持多种语言,这种情况下,不同语言设置的情况下,资源的存储结构不同,或者不同语言设置的情况下,同一应用程序的资源存储在不同的目录中。相应地,在步骤203中生成目标资源的绝对路径时,需要考虑当前的语言设置,不同的语言设置情况下,同一目标资源的绝对路径有所不同。
步骤204:根据该目标资源的绝对路径对该目标资源进行访问。该步骤可由资源访问***100中的访问管理模块30执行。
本申请实施例中,可预先设置DataManager JS API,该API(Application Programming Interface,应用程序编程接口)是对应用程序本身的资源以及运行时的资源进行访问的统一接口。访问管理模块30可通过DataManager JS API对应用程序本身的资源或者对应用程序运行时的资源进行访问,具体可通过Node_DataManager调用DataManager JS API实现对资源的访问。其中,Node_DataManger是对访问管理模块30的JS封装(Wrapper)的插件(Addon)实现。Data Manager JS API可实现直接基于Node.js JS API,这样可以避免Node_DataManager的复杂繁多的接口实现,有效的复用Node.js的接口,设计实现更加简洁。
为了提高安全性,可在根据目标资源的绝对路径进行资源访问之前,根据预先设定的访问权限判决规则对该资源访问请求的访问权限进行判决,若访问权限判决通过,则执行资源访问,否则拒绝执行资源访问。进行访问权限判决的依据可包括目标资源所属的域和/或资源访问请求发起方用户信息。
具体实施时,在一些实施例中,可以预先针对不同域或不同的资源标识设置各自对应的用户列表,该用户列表中可包括一个或多个用户信息(如用户名),该用户列表中的用户有权访问对应的资源(即该用户列表为白名单用户列表),或者该用户列表中的用户无权访问对应的资源(即该用户列表为黑名单用户列表)。这样,在根据目标资源的绝对路径进行资源访问之前,可根据目标资源所属的域或者根据目标资源的标识获取对应的用户列表,根据解析得到的发起资源访问请求的用户的信息,并结合获取到的用户列表进行访问权限判决,如果发起方用户属于该列表中的用户,则在该用户列表中的用户为有权访问(即该用户列表为白名单用户列表)的情况下,访问权限判决通过,在该用户列表中的用户无权访问(即该用户列表为黑名单用户列表)的情况下,访问权限判决不通过。
当然,上述用户列表的内容也可设置为“全部(ALL)”以表示该资源可被所有用户访问,或者设置为“空(NULL)”以表示该资源不能被用户 访问。
具体实施时,在另一些实施例中,可以预先针对不同用户设置各自对应的资源列表,该资源列表中可包括一个或多个资源的URI和/或包括资源所属的域,该资源列表中的资源可被对应用户访问(即该资源列表为白名单资源列表)或者不能被对应用户访问(即该资源列表为黑名单资源列表)。这样,在根据目标资源的绝对路径进行资源访问之前,可根据资源访问请求发起方用户的信息获取对应的资源列表,根据目标资源的URI或者解析得到的目标资源所属的域,并结合获取到的资源列表进行访问权限判决,如果目标资源属于该列表中的资源,则在该资源列表中的资源为有权被访问(即该资源列表为白名单资源列表)的情况下,访问权限判决通过,在该资源列表中的资源无权被访问(即该资源列表为黑名单资源列表)的情况下,访问权限判决不通过。
当然,上述资源列表的内容也可设置为“全部(ALL)”以表示该用户对所有资源均有权访问,或者设置为“空(NULL)”以表示该用户对所有资源均无权访问。
当然,上述两种判决方式也可以相互结合使用,在此不再赘述,这样可以进一步提高资源访问的安全性。
具体实施时,在另一些实施例中,可预先配置资源访问的秘钥,所存储的资源是先进行加密处理再进行存储的。当对目标资源进行访问时,需要使用相应的秘钥进行解密操作,只有解密成功,才能进行资源访问。这样,对于合法用户来说,可以使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源;对于非法用户来说,因无法获取到秘钥进而无法进行资源访问,从而提高资源访问的安全性。
进一步地,如果上述流程中,在步骤204中根据目标资源的绝对地址进行资源访问失败,即未获取到请求访问的资源时(这种情况通常是由于请求访问的资源不在本地而是在其他终端上或在云端时),可执行资源同步过程,从而将其他终端或云端上的资源同步到本地。
具体地,访问管理模块30可向网络服务模块40发送资源同步请求,并接收网络侧根据该资源同步请求返回的资源(其中包括所请求访问的目 标资源),从而与网络侧的资源保持同步。
通过以上描述可以看出,本申请的上述实施例中,资源访问请求中的目标资源标识中包含相对路径而非绝对路径,通过解析该目标资源标识可得到该相对路径以及目标资源的类型,根据解析得到的信息生成该目标资源的绝对路径,从而根据该绝对路径访问目标资源。由于目标资源标识中无需携带绝对路径,因而克服了现有技术中需要在资源访问请求中携带目标资源的绝对路径所导致的问题。
另一方面,由于资源访问请求中的目标数据在标识中包含的目标资源路径为相对路径,比如是该目标资源在其所属域中的路径,这样,当给目标资源所属域的目录有所改变的情况下,无需改变该目标资源的相对路径也可访问到该资源。
更为具体地,通过本申请的上述实施例可以实现以下目的:
- 通过定义新的URI来标识资源,便于实现统一访问的标准化定义;
- 定义资源类型来标识本地(或称非外部存储器)的资源,便于区分不同类型的资源,方便本地、外部存储器和云端的资源访问;
- 通过相对路径访问资源,无需用户输入资源的绝对路径,通过相对路径可以跨域访问资源。
- 本地或云端资源的访问使用统一化接口,便于应用开发者进行应用程序开发。
采用本申请实施例,可以实现以下功能:
- 资源访问:以本申请实施例定义的资源标识,提供一种统一的资源访问方式,从而可以便捷地访问本地或云端的资源;
- 资源缓存:以本申请实施例定义的资源标识,进行资源的缓存;
- 资源同步:以本申请实施例定义的资源标识,实现本地与云端的资源同步,也可实现终端与终端间的资源同步;
- 资源隔离:实现资源的安全访问,实现跨域访问;
- 资源共享:实现资源的云端共享(比如属于一个用户的所有终端上 的资源均与云端保持同步),可实现端端共享(比如一个用户的不同终端上的资源可以进行访问或同步),还可实现跨域共享。
基于相同的技术构思,本申请实施例还提供了一种终端。
参见图3,为本申请实施例提供的终端的结构示意图。该终端总体来说可包括:处理器301,存储器302、显示器303。
其中,处理器301可以是通用处理器(比如微处理器或者任何常规的处理器等)、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。存储器302具体可包括内部存储器和/或外部存储器,比如随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质。显示器303可包括触摸屏控制电路。
处理器301与其他各模块之间存在数据通信连接,比如可基于总线架构进行数据通信。总线架构可以包括任意数量的互联的总线和桥,具体由处理器301代表的一个或多个处理器和存储器302代表的存储器的各种电路链接在一起。总线架构还可以将诸如***设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。处理器301负责管理总线架构和通常的处理,存储器302可以存储处理器301在执行操作时所使用的数据。
本申请实施例揭示的资源管理流程,可以应用于处理器301中,或者由处理器301实现。在实现过程中,图片搜索流程的各步骤可以通过处理器301中的硬件的集成逻辑电路或者软件形式的指令完成。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。
具体地,处理器301,耦合到存储器302,用于读取存储器302存储的计算机程序指令,并作为响应,执行如下操作:
接收资源访问请求,所述资源访问请求中携带有所请求访问的目标资源的标识;
解析所述目标资源的标识,至少得到所述目标资源的类型和相对路径;
根据解析得到的信息,生成所述目标资源的绝对路径;
根据所述目标资源的绝对路径对所述目标资源进行访问。
其中,资源标识可以是资源URI。
其中,所述URI中包括以下信息域:
资源类型域,用于承载资源类型指示信息;
域名域,用于承载资源所属域的指示信息;
路径域,用于承载资源在其所属域中的路径。
其中,所述资源类型域包括第一字段和第二字段;若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
进一步地,所述URI中还包括以下信息域中的一种或组合:
用户信息域,用于承载发起资源访问请求的用户的信息;
参数域,用于承载参数。
优选地,所述目标资源的标识中包含目标资源类型的指示信息,其中,资源的类型包括:
第一类型,用于表示资源存储于外部存储器;
第二类型,用于表示资源未存储于外部存储器,且资源为应用程序本身资源;
第三类型,用于表示资源未存储于外部存储器,且资源为应用程序运行时资源。
其中,所述目标资源的标识中包括:资源类型指示信息域,所述资源类型指示信息域包括第一字段和第二字段;
若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第 二类型或第三类型。
优选地,处理器301在生成所述目标资源的绝对路径时,可具体用于:若所述目标资源类型的指示信息指示所述目标资源的类型为第一类型,则根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径;若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型或第三类型,则根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
其中,所述目标资源的标识中还包含所述目标资源所属域的指示信息。相应地,处理器301可根据外部存储器中的资源存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径。
优选地,所述目标资源的标识中还包含所述目标资源所属域的指示信息。相应地,处理器301可在所述目标资源类型的指示信息指示所述目标资源的类型为第二类型的情况下,根据本地的应用程序本身资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径;在所述目标资源类型的指示信息指示所述目标资源的类型为第三类型的情况下,根据本地的应用程序运行时资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
优选地,处理器301在解析所述目标资源的标识之前,还可对所述目标资源的标识的格式进行合法性验证。
优选地,所述目标资源的标识中包含所述目标资源所属域的指示信息,所述解析得到的相对路径为所述目标资源在所属域中的路径;和/或,所述目标资源的标识中包含所述资源访问请求的发起方用户信息。
相应地,处理器301可在根据所述目标资源的绝对路径对所述目标资源进行访问之前,根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息中的一种或多种组合,以及预设的访问权限判决规则,对 所述资源访问请求进行访问权限判决。
其中,处理器301可根据所述资源访问请求的发起方用户信息获取对应的预先设置的资源列表,根据所述发起方用户信息以及获取到的资源列表对所述资源访问请求进行访问权限判决,其中,所述资源列表中的资源有权或无权被所述发起方用户访问;或者,根据所述资源访问请求中携带的目标资源标识或目标资源所属域获取对应的预先设置的用户列表,根据所述目标资源标识或目标资源所属域,以及获取到的用户列表对所述资源访问请求进行访问权限判决,其中,所述用户列表中的用户有权或无权访问所述目标资源。
优选地,处理器301可在根据所述目标资源的绝对路径对所述目标资源进行访问时,使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源。
优选地,处理器301在根据所述目标资源的绝对路径对所述目标资源进行访问时访问失败的情况下,还可发起资源同步过程。
本申请是参照根据本申请实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现 在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (33)

  1. 一种资源访问方法,其特征在于,包括:
    接收资源访问请求,所述资源访问请求中携带有所请求访问的目标资源的标识;
    解析所述目标资源的标识,至少得到所述目标资源的类型和相对路径;
    根据解析得到的信息,生成所述目标资源的绝对路径;
    根据所述目标资源的绝对路径对所述目标资源进行访问。
  2. 如权利要求1所述的方法,其特征在于,所述目标资源的标识中包含目标资源类型的指示信息,其中,资源的类型包括:
    第一类型,用于表示资源存储于外部存储器;
    第二类型,用于表示资源未存储于外部存储器,且资源为应用程序本身资源;
    第三类型,用于表示资源未存储于外部存储器,且资源为应用程序运行时资源。
  3. 如权利要求2所述的方法,其特征在于,所述目标资源的标识中包括:资源类型域,所述资源类型域包括第一字段和第二字段;
    若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
  4. 如权利要求2所述的方法,其特征在于,所述至少根据所述目标资源的类型以及相对路径,生成所述目标资源的绝对路径,包括:
    若所述目标资源类型的指示信息指示所述目标资源的类型为第一类型,则根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径;
    若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型 或第三类型,则根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
  5. 如权利要求4所述的方法,其特征在于,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
    所述根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径,包括:
    根据外部存储器中的资源存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径。
  6. 如权利要求4所述的方法,其特征在于,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
    所述根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径,包括:
    若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型,则根据本地的应用程序本身资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径;
    若所述目标资源类型的指示信息指示所述目标资源的类型为第三类型,则根据本地的应用程序运行时资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
  7. 如权利要求1所述的方法,其特征在于,解析所述目标资源的标识之前,还包括:
    对所述目标资源的标识的格式进行合法性验证。
  8. 如权利要求1所述的方法,其特征在于,所述目标资源的标识中包含所述目标资源所属域的指示信息,所述解析得到的相对路径为所述目标资源在所属域中的路径;和/或,
    所述目标资源的标识中包含所述资源访问请求的发起方用户信息。
  9. 如权利要求8所述的方法,其特征在于,根据所述目标资源的绝对路径对所述目标资源进行访问之前,还包括:
    根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息中的一种或多种组合,以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决。
  10. 如权利要求9所述的方法,其特征在于,所述根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决,包括:
    根据所述资源访问请求的发起方用户信息获取对应的预先设置的资源列表,根据所述发起方用户信息以及获取到的资源列表对所述资源访问请求进行访问权限判决,其中,所述资源列表中的资源有权或无权被所述发起方用户访问;或者,
    根据所述资源访问请求中携带的目标资源标识或目标资源所属域获取对应的预先设置的用户列表,根据所述目标资源标识或目标资源所属域,以及获取到的用户列表对所述资源访问请求进行访问权限判决,其中,所述用户列表中的用户有权或无权访问所述目标资源。
  11. 如权利要求1所述的方法,其特征在于,所述根据所述目标资源的绝对路径对所述目标资源进行访问,包括:
    使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源。
  12. 如权利要求1所述的方法,其特征在于,若根据所述目标资源的绝对路径对所述目标资源进行访问时访问失败,则还包括以下步骤:
    发起资源同步过程。
  13. 如权利要求1至12中任一项所述的方法,其特征在于,所述资源标识为统一资源标识符URI。
  14. 如权利要求13所述的方法,其特征在于,所述URI中包括以下信息域:
    资源类型域,用于承载资源类型指示信息;
    域名域,用于承载资源所属域的指示信息;
    路径域,用于承载资源在其所属域中的路径。
  15. 如权利要求14所述的方法,其特征在于,所述资源类型域包括第一字段和第二字段;
    若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
  16. 如权利要求14所述的方法,其特征在于,所述URI中还包括以下信息域中的一种或组合:
    用户信息域,用于承载发起资源访问请求的用户的信息;
    参数域,用于承载参数。
  17. 一种资源访问***,其特征在于,包括:
    解析模块,用于接收资源访问请求,解析所述资源访问请求中携带的目标资源的标识,至少得到所述目标资源的类型和相对路径;
    生成模块,用于根据解析得到的信息,生成所述目标资源的绝对路径;
    访问管理模块,用于根据所述目标资源的绝对路径对所述目标资源进行访问。
  18. 如权利要求17所述的***,其特征在于,所述目标资源的标识中包含目标资源类型的指示信息,其中,资源的类型包括:
    第一类型,用于表示资源存储于外部存储器;
    第二类型,用于表示资源未存储于外部存储器,且资源为应用程序本身资源;
    第三类型,用于表示资源未存储于外部存储器,且资源为应用程序运行时资源。
  19. 如权利要求18所述的***,其特征在于,所述目标资源的标识中包括:资源类型指示信息域,所述资源类型指示信息域包括第一字段和第二字段;
    若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
  20. 如权利要求18所述的***,其特征在于,所述生成模块具体用于:
    若所述目标资源类型的指示信息指示所述目标资源的类型为第一类型,则根据外部存储器中的资源存储结构以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径;
    若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型或第三类型,则根据本地资源存储结构以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
  21. 如权利要求20所述的***,其特征在于,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
    所述生成模块具体用于:
    根据外部存储器中的资源存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在所述外部存储器中的绝对路径。
  22. 如权利要求20所述的***,其特征在于,所述目标资源的标识中还包含所述目标资源所属域的指示信息;
    所述生成模块具体用于:
    若所述目标资源类型的指示信息指示所述目标资源的类型为第二类型,则根据本地的应用程序本身资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径;
    若所述目标资源类型的指示信息指示所述目标资源的类型为第三类型,则根据本地的应用程序运行时资源的存储结构确定所述目标资源所属域所在的目录,根据该目录以及所述目标资源的相对路径,生成所述目标资源在本地的绝对路径。
  23. 如权利要求17所述的***,其特征在于,所述解析模块还用于:
    解析所述目标资源的标识之前,对所述目标资源的标识的格式进行合法性验证。
  24. 如权利要求17所述的***,其特征在于,所述目标资源的标识中包含所述目标资源所属域的指示信息,所述解析得到的相对路径为所述目标资源在所属域中的路径;和/或,
    所述目标资源的标识中包含所述资源访问请求的发起方用户信息。
  25. 如权利要求24所述的***,其特征在于,所述访问管理模块还用于:
    根据所述目标资源的绝对路径对所述目标资源进行访问之前,根据所述资源访问请求的发起方用户信息、目标资源所属域的指示信息中的一种或多种组合,以及预设的访问权限判决规则,对所述资源访问请求进行访问权限判决。
  26. 如权利要求25所述的***,其特征在于,所述访问管理模块具体用于:
    根据所述资源访问请求的发起方用户信息获取对应的预先设置的资源列表,根据所述发起方用户信息以及获取到的资源列表对所述资源访问请求进行访问权限判决,其中,所述资源列表中的资源有权或无权被所述发起方用户访问;或者,
    根据所述资源访问请求中携带的目标资源标识或目标资源所属域获取对应的预先设置的用户列表,根据所述目标资源标识或目标资源所属域,以及获取到的用户列表对所述资源访问请求进行访问权限判决,其中,所述用户列表中的用户有权或无权访问所述目标资源。
  27. 如权利要求17所述的***,其特征在于,所述访问管理模块具体用于:
    使用预先配置的资源访问秘钥对目标资源进行解密处理,得到解密后的目标资源。
  28. 如权利要求17所述的***,其特征在于,所述访问管理模块还用于:
    若根据所述目标资源的绝对路径对所述目标资源进行访问时访问失败,则发起资源同步过程。
  29. 如权利要求17至28中任一项所述的***,其特征在于,所述资源标识为统一资源标识符URI。
  30. 如权利要求29所述的***,其特征在于,所述URI中包括以下信息域:
    资源类型域,用于承载资源类型指示信息;
    域名域,用于承载资源所属域的指示信息;
    路径域,用于承载资源在其所属域中的路径。
  31. 如权利要求30所述的***,其特征在于,所述资源类型域包括第一字段和第二字段;
    若所述第一字段的取值表明所述目标资源的类型为第一类型,则所述第二字段为空;否则,所述第二字段的取值表明所述目标资源的类型为第二类型或第三类型。
  32. 如权利要求30所述的***,其特征在于,所述URI中还包括以下信息域中的一种或组合:
    用户信息域,用于承载发起资源访问请求的用户的信息;
    参数域,用于承载参数。
  33. 一种终端,其特征在于,包括:
    存储器,用于存储计算机程序指令;
    处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序指令,并作为响应,执行如下操作:
    接收资源访问请求,所述资源访问请求中携带有所请求访问的目标资源的标识;
    解析所述目标资源的标识,至少得到所述目标资源的类型和相对路径;
    根据解析得到的信息,生成所述目标资源的绝对路径;
    根据所述目标资源的绝对路径对所述目标资源进行访问。
PCT/CN2017/071556 2016-01-28 2017-01-18 一种资源访问方法、装置及*** WO2017129016A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/041,356 US20190089810A1 (en) 2016-01-28 2018-07-20 Resource access method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610059809.0A CN107015996A (zh) 2016-01-28 2016-01-28 一种资源访问方法、装置及***
CN201610059809.0 2016-01-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/041,356 Continuation-In-Part US20190089810A1 (en) 2016-01-28 2018-07-20 Resource access method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2017129016A1 true WO2017129016A1 (zh) 2017-08-03

Family

ID=59397370

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/071556 WO2017129016A1 (zh) 2016-01-28 2017-01-18 一种资源访问方法、装置及***

Country Status (3)

Country Link
US (1) US20190089810A1 (zh)
CN (1) CN107015996A (zh)
WO (1) WO2017129016A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764805A (zh) * 2019-10-28 2020-02-07 腾讯科技(深圳)有限公司 客户端无感升级的方法、装置、终端及存储介质

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108347460B (zh) * 2017-01-25 2020-04-14 华为技术有限公司 资源访问方法及装置
CN107908956B (zh) * 2017-12-07 2020-01-17 湖北三新文化传媒有限公司 一种资源访问请求的监控方法、装置及可读存储介质
WO2021046782A1 (zh) * 2019-09-11 2021-03-18 Oppo广东移动通信有限公司 访问控制方法、设备及存储介质
CN110825429A (zh) * 2019-11-13 2020-02-21 中孚安全技术有限公司 一种web项目打包方法及***
CN111222146B (zh) * 2019-11-14 2022-08-12 京东科技控股股份有限公司 权限校验方法、权限校验装置、存储介质与电子设备
CN111143742A (zh) * 2019-12-24 2020-05-12 联想(北京)有限公司 处理方法和处理装置
US11709750B2 (en) * 2020-05-12 2023-07-25 International Business Machines Corporation Dynamically mapping software infrastructure utilization
US10997243B1 (en) 2020-06-30 2021-05-04 Snowflake Inc. Supporting unstructured, semi-structured, and structured files
CN111988298B (zh) * 2020-08-13 2023-05-30 山东伏羲智库互联网研究院 数据处理方法、装置及设备
CN112134951A (zh) * 2020-09-22 2020-12-25 睿视(苏州)视频科技有限公司 数据传输方法、装置、电子设备及存储介质
CN112257103A (zh) * 2020-10-10 2021-01-22 海信电子科技(深圳)有限公司 一种访问权限控制方法及显示设备
CN112202823B (zh) * 2020-12-07 2021-03-19 杭州筋斗腾云科技有限公司 网络资源访问***及方法、用户门户及资源门户
CN112511569B (zh) * 2021-02-07 2021-05-11 杭州筋斗腾云科技有限公司 网络资源访问请求的处理方法、***及计算机设备
CN113190363B (zh) * 2021-04-22 2023-05-30 Oppo广东移动通信有限公司 远程控制方法、装置、计算机可读存储介质及电子设备
CN113271362B (zh) * 2021-06-08 2022-10-11 天闻数媒科技(湖南)有限公司 基于混合云的教育资源的处理方法、装置、***及介质
CN113342400B (zh) * 2021-06-29 2022-05-17 上海哔哩哔哩科技有限公司 离线包打包方法、装置及计算机设备
CN114840868B (zh) * 2022-07-04 2022-10-14 广州市玄武无线科技股份有限公司 数据访问方法、装置、电子设备及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142996A (zh) * 2011-02-28 2011-08-03 浪潮(北京)电子信息产业有限公司 云操作***中一种物理节点的识别方法及装置
CN102169484A (zh) * 2010-02-26 2011-08-31 威睿公司 虚拟化环境中综合的、相关的和动态的数据搜索
CN102902529A (zh) * 2011-09-07 2013-01-30 微软公司 变换的上下文知晓数据源管理
CN102906747A (zh) * 2010-03-26 2013-01-30 诺基亚公司 用于可移动存储介质上的便携式索引的方法和装置
CN104067263A (zh) * 2012-01-19 2014-09-24 微软公司 识别云内容

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5901312A (en) * 1994-12-13 1999-05-04 Microsoft Corporation Providing application programs with unmediated access to a contested hardware resource
KR20020036072A (ko) * 2000-11-07 2002-05-16 황기수 계층적 구조의 코드를 사용한 인터넷 자동 접속 방법 및시스템
US20120005307A1 (en) * 2010-06-30 2012-01-05 Abhik Das Storage virtualization
US8914632B1 (en) * 2011-12-21 2014-12-16 Google Inc. Use of access control lists in the automated management of encryption keys
IL219244A0 (en) * 2012-04-18 2012-07-31 Google Inc Splitting of user-lists
CN102868533B (zh) * 2012-09-13 2016-05-25 中科华核电技术研究院有限公司 资源访问授权验证方法及***
US9063971B2 (en) * 2012-12-03 2015-06-23 Red Hat Israel, Ltd. Schema and query abstraction for different LDAP service providers
GB2513617A (en) * 2013-05-01 2014-11-05 Openwave Mobility Inc Caching of content

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102169484A (zh) * 2010-02-26 2011-08-31 威睿公司 虚拟化环境中综合的、相关的和动态的数据搜索
CN102906747A (zh) * 2010-03-26 2013-01-30 诺基亚公司 用于可移动存储介质上的便携式索引的方法和装置
CN102142996A (zh) * 2011-02-28 2011-08-03 浪潮(北京)电子信息产业有限公司 云操作***中一种物理节点的识别方法及装置
CN102902529A (zh) * 2011-09-07 2013-01-30 微软公司 变换的上下文知晓数据源管理
CN104067263A (zh) * 2012-01-19 2014-09-24 微软公司 识别云内容

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764805A (zh) * 2019-10-28 2020-02-07 腾讯科技(深圳)有限公司 客户端无感升级的方法、装置、终端及存储介质
CN110764805B (zh) * 2019-10-28 2024-01-23 腾讯科技(深圳)有限公司 客户端无感升级的方法、装置、终端及存储介质

Also Published As

Publication number Publication date
CN107015996A (zh) 2017-08-04
US20190089810A1 (en) 2019-03-21

Similar Documents

Publication Publication Date Title
WO2017129016A1 (zh) 一种资源访问方法、装置及***
US10891383B2 (en) Validating computer resource usage
CN112333198B (zh) 安全跨域登录方法、***及服务器
EP3301881B1 (en) Method, device and system for using and invoking oauth api
CN110213276B (zh) 一种微服务架构下的授权验证方法、服务器、终端及介质
EP3694175B1 (en) System and method for delegating authority through coupled devices
US11388012B2 (en) Application certificate
US20090106549A1 (en) Method and system for extending encrypting file system
CN112131021B (zh) 一种访问请求处理方法及装置
US20230370265A1 (en) Method, Apparatus and Device for Constructing Token for Cloud Platform Resource Access Control
JP2013532394A (ja) 複数のクライアントを有する電子ネットワークにおける遠隔保守のためのシステム及び方法
US10148637B2 (en) Secure authentication to provide mobile access to shared network resources
US20180285172A1 (en) Data exchange between applications
WO2019214714A1 (zh) 一种视频播放控制方法、***、节点和计算机存储介质
CN112437078A (zh) 文件存储方法、装置、设备及计算机可读存储介质
CN116192483A (zh) 认证鉴权方法、装置、设备及介质
US9948632B2 (en) Sharing data between sandboxed applications with certificates
CN112738005A (zh) 访问处理方法、装置、***、第一认证服务器及存储介质
CN113784354B (zh) 基于网关的请求转换方法和装置
CN113765876B (zh) 报表处理软件的访问方法和装置
US20220100485A1 (en) Applet package sending method and device, electronic apparatus, and computer readable medium
US11977620B2 (en) Attestation of application identity for inter-app communications
Salecha Security and Secrets Management
CN115766018A (zh) 一种基于去中心化身份标识的认证方法、装置及设备
US20240214228A1 (en) Blockchain based public key infrastructure

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: 17743631

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: 17743631

Country of ref document: EP

Kind code of ref document: A1