Data processing method and apparatus
By creating sandboxes for third-party applications within the service platform and monitoring their function API calls, the issues of inconsistent interface styles and data security after embedding third-party applications are resolved, achieving effective supervision and data protection for third-party applications.
Patent Information
- Application Number
- CN201910635764.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-15
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2039-07-15
AI Technical Summary
In existing technologies, when third-party applications are embedded in a service platform, the consistency of the service platform's interface style and data security cannot be guaranteed.
Create sandboxes for third-party applications in the service platform, load the third-party applications in the sandboxes, and strictly restrict their operation behavior by monitoring their function interface call requests to ensure that the operation is within the legal scope.
It enables the supervision of third-party applications, ensuring a consistent interface style and data security for the service platform.
Smart Images

Figure CN112306566B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a data processing method and device. BACKGROUND
[0002] In order to provide sufficient services for users, a service platform often needs to introduce third-party services. When introducing third-party services, it is necessary to ensure that the service platform will not be affected by the third-party services, including: it is necessary to ensure that the interface style of the service platform is unified, and it is necessary to ensure the data security of the service platform itself.
[0003] In the related art, a third-party application is usually embedded into the current service platform to introduce the third-party application into the current service platform. However, the embedded manner cannot supervise the third-party application by the service platform, and thus cannot ensure the interface style of the service platform to be unified, and cannot ensure the data security of the service platform itself. SUMMARY
[0004] According to an aspect of the present application, a data processing method is provided, which is applied to a first application, and the method comprises:
[0005] When it is determined that a second application has the first application as a host application, a sandbox is created for the second application;
[0006] When it is necessary to load a second application having the first application as a host application, a running environment is created for the second application in the first application;
[0007] The second application is loaded into the running environment to run.
[0008] In a possible implementation manner, the loading of the second application into the running environment to run comprises:
[0009] Configuration information of the first application is obtained, and the configuration information of the first application comprises application identifier information and download address information of the second application;
[0010] The second application is loaded into the running environment to run according to the configuration information of the first application.
[0011] In a possible implementation manner, the method further comprises:
[0012] A calling request of a second application for a function function interface is received, which is a request for calling the function function interface sent by the second application to the running environment in response to an interface calling triggering operation;
[0013] Corresponding processing is performed on the calling request.
[0014] In a possible implementation, the creating a running environment for the second application in the first application when the second application needs to be loaded as a host application of the first application comprises:
[0015] The configuration information of the first application is acquired, and it is determined that the second application needs to be loaded when the second application as a host application of the first application exists in the configuration information.
[0016] The running environment for the second application in the first application is created, and any API interface in the running environment is shielded.
[0017] In a possible implementation, the performing corresponding processing on the calling request comprises:
[0018] It is determined according to the configuration information of the first application whether the calling request is legal.
[0019] When the calling request is legal, the calling request is responded, and an operation corresponding to the calling request is performed.
[0020] In a possible implementation, the configuration information comprises at least one domain name that the second application allows to access, the calling request is a first calling request for a first function function interface, and the first calling request comprises a first domain name to be accessed,
[0021] The performing corresponding processing on the calling request comprises:
[0022] It is determined whether the first domain name to be accessed carried in the first calling request exists in the at least one domain name.
[0023] When the first domain name to be accessed exists in the at least one domain name, a call for the first function function interface is performed, and a network access operation corresponding to the first calling request for the first domain name to be accessed is implemented.
[0024] In a possible implementation, the configuration information comprises at least one object that the second application allows to call, the calling request is a second calling request for a second function function interface, and the second calling request comprises a first object to be accessed and data to be read and written,
[0025] The performing corresponding processing on the calling request comprises:
[0026] It is determined whether the first object carried in the second calling request exists in the at least one object.
[0027] When the first object exists in the at least one object, the call for the second function function interface is performed, and a data read-write operation for the first object is implemented according to the data to be read and written.
[0028] In a possible implementation, the call request is a third call request for a third function function interface, and the interface description data is included in the third call request, and the performing corresponding processing on the call request comprises:
[0029] The call for the third function function interface is performed, and corresponding interface rendering operations are implemented according to a preset domain-specific language (DSL) standard and the interface description data carried in the third call request, so as to update the interface.
[0030] In a possible implementation, the loading the second application into the running environment for running comprises:
[0031] The first command information is added in the second application, and the first command information is used to instruct the running environment to run the second application in a strict mode;
[0032] The second application with the added first command information is loaded into the running environment for running.
[0033] In a possible implementation, the running environment is a sandbox.
[0034] According to another aspect of the present application, a data processing method applied to a sandbox is provided, comprising:
[0035] The call request for the function function interface of the second application is monitored;
[0036] In response to the call request for the function function interface of the second application, the call request for the function function interface is forwarded to the first application, so that the first application performs corresponding processing on the call request;
[0037] The first application is a host application of the second application, and the call request for the function function interface is a request for calling the function function interface sent by the second application to the sandbox in response to an interface call triggering operation for the function function interface.
[0038] In a possible implementation, the call request for the function function interface of the second application is a first call request for a first function function interface, and the first domain name to be accessed is included in the first call request,
[0039] forwarding the first call request to the first application, so that the first application performs a calling operation for the first function function interface to implement a network access operation for the first domain name when determining that the network access request for the first domain name is legal.
[0040] forwarding the first call request to the first application, so that the first application performs a calling operation for the first function function interface to implement a network access operation for the first domain name when determining that the network access request for the first domain name is legal.
[0041] In a possible implementation, the second application call request for the function function interface is a second call request for a second function function interface, the second call request including a first object and data to be read and written,
[0042] forwarding the first call request to the first application, so that the first application performs a calling operation for the first function function interface to implement a network access operation for the first domain name when determining that the network access request for the first domain name is legal.
[0043] forwarding the second call request to the second application, so that the first application performs a calling operation for the second function function interface to implement a data read and write operation for the first object according to the data to be read and written when determining that the data read and write request for the first object is legal.
[0044] In a possible implementation, the second application call request for the function function interface is a third call request for a third function function interface, the third call request including interface description data,
[0045] forwarding the first call request to the first application, so that the first application performs a calling operation for the first function function interface to implement a network access operation for the first domain name when determining that the network access request for the first domain name is legal.
[0046] forwarding the third call request to the first application, so that the first application performs an interface rendering operation for the second application according to a preset domain-specific language (DSL) standard and the interface description data to update the interface in response to the third call request.
[0047] In a possible implementation, the second application carries first command information, and the sandbox runs the second application in a strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
[0048] According to another aspect of the present application, a data processing method is provided, which is applied to a first application, and the method comprises:
[0049] creating a sandbox for the second application in the first application when the second application needs to be loaded as a host application of the first application;
[0050] loading the second application to run in the sandbox;
[0051] receiving a calling request of the second application for a function interface sent by the sandbox, the calling request being a request for calling the function interface sent by the second application to the sandbox in response to an interface calling triggering operation;
[0052] performing corresponding processing on the calling request.
[0053] According to another aspect of the present application, a data processing apparatus is provided, which is applied to a first application, and the apparatus comprises:
[0054] a creating module, configured to create a running environment for a second application in the first application when the second application needs to be loaded as a host application of the first application;
[0055] a loading module, configured to load the second application to run in the running environment.
[0056] In a possible implementation manner, the loading module is further configured to:
[0057] obtain configuration information of the first application, wherein the configuration information of the first application comprises application identifier information and download address information of the second application;
[0058] load the second application to run in the running environment according to the configuration information of the first application.
[0059] In a possible implementation manner, the method further comprises:
[0060] a receiving module, configured to receive a calling request of the second application for a function interface sent by the running environment, the calling request being a request for calling the function interface sent by the second application to the running environment in response to an interface calling triggering operation;
[0061] a processing module, configured to perform corresponding processing on the calling request.
[0062] In a possible implementation manner, the creating module is further configured to:
[0063] obtain configuration information of the first application, and determine that the second application needs to be loaded when the second application as a host application of the first application exists in the configuration information;
[0064] The first application creates a running environment for the second application, and any API interface in the running environment is shielded.
[0065] In a possible implementation, the processing module is further configured to:
[0066] determine whether the calling request is legal according to the configuration information of the first application;
[0067] when the calling request is legal, perform an operation corresponding to the calling request in response to the calling request.
[0068] In a possible implementation, the configuration information includes at least one domain name that the second application allows to access, the calling request is a first calling request for a first function function interface, and the first calling request includes a first domain name to be accessed,
[0069] The processing module is further configured to:
[0070] determine whether the first domain name to be accessed carried in the first calling request exists in the at least one domain name;
[0071] when the first domain name to be accessed exists in the at least one domain name, perform a call for the first function function interface, and implement a network access operation corresponding to the first domain name to be accessed in the first calling request.
[0072] In a possible implementation, the configuration information includes at least one object that the second application allows to call, the calling request is a second calling request for a second function function interface, and the second calling request includes a first object to be accessed and data to be read and written,
[0073] The processing module is further configured to:
[0074] determine whether the first object carried in the second calling request exists in the at least one object;
[0075] when the first object exists in the at least one object, perform a call for the second function function interface, and implement a data read-write operation for the first object according to the data to be read and written.
[0076] In a possible implementation, the calling request is a third calling request for a third function function interface, the third calling request includes interface description data, and the processing module is further configured to:
[0077] Perform the call for the third function function interface, realize the interface rendering operation according to the preset domain specific language DSL standard and the interface description data carried in the third call request, and update the interface.
[0078] In a possible implementation, the loading module is further configured to:
[0079] add first command information in the second application, the first command information being used to instruct the running environment to run the second application in a strict mode;
[0080] load the second application with the added first command information into the running environment for running.
[0081] In a possible implementation, the running environment is a sandbox.
[0082] According to another aspect of the present application, a data processing apparatus is provided, which is applied to a sandbox and comprises:
[0083] a monitoring module configured to monitor a call request of a second application for a function function interface;
[0084] a sending module configured to, in response to the call request of the second application for the function function interface, forward the call request for the function function interface to a first application, so that the first application performs corresponding processing on the call request;
[0085] wherein the first application is a host application of the second application, and the call request for the function function interface is a request for calling the function function interface sent by the second application to the sandbox in response to an interface call triggering operation for the function function interface.
[0086] In a possible implementation, the call request of the second application for the function function interface is a first call request for a first function function interface, and the first call request comprises a first domain name to be accessed, and the sending module is further configured to:
[0087] forward the first call request to the first application, so that the first application performs a call operation for the first function function interface when determining that a network access request for the first domain name is legal, to realize a network access operation for the first domain name.
[0088] In a possible implementation, the call request of the second application for the function function interface is a second call request for a second function function interface, and the second call request comprises a first object and data to be read and written, and the sending module is further configured to:
[0089] forward the second calling request to the second application, so that the first application determines that the data read-write request for the first object is legal, and executes the calling operation for the second function function interface, to implement the data read-write operation for the first object according to the data to be read and written.
[0090] In a possible implementation, the second application is a third application, the calling request for the function function interface is a third calling request for a third function function interface, and the third calling request includes interface description data.
[0091] The sending module is further configured to:
[0092] forward the third calling request to the first application, so that the first application responds to the third calling request, and executes the interface rendering operation for the second application according to a preset domain-specific language (DSL) standard and the interface description data, to update the interface.
[0093] In a possible implementation, the second application carries first command information, and the sandbox runs the second application in the strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
[0094] According to another aspect of the present application, a data processing apparatus is provided, which is applied to a first application, and includes:
[0095] A creating module is configured to create a sandbox for a second application in the first application when the second application needs to be loaded as a host application of the first application.
[0096] A loading module is configured to load the second application into the sandbox to run.
[0097] A receiving module is configured to receive a calling request for a function function interface of the second application sent by the sandbox, where the calling request is a request for calling the function function interface sent by the second application to the sandbox in response to an interface calling triggering operation.
[0098] The calling request is processed.
[0099] According to another aspect of the present application, a data processing apparatus is provided, which includes a processor and a memory for storing processor-executable instructions, and the processor is configured to execute the above method.
[0100] According to another aspect of the present application, a nonvolatile computer readable storage medium is provided, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the above method.
[0101] In this way, when the first application needs to load a second application which takes the first application as a host application, the first application creates a running environment for the second application in the first application and loads the second application into the running environment to run. According to the data processing method provided by the embodiment of the present application, the first application can provide an independent running environment for the second application and load the second application into the running environment to run, so as to monitor the operation behavior of the second application through the running environment, strictly limit the operation performed by the second application, and realize the supervision of the first application on the second application, thereby ensuring the uniformity of the interface styles corresponding to the first application and the second application, ensuring the data security of the first application itself, and the like.
[0102] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0103] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and serve to explain the principles of the present application.
[0104] Figure 1 A schematic diagram of a data processing system according to an embodiment of the present application is shown;
[0105] Figure 2 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0106] Figure 3 An exemplary interface schematic diagram according to an embodiment of the present application is shown;
[0107] Figure 4 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0108] Figure 5 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0109] Figure 6 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0110] Figure 7 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0111] Figure 8 An exemplary schematic diagram of a data processing method according to an embodiment of the present application is shown;
[0112] Figure 9 A flowchart of a data processing method according to an embodiment of the present application is shown;
[0113] Figure 10A flow chart of a data processing method according to an embodiment of the present application is shown.
[0114] Figure 11 An exemplary interface schematic diagram according to the present application is shown.
[0115] Figure 12 A structural block diagram of a data processing apparatus according to an embodiment of the present application is shown.
[0116] Figure 13 A structural block diagram of a data processing apparatus according to an embodiment of the present application is shown.
[0117] Figure 14 A block diagram of an apparatus 1500 for data processing according to an exemplary embodiment is shown. DETAILED DESCRIPTION
[0118] For the purpose of making the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in connection with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0119] To solve the above technical problems, the present application provides a data processing system, which can be referred to as Figure 1 The system can include a first application, a second application server, and a second application, wherein the second application takes the first application as a host application. Before loading the second application, the first application can create an independent running environment (sandbox) for the first application, and all interfaces in the independent running environment are shielded. After creating the running environment, the first application can load the second application into the running environment for running. Since the running environment cannot execute the related operations of the second application, the first application can send a corresponding interface call request to the first application according to the related operations of the second application, so that the first application executes the related operations of the second application in response to the interface call request, thereby realizing the supervision of the first application on the second application. The operations of the second application are realized by the first application, which can ensure that the interface styles corresponding to the first application and the second application are uniform, and the data security of the first application itself is ensured.
[0120] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0121] Embodiment 1
[0122] Figure 2 A flow chart of a data processing method according to an embodiment of the present application is shown. The method can be applied to a first application, such as Figure 2As shown, the method can include:
[0123] Step 201, when a second application needs to be loaded as a host application of a first application, creating a running environment for the second application in the first application;
[0124] For example, the first application can obtain the configuration information of the first application from a server during running, the configuration information of the first application can include the application identification information and the download address information of the second application with the first application as the host application, the first application can load the second application from the corresponding server according to the download address information, wherein the application identification information of the second application can be the application name of the second application or other information capable of identifying the second application. The first application determines that there is the second application with the first application as the host application through the configuration information, and determines that the second application needs to be loaded, so the running environment for the second application can be created in the first application.
[0125] In a possible implementation, the running environment can be a sandbox.
[0126] Figure 3 An exemplary interface schematic diagram according to the present application is shown.
[0127] The first application can load the second application with the first application as the host application during running. For example, refer to Figure 3 As shown, the first application is a browser application, and the second application can be an application corresponding to any function module provided by a third party in the browser application, wherein the second application can be displayed in a small window mode in the interface of the first application, or can be displayed in full screen, and the present application does not limit the display mode of the second application.
[0128] In a possible implementation, the step 101 of creating a running environment for the second application in the first application when the second application needs to be loaded as the host application of the first application can include:
[0129] Obtaining the configuration information of the first application, when the second application with the first application as the host application exists in the configuration information, determining that the second application needs to be loaded;
[0130] Creating a running environment for the second application in the first application, and any API interface in the running environment is shielded.
[0131] For example, the first application can obtain the configuration information of the first application from a server, and when the application identification information of the second application with the first application as the host application exists in the configuration information of the first application, it can be determined that there is the second application with the first application as the host application, and the first application determines that the second application needs to be loaded.
[0132] The first application can create a running environment for the second application, and shield API interfaces (for example, XHR (XmlHttpRequest), fetch, worker, Function construction, eval, and the like) in the running environment, so that the running environment does not have interface calling capability. For example, the above-mentioned API interfaces can be shielded in the form of a closure, or an invalid interface module can be constructed to cover the above-mentioned API interfaces, so that the running environment does not have the calling function of the above-mentioned API interfaces. Further, in the process of loading the second application into the running environment for running by the first application, the running environment only has simple calculation function and cannot execute operations (for example, network access, data read / write, interface rendering, and the like) associated with the above-mentioned API interfaces in the second application.
[0133] Step 202, loading the second application into the running environment for running.
[0134] For example, the first application can create a running environment for the second application, load the second application into the running environment, and run the second application in the running environment. In this way, the running environment of the second application is isolated from the first application, and the running environment can strictly control the resources that can be accessed and called during the running of the second application.
[0135] In a possible implementation, the above-mentioned loading the second application into the running environment for running can include:
[0136] Obtaining configuration information of the first application, wherein the configuration information of the first application includes application identification information and download address information of the second application;
[0137] Loading the second application into the running environment for running according to the configuration information of the first application.
[0138] For example, the first application can obtain the configuration information of the first application from a server, and the configuration information of the first application can include the application identification information and the download address information of the second application with the first application as a host application. The first application can load the second application from a corresponding server according to the download address information, and the application identification information of the second application can be the application name of the second application or other information that can identify the second application.
[0139] It should be noted that the number of second applications with the first application as a host application can be one or multiple, which is not limited in the present application. When there are multiple second applications with the first application as a host application, the first application can load each second application according to the download address information of each second application, create a corresponding running environment for each second application, and load each second application into the corresponding running environment for running.
[0140] In a possible implementation, the loading the second application into the running environment to run includes:
[0141] adding first command information in the second application, the first command information being used to instruct the running environment to run the second application in a strict mode;
[0142] loading the second application with the added first command information into the running environment to run.
[0143] For example, after the first application acquires the second application, the first application can add first command information in the application program code of the second application, the first command information being used to instruct the running environment to run the second application in a strict mode, and load the second application with the added first command information into the running environment to run, so that the running environment can run the second application in the strict mode in response to the first command information, and the second application can avoid providing the running environment with the API interface calling capability by constructing the Function function, and thus the running environment has the capability of data reading and writing, network access, interface rendering, and the like.
[0144] In this way, when the first application needs to load the second application with the first application as a host application, the first application creates a running environment for the second application in the first application, and loads the second application into the running environment to run. According to the data processing method provided in the embodiments of the present application, the first application can provide a separate running environment for the second application, and load the second application into the running environment to run, so as to monitor the operation behavior of the second application through the running environment, strictly limit the operations performed by the second application, and thus can realize the supervision of the first application on the second application, and further can ensure the uniformity of the interface styles corresponding to the first application and the second application, and ensure the data security of the first application itself.
[0145] Figure 4 A flowchart of a data processing method according to an embodiment of the present application is shown.
[0146] In a possible implementation, referring to Figure 4 The method can further include:
[0147] Step 203: receiving a calling request of the second application for a function function interface sent by the running environment, the calling request being a request of the second application for calling the function function interface sent by the running environment in response to an interface calling triggering operation;
[0148] For example, the interface calling operation is an operation of triggering the function interface of the second application, such as a triggering operation of the user on the second application. During the running of the second application in the running environment, the second application can call the corresponding function interface (for example, an API (Application Programming Interface, application programming interface)) provided by the running environment based on the operation performed. Since the first application performs the shielding processing on the function interface of the running environment during the creation of the running environment, the running environment cannot respond to the calling request of the second application for the function interface. The running environment can forward the calling request to the first application (for example, the running environment can communicate with the worker layer of the first application through postMessage) to request the first application to perform the operation of the second application for the function interface. For example, when the second application performs a network access operation, the second application sends a calling request for a network access function interface to the running environment. The running environment can forward the calling request to the first application, so that the first application performs the corresponding network access operation. When the second application performs a data read / write operation, the second application sends a calling request for a data read / write function interface to the running environment. The running environment can forward the calling request to the first application, so that the first application performs the corresponding data read / write operation. When the second application performs an interface update operation, the second application sends a calling request for an interface update function interface to the running environment. The running environment can forward the calling request to the first application, so that the first application performs the corresponding interface update operation.
[0149] Step 204, performing corresponding processing on the calling request.
[0150] After the first application receives the calling request of the second application for the function interface forwarded by the running environment, the first application can perform corresponding processing based on the calling request.
[0151] For example, the first application can determine whether the calling request for the function interface is a legal calling request, and then determine whether to perform the operation corresponding to the calling request. When the calling request is a legal calling request, the operation corresponding to the calling request can be performed. When the calling request is an illegal calling request, the calling request is not responded to, and the calling request can be recorded in a violation operation record. The violation operation record can be used to record the illegal calling request of the second application. For example, when the calling request for the network access function interface is received, if the object requested to be accessed by the calling request is an object allowed to be accessed by the first application, it can be determined that the calling request is legal. The first application can perform the calling of the network access function interface to implement the network access operation on the object. Otherwise, the calling request is not responded to.
[0152] In this way, the first application receives the calling request of the function interface sent by the second application through the running environment, and performs corresponding processing on the calling request. According to the data processing method and device provided in the embodiments of the present application, the first application can load the second application taking the first application as a host application into the running environment to run, monitor the operation behavior of the second application through the running environment, and report the calling request of the function interface corresponding to the operation behavior to the first application, so as to realize the supervision of the first application on the second application, and the operation of the second application is realized by the first application, which can ensure that the interface styles corresponding to the first application and the second application are uniform, and the data security of the first application itself is ensured.
[0153] Figure 5 A flowchart of a data processing method according to an embodiment of the present application is shown.
[0154] In a possible implementation manner, referring to Figure 5 The step 204 and the processing of the calling request can include the following steps.
[0155] The step 2041 includes determining whether the calling request is legal according to the configuration information.
[0156] The step 2042 includes, when the calling request is legal, responding to the calling request and performing the operation corresponding to the calling request.
[0157] For example, before the first application becomes the host application of the second application, the first application and the second application can reach an operation agreement, which can include the operation allowed by the first application to be performed by the second application, and the operation agreement can be stored in the server side of the first application as one of the configuration information of the first application, and the first application can load the configuration information of the first application from the server side when running. After receiving the calling request sent by the running environment, the first application can obtain the operation agreement corresponding to the second application from the configuration information of the first application according to the identification information of the second application, and determine whether the calling request is legal according to the operation agreement corresponding to the second application, for example, determine whether the operation corresponding to the calling request is recorded in the operation agreement, when the operation corresponding to the calling request is included in the operation agreement, it can be determined that the operation is the operation allowed by the first application to be performed by the second application, and then it can be determined that the calling request is legal, and the first application can respond to the calling request and perform the operation corresponding to the calling request.
[0158] For example, the first application is a browser, and the second application is a function module in the browser interface, which implements a logistics information query function. The operation protocol between the first application and the second application includes: allowing the second application to store a user-input express number in a local cookie, allowing the second application to read a historical express number input by the user from the local cookie, and allowing access to a service platform corresponding to the second application.
[0159] When the user triggers an input operation on the express number on the interface corresponding to the second application, the second application can obtain the historical express number input and display it on the interface for the user to select. At this time, the running environment cannot respond to the calling operation of the second application on the data read-write function interface, and cannot implement the operation of the second application reading the historical express number from the local cookie. Therefore, the calling request for the data read-write function interface can be sent to the first application. After the first application receives the calling request, it determines that the operation protocol corresponding to the second application allows the operation corresponding to the calling request. Then, the first application responds to the calling request, calls the corresponding data read-write function interface, reads the historical express number from the local cookie, and sends it to the running environment to display the historical express number on the interface.
[0160] Alternatively, the operation protocol can include at least one domain name that the second application is allowed to access and at least one object that the second application is allowed to call. The operation protocol can be included in the configuration information of the first application and stored in the server side of the first application. The first application running system can load the configuration information of the first application when loading the first application.
[0161] After receiving the calling request sent by the running environment, the first application running system can determine whether the calling request is legal according to the operation protocol of the second application in the configuration information of the first application. For example, it can be determined whether the domain name to be accessed by the calling request is a domain name that the second application is allowed to access. When the domain name to be accessed by the calling request is a domain name that the second application is allowed to access, it can be determined that the calling request is legal. Alternatively, it can be determined whether the object to be called by the calling request is an object that the second application is allowed to call. When the object to be called by the calling request is an object that the second application is allowed to call, it can be determined that the calling request is legal.
[0162] When the first application determines that the calling request is legal, the first application can respond to the calling request and perform the operation corresponding to the calling request, such as performing a network access operation corresponding to the calling request or performing a data read-write operation corresponding to the calling request.
[0163] In this way, the first application can monitor the second application during the running process of the second application, thereby ensuring the data security of the first application itself.
[0164] Figure 6 A flow chart of a data processing method according to an embodiment of the application is shown.
[0165] In a possible implementation, the configuration information can include at least one domain name allowed to be accessed by the second application, and the calling request is a first calling request for a first function interface, and the first calling request includes a first domain name to be accessed. Figure 6 ,
[0166] The step 204 of performing corresponding processing on the calling request can include:
[0167] The step 2043 of determining whether the first domain name to be accessed carried in the first calling request exists in the at least one domain name.
[0168] The step 2044 of performing calling for the first function interface when the first domain name to be accessed exists in the at least one domain name, to implement a network access operation corresponding to the first calling request for the first domain name to be accessed.
[0169] For example, during the running of the second application, the second application can call a first function interface (for example, an http interface) of the running environment in response to a triggering operation (for example, jumping to a service platform corresponding to the first domain name, writing data to the service platform corresponding to the first domain name, or reading data from the service platform corresponding to the first domain name, etc.) of network access for the first domain name. The first function interface is an interface for implementing network access function. Since the first function interface in the running environment is shielded by the first application when it is created, it does not have the ability to perform network access operation. Therefore, the running environment can forward a first calling request of the second application for the first function interface to the first application. The first calling request can include the first domain name to be accessed, and can also include identification information of the second application.
[0170] The first application receives the first calling request sent by the running environment. The first application can obtain an operation protocol corresponding to the second application from the configuration information of the first application according to the identification information of the second application. The operation protocol can include at least one domain name allowed to be accessed by the second application. The first application can determine whether the first domain name exists in the at least one domain name allowed to be accessed by the second application. When the first domain name exists, it is determined that the network access operation of the second application for the first domain name is allowed, and the network access operation corresponding to the first calling request can be performed to perform network access for the first domain name.
[0171] For example, the first application is a browser, and the second application is a function module in the browser interface, which implements a logistics information query function. The operation protocol between the first application and the second application includes: allowing the second application to access a domain name 1, which is the domain name of the service platform to which the second application belongs.
[0172] When the user performs a logistics query through the second application, the second application performs a corresponding network access operation in response to the express delivery order number input by the user, calls the first function interface of the running environment, to send a network request to the service platform to which the second application belongs, which can include the domain name 1 (which is the domain name of the service platform to which the second application belongs), to query the logistics progress corresponding to the express delivery order number from the service platform represented by the domain name 1. The running environment responds to the call operation and sends a corresponding call request to the first application, which can include the domain name 1 and the identification information of the second application. The first application obtains the operation protocol corresponding to the second application from the configuration information according to the identification information of the second application.
[0173] If the domain name 1 is included in the domain name allowed to be accessed by the second application in the operation protocol between the first application and the second application, the first application can determine that the second application is allowed to access the domain name 1 according to the operation protocol, and the first application can call the first function interface to send the network request to the service platform of the second application to obtain the logistics information corresponding to the express delivery order number input by the user from the service platform of the second application.
[0174] In a possible implementation, the first application can determine the operation type corresponding to the network access operation to the second application, and when the operation type corresponding to the network access operation is a data information sharing operation, the parameter information of the sandbox can be obtained, and the sharing data (including the parameter information of the sandbox and the data information to be shared) can be sent to the receiving end, so that the receiving end creates a corresponding sandbox according to the parameter information of the sandbox, and the data information to be shared is viewed through the sandbox.
[0175] In this way, the first application can supervise the network access operation of the second application, so that the network access operation allowed in the second application can be executed, and further, the illegal source resources and illegal jumps to other applications and the like can be intercepted, and thus the data security of the first application can be ensured.
[0176] Figure 7 A flowchart of a data processing method according to an embodiment of the present application is shown.
[0177] In a possible implementation, the configuration information includes at least one object allowed to be called by the second application, the call request is a second call request for a second function interface, and the second call request includes: a first object to be accessed and data to be read and written.Figure 7 The step 204 of performing corresponding processing on the calling request can include:
[0178] The step 2045 of determining whether the first object carried in the second calling request exists in the at least one object can include:
[0179] The step 2046 of performing the calling for the second function interface and performing the data read / write operation on the first object according to the data to be read / written when the first object exists in the at least one object can include:
[0180] For example, during the running of the second application, the second application can call the second function interface in response to the data read / write operation on the first object (the data read / write request in the embodiment of the present application refers to the data read request or the data write request), and the second function interface is an interface for implementing the data read / write function (for example, the getStorage interface for obtaining the storage information and the setStorage interface for storing the information). Since the first function interface in the running environment is shielded by the first application when being created, the first function interface does not have the ability to perform the calling object to perform the data read / write operation, and therefore the running environment forwards the second calling request of the second application for the second function interface to the first application. The second calling request can include the first object to be accessed and the data to be read / written, and the data read / write request can further include the identification information of the second application.
[0181] The first application receives the second calling request sent by the running environment, and the first application can obtain the operation protocol corresponding to the second application from the configuration information of the first application according to the identification information of the second application. The operation protocol can include at least one object allowed by the first application to be called by the second application. The first application can determine whether the first object exists in the at least one object allowed by the first application to be accessed by the second application, and when the first object exists, it can be determined that the data read / write operation of the second application on the first object is allowed, and therefore the data read / write operation corresponding to the second calling request can be performed, that is, the data read / write operation on the first object is performed.
[0182] For example, the first application is a browser, and the second application is a function module in the browser interface, and the function module implements the logistics information query function.
[0183] When the user triggers an input operation for the express delivery number on the interface corresponding to the second application, the second application calls a second function function interface of the running environment to obtain the historical input express delivery number and display it on the interface for the user to select, or when the second application obtains the express delivery number input by the user, calls the second function function interface of the running environment to cache the express delivery number to the local for subsequent user selection. At this time, the running environment sends the above-mentioned second call request for the second function function interface to the first application, and the second call request includes the identification information of the second application and the calling object: the local cookie and the express delivery number to be read and written. The first application obtains the operation protocol corresponding to the second application from the configuration information according to the identification information of the second application.
[0184] If the operation protocol of the first application and the second application includes: allowing the second application to call the local cookie, the first application can determine to allow the calling operation of the second application to the local cookie, and the first application can call the second function function interface to send the historical express delivery number read from the local cookie to the running environment or write the express delivery number input by the user into the local cookie.
[0185] If the calling object in the operation protocol of the first application and the second application does not include the local cookie, the first application determines that the calling operation of the second application to the local cookie is not allowed according to the operation protocol of the second application, and can not respond to the second call request, that is, does not perform the operation of reading the historical express delivery number from the local cookie or writing the express delivery number input by the user into the local cookie.
[0186] In this way, during the running of the second application, the data read and write operations of the second application are supervised by the first application, so that the allowed data read and write operations in the second application can be executed, thereby realizing the interception of illegal data storage operations and ensuring the data security of the first application.
[0187] In a possible implementation manner, the calling request is a third calling request for a third function function interface, and the third calling request includes interface description data. The step 104 and the performing corresponding processing on the calling request can include:
[0188] The calling for the third function function interface is performed, and corresponding interface rendering operations are performed according to the preset domain-specific language (DSL) standard and the interface description data carried in the third calling request, so as to update the interface.
[0189] For example, the server of the first application can be provided with a preset domain-specific language DSL standard for rendering the first application interface and a basic component library, the preset domain-specific language DSL standard being used to define specifications of components in the first application interface and a style of the first application interface, and the basic component library being used to store components for constructing an interface. The first application can obtain the preset domain-specific language DSL standard and the basic component library of the first application from the server.
[0190] During the running of the second application, the running environment forwards, to the first application, a third call request of the second application to the third function interface for interface rendering operation of the second application, where the third function interface is an interface for implementing interface update rendering (for example, a setState interface), and the third call request includes interface description data.
[0191] After receiving the third call request sent by the running environment, the first application can call the third function interface to perform interface rendering operation of the second application according to the preset domain-specific language DSL standard and the interface description data, so as to render the interface of the second application to be consistent with the style of the interface of the first application. For example, the preset domain-specific language DSL standard defines that the specification of a button control is 100, the font is Songti, and the font size is 4, and the interface description data includes the button control, so the first application can obtain the button control from the basic component library and perform rendering operation according to the preset domain-specific language DSL standard. After the rendering operation is completed, the specification of the button control in the second interface is 100, the font is Songti, and the font size is 4.
[0192] In this way, during the running of the second application, the first application can perform interface rendering operation of the second application, so as to ensure that the interface of the second application is consistent with the style of the interface of the first application, and when multiple second applications are loaded, resource sharing can be achieved through the basic component library.
[0193] In a possible implementation, the first application can determine a type of a people group (adults, the elderly, children, or people with hearing or visual impairment) to which a current user belongs in response to a setting operation of the user, or can collect operation data generated due to user operation, and then analyze the operation data to determine the type of the people group to which the current user belongs. The first application performs an update operation on a page according to the type of the people group to which the current user belongs, for example, when the type of the people group to which the current user belongs is a special people group (the elderly, children, or people with hearing or visual impairment), the first application performs a page update according to a preconfigured update strategy, where the update strategy is used to indicate that display content unsuitable for the special people group is shielded. In a possible implementation, the first application can determine a type of a people group (adults, the elderly, children, or people with hearing or visual impairment) to which a current user belongs in response to a setting operation of the user, or can collect operation data generated due to user operation, and then analyze the operation data to determine the type of the people group to which the current user belongs. The first application performs an update operation on a page according to the type of the people group to which the current user belongs, for example, when the type of the people group to which the current user belongs is a special people group (the elderly, children, or people with hearing or visual impairment), the first application performs a page update according to a preconfigured update strategy, where the update strategy is used to indicate that display content unsuitable for the special people group is shielded.
[0194] Figure 8 FIG. 1 shows a schematic diagram of a data processing method according to an example of the present application.
[0195] In order to better understand the embodiments of the present application, the embodiments of the present application are described below by way of examples.
[0196] With reference to Figure 8 , the first application is a browser, and the second application is a function module in the browser interface, which implements a logistics information query function. The operation protocol of the second application formulated by the first application operator and the second application operator includes: allowed objects called by the second application: cookies, and domain names accessed by the second application: domain name 1, which is the domain name of the service platform to which the second application belongs. The browser configuration information is stored in the server of the browser, including: second application identification information, a second application download address corresponding to the second application identification information, and an operation protocol of the second application.
[0197] The first application responds to the user's opening operation, runs and acquires the configuration information of the first application. The first application determines that there is a second application with the first application as the host application according to the configuration information, creates a running environment that shields all function API interfaces for the second application, and loads the second application identified by the second application identification information into the running environment according to the second application download address corresponding to the second application identification information in the configuration information.
[0198] After the running environment loads the second application, the second application needs to call a third function interface in the running environment for implementing the interface update rendering function to render the interface of the second application according to the interface description data, but the running environment does not have the interface rendering capability, so it sends a first call request to the first application, which includes the interface description data of the second application. The first application can call the third function interface to perform interface rendering operation according to the preset domain-specific language (DSL) standard of the first application and the interface description data, so that the specifications of each component in the interface of the second application are consistent with the specifications of each component in the interface of the first application, and the overall style is consistent with the interface style of the first application.
[0199] After the interface of the second application is rendered, the interface includes an express number input box, and the user inputs the express number to be queried in the input box for the first time. At this time, the running environment monitors a second calling request (1) of the second application calling the second function interface, so as to record the express number in the local cookie. However, the running environment does not have the data read-write capability, and therefore the running environment can forward the second calling request (1) to the first application. The second calling request (1) can include the second application identification information, the express number to be written, and the object to be operated: cookie. After the first application receives the second calling request (1), the operation protocol corresponding to the second application is obtained from the configuration information of the browser according to the second application identification information, and it is determined that the cookie is allowed to be called according to the operation protocol. Therefore, the first application can call the second function interface to write the express number to be written into the cookie.
[0200] The second application sends a network request to the service platform to which the second application belongs in response to the query operation of the user on the express number to be queried. The network request can include domain name 1. The running environment monitors a second calling request (2) of the second application calling the second function interface, so as to send the network request to the platform to which the second application belongs to query the logistics information corresponding to the express number. However, the running environment does not have the network access capability, and therefore the running environment can forward the second calling request (2) to the first application. The second calling request (2) can include the domain name 1, the express number, and the second application identification information. After the first application receives the second calling request (2), the operation protocol corresponding to the second application is obtained from the configuration information of the browser according to the second application identification information, and it is determined that the domain name 1 is allowed to be accessed according to the operation protocol. Therefore, the first application can send a network request to the service platform to which the second application belongs corresponding to the domain name 1, so as to obtain the logistics information corresponding to the express number, and send the logistics information corresponding to the express number to the running environment.
[0201] After the running environment receives the logistics information corresponding to the express number, the second application is fed back, and the second application calls a third function interface to render the interface to display the logistics information in the interface. Therefore, the running environment can forward the third calling operation of the second application on the third function interface to the first application, so that the first application can render the interface (for details, refer to the foregoing embodiments) and display the logistics information in the interface.
[0202] In this way, the operation behavior of the second application during the running process is monitored by the first application, which can ensure the uniformity of the interface style of the first application and the data security of the first application itself.
[0203] Figure 9 A flowchart of a data processing method according to an embodiment of the present application is shown. The method can be applied to a sandbox, and reference is made toFigure 9 The method can comprise:
[0204] Step 901, monitoring a calling request of a second application for a function function interface;
[0205] For example, the first application can create a sandbox for the second application taking the first application as a host application during running, and load the second application into the sandbox to run. During running of the sandbox second application, the operation behavior of the second application can be monitored by monitoring the calling request of the second application for the function function interface, such as network access operation, data read-write operation, interface rendering operation, and the like.
[0206] Step 902, in response to the calling request of the second application for the function function interface, forwarding the calling request for the function function interface to the first application, so that the first application performs corresponding processing on the calling request;
[0207] The first application is a host application of the second application, and the calling request for the function function interface is a request for calling the function function interface sent by the second application to the sandbox in response to an interface calling triggering operation for the function function interface.
[0208] When the sandbox monitors that the second application has a calling request for the function function interface, the sandbox can forward the calling request to the first application, so that the first application can perform corresponding processing on the calling request. For example, the first application can determine whether the calling request is a legal operation request, and then determine whether to perform an operation corresponding to the calling request. Only when the calling request is a legal calling request, the operation corresponding to the calling request can be performed (for details, refer to the foregoing embodiments, which will not be described here again).
[0209] In this way, the sandbox can monitor the calling request of the second application for the function function interface during running of the second application, and can forward the calling request for the function function interface to the first application in response to the calling request of the second application for the function function interface, so that the first application performs corresponding processing on the calling request. In this way, according to the data processing method provided in the embodiments of the present application, the second application runs in the sandbox, that is, the operation behavior of the second application can be monitored by the sandbox, and the corresponding calling request can be reported to the first application as a host application, so as to realize the supervision of the first application on the second application, and further to ensure the uniformity of the interface style of the first application and the data security of the first application itself.
[0210] In a possible implementation, the call request of the second application for the function interface is a first call request for a first function interface, and the first call request includes a first domain name to be accessed. The forwarding of the call request of the second application for the function interface to the first application to enable the first application to perform corresponding processing on the call request can include the following steps.
[0211] The first application is forwarded with the first call request, so that the first application performs a call operation for the first function interface when it is determined that the network access request for the first domain name is legal, to implement the network access operation for the first domain name.
[0212] For example, when the second application performs a network access operation, it needs to call the first function interface of the sandbox (see the foregoing embodiments). When the sandbox monitors that the second application generates a first call request for the first function interface, since the sandbox does not have network access capability, the sandbox can forward the first call request to the first application, and the first call request can include a first domain name to be accessed. After the first application receives the first call request, it can determine whether the first call request for the first domain name is legal (for details, see the foregoing embodiments, which are not described herein again), and perform a network access operation for the first domain name according to the first call request when it is determined that the call request for the first domain name is legal (for details, see the foregoing embodiments, which are not described herein again).
[0213] In this way, the first application can monitor the network access operation of the second application, so that the network access operation allowed in the second application can be performed, and further, operations such as illegal resource jumping of an illegal source and to other applications can be intercepted, thereby ensuring the data security of the first application.
[0214] In a possible implementation, the call request of the second application for the function interface is a second call request for a second function interface, and the second call request includes a first object and data to be read and written,
[0215] The forwarding of the call request of the second application for the function interface to the first application to enable the first application to perform corresponding processing on the call request can include the following steps.
[0216] The second application is forwarded with the second call request, so that the first application performs a call operation for the second function interface when it is determined that a data read-write request for the first object is legal, to implement a data read-write operation for the first object according to the data to be read and written.
[0217] For example, when the second application performs a data read / write operation, the second application needs to call the second function interface of the sandbox (see the foregoing embodiments). The sandbox monitors that the second application generates a second call request for the second function interface. Since the sandbox does not have a data read / write capability, the sandbox can send the second call request to the first application. The second call request can include the first object and the data to be read / written. After receiving the second call request, the first application can determine whether the data read / write request for the first object is legal (for details, see the foregoing embodiments, which are not described herein again). When the data read / write request for the first object is determined to be legal, the first application performs a data read / write operation for the first object according to the second call request (for details, see the foregoing embodiments, which are not described herein again).
[0218] In this way, the first application can monitor the data read / write operation of the second application, so that the allowed data read / write operation of the second application can be performed, and the data security of the first application can be ensured.
[0219] In a possible implementation, the call request of the second application for the function interface is a third call request for a third function interface. The third call request includes interface description data.
[0220] The method further includes the following steps.
[0221] The third call request is forwarded to the first application, so that the first application performs an interface rendering operation for the second application according to a preset domain-specific language (DSL) standard and the interface description data, to update the interface, in response to the third call request.
[0222] For example, when the second application performs an interface update operation, the second application needs to call the third function interface of the sandbox (see the foregoing embodiments). The sandbox monitors that the second application generates a third call operation for the third function interface. Since the sandbox does not have an interface rendering capability, the sandbox can send the third call operation to the first application. The third call request can include interface description data. After receiving the third call request, the first application can determine whether the third call request is legal (for details, see the foregoing embodiments, which are not described herein again). When the third call request for the second application is determined to be legal, the first application performs an interface rendering operation for the second application according to the third call request (for details, see the foregoing embodiments, which are not described herein again).
[0223] In this way, by executing the interface rendering operation of the second application by the first application, the interface of the second application can be ensured to be uniform with the interface style of the first application.
[0224] In a possible implementation, the second application carries first command information, and the sandbox runs the second application in the strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
[0225] After the first application loads the second application, the first application can add first command information for instructing the sandbox to run the second application in the strict mode in the application program code of the second application, and load the second application with the added first command information into the sandbox for running, so that the sandbox can run the second application in the strict mode, and the second application can avoid providing the sandbox with the API interface calling capability by constructing the Function function, so that the sandbox has the capabilities of data reading and writing, network access, interface rendering, and the like.
[0226] Figure 10 A flowchart of a data processing method according to an embodiment of the present application is shown, the method can be applied to a first application, as shown in the figure, the method can include: Figure 10
[0227] Step 1001, when a second application that needs to be loaded with the first application as a host application is needed, creating a sandbox for the second application in the first application;
[0228] Step 1002, loading the second application into the sandbox for running;
[0229] Step 1003, receiving a calling request of the second application for a function function interface sent by the sandbox, the calling request being a request for calling the function function interface sent by the second application to the sandbox in response to an interface calling triggering operation;
[0230] Step 1004, performing corresponding processing on the calling request.
[0231] The specific implementation process can refer to the foregoing embodiments, which will not be repeated here.
[0232] In this way, when the first application needs to load a second application that is hosted by the first application, it creates a sandbox for the second application within the first application and loads the second application into the sandbox to run. The first application receives function call requests from the second application forwarded by the sandbox and performs corresponding processing on the call requests. According to the data processing method provided in this application embodiment, the first application can provide an independent runtime environment sandbox for the second application and load the second application into the sandbox to run. This allows the sandbox to monitor the operation behavior of the second application, strictly restrict the operations performed by the second application, and enable the first application to supervise the second application. This, in turn, ensures the consistency of the interface style between the first and second applications and guarantees the data security of the first application itself.
[0233] This application also proposes a data processing method for use in social applications, the method including:
[0234] In response to the opening operation of a third-party mini-program, a runtime environment is created for the third-party mini-program in the social application;
[0235] The third-party mini-program is run in the operating environment.
[0236] The data processing method proposed in this application can be applied to social applications, where third-party services can register corresponding third-party mini-programs within the social application. Users can then use these mini-programs without downloading them within the social application. For example, the mini-program's interface (icon, etc.) in the social application interface can be referenced. Figure 11 (Icons 1, 2, 3, and 4 represent Mini Program 1, Mini Program 2, Mini Program 3, and Mini Program 4, respectively). Users can launch the third-party Mini Program and enter its program interface by triggering this interface.
[0237] Social applications can respond to the opening action of the aforementioned third-party mini-program (such as triggering an icon), create an independent runtime environment for the third-party mini-program, and run the third-party mini-program in that independent runtime environment.
[0238] Figure 12 This diagram illustrates a structural block diagram of a data processing apparatus according to an embodiment of the present application. This apparatus can be applied to a first application, such as... Figure 12 As shown, the device may include:
[0239] The creation module 1201 can be used to create a runtime environment for the second application in the first application when it is necessary to load the second application which is hosted by the first application.
[0240] The loading module 1202 can be used to load the second application into the running environment.
[0241] In this way, when the first application needs to load the second application with the first application as a host application, the first application creates a running environment for the second application in the first application and loads the second application into the running environment to run. According to the data processing apparatus provided by the embodiments of the present application, the first application can provide an independent running environment for the second application and load the second application into the running environment to run, so as to monitor the operation behavior of the second application through the running environment, strictly limit the operations performed by the second application, and achieve the supervision of the first application over the second application, thereby ensuring the uniformity of the interface styles corresponding to the first application and the second application and ensuring the data security of the first application itself.
[0242] In a possible implementation, the loading module can also be used to:
[0243] Obtain the configuration information of the first application, wherein the configuration information of the first application includes the application identifier information and the download address information of the second application;
[0244] Load the second application into the running environment according to the configuration information of the first application.
[0245] In a possible implementation, the method further includes:
[0246] The receiving module is configured to receive a calling request of the second application for a function function interface sent by the running environment, wherein the calling request is a request for calling the function function interface sent by the running environment in response to an interface calling triggered operation of the second application;
[0247] The processing module is configured to perform corresponding processing on the calling request.
[0248] In a possible implementation, the creating module is further configured to:
[0249] Obtain the configuration information of the first application, and determine that the second application needs to be loaded when the second application with the first application as a host application exists in the configuration information.
[0250] Create a running environment for the second application in the first application, and any API interface in the running environment is shielded.
[0251] In a possible implementation, the processing module is further configured to:
[0252] Determine whether the calling request is legal according to the configuration information of the first application;
[0253] When the calling request is legal, an operation corresponding to the calling request is performed in response to the calling request.
[0254] In a possible implementation, the configuration information includes at least one domain name allowed to be accessed by the second application, the calling request is a first calling request for a first function interface, and the first calling request includes a first domain name to be accessed,
[0255] The processing module is further configured to:
[0256] determine whether the first domain name to be accessed carried in the first calling request exists in the at least one domain name;
[0257] when the first domain name to be accessed exists in the at least one domain name, perform a call for the first function interface, and implement a network access operation corresponding to the first domain name to be accessed in the first calling request.
[0258] In a possible implementation, the configuration information includes at least one object allowed to be called by the second application, the calling request is a second calling request for a second function interface, and the second calling request includes a first object to be accessed and data to be read or written,
[0259] The processing module is further configured to:
[0260] determine whether the first object carried in the second calling request exists in the at least one object;
[0261] when the first object exists in the at least one object, perform a call for the second function interface, and implement a data read-write operation for the first object according to the data to be read or written.
[0262] In a possible implementation, the calling request is a third calling request for a third function interface, and the third calling request includes interface description data, and the processing module is further configured to:
[0263] perform a call for the third function interface, and implement a corresponding interface rendering operation according to a preset domain-specific language (DSL) standard and the interface description data carried in the third calling request, to update an interface.
[0264] In a possible implementation, the loading module is further configured to:
[0265] add first command information in the second application, where the first command information is used to instruct the running environment to run the second application in a strict mode;
[0266] loading a second application added with the first command information into the running environment to run.
[0267] In a possible implementation, the running environment is a sandbox.
[0268] Figure 13 A structural block diagram of a data processing apparatus according to an embodiment of the present application is shown, which can be applied to a sandbox, such as Figure 13 As shown, the apparatus can include
[0269] The monitoring module 1301 can be configured to monitor a calling request of a second application for a function function interface.
[0270] The sending module 1302 can be configured to, in response to the calling request of the second application for the function function interface, forward the calling request for the function function interface to a first application, so that the first application performs corresponding processing on the calling request.
[0271] The first application is a host application of the second application, and the calling request for the function function interface is a request for calling the function function interface sent by the second application to the sandbox in response to an interface calling triggering operation of the function function interface.
[0272] In this way, the sandbox can monitor the calling request of the second application for the function function interface during running of the second application, and can forward the calling request for the function function interface to the first application in response to the calling request of the second application for the function function interface, so that the first application performs corresponding processing on the calling request. In this way, according to the data processing apparatus provided in the embodiments of the present application, the second application runs in the sandbox, that is, the operation behavior of the second application can be monitored by the sandbox, and the corresponding calling request can be reported to the first application as the host application, so as to realize the supervision of the first application on the second application, and further to ensure the uniform interface style of the first application and the data security of the first application itself.
[0273] In a possible implementation, the calling request of the second application for the function function interface is a first calling request for a first function function interface, the first calling request includes a first domain name to be accessed, and the sending module is further configured to:
[0274] forward the first calling request to the first application, so that the first application performs a calling operation for the first function function interface when determining that a network access request for the first domain name is legal, to realize a network access operation for the first domain name.
[0275] In a possible implementation, the second application's calling request for the function interface is a second calling request for a second function interface, the second calling request including the first object and data to be read and written, and the sending module is further configured to:
[0276] forward the second calling request to the second application, so that the first application performs a calling operation for the second function interface to implement a data read and write operation for the first object according to the data to be read and written, when determining that the data read and write request for the first object is legal.
[0277] In a possible implementation, the second application's calling request for the function interface is a third calling request for a third function interface, the third calling request including interface description data,
[0278] The sending module is further configured to:
[0279] forward the third calling request to the first application, so that the first application performs an interface rendering operation for the second application according to a preset domain-specific language (DSL) standard and the interface description data, to update the interface, in response to the third calling request.
[0280] In a possible implementation, the second application carries first command information, and the sandbox runs the second application in a strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
[0281] An embodiment of the present application provides a data processing apparatus, which can be applied to a first application, and the apparatus can include:
[0282] A creating module, configured to create a sandbox for a second application in the first application, when the second application needs to be loaded as a host application of the first application;
[0283] A loading module, configured to load the second application into the sandbox to run the second application;
[0284] A receiving module, configured to receive a calling request for a function interface of the second application sent by the sandbox, the calling request being a request for calling the function interface sent by the second application to the sandbox in response to an interface calling triggering operation;
[0285] Perform corresponding processing on the calling request.
[0286] In this way, when the first application needs to load a second application which takes the first application as a host application, the first application creates a sandbox for the second application in the first application, and loads the second application to run in the sandbox, the first application receives a call request of the second application for a function interface forwarded by the sandbox, and performs corresponding processing on the call request. According to the data processing apparatus provided in the embodiments of the present application, the first application can provide a separate running environment sandbox for the second application, and load the second application to run in the sandbox, so as to monitor the operation behavior of the second application through the sandbox, strictly limit the operation performed by the second application, and realize the supervision of the first application on the second application, thereby ensuring that the interface styles corresponding to the first application and the second application are unified, and ensuring the data security of the first application itself.
[0287] In a possible implementation, the operation associated with the first application is a network access operation for a first domain name, and the sending module can be further configured to:
[0288] send a network access request to the first application according to the network access operation, the network access request carrying the first domain name to be accessed, so that the first application performs a network access operation corresponding to the network access request when determining that the network access request for the first domain name is legal.
[0289] In a possible implementation, the operation associated with the first application is a data read-write operation for a first object, and the sending module can be further configured to:
[0290] send a data read-write request to the first application according to the data read-write operation for the first object, the data read-write request including the first object, so that the first application performs a data read-write operation corresponding to the data read-write request on the first object when determining that the data read-write request for the first object is legal.
[0291] In a possible implementation, the operation associated with the first application is an interface rendering operation for the second application, and the sending module can be further configured to:
[0292] send an interface rendering request to the first application according to the interface rendering operation, the interface rendering request including interface description data, so that the first application performs an interface rendering operation for the second application according to a preset domain-specific language (DSL) standard and the interface description data.
[0293] In a possible implementation, the second application carries first command information, and the sandbox runs the second application in a strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
[0294] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0295] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the functions specified in the flowchart illustrations and / or block diagrams block or blocks.
[0296] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the functions specified in the flowchart illustrations and / or block diagrams block or blocks.
[0297] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the functions specified in the flowchart illustrations and / or block diagrams block or blocks.
[0298] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0299] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. The memory is an example of computer readable media.
[0300] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0301] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0302] Figure 14 is a block diagram of an apparatus 1500 for data processing according to an exemplary embodiment. For example, the apparatus 1500 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0303] Referring to Figure 14 , the apparatus 1500 can include one or more of the following components: a processing component 1502, a memory 1504, a power supply component 1506, a multimedia component 1508, an audio component 1510, an input / output (I / O) interface 1512, a sensor component 1514, and a communication component 1516.
[0304] The processing component 1502 generally controls the overall operations of the device 1500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1502 can include one or more processors 1520 to execute instructions and to complete all or part of steps of the methods described above. In addition, the processing component 1502 can include one or more modules to facilitate interaction between the processing component 1502 and other components. For example, the processing component 1502 can include a multimedia module to facilitate the interaction between the multimedia component 1508 and the processing component 1502.
[0305] The memory 1504 is configured to store various types of data to support operations of the device 1500. Examples of these data include instructions for any applications or methods operating on the device 1500, contact data, phonebook data, messages, pictures, videos, and so on. The memory 1504 can be implemented by any type of volatile or nonvolatile memory devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0306] The power supply component 1506 supplies electrical power for various components of the device 1500. The power supply component 1506 can include a power management system, one or more power supplies, and other components associated with generating, managing and distributing electrical power for the device 1500.
[0307] The multimedia component 1508 includes a screen providing an output interface between the device 1500 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide and a gesture on the touch panel. The touch sensors can not only sense a boundary of a touching or sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 1508 includes a front camera and / or a rear camera. The front camera and / or the rear camera can receive external multimedia data when the device 1500 is in an operation mode, such as a shooting mode or a video mode. Each of the front and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0308] The audio component 1510 is configured to output and / or input audio signals. For example, the audio component 1510 includes a microphone (MIC) that is configured to receive an external audio signal when the device 1500 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1504 or transmitted via the communication component 1516. In some embodiments, the audio component 1510 also includes a speaker for outputting audio signals.
[0309] The I / O interface 1512 provides an interface between the processing component 1502 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0310] The sensor component 1514 includes one or more sensors for providing status assessments of various aspects of the device 1500. For example, the sensor component 1514 can detect an open / closed position of the device 1500, relative positioning of components, such as a display and a keypad of the device 1500, a change in position of the device 1500 or a component of the device 1500, the presence or absence of user contact with the device 1500, the orientation or acceleration / deceleration of the device 1500, and a temperature change of the device 1500, among a plethora of other examples. The sensor component 1514 can include a proximity sensor configured to detect the presence of a nearby object without any physical touch. The sensor component 1514 can also include a light sensor, such as a CMOS or CCD image sensor, configured to work in conjunction with an imaging application. In some embodiments, the sensor component 1514 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0311] The communication component 1516 is configured to facilitate wired or wireless communication between the device 1500 and another device. The device 1500 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an example embodiment, the communication component 1516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 1516 can further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technology.
[0312] In an example embodiment, the apparatus 1500 can be implemented using one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components, for performing the above methods.
[0313] In an example embodiment, a non-transitory computer-readable storage medium, such as the memory 1504 including computer program instructions, is also provided, which can be executed by the processor 1520 of the apparatus 1500 to complete the above methods.
[0314] Those skilled in the art will appreciate that embodiments of the present application can be provided as methods, systems or computer program products. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can be in the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) having computer-usable program code contained therein.
[0315] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A data processing method, characterized by, The method applied to a first application comprises: Obtaining configuration information of the first application, and determining that a second application needs to be loaded when the second application exists in the configuration information and takes the first application as a host application; Creating a running environment for the second application in the first application, wherein any API interface in the running environment is shielded and processed so that the running environment does not have interface calling capability; and the running environment is a sandbox; Adding first command information in the second application, wherein the first command information is used to instruct the running environment to run the second application in a strict mode, and the running environment cannot execute operations associated with the API interface in the strict mode, and the operations associated with the API interface include at least one of network access, data read / write, and interface rendering; 2. The method of claim 1, wherein, Loading the second application with the added first command information into the running environment according to application identifier information and download address information of the second application included in the configuration information of the first application. The method further comprises: Receiving a calling request of the second application for a function interface sent by the running environment, wherein the calling request is a request for calling the function interface sent by the running environment in response to an interface calling trigger operation of the second application; 3. The method of claim 2, wherein, Performing corresponding processing on the calling request. The corresponding processing on the calling request comprises: Determining whether the calling request is legal according to the configuration information of the first application; 4. The method of any one of claim 3, wherein, When the calling request is legal, responding to the calling request and performing an operation corresponding to the calling request. The configuration information includes at least one domain name that the second application is allowed to access, the calling request is a first calling request for a first function interface, and the first calling request includes a first domain name to be accessed, The corresponding processing on the calling request comprises: Determining whether the first domain name to be accessed is included in the at least one domain name; 5. The method of any one of claim 3, wherein, When the first domain name to be accessed is included in the at least one domain name, performing calling for the first function interface to implement a network access operation corresponding to the first calling request for the first domain name to be accessed. The configuration information includes at least one object that the second application is allowed to call, the calling request is a second calling request for a second function interface, and the second calling request includes a first object to be accessed and data to be read and written, The corresponding processing on the calling request comprises: Determining whether the first object carried in the second calling request is included in the at least one object; 6. The method of any one of claim 3, wherein, When the first object is included in the at least one object, performing calling for the second function interface to implement a data read / write operation for the first object according to the data to be read and written. The calling request is a third calling request for a third function interface, the third calling request includes interface description data, and the corresponding processing on the calling request comprises: Performing the call for the third function function interface, realizing the interface rendering operation according to the preset domain specific language DSL standard and the interface description data carried in the third call request, to update the interface.
7. A data processing method, characterized by, Applied to a sandbox, comprising: Monitoring a second application for a function function interface call request; In response to the second application for the function function interface call request, the function function interface call request is forwarded to the first application to make the first application perform corresponding processing on the call request; Wherein, the first application is the host application of the second application, and the function function interface call request is the request for calling the function function interface sent by the second application to the sandbox in response to the interface call trigger operation of the function function interface; the second application is loaded into the sandbox created by the first application according to the method of any one of claims 1-6.
8. The method of claim 7, wherein, The second application for the function function interface call request is the first call request for the first function function interface, and the first call request includes a first domain name to be accessed, The response to the second application for the function function interface call request, the function function interface call request is forwarded to the first application to make the first application perform corresponding processing on the call request, comprising: Forwarding the first call request to the first application to make the first application execute the call operation for the first function function interface to realize the network access operation for the first domain name when determining that the network access request for the first domain name is legal.
9. The method of claim 7, wherein, The second application for the function function interface call request is the second call request for the second function function interface, and the second call request includes a first object and data to be read and written, The response to the second application for the function function interface call request, the function function interface call request is forwarded to the first application to make the first application perform corresponding processing on the call request, comprising: Forwarding the second call request to the second application to make the first application execute the call operation for the second function function interface to realize the data read and write operation for the first object according to the data to be read and written when determining that the data read and write request for the first object is legal.
10. The method of claim 7, wherein, The second application for the function function interface call request is the third call request for the third function function interface, and the third call request includes interface description data, The response to the second application for the function function interface call request, the function function interface call request is forwarded to the first application to make the first application perform corresponding processing on the call request, comprising: Forwarding the third call request to the first application to make the first application execute the interface rendering operation for the second application according to the preset domain specific language DSL standard and the interface description data in response to the third call request, to update the interface.
11. The method according to any one of claims 7 to 10, characterized in that, The second application carries first command information, and the sandbox runs the second application in the strict mode in response to the first command information, where the first command information is used to instruct the sandbox to run the second application in the strict mode.
12. A data processing apparatus, characterized by The apparatus is applied to a first application and includes: A creating module configured to acquire configuration information of a first application, determine that a second application needs to be loaded when the second application exists in the configuration information and take the first application as a host application, create a running environment for the second application in the first application, mask any API interface in the running environment, so that the running environment does not have an interface calling capability, and the running environment is a sandbox; A loading module configured to add first command information in the second application, the first command information being used to instruct the running environment to run the second application in the strict mode, where the running environment cannot execute an operation associated with the API interface in the second application in the strict mode, and the operation associated with the API interface includes at least one of network access, data read / write or interface rendering, load the second application with the added first command information into the running environment according to application identifier information and download address information of the second application included in the configuration information of the first application, and run the second application.
13. A data processing apparatus, characterized by: The apparatus is applied to a sandbox and includes: A monitoring module configured to monitor a calling request of a second application for a function function interface; A sending module configured to forward the calling request for the function function interface to a first application in response to the calling request of the second application for the function function interface, so that the first application performs corresponding processing on the calling request; where the first application is a host application of the second application, the calling request for the function function interface is a request for calling the function function interface sent by the second application to the sandbox in response to a calling trigger operation for the function function interface, and the second application is loaded into the sandbox created by the first application according to the method in any one of claims 1-6.
14. A data processing apparatus, characterized by include: a processor; a memory for storing computer instructions executable by the processor; where the processor executes the computer instructions to perform the steps of the data processing method in any one of claims 1-11.
15. A non-transitory computer readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions are executed by the processor to implement the method in any one of claims 1-11. The computer program instructions are executed by the processor to implement the method in any one of claims 1-11.
Citation Information
Patent Citations
Method and device to manage and control resources used by process
CN108089925A
Control method and system of restricted access in Android application multi-running environment
CN108932427A
Application program interactive multi-opening method and system, storage medium and electronic equipment
CN109491725A