CN110333914B - Method and device for executing target operation - Google Patents

Method and device for executing target operation Download PDF

Info

Publication number
CN110333914B
CN110333914B CN201910294207.7A CN201910294207A CN110333914B CN 110333914 B CN110333914 B CN 110333914B CN 201910294207 A CN201910294207 A CN 201910294207A CN 110333914 B CN110333914 B CN 110333914B
Authority
CN
China
Prior art keywords
application
file management
target
file
request
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
CN201910294207.7A
Other languages
Chinese (zh)
Other versions
CN110333914A (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.)
Shanghai Lianshang Network Technology Co Ltd
Original Assignee
Shanghai Lianshang Network Technology Co 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 Shanghai Lianshang Network Technology Co Ltd filed Critical Shanghai Lianshang Network Technology Co Ltd
Priority to CN201910294207.7A priority Critical patent/CN110333914B/en
Publication of CN110333914A publication Critical patent/CN110333914A/en
Application granted granted Critical
Publication of CN110333914B publication Critical patent/CN110333914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/11File system administration, e.g. details of archiving or snapshots
    • 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application aims to provide a method and equipment for executing target operation, wherein a hosting application calls a preset file management interface to generate a file management request, and the file management request is provided to a corresponding target application; the target application calls a system interface of the user equipment based on a file management request generated by a corresponding hosting application to execute a corresponding file management operation, acquires a file operation result corresponding to the file management operation, and sends the file operation result to the hosting application; the hosting application receives the file operation result; and the host application and the target application corresponding to the hosted application are configured on the user equipment. The application facilitates the customization of operations that a hosted application may perform by a service provider without being limited by the host application.

Description

Method and device for executing target operation
Technical Field
The present application relates to the field of communications, and more particularly, to a technique for performing a target operation.
Background
The hosting application is an application which depends on the host application and can be used without downloading an installation package for installation, and the functions of the host application are further expanded. The hosting application realizes the dream of ' tentacle ' and the user can open the application by sweeping or searching, and also embodies the concept of ' run out and walk without concern of the user about whether the user equipment is provided with too many applications. The hosted application is ready for use without being installed by an installation package or uninstalled. With the development of the age, more and more host applications are presented, and hosting applications depending on the host applications also become ubiquitous. At present, the interaction between the hosting application and the host application needs to rely on the host application to complete the call to the related interface (such as the file operation interface) of the system so as to realize the function corresponding to the operation of the user in the hosting application.
Disclosure of Invention
It is an object of the present application to provide a method and apparatus for performing a target operation.
According to one aspect of the present application, there is provided a method for performing file management operations by a hosted application on a user equipment, the method comprising the steps of:
calling a preset file management interface to generate a file management request;
providing the file management request to a corresponding target application;
receiving a file operation result sent by the target application based on the file management request;
the host application and the target application corresponding to the hosted application are both configured in the user equipment, and the file operation result is obtained by the target application based on the file management request and calling a system interface of the user equipment to execute the corresponding file management operation.
According to another aspect of the present application, there is provided a method for performing a file management operation by a target application on a user equipment, the method comprising the steps of:
invoking a system interface of the user equipment based on a file management request generated by a corresponding hosting application to execute a corresponding file management operation;
Acquiring a file operation result corresponding to the file management operation;
sending the file operation result to the hosting application;
and the host application and the target application corresponding to the hosted application are configured on the user equipment.
According to one aspect of the present application, there is provided a method for performing a target operation by a first application on a user device, the method comprising the steps of:
calling a preset target operation interface to generate a target operation request;
providing the target operation request to a corresponding second application;
receiving a target operation result sent by the second application based on the target operation request;
the first application and the second application are both configured in the user equipment, and the target operation result is obtained by the second application based on the target operation request and calling a system interface of the user equipment to execute corresponding file management operation.
According to another aspect of the present application, there is provided a method for performing a target operation by a second application on a user equipment, the method comprising the steps of:
invoking a system interface of the user equipment based on a target operation request generated by a corresponding first application to execute a target operation corresponding to the target operation request;
Obtaining a target operation result corresponding to the target operation;
sending the target operation result to the first application;
wherein the first application and the second application are both configured at the user device.
According to one aspect of the present application, there is provided a method for performing a file management operation, the method comprising the steps of:
the hosting application calls a preset file management interface to generate a file management request, and the file management request is provided to a corresponding target application;
the target application calls a system interface of the user equipment based on a file management request generated by a corresponding hosting application to execute a corresponding file management operation, acquires a file operation result corresponding to the file management operation, and sends the file operation result to the hosting application;
the hosting application receives the file operation result;
and the host application and the target application corresponding to the hosted application are configured on the user equipment.
According to another aspect of the present application, there is provided a method for performing a target operation, characterized in that the method comprises:
the method comprises the steps that a first application calls a preset target operation interface to generate a target operation request, and the target operation request is provided to a corresponding second application;
The second application calls a system interface of the user equipment based on a target operation request generated by a corresponding first application to execute target operation corresponding to the target operation request, obtains a target operation result corresponding to the target operation, and sends the target operation result to the first application;
the first application receives the target operation result;
wherein the first application and the second application are both configured at the user device.
According to one aspect of the present application, there is provided an apparatus for performing a file management operation, wherein the apparatus includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the operations of the method for performing file management operations of any of the above.
According to another aspect of the present application, there is provided an apparatus for performing a target operation, wherein the apparatus includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the operations of the method for performing a target operation as described in any of the preceding claims.
According to another aspect of the application, there is provided a computer readable medium storing instructions that, when executed, cause a system to perform the operations of the method of any of the above.
Compared with the prior art, the application is convenient for adjusting (e.g. adding) the interface for the hosting application to execute the file management operation or other target operation of the user equipment, especially when adding the available related interfaces for the hosting application, the hosting application is not required to be upgraded, and a new interface is provided for the hosting application for access only by updating the interface based on the application (also called as an agent program) provided by the service provider or updating the application provided by the service provider, so that the service provider can conveniently customize the executable operation of the hosting application without being limited by the hosting application. Furthermore, according to the present application, the hosting application does not perform the above-described operations through the hosting application, so that a developer does not need to debug on the hosting application running on the user device when developing the relevant hosting application, but can run the corresponding agent on other platforms (e.g., PCs) and simulate to implement the corresponding operation interface, i.e., debug the relevant service on the corresponding platform.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a method flow for performing file management operations according to one embodiment of the application;
FIG. 2 illustrates the principles of performing file management operations based on a hosted application, according to one embodiment of the application;
FIG. 3 is a flow chart of a method for performing file management operations by a hosted application on a user device, according to another embodiment of the application;
FIGS. 4 and 5 illustrate the principles of performing file management operations based on a hosted application, respectively, in accordance with another embodiment of the application;
FIG. 6 is a flowchart of a method for performing file management operations by a target application on a user device, according to another embodiment of the application;
FIG. 7 illustrates a method flow for performing a target operation according to another embodiment of the application;
FIG. 8 is a flow chart of a method for performing a target operation by a first application on a user device according to another embodiment of the application;
FIG. 9 is a flowchart of a method for performing a target operation by a second application on a user device, according to another embodiment of the application;
Fig. 10 shows functional modules of a user device according to an embodiment of the application;
fig. 11 shows functional modules of a user equipment according to another embodiment of the present application;
fig. 12 shows functional modules of a user equipment according to another embodiment of the present application;
fig. 13 shows functional modules of a user equipment according to another embodiment of the present application;
FIG. 14 illustrates functional modules of an exemplary system that may be used with embodiments of the present application.
The same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
The application is described in further detail below with reference to the accompanying drawings.
In one exemplary configuration of the application, the terminal, the device of the service network, and the trusted party each include one or more processors (e.g., central processing units (Central Processing Unit, CPU)), input/output interfaces, network interfaces, and memory.
The Memory may include non-volatile Memory in a computer readable medium, random access Memory (Random Access Memory, RAM) and/or non-volatile Memory, etc., such as Read Only Memory (ROM) or Flash Memory (Flash Memory). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase-Change Memory (PCM), programmable Random Access Memory (Programmable Random Access Memory, PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (Dynamic Random Access Memory, DRAM), other types of Random Access Memory (Random Access Memory, RAM), read-Only Memory (ROM), electrically erasable programmable Read-Only Memory (EEPROM), flash Memory (Flash Memory) or other Memory technology, read-Only Memory (Compact Disc Read-Only Memory, CD-ROM), digital versatile disks (Digital Versatile Disc, DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission media, which may be used to store information that may be accessed by the computing device.
The device includes, but is not limited to, a user device, a network device, or a device formed by integrating a user device and a network device through a network. The user equipment includes, but is not limited to, any mobile electronic product which can perform man-machine interaction with a user (for example, perform man-machine interaction through a touch pad), such as a smart phone, a tablet computer and the like, and the mobile electronic product can adopt any operating system, such as an Android operating system, an iOS operating system and the like. The network device includes an electronic device capable of automatically performing numerical calculation and information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a digital signal processor (Digital Signal Processor, DSP), an embedded device, and the like. The network device includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud of servers; here, the Cloud is composed of a large number of computers or network servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, a virtual supercomputer composed of a group of loosely coupled computer sets. Including but not limited to the internet, wide area networks, metropolitan area networks, local area networks, VPN networks, wireless Ad Hoc networks (Ad Hoc networks), and the like. Preferably, the device may be a program running on the user device, the network device, or a device formed by integrating the user device and the network device, the touch terminal, or the network device and the touch terminal through a network.
Of course, those skilled in the art will appreciate that the above-described devices are merely examples, and that other devices now known or hereafter may be present as applicable to the present application, and are intended to be within the scope of the present application and are incorporated herein by reference.
In the description of the present application, the meaning of "a plurality" is two or more unless explicitly defined otherwise.
Some embodiments of the present application are implemented based on a user equipment, and the following describes in detail embodiments of the present application by taking the user equipment as an example.
According to one aspect of the present application, a method for performing file management operations is provided. Referring to fig. 1 and 2, the method comprises the steps of:
the hosting application calls a preset file management interface to generate a file management request, and the file management request is provided to a corresponding target application;
the target application calls a system interface of the user equipment based on a file management request generated by a corresponding hosting application to execute a corresponding file management operation, acquires a file operation result corresponding to the file management operation, and sends the file operation result to the hosting application; and
And the hosting application receives the file operation result.
The host application and the target application corresponding to the hosted application are both configured in the user equipment, for example, the host application and the target application are both installed in the user equipment.
Further description is provided below from the perspective of the hosted application and the target application, respectively, described above.
According to another aspect of the present application, a method for performing file management operations by a hosted application on a user device is provided. Referring to fig. 3, the method includes step S110, step S120, and step S130. In step S110, the user equipment invokes a preset file management interface in the hosting application to generate a file management request; in step S120, the user equipment provides the file management request to a corresponding target application (also referred to as "agent application") in the hosting application, where the target application enables the hosting application to complete the corresponding file management operation without depending on its host application; in step S130, the user device receives, in the hosting application, a file operation result sent by the target application based on the file management request. The host application and the target application corresponding to the hosted application are both configured in the user equipment (for example, the host application and the target application are both installed in the user equipment), and the file operation result is obtained by the target application calling a system interface of the user equipment based on the file management request to execute the corresponding file management operation.
Specifically, in step S110, the user device invokes a preset file management interface in the hosted application to generate a file management request. In some embodiments the file management interface is invoked by the hosted application, and the system generates a corresponding file management request for the user device to perform corresponding file management operations (including, but not limited to, copying, reading, writing, etc. operations on the corresponding file) on the corresponding file on the user device. In some embodiments, the file management interface is provided by another application (which may be referred to as a "target application") other than the hosted application and its corresponding host application. Wherein in some embodiments the hosted application loads some or all of the code and interprets execution by the host application to achieve the corresponding functionality.
In step S120, the user device provides the file management request to the corresponding target application in the hosting application, for example, the hosting application sends the generated file management request to the target application, where the file management request includes, in some embodiments, an operation object of the file management operation (for example, but not limited to, a storage path or a file name of the related file on the user device) and an operation method (for example, but not limited to, copying, reading, writing, etc.), so that the target application performs the corresponding file management operation on the operation object according to the operation method.
In step S130, the user device receives, in the hosting application, a file operation result sent by the target application based on the file management request.
In various embodiments of the present application, the preset file management interface is provided by the target application, when the file management operation needs to be performed on a certain file or a certain file in response to the related operation of the user, the hosting application does not need to directly call the system interface of the user equipment, and meanwhile, the corresponding hosting application does not need to directly call the system interface of the user equipment, so when the interface for the hosting application to perform the file management operation of the user equipment or other target operation is adjusted (e.g., newly added), especially when the available related interface is added to the hosting application, a developer does not need to issue a new version of hosting application, but only needs to update the interface based on the application (also referred to as an "agent") provided by the service provider or update the application provided by the service provider to provide a new interface for the hosting application to access, so that the service provider can conveniently customize the operations executable by the hosting application without being limited by the hosting application.
In some embodiments, in step S110, the user device invokes a preset file management interface in the hosting application based on the file management operation about the target file, so as to generate a file management request corresponding to the file management operation, so that the target application performs the file management operation corresponding to the file management operation (for example, the file management operation is initiated by the user in the hosting application), and the file management operation is not required to be performed by the hosting application, so that the developer of the target application can update the file management operation available to the user in the hosting application by updating the corresponding interface provided by the target application, and the hosting application is not required to be coordinated and updated. For example, as described above, the target application performs the corresponding file management operation on the target file (i.e., the operation object of the file management operation) according to the corresponding operation method, specifically, the target application performs the file management operation by calling the corresponding system interface (e.g., application programming interface, i.e., application Programming Interface, API) local to the user equipment system, and generates the corresponding file operation result (e.g., the file operation result includes copy success/failure, read success/failure, write success/failure, etc. according to the operation method on the operation object and the operation result of calling the system local interface by the target application in different embodiments) based on the content returned by the call.
In some embodiments, in step S110, the user device determines, in the hosting application, a corresponding target parameter based on a file management operation with respect to the target file, and invokes a preset file management interface based on the target parameter to generate a file management request corresponding to the file management operation, where the file management request includes the target parameter so that the hosting application provides the target parameter to the target application. For example, to facilitate the hosting application providing the target parameters to a target application, the target parameters are integrated in a format and included in the file management request; after receiving the file management request containing the target parameters, the target application analyzes the target parameters in the file management request, calls a system interface of the user equipment based on the target parameters to complete corresponding functions, and returns an execution result to the hosting application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket; and in step S120, the user equipment sends the file management request to the local server started by the corresponding target application in the hosting application, so as to provide the file management request to the target application. In some embodiments, referring to fig. 4, the target application first starts a local server, where the local server receives a file management request sent by the hosted application and returns a corresponding file operation result to the hosted application. For example, first, a target application (also referred to as "proxy application") is running on the user equipment, where the target application makes the hosting application complete the corresponding file management operation without depending on its host application, and the target application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number can be arbitrarily defined); accordingly, the hosting application sends an HTTP request containing the target parameters to the local server, and receives the file operation results returned by the local server after the target application performs the corresponding operations based on the target parameters, which in some embodiments returns the results in json format.
In some embodiments, a file management script file is built in the target application, where the file management script file includes one or several preset file management interfaces for executing various file management operations; by updating (including but not limited to adding, modifying, removing) the relevant file management interfaces in the file management script file, a developer of the service provider (for example, a developer of the target application) can conveniently control or expand the interfaces accessible to the hosted application or the executable file management operations, so that corresponding rights management or function expansion is realized without updating the hosted application itself or updating the host application corresponding to the hosted application. Accordingly, the above step S110 includes sub-step S111 and sub-step S112 (neither shown). In sub-step S111, the user equipment obtains a file management script file provided by a corresponding target application in the hosted application, where the file management script file includes at least one preset file management interface; in sub-step S112, the user equipment invokes a corresponding file management interface from the at least one preset file management interface based on a file management operation with respect to the target file in the hosting application to generate a file management request corresponding to the file management operation. In one embodiment, the file management script file name is agent js, which is provided by the target application for access by the hosted application, e.g., the file management script file is sent by the target application to the hosted application or loaded by the hosted application before the hosted application invokes the associated file management interface; wherein the file management script file agent. Js provides some file management interfaces written in advance, such as:
FileSystemManager. Access (Object)// determine if a file/directory exists
File System manager copyFile (Object) per copy File
FileSystemManager. GetFileInfo (Object)// acquire File information
FileSystemManager.mkdir (Object)// create directory
FileSystemManager.readdir (Object)// read directory
FileSystemManager.readFile (Object)// read File content
File System manager, writeFile (Object)// write File content
File System manager.rename (Object)// rename File
FileSystemManager. Unlink (Object)// delete File
-…
The file management interface is called by the hosting application after the hosting application loads the file management script file agent. Js, for example, an access address (for example, http:// 127.0.1:8800/agent. Js) of the script file is inserted at a proper position of a code of the hosting application, and then the hosting application realizes specific function calling in a form of "file System manager. Access (Object)", so as to simplify a calling mode. In an embodiment in which the target application starts a local server in advance and communicates with the hosted application through the local server, the above functions of each file management interface are implemented by sending an HTTP request in URL format to the local server by AJAX, in the following format generally:
http://127.0.0.1:8800/apiname=apiname&param1=value1&param2=value2...
Where "apiname" represents the interface name of the call, "param1=value 1" represents the value of the 1 st parameter as value1, and "param2=value 2" represents the value of the 2 nd parameter as value2, and so on.
In accordance with another aspect of the present application, there is provided a method for performing a file management operation by a target application on a user device, corresponding to the method for performing a file management operation by a hosted application on a user device described above. Referring to fig. 6, the method includes step S210, step S220, and step S230. In step S210, the user equipment invokes a system interface of the user equipment to execute a corresponding file management operation based on a file management request generated by a corresponding hosting application in the target application; in step S220, the user equipment obtains a file operation result corresponding to the file management operation in the target application; in step S230, the user equipment sends the file operation result to the hosting application in the target application. And the host application and the target application corresponding to the hosted application are configured on the user equipment.
Specifically, in step S210, the user device invokes a system interface of the user device to perform a corresponding file management operation based on a file management request generated by a corresponding hosted application in a target application. In some embodiments the target application provides one or more file management interfaces for the hosted application call, which when invoked, will generate corresponding file management requests for the user device to perform corresponding file management operations (including, but not limited to, copying, reading, writing, etc. operations on the corresponding file) on the user device. In some embodiments, the file management interface is provided by another application (e.g., a target application) other than the hosted application and its corresponding host application. Wherein in some embodiments the hosted application loads some or all of the code and interprets execution by the host application to achieve the corresponding functionality.
In step S220, the user equipment obtains a file operation result corresponding to the file management operation in the target application. For example, after the target application invokes the system interface of the user device to perform a corresponding file management operation (including, but not limited to, copying, reading, writing, etc.), the user device generates a file operation result based on the content returned by the system (e.g., the file operation result includes copying success/failure, reading success/failure, writing success/failure, etc., and may be different according to the operation method for the operation object and the operation result of the target application invoking the system local interface in different embodiments).
In step S230, the user equipment sends the file operation result to the hosting application in the target application.
In various embodiments of the present application, the target application provides a preset file management interface for the hosted application to call. The hosting application does not need to directly call the system interface of the user equipment, and the corresponding hosting application does not need to directly call the system interface of the user equipment, so when an interface for the hosting application to execute file management operation or other target operation of the user equipment is adjusted (for example, newly added), particularly when an available relevant interface is added for the hosting application, a developer does not need to issue a new version of the hosting application, but only needs to update the interface provided by the target application based on the target application (also called as a proxy program) provided by the service provider, or update the target application provided by the service provider, so that the new interface can be provided for the hosting application for access, and the service provider can conveniently customize the executable operation of the hosting application without being limited by the hosting application.
In some embodiments, the file management request is generated by the hosting application invoking a preset file management interface based on a file management operation on the target file. For example, as described above, the target application performs the corresponding file management operation on the target file (i.e., the operation object of the file management operation) according to the corresponding operation method, specifically, the target application performs the file management operation by calling the corresponding system interface (e.g., application programming interface, i.e., application Programming Interface, API) local to the user equipment system, and generates the corresponding file operation result (e.g., the file operation result includes copy success/failure, read success/failure, write success/failure, etc. according to the operation method on the operation object and the operation result of calling the system local interface by the target application in different embodiments) based on the content returned by the call.
In some embodiments, in order to facilitate the hosting application to provide the target parameters to the target application, in step S210, the user device determines corresponding call parameters in the target application based on the target parameters included in the file management request generated by the corresponding hosting application, and calls a system interface of the user device based on the call parameters to perform the corresponding file management operation. For example, the target parameters are integrated in a format and included in the file management request; after receiving the file management request containing the target parameters, the target application analyzes the target parameters in the file management request, calls a system interface of the user equipment based on the target parameters to complete corresponding functions, and returns an execution result to the hosting application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket. The above method further comprises step S240 (not shown). In this step S240, the user equipment starts a local server on the user equipment in the target application; subsequently, in step S210, the user device receives, in the target application, a file management request generated by the corresponding hosting application through the local server, and invokes a system interface of the user device corresponding to the file management request to execute a file management operation corresponding to the file management request, where the file management request is generated based on a hypertext transfer protocol. In some embodiments, referring to fig. 4, the target application first starts a local server, where the local server receives a file management request sent by the hosted application and returns a corresponding file operation result to the hosted application. For example, referring to FIG. 5, a target application (also referred to as a "proxy application") is first running on a user device, which enables a hosting application to complete a corresponding file management operation without relying on its host application, and the target application starts a local HTTP Server (Server) with access address http://127.0.0.1 and port number 8800 (for example only, the specific port number can be arbitrarily defined); accordingly, the hosting application sends an HTTP request containing the target parameters to the local server, and receives a file operation result returned by the local server after the target application performs corresponding operations based on the target parameters. In some embodiments, after receiving the HTTP request, the local Server (HTTP Server) parses out the API name and parameters corresponding to the interface to complete the call of the local API of the user equipment, where the local Server returns the result through json format.
In some embodiments, a file management script file is built in the target application, where the file management script file includes one or several preset file management interfaces for executing various file management operations; by updating (including but not limited to adding, modifying and removing) the relevant file management interfaces in the file management script file, a developer of the service provider can conveniently control or expand interfaces accessible to the hosted application or executable file management operations, thereby realizing corresponding rights management or function expansion without updating the hosted application itself or updating the host application corresponding to the hosted application. The specific embodiments of the file management script file are the same as or substantially the same as those described above, and are not described in detail herein and incorporated by reference.
The target application provided by the above embodiments may further allow a plurality of different hosted applications (including a hosted application loaded and run by the same host application and a hosted application loaded and run by different host applications) to perform file management operations respectively. In particular, the design objective of each hosted application may vary from one hosted application to another. In some embodiments, for the purpose of protecting user data and privacy and keeping the user equipment system stable, in the above step S210, the user equipment receives, in the target application, a file management request generated by a corresponding hosting application, and invokes a system interface of the user equipment to perform a corresponding file management operation based on operation authority information of the hosting application about the file management request, for example, to implement authority management of file management of a plurality of hosting applications based on an authority management scheme.
According to another aspect of the present application, a method for performing a target operation is provided. Referring to fig. 7, the method includes the steps of:
the method comprises the steps that a first application calls a preset target operation interface to generate a target operation request, and the target operation request is provided to a corresponding second application;
the second application calls a system interface of the user equipment based on a target operation request generated by a corresponding first application to execute target operation corresponding to the target operation request, obtains a target operation result corresponding to the target operation, and sends the target operation result to the first application;
the first application receives the target operation result;
wherein the first application and the second application are both configured at the user device.
Further description is provided below from the perspective of the first application and the second application described above, respectively.
According to another aspect of the present application, a method for performing a target operation by a first application on a user device is provided. Referring to fig. 8, the method includes step S310, step S320, and step S330. In step S310, the user equipment invokes a preset target operation interface in the first application to generate a target operation request; in step S320, the user equipment provides the target operation request to the corresponding second application in the first application; in step S330, the user equipment receives, in the first application, a target operation result sent by the second application based on the target operation request. Wherein the first application and the second application are both configured to the user device (e.g., the first application and the second application are both installed to the user device), the target operation result is obtained by the second application invoking a system interface of the user device based on the target operation request to perform a corresponding file management operation. The target operations include, but are not limited to, file management, accessing hardware resources on the user device, accessing peripherals of the user device, accessing secured data, etc., and it should be understood by those skilled in the art that these target operations are merely examples and not limiting of any particular embodiment of the present application, and that other target operations that may now be present or later come within the scope of the present application are intended to be encompassed by the present application and are incorporated herein by reference.
Specifically, in step S310, the user equipment invokes a preset target operation interface in the first application to generate a target operation request. In some embodiments, the target operation interface is invoked by the first application, and the system generates a corresponding target operation request after the target operation interface is invoked, where the target operation request is used by the user equipment to perform a corresponding target operation (including, but not limited to, file management, accessing a hardware resource on the user equipment, accessing a peripheral of the user equipment, accessing confidential data, etc.). In some embodiments, the target operation interface is provided by another application (which may be referred to as a "second application") other than the first application.
The method for performing the target operation by the first application on the user device is substantially the same as the specific embodiment of the method for performing the target operation by the hosted application on the user device described above, except that the target operation performed by the first application includes, but is not limited to, file management, accessing a hardware resource on the user device, accessing a peripheral device of the user device, accessing secured data, and the like. For example, if a first application needs to query access information of one or more wireless access points shared by other users to connect the user device to a certain wireless access point, since the internal implementation of the query operation needs to be kept secret, the service provider should not provide the relevant functions to the developer of the first application in the form of a software development kit (Software Development Kit, SDK), but provide the relevant functions to the developer of the first application through the second application in the above embodiment, so as to keep the specific implementation of the function of querying the password secret.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket; and in step S320, the user equipment sends the target operation request to the local server started by the corresponding second application in the first application, so as to provide the target operation request to the second application. In some embodiments, the second application first starts a local server, where the local server receives the target operation request sent by the first application and returns a corresponding target operation result to the first application. For example, a second application (also referred to as "proxy application") is first running on the ue, and the second application may call the system interface of the ue to perform the corresponding function, where the second application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number may be arbitrarily defined); accordingly, the first application sends an HTTP request including the target parameter to the local server, and receives a file operation result returned by the local server after the second application performs a corresponding operation based on the target parameter, and in some embodiments, the local server returns the result in json format.
In some embodiments, the second application embeds a target operation script file, where the target operation script file includes one or several preset target operation interfaces for executing various target operations; by updating (including but not limited to adding, modifying, removing) the relevant target operation interfaces in the target operation script file, a developer of the service provider (for example, a developer of the second application) can conveniently control or expand the interfaces accessible or the target operations capable of being executed by the first application, thereby realizing corresponding rights management or function expansion without updating the first application itself.
In accordance with another aspect of the present application, there is provided a method for performing a target operation by a second application on a user device, corresponding to the method for performing a target operation by a first application on a user device described above. Referring to fig. 9, the method includes step S410, step S420, and step S430. In step S410, the user equipment invokes a system interface of the user equipment in the second application based on the target operation request generated by the corresponding first application to execute the target operation corresponding to the target operation request; in step S420, the user equipment obtains a target operation result corresponding to the target operation in the second application; in step S430, the user equipment sends the target operation result to the first application in the second application. Wherein the first application and the second application are both configured at the user device.
Specifically, in step S410, the user equipment invokes, in the second application, based on the target operation request generated by the corresponding first application, a system interface of the user equipment to execute the target operation corresponding to the target operation request. In some embodiments the second application provides one or more target operation interfaces for the first application call, which when invoked will generate a corresponding target operation request for the user device to perform a corresponding target operation (including, but not limited to, file management, accessing hardware resources on the user device, accessing peripherals of the user device, accessing secured data, etc.). In some embodiments, the target operation interface is provided by another application (e.g., a second application) other than the first application.
In step S420, the user equipment obtains a target operation result corresponding to the target operation in the second application. For example, after the second application invokes the system interface of the user device to perform a corresponding target operation (e.g., including, but not limited to, file management, accessing a hardware resource on the user device, accessing a peripheral of the user device, accessing secured data, etc.), the user device generates a target operation result (e.g., file operation success/failure, accessing a resource/peripheral/data success/failure, etc.) based on the content returned by the system, which may be different in different embodiments depending on the method of operation on the operation object and the operation result of the second application invoking the system local interface.
In step S430, the user equipment sends the target operation result to the first application in the second application.
In various embodiments of the present application, the second application provides a preset target operation interface for the first application to call. The first application does not need to directly call the system interface of the user equipment, so when the interface for the first application to execute the target operation of the user equipment is adjusted (e.g. newly added), especially when the available related interface is increased for the first application, the developer only needs to update the interface provided by the second application (also called as "agent program") based on the second application provided by the service provider, or update the second application provided by the service provider, so that the new interface can be provided for the first application to access, and thus the service provider can conveniently customize the executable operation of the first application without being limited by the first application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket. The above method further comprises step S440 (not shown). In this step S440, the user equipment starts a local server on said user equipment in a second application; subsequently, in step S410, the user equipment receives, in the second application, a target operation request generated by the corresponding first application through the local server, and invokes a system interface of the user equipment corresponding to the target operation request to execute a target operation corresponding to the target operation request, where the target operation request is generated based on a hypertext transfer protocol. In some embodiments, the second application first starts a local server, where the local server receives the target operation request sent by the first application and returns a corresponding target operation result to the first application. For example, a second application (also referred to as "proxy application") is first running on the ue, and the second application may call the system interface of the ue to perform the corresponding function, where the second application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number may be arbitrarily defined); accordingly, the first application sends an HTTP request including the target parameter to the local server, and receives a target operation result returned by the local server after the second application performs a corresponding operation based on the target parameter, and in some embodiments, the local server returns the result in json format.
In some embodiments, the second application embeds a target operation script file, where the target operation script file includes one or several preset target operation interfaces for executing various target operations; by updating (including but not limited to adding, modifying, removing) the relevant target operation interfaces in the target operation script file, a developer of the service provider (for example, a developer of the second application) can conveniently control or expand the interfaces accessible or the target operations capable of being executed by the first application, thereby realizing corresponding rights management or function expansion without updating the first application itself.
According to another aspect of the present application, a user device 100 for performing file management operations by a hosted application is provided. Referring to fig. 10, the user equipment 100 includes a first sub-module 110, a first second module 120, and a first third module 130. A first module 110 for calling a preset file management interface in the hosted application to generate a file management request; the first second module 120 provides the file management request in the hosted application to a corresponding target application (also referred to as a "proxy application") that enables the hosted application to complete the corresponding file management operation without relying on its host application; the first three modules 130 receive, in the hosted application, a file operation result sent by the target application based on the file management request. The host application and the target application corresponding to the hosted application are both configured in the user equipment (for example, the host application and the target application are both installed in the user equipment), and the file operation result is obtained by the target application calling a system interface of the user equipment based on the file management request to execute the corresponding file management operation.
Specifically, the first module 110 invokes a preset file management interface in the hosted application to generate a file management request. In some embodiments the file management interface is invoked by the hosted application, and the system generates a corresponding file management request for the user device to perform corresponding file management operations (including, but not limited to, copying, reading, writing, etc. operations on the corresponding file) on the corresponding file on the user device. In some embodiments, the file management interface is provided by another application (which may be referred to as a "target application") other than the hosted application and its corresponding host application. Wherein in some embodiments the hosted application loads some or all of the code and interprets execution by the host application to achieve the corresponding functionality.
The first second module 120 provides the file management request to a corresponding target application in the hosted application, e.g., the hosted application sends the generated file management request to the target application, where the file management request in some embodiments includes an operation object (e.g., including but not limited to a storage path or a file name of a related file on the user device) of a file management operation and an operation method (e.g., including but not limited to copying, reading, writing, etc.) for the target application to perform the corresponding file management operation on the operation object according to the operation method.
The first three modules 130 receive, in the hosted application, a file operation result sent by the target application based on the file management request.
In various embodiments of the present application, the preset file management interface is provided by the target application, when the file management operation needs to be performed on a certain file or a certain file in response to the related operation of the user, the hosting application does not need to directly call the system interface of the user equipment, and meanwhile, the corresponding hosting application does not need to directly call the system interface of the user equipment, so when the interface for the hosting application to perform the file management operation of the user equipment or other target operation is adjusted (e.g., newly added), especially when the available related interface is added to the hosting application, a developer does not need to issue a new version of hosting application, but only needs to update the interface based on the application (also referred to as an "agent") provided by the service provider or update the application provided by the service provider to provide a new interface for the hosting application to access, so that the service provider can conveniently customize the operations executable by the hosting application without being limited by the hosting application.
In some embodiments, the first module 110 invokes a preset file management interface in the hosting application based on a file management operation about the target file, so as to generate a file management request corresponding to the file management operation, so that the target application can execute the file management operation corresponding to the file management operation (for example, the file management operation is initiated by a user in the hosting application), and the file management operation is not required to be executed by the hosting application, so that a developer of the target application can update the file management operation available to the user in the hosting application by updating the corresponding interface provided by the target application, and the hosting application is not required to be coordinated and updated. For example, as described above, the target application performs the corresponding file management operation on the target file (i.e., the operation object of the file management operation) according to the corresponding operation method, specifically, the target application performs the file management operation by calling the corresponding system interface (e.g., application programming interface, i.e., application Programming Interface, API) local to the user equipment system, and generates the corresponding file operation result (e.g., the file operation result includes copy success/failure, read success/failure, write success/failure, etc. according to the operation method on the operation object and the operation result of calling the system local interface by the target application in different embodiments) based on the content returned by the call.
In some embodiments, the first module 110 determines, in the hosted application, a corresponding target parameter based on a file management operation with respect to a target file, and invokes a preset file management interface based on the target parameter to generate a file management request corresponding to the file management operation, where the file management request includes the target parameter, so that the hosted application provides the target parameter to the target application. For example, to facilitate the hosting application providing the target parameters to a target application, the target parameters are integrated in a format and included in the file management request; after receiving the file management request containing the target parameters, the target application analyzes the target parameters in the file management request, calls a system interface of the user equipment based on the target parameters to complete corresponding functions, and returns an execution result to the hosting application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket; and the first second module 120 sends the file management request to the local server initiated by the corresponding target application in the hosted application to provide the file management request to the target application. In some embodiments, referring to fig. 4, the target application first starts a local server, where the local server receives a file management request sent by the hosted application and returns a corresponding file operation result to the hosted application. For example, first, a target application (also referred to as "proxy application") is running on the user equipment, where the target application makes the hosting application complete the corresponding file management operation without depending on its host application, and the target application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number can be arbitrarily defined); accordingly, the hosting application sends an HTTP request containing the target parameters to the local server, and receives the file operation results returned by the local server after the target application performs the corresponding operations based on the target parameters, which in some embodiments returns the results in json format.
In some embodiments, a file management script file is built in the target application, where the file management script file includes one or several preset file management interfaces for executing various file management operations; by updating (including but not limited to adding, modifying, removing) the relevant file management interfaces in the file management script file, a developer of the service provider (for example, a developer of the target application) can conveniently control or expand the interfaces accessible to the hosted application or the executable file management operations, so that corresponding rights management or function expansion is realized without updating the hosted application itself or updating the host application corresponding to the hosted application. Accordingly, the first one-to-one module 110 includes a first unit 111 and a second unit 112 (both not shown). The first unit 111 obtains a file management script file provided by a corresponding target application in the hosted application, wherein the file management script file comprises at least one preset file management interface; the second unit 112 invokes a corresponding file management interface from the at least one preset file management interface based on a file management operation on the target file in the hosted application to generate a file management request corresponding to the file management operation. In one embodiment, the file management script file name is agent js, which is provided by the target application for access by the hosted application, e.g., the file management script file is sent by the target application to the hosted application or loaded by the hosted application before the hosted application invokes the associated file management interface; wherein the file management script file agent. Js provides some file management interfaces written in advance, such as:
FileSystemManager. Access (Object)// determine if a file/directory exists
File System manager copyFile (Object) per copy File
FileSystemManager. GetFileInfo (Object)// acquire File information
FileSystemManager.mkdir (Object)// create directory
FileSystemManager.readdir (Object)// read directory
FileSystemManager.readFile (Object)// read File content
File System manager, writeFile (Object)// write File content
File System manager.rename (Object)// rename File
FileSystemManager. Unlink (Object)// delete File
-…
The file management interface is called by the hosting application after the hosting application loads the file management script file agent. Js, for example, an access address (for example, http:// 127.0.1:8800/agent. Js) of the script file is inserted at a proper position of a code of the hosting application, and then the hosting application realizes specific function calling in a form of "file System manager. Access (Object)", so as to simplify a calling mode. In an embodiment in which the target application starts a local server in advance and communicates with the hosted application through the local server, the above functions of each file management interface are implemented by sending an HTTP request in URL format to the local server by AJAX, in the following format generally:
http://127.0.0.1:8800/apiname=apiname&param1=value1&param2=value2...
Where "apiname" represents the interface name of the call, "param1=value 1" represents the value of the 1 st parameter as value1, and "param2=value 2" represents the value of the 2 nd parameter as value2, and so on.
In correspondence with the above-described user device for performing a file management operation by a hosted application, according to another aspect of the present application, there is provided a user device 200 for performing a file management operation by a target application. Referring to fig. 11, the user equipment 200 includes a second first module 210, a second module 220, and a second third module 230. The second module 210 invokes a system interface of the user device to perform a corresponding file management operation in the target application based on a file management request generated by a corresponding hosted application; the second module 220 obtains a file operation result corresponding to the file management operation in the target application; the second three modules 230 send the file operation results to the hosted application in the target application. And the host application and the target application corresponding to the hosted application are configured on the user equipment.
Specifically, the second module 210 invokes a system interface of the user device to perform a corresponding file management operation in the target application based on a file management request generated by the corresponding hosted application. In some embodiments the target application provides one or more file management interfaces for the hosted application call, which when invoked, will generate corresponding file management requests for the user device to perform corresponding file management operations (including, but not limited to, copying, reading, writing, etc. operations on the corresponding file) on the user device. In some embodiments, the file management interface is provided by another application (e.g., a target application) other than the hosted application and its corresponding host application. Wherein in some embodiments the hosted application loads some or all of the code and interprets execution by the host application to achieve the corresponding functionality.
The second module 220 obtains a file operation result corresponding to the file management operation in the target application. For example, after the target application invokes the system interface of the user device to perform a corresponding file management operation (including, but not limited to, copying, reading, writing, etc.), the user device generates a file operation result based on the content returned by the system (e.g., the file operation result includes copying success/failure, reading success/failure, writing success/failure, etc., and may be different according to the operation method for the operation object and the operation result of the target application invoking the system local interface in different embodiments).
The second three modules 230 send the file operation results to the hosted application in the target application.
In various embodiments of the present application, the target application provides a preset file management interface for the hosted application to call. The hosting application does not need to directly call the system interface of the user equipment, and the corresponding hosting application does not need to directly call the system interface of the user equipment, so when an interface for the hosting application to execute file management operation or other target operation of the user equipment is adjusted (for example, newly added), particularly when an available relevant interface is added for the hosting application, a developer does not need to issue a new version of the hosting application, but only needs to update the interface provided by the target application based on the target application (also called as a proxy program) provided by the service provider, or update the target application provided by the service provider, so that the new interface can be provided for the hosting application for access, and the service provider can conveniently customize the executable operation of the hosting application without being limited by the hosting application.
In some embodiments, the file management request is generated by the hosting application invoking a preset file management interface based on a file management operation on the target file. For example, as described above, the target application performs the corresponding file management operation on the target file (i.e., the operation object of the file management operation) according to the corresponding operation method, specifically, the target application performs the file management operation by calling the corresponding system interface (e.g., application programming interface, i.e., application Programming Interface, API) local to the user equipment system, and generates the corresponding file operation result (e.g., the file operation result includes copy success/failure, read success/failure, write success/failure, etc. according to the operation method on the operation object and the operation result of calling the system local interface by the target application in different embodiments) based on the content returned by the call.
In some embodiments, to facilitate the hosted application providing the target parameters to the target application, the second module 210 determines corresponding call parameters in the target application based on the target parameters included in the file management request generated by the corresponding hosted application, and invokes a system interface of the user device to perform the corresponding file management operation based on the call parameters. For example, the target parameters are integrated in a format and included in the file management request; after receiving the file management request containing the target parameters, the target application analyzes the target parameters in the file management request, calls a system interface of the user equipment based on the target parameters to complete corresponding functions, and returns an execution result to the hosting application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket. The above-mentioned user equipment 200 further comprises a second fourth module 240 (not shown). The second fourth module 240 starts a local server on the user equipment in the target application; the second module 210 then receives, in the target application, a file management request generated by the corresponding hosted application via the local server, and invokes a system interface of the user device corresponding to the file management request to perform a file management operation corresponding to the file management request, where the file management request is generated based on a hypertext transfer protocol. In some embodiments, referring to fig. 4, the target application first starts a local server, where the local server receives a file management request sent by the hosted application and returns a corresponding file operation result to the hosted application. For example, referring to FIG. 5, a target application (also referred to as a "proxy application") is first running on a user device, which enables a hosting application to complete a corresponding file management operation without relying on its host application, and the target application starts a local HTTP Server (Server) with access address http://127.0.0.1 and port number 8800 (for example only, the specific port number can be arbitrarily defined); accordingly, the hosting application sends an HTTP request containing the target parameters to the local server, and receives a file operation result returned by the local server after the target application performs corresponding operations based on the target parameters. In some embodiments, after receiving the HTTP request, the local Server (HTTP Server) parses out the API name and parameters corresponding to the interface to complete the call of the local API of the user equipment, where the local Server returns the result through json format.
In some embodiments, a file management script file is built in the target application, where the file management script file includes one or several preset file management interfaces for executing various file management operations; by updating (including but not limited to adding, modifying and removing) the relevant file management interfaces in the file management script file, a developer of the service provider can conveniently control or expand interfaces accessible to the hosted application or executable file management operations, thereby realizing corresponding rights management or function expansion without updating the hosted application itself or updating the host application corresponding to the hosted application. The specific embodiments of the file management script file are the same as or substantially the same as those described above, and are not described in detail herein and incorporated by reference.
The target application provided by the above embodiments may further allow a plurality of different hosted applications (including a hosted application loaded and run by the same host application and a hosted application loaded and run by different host applications) to perform file management operations respectively. In particular, the design objective of each hosted application may vary from one hosted application to another. In some embodiments, for the purpose of protecting the data and privacy of the user and keeping the system of the user device stable, the second module 210 receives, in the target application, a file management request generated by a corresponding hosting application, and invokes a system interface of the user device to perform a corresponding file management operation based on the operation authority information of the hosting application about the file management request, for example, to implement authority management of file management of multiple hosting applications based on an authority management scheme.
According to another aspect of the present application, a user equipment 300 for performing a target operation by a first application is provided. Referring to fig. 12, the user equipment 300 includes a third first module 310, a third second module 320, and a third module 330. The third module 310 invokes a preset target operation interface in the first application to generate a target operation request; the third second module 320 provides the target operation request to the corresponding second application in the first application; the third module 330 receives, in the first application, a target operation result sent by the second application based on the target operation request. Wherein the first application and the second application are both configured to the user device (e.g., the first application and the second application are both installed to the user device), the target operation result is obtained by the second application invoking a system interface of the user device based on the target operation request to perform a corresponding file management operation. The target operations include, but are not limited to, file management, accessing hardware resources on the user device, accessing peripherals of the user device, accessing secured data, etc., and it should be understood by those skilled in the art that these target operations are merely examples and not limiting of any particular embodiment of the present application, and that other target operations that may now be present or later come within the scope of the present application are intended to be encompassed by the present application and are incorporated herein by reference.
Specifically, the third module 310 invokes a preset target operation interface in the first application to generate a target operation request. In some embodiments, the target operation interface is invoked by the first application, and the system generates a corresponding target operation request after the target operation interface is invoked, where the target operation request is used by the user equipment to perform a corresponding target operation (including, but not limited to, file management, accessing a hardware resource on the user equipment, accessing a peripheral of the user equipment, accessing confidential data, etc.). In some embodiments, the target operation interface is provided by another application (which may be referred to as a "second application") other than the first application.
The method for performing the target operation by the first application on the user device is substantially the same as the specific embodiment of the method for performing the target operation by the hosted application on the user device described above, except that the target operation performed by the first application includes, but is not limited to, file management, accessing a hardware resource on the user device, accessing a peripheral device of the user device, accessing secured data, and the like. For example, if a first application needs to query access information of one or more wireless access points shared by other users to connect the user device to a certain wireless access point, since the internal implementation of the query operation needs to be kept secret, the service provider should not provide the relevant functions to the developer of the first application in the form of a software development kit (Software Development Kit, SDK), but provide the relevant functions to the developer of the first application through the second application in the above embodiment, so as to keep the specific implementation of the function of querying the password secret.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket; and the third second module 320 sends the target operation request to a local server initiated by the corresponding second application in the first application, so as to provide the target operation request to the second application. In some embodiments, the second application first starts a local server, where the local server receives the target operation request sent by the first application and returns a corresponding target operation result to the first application. For example, a second application (also referred to as "proxy application") is first running on the ue, and the second application may call the system interface of the ue to perform the corresponding function, where the second application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number may be arbitrarily defined); accordingly, the first application sends an HTTP request including the target parameter to the local server, and receives a file operation result returned by the local server after the second application performs a corresponding operation based on the target parameter, and in some embodiments, the local server returns the result in json format.
In some embodiments, the second application embeds a target operation script file, where the target operation script file includes one or several preset target operation interfaces for executing various target operations; by updating (including but not limited to adding, modifying, removing) the relevant target operation interfaces in the target operation script file, a developer of the service provider (for example, a developer of the second application) can conveniently control or expand the interfaces accessible or the target operations capable of being executed by the first application, thereby realizing corresponding rights management or function expansion without updating the first application itself.
In correspondence with the above-described user equipment for performing a target operation by a first application, according to another aspect of the present application, there is provided a user equipment 400 for performing a target operation by a second application. Referring to fig. 13, the user equipment 400 includes a fourth first module 410, a fourth second module 420, and a fourth third module 430. A fourth module 410 invokes a system interface of the user equipment in the second application based on the target operation request generated by the corresponding first application to execute the target operation corresponding to the target operation request; a fourth second module 420 obtains a target operation result corresponding to the target operation in a second application; the fourth third module 430 sends the target operation result to the first application in the second application. Wherein the first application and the second application are both configured at the user device.
Specifically, the fourth module 410 invokes, in the second application, the system interface of the user equipment based on the target operation request generated by the corresponding first application, to execute the target operation corresponding to the target operation request. In some embodiments the second application provides one or more target operation interfaces for the first application call, which when invoked will generate a corresponding target operation request for the user device to perform a corresponding target operation (including, but not limited to, file management, accessing hardware resources on the user device, accessing peripherals of the user device, accessing secured data, etc.). In some embodiments, the target operation interface is provided by another application (e.g., a second application) other than the first application.
The fourth second module 420 obtains a target operation result corresponding to the target operation in the second application. For example, after the second application invokes the system interface of the user device to perform a corresponding target operation (e.g., including, but not limited to, file management, accessing a hardware resource on the user device, accessing a peripheral of the user device, accessing secured data, etc.), the user device generates a target operation result (e.g., file operation success/failure, accessing a resource/peripheral/data success/failure, etc.) based on the content returned by the system, which may be different in different embodiments depending on the method of operation on the operation object and the operation result of the second application invoking the system local interface.
The fourth third module 430 sends the target operation result to the first application in the second application.
In various embodiments of the present application, the second application provides a preset target operation interface for the first application to call. The first application does not need to directly call the system interface of the user equipment, so when the interface for the first application to execute the target operation of the user equipment is adjusted (e.g. newly added), especially when the available related interface is increased for the first application, the developer only needs to update the interface provided by the second application (also called as "agent program") based on the second application provided by the service provider, or update the second application provided by the service provider, so that the new interface can be provided for the first application to access, and thus the service provider can conveniently customize the executable operation of the first application without being limited by the first application.
In some embodiments, the file management requests described above are generated based on the hypertext transfer protocol (Hyper-Text Transfer Protocol, HTTP) to facilitate communication between processes via socket. The above-mentioned user equipment 400 further comprises a fourth module 440 (not shown). The fourth module 440 starts a local server on the user device in the second application; the fourth module 410 then receives, in the second application, a target operation request generated by the corresponding first application via the local server, and invokes a system interface of the user device corresponding to the target operation request to execute a target operation corresponding to the target operation request, where the target operation request is generated based on a hypertext transfer protocol. In some embodiments, the second application first starts a local server, where the local server receives the target operation request sent by the first application and returns a corresponding target operation result to the first application. For example, a second application (also referred to as "proxy application") is first running on the ue, and the second application may call the system interface of the ue to perform the corresponding function, where the second application starts a local HTTP Server (Server) with a port number of 8800 (for example only, a specific port number may be arbitrarily defined); accordingly, the first application sends an HTTP request including the target parameter to the local server, and receives a target operation result returned by the local server after the second application performs a corresponding operation based on the target parameter, and in some embodiments, the local server returns the result in json format.
In some embodiments, the second application embeds a target operation script file, where the target operation script file includes one or several preset target operation interfaces for executing various target operations; by updating (including but not limited to adding, modifying, removing) the relevant target operation interfaces in the target operation script file, a developer of the service provider (for example, a developer of the second application) can conveniently control or expand the interfaces accessible or the target operations capable of being executed by the first application, thereby realizing corresponding rights management or function expansion without updating the first application itself.
The application also provides a computer readable storage medium storing computer code which, when executed, performs a method as claimed in any preceding claim.
The application also provides a computer program product which, when executed by a computer device, performs a method as claimed in any preceding claim.
The present application also provides a computer device comprising:
one or more processors;
a memory for storing one or more computer programs;
The one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the method of any preceding claim.
FIG. 14 illustrates an exemplary system that may be used to implement various embodiments described in the present application.
As shown in fig. 14, in some embodiments, the system 1000 can be implemented as any of the user devices of the various described embodiments. In some embodiments, system 1000 can include one or more computer-readable media (e.g., system memory or NVM/storage 1020) having instructions and one or more processors (e.g., processor(s) 1005) coupled with the one or more computer-readable media and configured to execute the instructions to implement the modules to perform the actions described in this disclosure.
For one embodiment, the system control module 1010 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1005 and/or any suitable device or component in communication with the system control module 1010.
The system control module 1010 may include a memory controller module 1030 to provide an interface to the system memory 1015. The memory controller module 1030 may be a hardware module, a software module, and/or a firmware module.
System memory 1015 may be used, for example, to load and store data and/or instructions for system 1000. For one embodiment, system memory 1015 may comprise any suitable volatile memory, such as, for example, suitable DRAM. In some embodiments, the system memory 1015 may comprise double data rate type four synchronous dynamic random access memory (DDR 4 SDRAM).
For one embodiment, the system control module 1010 may include one or more input/output (I/O) controllers to provide an interface to NVM/storage 1020 and communication interface(s) 1025.
For example, NVM/storage 1020 may be used to store data and/or instructions. NVM/storage 1020 may include any suitable nonvolatile memory (e.g., flash memory) and/or may include any suitable nonvolatile storage device(s) (e.g., hard Disk drive(s) (HDD), compact Disk drive(s) (CD) and/or digital versatile Disk drive (s)).
NVM/storage 1020 may include storage resources that are physically part of the device on which system 1000 is installed or which may be accessed by the device without being part of the device. For example, NVM/storage 1020 may be accessed over a network via communication interface(s) 1025.
Communication interface(s) 1025 may provide an interface for system 1000 to communicate over one or more networks and/or with any other suitable device. The system 1000 may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and/or protocols.
For one embodiment, at least one of the processor(s) 1005 may be packaged together with logic of one or more controllers (e.g., memory controller module 1030) of the system control module 1010. For one embodiment, at least one of the processor(s) 1005 may be packaged together with logic of one or more controllers of the system control module 1010 to form a System In Package (SiP). For one embodiment, at least one of the processor(s) 1005 may be integrated on the same die with logic of one or more controllers of the system control module 1010. For one embodiment, at least one of the processor(s) 1005 may be integrated on the same die with logic of one or more controllers of the system control module 1010 to form a system on chip (SoC).
In various embodiments, system 1000 may be, but is not limited to being: a server, workstation, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet, netbook, etc.). In various embodiments, system 1000 may have more or fewer components and/or different architectures. For example, in some embodiments, system 1000 includes one or more cameras, keyboards, liquid Crystal Display (LCD) screens (including touch screen displays), non-volatile memory ports, multiple antennas, graphics chips, application Specific Integrated Circuits (ASICs), and speakers.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, e.g., using Application Specific Integrated Circuits (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application may be executed by a processor to perform the steps or functions described above. Likewise, the software programs of the present application (including associated data structures) may be stored on a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. In addition, some steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
Furthermore, portions of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application by way of operation of the computer. Those skilled in the art will appreciate that the form of computer program instructions present in a computer readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the manner in which the computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, a computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by a computer.
Communication media includes media whereby a communication signal containing, for example, computer readable instructions, data structures, program modules, or other data, is transferred from one system to another. Communication media may include conductive transmission media such as electrical cables and wires (e.g., optical fibers, coaxial, etc.) and wireless (non-conductive transmission) media capable of transmitting energy waves, such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data may be embodied as a modulated data signal, for example, in a wireless medium, such as a carrier wave or similar mechanism, such as that embodied as part of spread spectrum technology. The term "modulated data signal" means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. The modulation may be analog, digital or hybrid modulation techniques.
By way of example, and not limitation, computer-readable storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and nonvolatile memory such as flash memory, various read only memory (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic/ferroelectric memory (MRAM, feRAM); and magnetic and optical storage devices (hard disk, tape, CD, DVD); or other now known media or later developed computer-readable information/data that can be stored for use by a computer system.
An embodiment according to the application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to operate a method and/or a solution according to the embodiments of the application as described above.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.

Claims (17)

1. A method for performing file management operations by a hosted application on a user device, the method comprising:
invoking a preset file management interface to generate a file management request, wherein the file management request is used for a user equipment to execute corresponding file management operation on corresponding files on the user equipment, and invoking the preset file management interface to generate the file management request comprises: acquiring a file management script file provided by a corresponding target application, wherein the file management script file comprises at least one preset file management interface; calling a corresponding file management interface from the at least one preset file management interface based on a file management operation on a target file to generate a file management request corresponding to the file management operation;
providing the file management request to a corresponding target application;
receiving a file operation result sent by the target application based on the file management request;
the host application and the target application corresponding to the hosted application are both configured in the user equipment, and the file operation result is obtained by the target application based on the file management request and calling a system interface of the user equipment to execute the corresponding file management operation.
2. The method of claim 1, wherein the invoking the preset file management interface to generate the file management request comprises:
a preset file management interface is called based on a file management operation on a target file to generate a file management request corresponding to the file management operation.
3. The method of claim 2, wherein the invoking the preset file management interface based on the file management operation with respect to the target file to generate the file management request corresponding to the file management operation comprises:
determining corresponding target parameters based on file management operation about target files, and calling a preset file management interface based on the target parameters to generate file management requests corresponding to the file management operation, wherein the file management requests contain the target parameters.
4. A method according to any one of claims 1 to 3, wherein the file management request is generated based on a hypertext transfer protocol;
the providing the file management request to the corresponding target application includes:
and sending the file management request to a local server started by a corresponding target application so as to provide the file management request to the target application.
5. A method for performing file management operations by a target application on a user device, the method comprising:
invoking a system interface of the user equipment to execute a corresponding file management operation based on a file management request generated by a corresponding hosting application, wherein the file management request is used for the user equipment to execute the corresponding file management operation on a corresponding file on the user equipment, the file management request is generated by the hosting application based on the file management operation on a target file by invoking the corresponding file management interface from at least one preset file management interface, the at least one preset file management interface is contained in a file management script file, and the file management script file is provided by the target application;
acquiring a file operation result corresponding to the file management operation;
sending the file operation result to the hosting application;
and the host application and the target application corresponding to the hosted application are configured on the user equipment.
6. The method of claim 5, wherein the file management request contains target parameters determined by the hosting application based on file management operations with respect to a target file;
The file management request generated based on the corresponding hosting application calls a system interface of the user equipment to execute the corresponding file management operation, including:
and determining corresponding calling parameters based on the target parameters contained in the file management request generated by the corresponding hosting application, and calling a system interface of the user equipment based on the calling parameters to execute corresponding file management operation.
7. The method according to claim 5 or 6, characterized in that the method further comprises:
starting a local server on the user equipment;
the file management request generated based on the corresponding hosting application calls a system interface of the user equipment to execute the corresponding file management operation, including:
and receiving a file management request generated by a corresponding hosting application through the local server, and calling a system interface of the user equipment corresponding to the file management request to execute a file management operation corresponding to the file management request, wherein the file management request is generated based on a hypertext transfer protocol.
8. The method of claim 5, wherein invoking the system interface of the user device to perform the corresponding file management operation based on the file management request generated by the corresponding hosted application comprises:
And receiving a file management request generated by a corresponding hosting application, and calling a system interface of the user equipment based on the operation authority information of the hosting application about the file management request to execute corresponding file management operation.
9. A method for performing a target operation by a first application on a user device, the method comprising:
invoking a preset target operation interface to generate a target operation request, wherein the target operation request is used for user equipment to execute corresponding target operation, the target operation request is generated by a first application based on the target operation invoking the preset target operation interface, and the target operation interface is contained in a target operation script file provided by a second application;
providing the target operation request to a corresponding second application;
receiving a target operation result sent by the second application based on the target operation request;
the first application and the second application are both configured in the user equipment, and the target operation result is obtained by the second application based on the target operation request and calling a system interface of the user equipment to execute corresponding file management operation.
10. The method of claim 9, wherein the target operation request is generated based on a hypertext transfer protocol;
the providing the target operation request to the corresponding second application includes:
and sending the target operation request to a local server started by a corresponding second application so as to provide the target operation request to the second application.
11. A method for performing a target operation by a second application on a user device, the method comprising:
invoking a system interface of the user equipment based on a target operation request generated by a corresponding first application to execute a target operation corresponding to the target operation request, wherein the target operation request is used for the user equipment to execute a corresponding target operation, the target operation request is generated by the first application based on the target operation invoking a preset target operation interface, and the target operation interface is contained in a target operation script file provided by a second application;
obtaining a target operation result corresponding to the target operation;
sending the target operation result to the first application;
wherein the first application and the second application are both configured at the user device.
12. The method of claim 11, wherein the method further comprises:
starting a local server on the user equipment;
the calling the system interface of the user equipment to execute the target operation corresponding to the target operation request based on the target operation request generated by the corresponding first application comprises the following steps:
and receiving a target operation request generated by a corresponding first application through the local server, and calling a system interface of the user equipment corresponding to the target operation request to execute a target operation corresponding to the target operation request, wherein the target operation request is generated based on a hypertext transfer protocol.
13. A method for performing file management operations, the method comprising:
the hosting application calls a preset file management interface to generate a file management request, and provides the file management request to a corresponding target application, wherein the file management request is used for a user equipment to execute corresponding file management operation on a corresponding file on the user equipment, and the calling the preset file management interface to generate the file management request comprises the following steps: acquiring a file management script file provided by a corresponding target application, wherein the file management script file comprises at least one preset file management interface; calling a corresponding file management interface from the at least one preset file management interface based on a file management operation on a target file to generate a file management request corresponding to the file management operation;
The target application calls a system interface of user equipment based on a file management request generated by a corresponding hosting application to execute a corresponding file management operation, acquires a file operation result corresponding to the file management operation, and sends the file operation result to the hosting application;
the hosting application receives the file operation result;
and the host application and the target application corresponding to the hosted application are configured on the user equipment.
14. A method for performing a target operation, the method comprising:
the method comprises the steps that a first application calls a preset target operation interface to generate a target operation request, and the target operation request is provided to a corresponding second application, wherein the target operation request is used for user equipment to execute corresponding target operation, the target operation request is generated by the first application based on the target operation calling the preset target operation interface, and the target operation interface is contained in a target operation script file provided by the second application;
the second application calls a system interface of the user equipment based on a target operation request generated by a corresponding first application to execute target operation corresponding to the target operation request, obtains a target operation result corresponding to the target operation, and sends the target operation result to the first application;
The first application receives the target operation result;
wherein the first application and the second application are both configured at the user device.
15. An apparatus for performing file management operations, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the operations of the method according to any one of claims 1 to 8.
16. An apparatus for performing a target operation, wherein the apparatus comprises:
a processor; and
a memory arranged to store computer executable instructions which, when executed, cause the processor to perform the operations of the method according to any of claims 9 to 12.
17. A computer readable medium storing instructions that, when executed, cause a system to perform the operations of the method of any one of claims 1 to 12.
CN201910294207.7A 2019-04-12 2019-04-12 Method and device for executing target operation Active CN110333914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910294207.7A CN110333914B (en) 2019-04-12 2019-04-12 Method and device for executing target operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910294207.7A CN110333914B (en) 2019-04-12 2019-04-12 Method and device for executing target operation

Publications (2)

Publication Number Publication Date
CN110333914A CN110333914A (en) 2019-10-15
CN110333914B true CN110333914B (en) 2023-09-15

Family

ID=68139877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910294207.7A Active CN110333914B (en) 2019-04-12 2019-04-12 Method and device for executing target operation

Country Status (1)

Country Link
CN (1) CN110333914B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301899B (en) * 2020-09-22 2022-10-25 荣耀终端有限公司 Data transmission method, system, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699405A (en) * 2009-10-26 2010-04-28 中兴通讯股份有限公司 Method and device for interaction between host program and plug-in and interaction between plug-ins
CN103067343A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Method and system for preventing tampering of usage of ActiveX control
WO2016177341A1 (en) * 2015-05-07 2016-11-10 北京金山安全软件有限公司 Interface calling method and device, and terminal
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106844489A (en) * 2016-12-24 2017-06-13 上海七牛信息技术有限公司 A kind of file operation method, device and system
CN108595220A (en) * 2018-04-25 2018-09-28 上海掌门科技有限公司 Processing method, equipment and the computer readable storage medium of application component

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699405A (en) * 2009-10-26 2010-04-28 中兴通讯股份有限公司 Method and device for interaction between host program and plug-in and interaction between plug-ins
CN103067343A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Method and system for preventing tampering of usage of ActiveX control
WO2016177341A1 (en) * 2015-05-07 2016-11-10 北京金山安全软件有限公司 Interface calling method and device, and terminal
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106844489A (en) * 2016-12-24 2017-06-13 上海七牛信息技术有限公司 A kind of file operation method, device and system
CN108595220A (en) * 2018-04-25 2018-09-28 上海掌门科技有限公司 Processing method, equipment and the computer readable storage medium of application component

Also Published As

Publication number Publication date
CN110333914A (en) 2019-10-15

Similar Documents

Publication Publication Date Title
KR101872141B1 (en) Consistent extension points to allow an extension to extend functionality of an application to another application
CN110765395B (en) Method and equipment for providing novel information
EP2932390B1 (en) Inversion-of-control component service models for virtual environments
CN111212183B (en) Method, device and computer readable medium for running hosted application
CN110262810B (en) Method and device for installing application
CN110290557B (en) Method and equipment for loading page tags in application
CN107690175A (en) A kind of method and apparatus for being used to manage WAP
CN111325574B (en) Method and device for providing presentation information
WO2020192745A1 (en) Method and device for providing hosted application
CN111162990B (en) Method and equipment for presenting message notification
CN111506232A (en) Method and equipment for controlling menu display in reading application
CN110780887A (en) Method and equipment for providing application installation package
CN109947504B (en) Method and equipment for executing hosted program in hosted program
CN109710280B (en) Method and equipment for installing application on user equipment
CN110430253B (en) Method and equipment for providing novel update notification information
US11263297B2 (en) Dynamic insertion of variablized secrets in a pipeline integration system
CN113641503B (en) Multi-cloud multi-cluster Kubernetes management system, method and equipment
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN110333914B (en) Method and device for executing target operation
WO2016169426A1 (en) Video playing method and device
US20160212243A1 (en) Machine-Specific Instruction Set Translation
CN110765258B (en) Method and equipment for providing electronic books
CN111078654B (en) Method and device for sharing information
CN114153535B (en) Method, apparatus, medium and program product for jumping pages on an open page
CN109245938B (en) Method and equipment for executing resource configuration operation of user

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