WO2018032612A1 - 应用数据的共享方法、装置和终端设备 - Google Patents
应用数据的共享方法、装置和终端设备 Download PDFInfo
- Publication number
- WO2018032612A1 WO2018032612A1 PCT/CN2016/103883 CN2016103883W WO2018032612A1 WO 2018032612 A1 WO2018032612 A1 WO 2018032612A1 CN 2016103883 W CN2016103883 W CN 2016103883W WO 2018032612 A1 WO2018032612 A1 WO 2018032612A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- data
- control
- interface
- current
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/44—Program or device authentication
Definitions
- the present invention relates to communication technologies, and in particular, to a method, an apparatus, and a terminal device for sharing application data.
- APP applications
- the chat content may include the user's personal information, itinerary information, picture information, etc. According to these chat contents, users can provide more and better services.
- the user sends a message to a friend in WeChat "Tomorrow afternoon 3 o'clock to eat at Xinjiekou, you can create a schedule reminder for the user at 3 o'clock in the afternoon in the calendar app, or you can use Xinjiekou as a destination candidate in the map app, or you can In the group purchase APP recommendation, the food of Xinjiekou is recommended.
- the content provider (ContentProvider) is used to implement data sharing between the two applications.
- the application A and the application B are used as an example, and the application B needs to share the display data of the current interface of the application A.
- B sends an application request to the operating system, where the request carries a first identifier (URI) of the Provider that the application B wants to share, and then the operating system according to the first URI in the application request and other applications previously recorded in the operating system
- the declared URI is matched. Assuming that the first URI matches the URI of the Provider declared by the application A, the operating system indicates the operation to be performed by the application A and the returned data structure, and then the application A performs the operation and obtains the data of the corresponding data structure. , the data is returned to the operating system, and the data is transparently transmitted to the application B by the operating system.
- the application data sharing method, device and terminal device provided by the embodiments of the present invention are used to solve the problem that the information monopoly and the information interoperability are poor due to the influence of the developer authorization limitation in the prior art, and the user experience is not good. High technical issues.
- an embodiment of the present invention provides a method for sharing application data, including:
- the display data of the first application on the current display interface is obtained according to the control on the current display interface of the first application, where the control is an interface element of the current display interface;
- the method for sharing application data provided by the foregoing first aspect, when determining that the currently displayed first application is an application in a preset whitelist, acquiring the first application according to a control on a current display interface of the first application The display data on the interface is currently displayed, thereby determining whether to share the display data to the second application according to an authorized operation instruction input by the user.
- the display data acquired by the terminal device by the data sharing unit is separated from the authorization limit of the first application, and thus the shared object of the display data of the first application on the current display interface is directly determined by the authorized operation instruction of the user. It is not limited to the authorization authority of the developer of the first application.
- the obtaining, according to the control on the current display interface of the first application, the display data of the first application on the current display interface specifically includes:
- the effective control is a control carrying data that satisfies a first preset condition
- the data attribute includes a text length in the control
- a picture in the control occupies a size of a current interface
- the animation in the control occupies at least one of the sizes of the current interface
- the display data is acquired according to data of each of the valid controls.
- the determining, according to the data attribute of each control on the current display interface of the first application, the effective control on the current display interface of the first application specifically includes:
- the data attribute of the control is the length of the text in the control, and the length of the text in the control is greater than a preset first threshold, determining that the control is a valid control;
- the data attribute of the control is that the picture in the control occupies the size of the current interface, and the picture in the control occupies the size of the current interface is greater than a preset second threshold, determining that the control is a valid control;
- the data attribute of the control is the size of the current interface in the control, and the animation in the control occupies the size of the current interface is greater than a preset third threshold, determining that the control is a valid control;
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the obtaining the display data according to the data of each of the valid controls includes:
- the method is applicable to an Android operating system
- the Android operating system includes an application framework layer integrated with a screen data sharing unit, and the screen data sharing unit provides a first application facing the first application a program API interface and a second API interface for the second application;
- the screen data sharing unit is configured according to a control on a current display interface of the first application Obtaining, by the first API interface, display data of the first application on a current display interface;
- the screen data sharing unit shares the display data to the second application through the second API interface.
- the method provided by each of the above possible designs determines the effective control on the current display interface of the first application according to the data attribute of each control on the current display interface of the first application, thereby obtaining the first according to the data of each valid control.
- the data acquisition mode can be obtained only by traversing the control, the data acquisition mode is simple and effective, and the data finally shared by the terminal device to the second application is the data satisfying the first preset condition. That is, the data is ensured to meet the user's needs and can provide better service for the user.
- the embodiment integrates the acquired data of each valid control, and uses the integrated data as the display data of the first application on the current display interface, thereby greatly improving the data.
- the effectiveness of the shared data enables the second application to utilize the integrated display It is better for users.
- the determining whether the currently displayed first application is an application in a preset whitelist includes:
- Determining context information of the first application where the context information includes an identifier of the first application and a page identifier of a current display interface of the first application;
- the first application is determined to be an application in the whitelist.
- the method further includes:
- the display data is data in JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the determining whether to share the display data to the second application according to the authorization operation instruction input by the user includes:
- the user authorization interface is configured to receive an authorization operation instruction of the user
- the authorized operation instruction is an authorization instruction, sharing the display data to the second application;
- the method for sharing the application data provided by each of the foregoing possible designs, by determining the context information of the first application, and determining whether the identifier of the first application in the context information matches the identifier applied in the whitelist, and is in the first application.
- the identifier of the application matches the identifier of the application, it is further determined whether the identifier of the page corresponding to the current display interface of the first application matches the identifier of the page of the application in the whitelist, and is in the identifier and whitelist of the second page.
- the first application is determined to be an application in the whitelist, and the display data of the first application on the current display interface is obtained, thereby determining whether the data sharing is to be displayed according to the authorization operation instruction input by the user. Used for the second app.
- the method traverses the display data of the first application acquired by the control on the current display interface by the data sharing unit, which does not require the first application to perform a corresponding operation, and thus the display data is separated from the authorization limit of the first application in the application layer.
- the display data is independently present on the terminal device, and is not limited to the authorization authority of the developer of the first application.
- the user can pass The corresponding authorization operation instruction shares the display data to any type of second application, thereby ensuring the openness of data sharing between any two applications, and the interconnection and intercommunication of data, thereby greatly improving the user experience.
- an embodiment of the present invention provides a device for sharing application data, including: a determining module, a display module, an obtaining module, and a sharing module;
- a determining module configured to determine whether the first application currently displayed by the display module is an application in a preset whitelist
- An obtaining module configured to acquire, according to a control on a current display interface of the first application, the first application in a current display interface, when the determining module determines that the first application is an application in a preset whitelist Display data, the control is an interface element of the current display interface;
- a sharing module configured to determine whether to share the display data to a second application according to an authorization operation instruction input by a user, where the authorization operation instruction includes indicating to share the display data to the second application Authorization instruction and for indicating that sharing of the display data is prohibited The prohibition instruction of the second application.
- the acquiring module specifically includes:
- a determining unit configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on a current display interface of the first application; the effective control is to carry data that meets a first preset condition
- the data attribute includes at least one of a text length in the control, a picture in the control occupies a size of a current interface, and an animation in the control occupies a size of a current interface;
- an obtaining unit configured to acquire the display data according to data of each of the valid controls.
- the determining unit is specifically configured to: when a data attribute of the control is a text length in the control, and a text length in the control is greater than a preset first threshold, determining The control is a valid control; or, when the data attribute of the control is the size of the current interface in the control, and the image in the control occupies the size of the current interface is greater than a preset second threshold, Determining that the control is a valid control; or, when the data attribute of the control is the size of the current interface in the control, and the animation in the control occupies the size of the current interface is greater than a preset third threshold Determining that the control is a valid control;
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the obtaining unit is specifically configured to determine a data integration mechanism of the second application according to a type of the second application or registration information of the second application on an operating system, and Integrating data of all valid controls on the current display interface of the first application according to the data integration mechanism of the second application, and determining the integrated data as the display data; wherein the second application
- the registration information carries the data integration mechanism of the second application.
- the device is suitable for an Android operating system
- the Android operating system includes an application framework layer integrated with a screen data sharing unit, and the screen data sharing unit provides a first application facing the first application a program API interface and a second API interface for the second application;
- the screen data sharing unit acquires display data of the first application on the current display interface by using the first API interface according to the control on the current display interface of the first application;
- the screen data sharing unit shares the display data to the second application through the second API interface.
- the determining module is specifically configured to determine context information of the first application, where the context information includes an identifier of the first application and a page of a current display interface of the first application. And determining whether the identifier of the first application matches an identifier of an application in the whitelist; if the identifier of the first application matches an identifier of an application in the whitelist, determining the first Whether the page identifier of the current display interface of the application matches the page identifier of the application in the whitelist; if yes, the first application is determined to be an application in the whitelist.
- the device further includes:
- a storage module configured to cache the display data
- a deleting module configured to delete the cached display data when the first application exits or closes.
- the display data is data in JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the display module is further configured to display a user authorization interface, where the user authorization interface is configured to receive an authorized operation instruction of the user;
- the sharing module is configured to share the display data to the second application when the authorized operation instruction is an authorization instruction; or prohibit the second application sharing when the authorization operation instruction is a prohibition instruction The display data.
- an embodiment of the present invention provides a terminal device, including an input device, a display device, and a processor.
- the processor is configured to determine whether the first application currently displayed by the display device is an application in a preset whitelist, and when the first application is an application in the whitelist, according to the first
- the control on the current display interface of an application acquires display data of the first application on the current display interface, and the control is an interface element of the current display interface;
- the input device is configured to receive an authorization operation instruction input by a user, where the authorization operation instruction includes an authorization instruction for indicating sharing the display data to the second application, and is used to indicate that the display data is prohibited from being shared. a prohibition instruction to the second application;
- the processor is further configured to determine, according to the authorization operation instruction, whether to share the display data to a second application.
- the processor is specifically configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, and according to each The data of the valid control acquires the display data; wherein the valid control is a control that carries data that satisfies a first preset condition; the data attribute includes a text length in the control, and the control The picture occupies at least one of the size of the current interface, and the animation in the control occupies the size of the current interface.
- the processor is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, specifically:
- the processor is specifically configured to: when the data attribute of the control is a text length in the control, and the text length in the control is greater than a preset first threshold, determine that the control is a valid control; or Determining that the control is a valid control when the data attribute of the control is that the picture in the control occupies a size of the current interface, and the picture in the control occupies a size of the current interface that is greater than a preset second threshold; Alternatively, when the data attribute of the control is the size of the current interface in the control, and the animation in the control occupies the size of the current interface is greater than a preset third threshold, determining that the control is a valid control ;
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the processor is configured to acquire the display data according to data of each of the valid controls, and specifically includes:
- the processor is specifically configured to determine, according to the type of the second application or the registration information of the second application on the operating system, a data integration mechanism of the second application, and according to the data of the second application.
- An integration mechanism integrating data of all valid controls on the current display interface of the first application, and determining the integrated data as the display data; wherein the registration information of the second application carries the second Application data integration mechanism;
- the terminal device is an Android operating system
- the Android operating system includes an application framework layer integrated with a screen data sharing unit, and the screen data sharing unit provides a surface. a first application API interface to the first application and a second API interface to the second application;
- the screen data sharing unit acquires display data of the first application on the current display interface by using the first API interface according to the control on the current display interface of the first application;
- the screen data sharing unit shares the display data to the second application through the second API interface.
- the processor is configured to determine whether the currently displayed first application is an application in a preset whitelist, and specifically includes:
- the processor is specifically configured to determine context information of the first application, where the context information includes an identifier of the first application and a page identifier of a current display interface of the first application; and determining the first Determining whether the identifier of the application matches the identifier of the application in the whitelist; if the identifier of the first application matches the identifier of the application in the whitelist, determining the page identifier of the current display interface of the first application Whether it matches the page identifier of the application in the whitelist; if it matches, determining that the first application is an application in the whitelist.
- the processor is further configured to instruct the memory to cache the display data, and delete the cached display data when the first application is exited or closed.
- the display data is data in JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the display device is further configured to display a user authorization interface, where the user authorization interface is configured to receive an authorized operation instruction of the user;
- the processor is configured to: when the authorized operation instruction is an authorization instruction, share the display data to a second application; or, when the authorization operation instruction is a prohibition instruction, prohibit the second application
- the display data is shared.
- the present invention also provides an embodiment of a method for sharing data between applications, in which the different applications on the same mobile terminal can be considered to have obtained the data sharing authorization of the user by default.
- the method includes:
- An operating system running on the mobile terminal acquires, by using a first application program interface (API, Application Interface), a control set on a current display interface of the first application, where the control set is an interface element of the current display interface;
- API Application Program Interface
- the operating system running on the mobile terminal determines whether the current display interface of the first application is a data sharing page in a preset whitelist
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application;
- the operating system running on the mobile terminal shares the display data to the second application through a second application program interface (API).
- API application program interface
- the operating system includes an application framework, where the application framework includes a view system and a screen data sharing unit, wherein the operating system running on the mobile terminal passes through the first application interface Obtaining a collection of controls on the current display interface of the first application, including:
- An operating system running on the mobile terminal outputting, by using the display system, a current display interface of the first application;
- the display system passes the set of controls on the current display interface of the first application to the screen data sharing unit through the first application program interface.
- the control set may include one control or two controls, and may of course include three or more controls.
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application Specifically, including:
- the operating system running on the mobile terminal determines, according to the first application name, the page name of the current display interface, the control type, and the control identifier, the effective control on the current display interface of the first application by using the effective control configuration table;
- the operating system running on the mobile terminal acquires display data on the current display interface according to data of each valid control.
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application Specifically, including:
- the operating system running on the mobile terminal determines, according to the data attribute of each control on the current display interface of the first application, the effective control on the current display interface of the first application; a control of the data of the preset condition; the data attribute includes at least one of a length of the text in the control, a picture in the control occupies a size of the current interface, and an animation in the control occupies a size of the current interface;
- the operating system running on the mobile terminal acquires the display data according to data of each valid control.
- determining, according to the data attribute of each control on the current display interface of the first application, the effective control on the current display interface of the first application including:
- the operating system running on the mobile terminal determines that the control is a valid control
- the operating system running on the mobile terminal Determining that the control is a valid control
- the operating system running on the mobile terminal Determining that the control is a valid control
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the operating system of the mobile terminal is configured to obtain display data on the current display interface according to data of each valid control, including:
- the operating system running on the mobile terminal according to the data integration mechanism of the second application, Integrating data of all valid controls on the current display interface of the first application, and determining the integrated data as the display data.
- the operating system of the mobile terminal determines whether the current display interface of the first application is a data sharing page in the preset whitelist, including:
- the operating system running on the mobile terminal determines an identifier of the first application and a page identifier of a current display interface of the first application;
- the operating system running on the mobile terminal determines whether the identifier of the first application matches the identifier of the application in the whitelist;
- the operating system running on the mobile terminal determines whether the page identifier of the current display interface of the first application is in the whitelist. The page identifier of the application matches;
- the operating system running on the mobile terminal determines that the current display interface is a data sharing page in the preset white list.
- the operating system of the mobile terminal is configured to share the display data to the second application by using a second application program interface, including:
- the operating system running on the mobile terminal obtains the second application by using an application data sharing configuration table, and the application data sharing configuration table is pre-configured with a data subscription relationship between the second application and the first application;
- the operating system running on the mobile terminal invokes the second application interface to deliver the display data to the second application.
- the application data sharing configuration table may include one or more of an application name, an interface name, a control type, and a control ID.
- the application data sharing configuration table and the white list can be one table, which can of course be separated, that is, the application data sharing configuration table is one table, and the white list is another table.
- the operating system of the mobile terminal is configured to share the display data to the second application by using a second application program interface, including:
- the operating system running on the mobile terminal receives the call request of the second application through the second application program interface;
- the operating system running on the mobile terminal uses the display data as a return of the call request
- the back data is passed to the second application.
- the method further includes:
- the operating system running on the mobile terminal caches the display data
- the operating system running on the mobile terminal deletes the cached display data.
- the display data is data in a JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the execution body of the method for sharing data between applications is the operating system running on the mobile terminal.
- the execution body of the data sharing method between applications may be an operating system running on the mobile terminal.
- the screen data sharing unit of the application framework provides a first application program interface oriented to the first application and a second application program interface oriented to the second application.
- the present invention also provides an embodiment of a mobile terminal.
- the mobile terminal includes a memory and a processor, the memory stores operating system instruction code executed by the mobile terminal, and the processor runs an instruction code of an operating system in the memory, for:
- the display data is shared to the second application through the second application interface.
- the operating system includes an application framework, where the application framework includes a view system and a screen data sharing unit, wherein the processor runs an instruction of an operating system in the memory
- the code is configured to: obtain, by using the first application program interface, a control set on a current display interface of the first application, including:
- the processor outputs a current display interface of the first application through the display system
- the display system passes the set of controls on the current display interface of the first application to the screen data sharing unit through the first application program interface.
- the processor is configured according to a current display interface of the first application
- the collection of the control, the display data of the first application on the current display interface specifically includes:
- the processor determines, according to the first application name, a page name of the current display interface, a control type, and a control identifier, a valid control on the current display interface of the first application by using a valid control configuration table;
- the processor acquires display data on the current display interface according to data of each valid control.
- the processor is configured to obtain, according to the set of controls on the current display interface of the first application, the display data of the first application on the current display interface, specifically:
- the processor is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on a current display interface of the first application; the effective control is to carry data that meets a first preset condition
- the data attribute includes at least one of a text length in the control, a picture in the control occupies a size of a current interface, and an animation in the control occupies a size of a current interface;
- the processor acquires the display data according to data of each of the valid controls.
- the processor is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, including:
- the processor determines that the control is a valid control
- the processor determines that the control is Effective control
- the processor determines that the control is Effective control
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, and the size of the current interface in the control is greater than the second threshold, in the control.
- the animation occupies any size of the current interface greater than the third threshold.
- the processor acquires display data on the current display interface according to data of each valid control, including:
- the processor integrates data of all valid controls on the current display interface of the first application according to the data integration mechanism of the second application, and determines the integrated data as the display data.
- the processor determines whether the current display interface of the first application is a data sharing page in the preset whitelist, including:
- the processor determines whether the identifier of the first application matches an identifier of an application in the whitelist
- the processor determines whether the page identifier of the current display interface of the first application is different from the page of the application in the whitelist. Identification match
- the processor determines that the current display interface is a data sharing page in the preset whitelist.
- the processor shares the display data to the second application by using a second application interface, including:
- the processor obtains the second application by using a data sharing configuration table, where the application data sharing configuration table is pre-configured with a data subscription relationship between the second application and the first application;
- the processor invoking the second application interface to deliver the display data to the second application.
- the processor shares the display data to the second application by using a second application interface, including:
- the processor receives a call request of the second application by using the second application program interface
- the processor passes the display data as return data of the call request to the second application.
- the processor is further configured to:
- the display data is data in a JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the mobile terminal may be a mobile phone, a tablet, a wearable device, or the like, which is not limited in this embodiment of the present invention.
- FIG. 1 is a schematic diagram of an application sharing scenario according to an embodiment of the present invention
- FIG. 2 is a block diagram showing a hardware structure of a mobile phone according to an embodiment of the present invention
- FIG. 3 is a structural block diagram of an Android operating system in the prior art according to an embodiment of the present invention.
- FIG. 4 is a structural block diagram of an Android operating system according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of Embodiment 1 of a method for sharing application data according to an embodiment of the present disclosure
- FIG. 6 is a schematic flowchart of Embodiment 2 of a method for sharing application data according to an embodiment of the present disclosure
- FIG. 7 is a schematic flowchart of Embodiment 3 of a method for sharing application data according to an embodiment of the present disclosure
- FIG. 8 is a schematic flowchart of Embodiment 4 of a method for sharing application data according to an embodiment of the present disclosure
- FIG. 9 is a schematic diagram 1 of a user authorization interface according to an embodiment of the present invention.
- FIG. 10 is a second schematic diagram of a user authorization interface according to an embodiment of the present invention.
- FIG. 11 is a schematic structural diagram of Embodiment 1 of an application data sharing apparatus according to an embodiment of the present disclosure
- FIG. 12 is a schematic structural diagram of Embodiment 2 of an application data sharing apparatus according to an embodiment of the present disclosure
- FIG. 13 is a schematic structural diagram of Embodiment 3 of an application data sharing apparatus according to an embodiment of the present disclosure.
- FIG. 14 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the present invention.
- the application data sharing method provided by the embodiment of the present invention can be applied to a scenario in which application data is shared between any two applications on the terminal device.
- the application sharing scenario shown in FIG. 1 is used.
- User-oriented, user-accessible application Application, referred to as APP.
- the process data generated by the user when using the APP is generally very valuable to the user.
- the chat content may include the user's personal information, itinerary information, picture information, etc., so some or all of the chat content may be shared with the third party application according to the chat content, for example, according to the user in WeChat A message sent by a friend "to eat at Xinjiekou at 3 pm tomorrow", you can create a schedule reminder for the user at 3 pm tomorrow (that is, share the message content to the calendar application) in the calendar app, or you can use it in the map app.
- Use Xinjiekou as a candidate for the destination (that is, share the content of the message to the map app), or you can also use the food of Xinjiekou as a recommendation item in the group purchase recommendation (that is, share the message content to the group purchase APP).
- the terminal device may include a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the like.
- FIG. 2 is a block diagram showing a part of the structure of the mobile phone 100 related to the embodiment of the present invention.
- the mobile phone 100 includes an RF (Radio Frequency) circuit 110, a memory 120, other input devices 130, a display 140, a sensor 150, an audio circuit 160, and an input/output (I/O).
- System 170, processor 180, And components such as power supply 190 It will be understood by those skilled in the art that the structure of the mobile phone shown in FIG. 2 does not constitute a limitation to the mobile phone, and may include more or less components than those illustrated, or combine some components, or split some components, or Different parts are arranged.
- display 140 is a User Interface (UI) and that handset 100 may include a user interface that is smaller than shown or less.
- UI User Interface
- the components of the mobile phone 100 will be specifically described below with reference to FIG. 2:
- the RF circuit 110 can be used for transmitting and receiving information or during a call, and receiving and transmitting the signal. Specifically, after receiving the downlink information of the base station, the processor 180 processes the data. In addition, the uplink data is designed to be sent to the base station.
- RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like.
- RF circuitry 110 can also communicate with the network and other devices via wireless communication.
- the wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
- the memory 120 can be used to store software programs and modules, and the processor 180 executes various functional applications and data processing of the mobile phone 100 by running software programs and modules stored in the memory 120.
- the memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored. Data created according to the use of the mobile phone 100 (such as audio data, phone book, etc.).
- memory 120 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- Other input devices 130 can be used to receive input numeric or character information, as well as generate key signal inputs related to user settings and function controls of the handset 100.
- other input devices 130 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and light mice (the light mouse is not sensitive to display visual output).
- function keys such as volume control buttons, switch buttons, etc.
- trackballs mice, joysticks, and light mice (the light mouse is not sensitive to display visual output).
- Other input devices 130 is coupled to other input device controllers 171 of I/O subsystem 170 for signal interaction with processor 180 under the control of other device input controllers 171.
- the display screen 140 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone 100, and can also accept user input.
- the display screen 140 may include a display panel 141 and a touch panel 142.
- the display panel 141 can be configured by using an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
- the touch panel 142 also referred to as a touch screen, a touch sensitive screen, etc., can collect contact or non-contact operations on or near the user (eg, the user uses any suitable object or accessory such as a finger, a stylus, etc. on the touch panel 142.
- the operation in the vicinity of the touch panel 142 may also include a somatosensory operation; the operation includes a single-point control operation, a multi-point control operation, and the like, and drives the corresponding connection device according to a preset program.
- the touch panel 142 may include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation and posture of the user, and detects a signal brought by the touch operation, and transmits a signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts the signal into a processor. The processed information is sent to the processor 180 and can receive commands from the processor 180 and execute them.
- the touch panel 142 can be implemented by using various types such as resistive, capacitive, infrared, and surface acoustic waves, and the touch panel 142 can be implemented by any technology developed in the future.
- the touch panel 142 can cover the display panel 141, and the user can display the content according to the display panel 141 (the display content includes, but is not limited to, a soft keyboard, a virtual mouse, a virtual button, an icon, etc.) on the display panel 141. Operation is performed on or near the covered touch panel 142.
- the touch panel 142 After detecting the operation thereon or nearby, the touch panel 142 transmits to the processor 180 through the I/O subsystem 170 to determine user input, and then the processor 180 according to the user The input provides a corresponding visual output on display panel 141 via I/O subsystem 170.
- the touch panel 142 and the display panel 141 are two independent components to implement the input and input functions of the mobile phone 100, in some embodiments, the touch panel 142 and the display panel 141 may be Integration and implementation of the input and output functions of the handset 100.
- the handset 100 can also include at least one type of sensor 150, such as a light sensor, motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may close the display panel 141 when the mobile phone 100 moves to the ear. / or backlight.
- the accelerometer sensor can detect the acceleration in all directions (usually three axes).
- the magnitude and direction of gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; 100 other gyro, barometer, hygrometer, thermometer, infrared sensor and other sensors can be configured, and will not be described here.
- the gesture of the mobile phone such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; 100 other gyro, barometer, hygrometer, thermometer, infrared sensor and other sensors can be configured, and will not be described here.
- the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the handset 100.
- the audio circuit 160 can transmit the converted audio data to the speaker 161 for conversion to the sound signal output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into a signal, which is received by the audio circuit 160.
- the audio data is converted to audio data, which is then output to the RF circuit 110 for transmission to, for example, another mobile phone, or the audio data is output to the memory 120 for further processing.
- the I/O subsystem 170 is used to control external devices for input and output, and may include other device input controllers 171, sensor controllers 172, and display controllers 173.
- one or more other input control device controllers 171 receive signals from other input devices 130 and/or send signals to other input devices 130.
- Other input devices 130 may include physical buttons (press buttons, rocker buttons, etc.) , dial, slide switch, joystick, click wheel, light mouse (light mouse is a touch-sensitive surface that does not display visual output, or an extension of a touch-sensitive surface formed by a touch screen). It is worth noting that other input control device controllers 171 can be connected to any one or more of the above devices.
- Display controller 173 in I/O subsystem 170 receives signals from display 140 and/or transmits signals to display 140. After the display 140 detects the user input, the display controller 173 converts the detected user input into an interaction with the user interface object displayed on the display screen 140, ie, implements human-computer interaction. Sensor controller 172 can receive signals from one or more sensors 150 and/or send signals to one or more sensors 150.
- the processor 180 is the control center of the handset 100, connecting various portions of the entire handset with various interfaces and lines, by running or executing software programs and/or modules stored in the memory 120, and recalling data stored in the memory 120, The various functions and processing data of the mobile phone 100 are executed to perform overall monitoring of the mobile phone.
- the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
- the modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 180.
- the handset 100 also includes a power source 190 (such as a battery) that supplies power to the various components, preferably, electricity.
- the source can be logically coupled to the processor 180 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.
- the mobile phone 100 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
- FIG. 2 introduces the structural framework of the terminal device by using the mobile phone as an example, and the application data sharing method according to the embodiment of the present invention also relates to the software architecture of the terminal device.
- the method according to the embodiment of the present invention can be applied to an operating system such as an Android system, an OS system, a Darwin system, an RTXC system, a Linux system, a Unix system, a Windows system, an embedded operating system such as VxWorks.
- an operating system such as an Android system, an OS system, a Darwin system, an RTXC system, a Linux system, a Unix system, a Windows system, an embedded operating system such as VxWorks.
- the system framework of the software operating system involved in the method of the embodiment of the present invention is described by taking the operating system as the Android system on the mobile phone as an example.
- Android is an open source mobile operating system. As a mobile device platform, its hierarchy includes an operating system, middleware (Middle Ware) and applications (Application), as shown in Figure 3, the Android operating system. Divided into the following levels:
- SDK Android Software Development Kit
- the operating system itself also includes some basic applications, such as SMS, phone, photo viewer, web browser and other system level. application.
- Android's application framework layer provides various application programming interfaces (APIs) for the application layer. It contains various controls required in the User Interface (UI) program, for example: Views (views) Components) include TextView, ListView, Buttons, WebView (Web Browser Control)
- APIs application programming interfaces
- This layer includes two parts: various libraries and runtime environment.
- the various libraries are mainly C library, multimedia library, graphics processing engine, etc.
- the runtime environment is mainly Dalvik virtual machine, which is different from the standard JAVA virtual machine.
- the .dex file is a virtual machine that has been tailored and optimized for mobile devices.
- Linux kernel development is based on the Linux kernel development, and its core system services, memory management, process management, network protocols and drivers all depend on the Linux kernel.
- Linux kernel layer is the hardware layer of the phone described in Figure 2.
- FIG. 2 and Figure 3 above illustrate the architecture of the terminal device from the perspective of hardware and software.
- the application B when any two applications on the terminal device (assume that the application A and the application B) are sharing application data, the application B must obtain the authorization of the application A to share the data of the application A, but the actual The situation is that for the sake of commercial interests, each application developer generally does not share its own data with other applications, resulting in information monopoly, poor information interoperability, and low user experience.
- the application data sharing method, device, and terminal device provided by the embodiments of the present invention are intended to solve the problem that the information monopoly and the information interoperability are poor due to the influence of the developer authorization limitation in the prior art, and the user experience is Not a high technical problem.
- the Android system is taken as an example, and the embodiment of the present invention adds screen data in the Framework layer of the Android operating system based on the Android operating system architecture level shown in FIG. 3 above.
- Screen Data Share hereinafter referred to as the data sharing unit. It provides two API interfaces for the display system (View System) and third-party applications (such as the schedule, map APP, group purchase APP, etc. involved in the above examples).
- the display framework passes the control tree of the currently displayed application (the control tree includes a collection of parent controls and child controls of the current display interface of the application) to the data sharing unit through one of the API interfaces, and the data sharing unit acquires the data according to the control tree.
- the application data of the current display interface is applied to share the application data to the third-party application through another API interface.
- the executor of the method embodiment may be a terminal device, or may be a sharing device of application data integrated in the terminal device, and the device may be implemented by software, hardware, or a combination of software and hardware.
- the following method embodiment is described by taking an execution subject as a terminal device as an example.
- FIG. 5 is a schematic flowchart of Embodiment 1 of a method for sharing application data according to an embodiment of the present invention.
- the embodiment relates to the display data of the current display interface of the first application that the terminal device matches the preset white list, and determines whether to share the display data to other third-party applications according to the authorization instruction of the user. process.
- the method includes the following steps:
- S101 Determine whether the currently displayed first application is an application in a preset whitelist.
- the terminal device determines whether the first application matches the attribute information of the application in the preset whitelist.
- the application in the whitelist may be an application that is set by the developer according to the development experience or the corresponding threshold.
- the display interface of the application includes data that can provide better service for the user.
- the application in the whitelist is also It can be a third-party application (ie, an application that wants to share display data of other applications) to inform the operating system which application application data is intended to be shared by itself, and such third-party application can also be notified to the operating system application.
- the whitelist may include an identifier of the application, a type of the application, an identifier of a page that carries data in the application, and the like.
- the terminal device may The control on the current display interface of the first application obtains the display data of the first application on the current display interface, and the control is an interface element of the current application interface of the source application.
- the first application is WeChat
- the current display interface is The chat interface of the WeChat
- the text content, the image or the time in the chat interface as a whole the chat interface is the control of the chat interface.
- the embodiment of the present invention is obtained by using a screen data sharing unit located on the application framework layer in FIG. 4, where the screen data sharing unit provides a first API interface of the first application and a second API interface for the second application, and the display system located on the application framework layer transmits the obtained control of the first application on the current display interface to the screen data through the first API interface
- the sharing unit, the screen data sharing unit may obtain the display data of the first application on the current display interface by traversing the control on the current display interface; the screen data sharing unit shares the display data to the second application through the second API interface.
- the display data may be all the data displayed on the current display interface of the first application, and may be part of the data that is filtered by the terminal device to display all the data displayed on the current display interface of the first application. This is not a limitation.
- the display data of the first application on the current display interface is obtained, which does not require the first application to perform the corresponding operation, and thus the display data is separated from the authorization limit of the first application in the application layer.
- the display data is independently present on the terminal device, When the display data is shared with other applications, it is not necessary to consider whether the developer of the first application is authorized.
- S103 Determine whether to share the display data to the second application according to an authorization operation instruction input by the user.
- the authorization operation instruction includes an authorization instruction for indicating sharing of the display data to the second application and a prohibition instruction for instructing the sharing of the display data to the second application.
- the authorization operation instruction includes indicating the display data.
- the display data on the display interface is shared to the second application, and the second application may be any type of application except the first application on the terminal device.
- the embodiment of the present invention does not limit the type of the second application.
- the second API interface for the third-party application ie, the second application
- the application can support the third-party application to actively query the current display data, and can also support the third-party application.
- the application subscribes to the current display data, that is, when the terminal obtains the display data of the first application, it determines whether to share to the third-party application according to the authorized operation instruction of the user, and there is no possibility of sharing to other third-party applications.
- the acquired display data is equivalent to being detached from the first application and is not restricted by the first application, and is owned by the terminal device, and thus
- the shared object of the display data may be authorized by the user to operate the instruction, which is not limited to the authorization authority of the developer of the first application, and therefore, as long as the user decides to share the display data of the first application on the current display interface, the user
- the display data can be shared to any type of second application through corresponding authorization operation instructions, thereby ensuring the openness of data sharing between any two applications, and the interconnection and intercommunication of data, thereby greatly improving the user experience.
- the application data sharing method obtaineds the first application in the current application according to the control on the current display interface of the first application when determining that the currently displayed first application is an application in the preset white list. Display data on the display interface to determine whether to share the display data for use by the second application according to an authorized operation instruction input by the user.
- the display data acquired by the terminal device through the data sharing unit is separated from the authorization limit of the first application, and thus the shared object of the display data of the first application on the current display interface is authorized by the user. Directly, it is not limited to the authorization authority of the developer of the first application.
- the user can use the corresponding authorization operation instruction to Display data sharing to any type of second application, which ensures the openness of data sharing between any two applications, and the interconnection of data, greatly improving the user experience.
- FIG. 6 is a schematic flowchart of Embodiment 2 of a method for sharing application data according to an embodiment of the present invention.
- the embodiment relates to a specific process of the terminal device acquiring the display data of the first application on the current display interface according to the valid email of the first application on the current display interface.
- the foregoing S102 may specifically include the following steps:
- S201 Determine, according to the data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application.
- the valid control is a control that carries data that satisfies a first preset condition; the data attribute includes a text length in the control, a picture in the control occupies a size of a current interface, and an animation in the control At least one of the size of the current interface;
- the UI interface of each application on the terminal device involves various controls, such as a TextView, a ListView, a Buttons, a WebView, and these controls. Subclasses, etc., each of which has a corresponding type of data.
- the terminal device may acquire the control set corresponding to the first application (for the acquisition manner, refer to the prior art, and details are not described herein again), the control set includes the first Applying all the controls on the current display interface; optionally, the control set may be a control tree corresponding to the first application, the control tree includes a parent control and various child controls, for example, if the first application is WeChat, the current display interface For the chat interface of WeChat, the chat interface is a parent control as a whole, and the text content, image or time in the chat interface is a child control. For example, if an expression image is inserted into the text content, the expression image is a child control. Child control.
- the terminal device traverses all the controls in the control set to determine which controls carry the data that meets the first preset condition, so that the carried meets the first preset.
- the control of the conditional data is determined to be a valid control.
- Common examples of carrying user data can be found in the following example of Table 1:
- Control name data 1 Text control TextView text 2 Text editing control EditText text 3 Image control ImageView image 4 Web page control WebView Web page
- control itself will carry its own data acquisition method.
- the text control can obtain the data on the file control through getText().
- the methods for obtaining data for common controls are shown in the following Table 2:
- the above URL is a Uniform Resource Locator (URL).
- the terminal device acquires the data on each control through the method of acquiring data carried by each control itself, and then determines whether the data carried on the control satisfies the data according to the data attribute of the data of each first control.
- a preset condition if satisfied, the terminal device determines that the control is a valid control, thereby determining all valid controls on the current display interface of the first application, and the first preset condition is a data preset by the developer about the control The conditions set for the value of the user.
- the foregoing data attribute may include at least one of a text length of the data in the control, a picture in the control occupies a size of the current interface, and an animation in the control occupies at least one of a size of the current interface, and may be broken
- the first preset The condition may be: the text length of the data in the control is greater than the first threshold, the size of the picture in the control is greater than the second threshold, and the size of the current interface in the control is greater than the current interface. Any one of the third thresholds.
- the terminal device determines, according to the data attribute of the data of each control, in combination with the first preset condition, the valid control in the control set corresponding to the first application, which may be: if the data attribute of the data of the control is the control The length of the text in the data, and the length of the text in the first control is greater than the preset first threshold, determining that the control is a valid control; or, if the data attribute of the control data is the image in the control occupying the current interface Size, and the image in the control occupies the current interface If the size is greater than the preset second threshold, the control is determined to be a valid control; or, if the data attribute of the control data is the size of the current interface in the control, and the animation in the control accounts for more than the current interface size
- the preset third threshold determines that the control is a valid control.
- S202 Acquire the display data according to data of each of the valid controls.
- the terminal device can directly use the data collection on each valid control as the display data, and can also perform corresponding integration on the data on each control, and use the integrated data as the display data, and the integration method can be specifically Referring to the third embodiment shown in FIG. 7, as shown in FIG. 7, the method may specifically include the following steps:
- S301 Determine a data integration mechanism of the second application according to the type of the second application or the registration information of the second application on the operating system, where the registration information of the second application carries the second The data integration mechanism of the application.
- each second application when it is required to share the display data of the currently displayed first application, is registered in the operating system in advance, thereby sending its own registration information to the operating system, where the registration information carries the second application.
- the data integration mechanism is designed to inform the operating system of the form or type of data it needs.
- the terminal device can know the data integration mechanism of each second application based on the operating system.
- the terminal device may further determine a data integration mechanism of the second application according to the type of the second application, where the type of the second application may include a chat application, a shopping application, a express application, a video application, and a music application. Any of them.
- S302 Integrate data of all valid controls on the current display interface of the first application according to the data integration mechanism of the second application, and determine the integrated data as the display data.
- the terminal device After the terminal device obtains the display data of the first application on the current display interface, and further determines which one or several second applications are to be shared, the terminal device performs a data integration mechanism according to the second application. And integrating data of all valid controls on the current display interface of the first application, and determining the integrated data as the display data. For example, it is assumed that the first application currently displayed is WeChat, and the current display interface is a WeChat chat interface, where the nickname, the conversation content, and the time are displayed in three different effective controls.
- the first application is a calendar application
- the first application is The data integration mechanism of the second application is ⁇ sender nickname, receiver nickname, message content, timestamp ⁇ , Therefore, the terminal device can output the contents of the three valid controls in the first application as a whole, as a conversation, and the format is: “sender nickname, receiver nickname, message content, time stamp ⁇ , and can be further multiple times.
- the conversations are integrated into a session in chronological order. In this way, the integrated data can be used as the display data of the first application on the current display interface, thereby greatly improving the validity of the shared data, so that the second application can better provide the user with the integrated display data. service.
- the current display interface changes at any time, so the data on the current display interface also changes according to the interface change. Therefore, the terminal device obtains the first application at the current time.
- the display data may be cached, and when the user exits the first application or closes the first application, the cached display data is deleted, thereby greatly improving data security and avoiding current The display interface changes and the display data is lost.
- the display data may be set to data in a JSON format, where the display data carries the identifier of the first application and/or the type of the first application. .
- the application data sharing method determines the effective control on the current display interface of the first application according to the data attribute of each control on the current display interface of the first application, thereby acquiring according to the data of each valid control.
- the first application currently displays the display data of the interface, and the data acquisition mode can be obtained only by traversing the control, the data acquisition mode is simple and effective, and the data that the terminal device finally shares to the second application is ensured to satisfy the first preset condition.
- the data ensures that the data is process data that satisfies the user's needs and can provide better service to the user. Therefore, it greatly improves the user experience and makes the interaction between the user and the terminal device more intelligent.
- the embodiment integrates the acquired data of each valid control, and uses the integrated data as the display data of the first application on the current display interface, thereby greatly Increased the effectiveness of shared data so that the second application can take advantage of the integration It displays data to provide users with better service.
- FIG. 8 is a schematic flowchart of Embodiment 4 of a method for sharing application data according to an embodiment of the present invention.
- the embodiment relates to the display data of the current display interface of the first application acquired by the terminal device according to the foregoing embodiments, and determining whether to display the data according to an authorization instruction of the user.
- the application in the whitelist is an application that meets the foregoing first preset condition
- the attribute information of the application in the whitelist includes an identifier of the application, an identifier of a page of the application, and is carried in the page.
- the data satisfies the first preset condition (that is, the data carried in the page may be data valuable to the user).
- the method may include the following steps:
- S401 Determine context information of the first application, where the context information includes an identifier of the first application and a page identifier of a current display interface of the first application.
- the terminal device may obtain the context information of the first application from the control set corresponding to the first application, and obtain the context information of the first application by using the operating system.
- the context information includes an identifier of the first application and a page identifier of a current display interface of the first application.
- the context information may further include a type of the first application.
- S402 Determine whether the identifier of the first application matches the identifier of the application in the whitelist.
- the whitelist includes an identifier of an application that satisfies the first preset condition and an identifier of a page that displays data that is valuable to the user in the application.
- the whitelist may further include the first The type of application for which the condition is preset.
- the developer can filter and classify the mainstream applications in the application market according to the first preset condition, and sort out a white list.
- developers can classify applications in the application market into the following categories, as shown in the example in Table 3:
- the terminal device After the terminal device obtains the context information of the first application, the terminal device matches the identifier of the first application in the context information with the identifier of each application in the whitelist. If the matching is performed, the following S403 is performed.
- the terminal device determines that the first application is an application in the whitelist, and then performs S405 described below.
- S405 Acquire, according to a control on the current display interface of the first application, display data of the first application on the current display interface.
- the terminal device determines that the first application matches the application in the whitelist
- the display data of the first application on the current display interface is obtained.
- the specific acquisition process refer to the description in the foregoing Embodiment 1 to Embodiment 3, where No longer.
- S406 Display a user authorization interface, where the user authorization interface is used to receive an authorization operation instruction of the user.
- the terminal displays a user authorization interface to the user, prompting the user to input a corresponding authorization operation instruction, thereby
- the display data of the first application current display interface is shared to the second application.
- the user authorization operation instruction in the embodiment of the present invention includes an authorization instruction for instructing sharing of the display data to the second application and a prohibition instruction for prohibiting sharing of the display data to the second application.
- the user authorization interface may be suspended on the current display interface, and may also be displayed in a message notification column. The user may pull down the notification bar to view the user authorization interface, and FIG. 9 is only An example of a user authorization interface.
- the user authorization interface may include two options, one option for receiving an authorization command of the user, and another option for receiving a prohibition instruction of the user; optionally, the user authorization interface may also be a voice.
- Authorization interface the interface displays a voice input control, the user operates the voice input control to input a corresponding voice instruction, to input a corresponding authorization or prohibition instruction to the terminal, as shown in FIG. 10, of course, FIG. 10 is only a user authorization.
- An example of an interface. The embodiment of the present invention does not limit the form of the user authorization interface and the manner in which the user inputs the authorization operation instruction.
- the application data sharing method determines the context information of the first application by using the context information of the first application, and determines whether the identifier of the first application in the context information matches the identifier applied in the whitelist, and is in the first application.
- the identifier matches the identifier of the application, it is further determined whether the identifier of the page corresponding to the current display interface of the first application matches the identifier of the page of the application in the whitelist, and the identifier of the second page and the whitelist are When the identifier of the page of the application matches, the first application is determined to be an application in the whitelist, and the display data of the first application on the current display interface is obtained, thereby determining whether to share the display data according to the authorization operation instruction input by the user.
- the second application is used.
- the method of the embodiment of the present invention traverses the display data of the first application acquired by the control on the current display interface by the data sharing unit, which does not require the first application to perform a corresponding operation, and thus the display data is separated from the first in the application layer.
- the authorization limit of the application, the display data is independently existed on the terminal device, and is not limited to the authorization authority of the developer of the first application, therefore, as long as the user decides to share the display data of the first application on the current display interface
- the user can share the display data to any type of second application through the corresponding authorization operation instruction, thereby ensuring the openness of data sharing between any two applications, and the interconnection and intercommunication of data, thereby greatly improving the user's Experience.
- the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
- the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
- FIG. 11 is a schematic structural diagram of Embodiment 1 of an application data sharing apparatus according to an embodiment of the present invention.
- the sharing device may be a stand-alone terminal device, or may be a device integrated in the terminal device, and the device may be implemented by software, hardware or a combination of software and hardware.
- the sharing device of the application data includes: a determining module 10, a display module 13, an obtaining module 11, and a sharing module 12.
- the determining module 10 is configured to determine whether the first application currently displayed by the display module 13 is an application in a preset whitelist
- the obtaining module 11 is configured to determine, in the determining module 10, that the first application is a preset white name In the application of the single application, the display data of the first application on the current display interface is obtained according to the control on the current display interface of the first application, and the control is an interface element of the current display interface;
- a sharing module 12 configured to determine, according to an authorized operation instruction input by a user, whether to share the display data to a second application, wherein the authorization operation instruction includes indicating to share the display data to the second An authorization instruction of the application and a prohibition instruction for instructing the sharing of the display data to the second application.
- the device for sharing the application data provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
- FIG. 12 is a schematic structural diagram of Embodiment 2 of an application data sharing apparatus according to an embodiment of the present disclosure.
- the acquiring module 11 further includes:
- the determining unit 111 is configured to determine, according to the data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application; the effective control is to carry the first preset condition a control of the data; the data attribute includes at least one of a length of the text in the control, a picture in the control occupies a size of the current interface, and an animation in the control occupies a size of the current interface;
- the obtaining unit 112 is configured to acquire the display data according to data of each of the valid controls.
- the determining unit 111 is specifically configured to: when the data attribute of the control is the text length in the control, and the text length in the control is greater than a preset first threshold, determining that the control is An effective control; or, when the data attribute of the control is that the picture in the control occupies the size of the current interface, and the picture in the control occupies the size of the current interface is greater than a preset second threshold, determining the control The effective control; or when the data attribute of the control is the size of the current interface in the control, and the animation in the control occupies the size of the current interface is greater than a preset third threshold, determining the The control is a valid control;
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the obtaining unit 112 is specifically configured to determine, according to the type of the second application or the registration information of the second application on the operating system, a data integration mechanism of the second application, and according to the a data integration mechanism of the application, integrating data of all valid controls on the current display interface of the first application, and determining the integrated data as the display data; wherein
- the registration information of the second application carries a data integration mechanism of the second application.
- the device for sharing the application data provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
- the apparatus is applicable to an Android operating system, the Android operating system including an application framework layer of an integrated screen data sharing unit, the screen data sharing unit providing a first application API interface facing the first application and a second API interface for the second application;
- the screen data sharing unit acquires display data of the first application on the current display interface by using the first API interface according to the control on the current display interface of the first application;
- the screen data sharing unit shares the display data to the second application through the second API interface.
- the determining module 10 is specifically configured to determine context information of the first application, where the context information includes an identifier of the first application and a page identifier of a current display interface of the first application; Determining whether the identifier of the first application matches the identifier of the application in the whitelist; if the identifier of the first application matches the identifier of the application in the whitelist, determining the identifier of the first application Whether the page identifier of the current display interface matches the page identifier of the application in the whitelist; if yes, the first application is determined to be an application in the whitelist.
- FIG. 13 is a schematic structural diagram of Embodiment 3 of the application device sharing device. Further, the device may further include: a storage module 14 and a deletion module 15. a storage module 14 configured to cache the display data;
- the deletion module 15 is configured to delete the cached display data when the first application is exited or closed; the display data is data in a JSON format, and the display data carries the identifier of the first application and/or Or the type of the first application.
- the display module 13 is further configured to display a user authorization interface, where the user authorization interface is configured to receive an authorized operation instruction of the user;
- the sharing module 12 is configured to share the display data to the second application when the authorized operation instruction is an authorization instruction; or prohibit the second application when the authorization operation instruction is a prohibition instruction
- the display data is shared.
- the device for sharing the application data provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects are similar, and details are not described herein again.
- FIG. 14 is a schematic structural diagram of an embodiment of a terminal device according to an embodiment of the present invention.
- the terminal may include a processor 20, such as a CPU, a memory 21, at least one communication bus 22, a display device 23, and an input device 24.
- Communication bus 22 is used to implement a communication connection between components.
- the memory 21 may include a high speed RAM memory, and may also include a nonvolatile memory NVM, such as at least one disk memory, in which various programs may be stored for performing various processing functions and implementing the method steps of the present embodiment;
- the input device 24 is configured to provide an input interface to a user, receive an operation or instruction input by the user, and the like.
- the processor 20 is configured to determine whether the first application currently displayed by the display device 23 is an application in a preset whitelist, and in the whitelist in the first application. And obtaining, by the control on the current display interface of the first application, display data of the first application on the current display interface, where the control is an interface element of the current display interface;
- the input device 24 is configured to receive an authorization operation instruction input by a user, where the authorization operation instruction includes an authorization instruction for indicating sharing the display data to the second application, and for indicating that the display data is prohibited from being used. a prohibition instruction shared to the second application;
- the processor 20 is further configured to determine, according to the authorization operation instruction, whether to share the display data to a second application.
- the terminal device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
- the processor 20 is specifically configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, and valid according to each The data of the control is obtained by acquiring the display data; wherein the valid control is a control that carries data that satisfies a first preset condition; the data attribute includes a length of text in the control, and a picture in the control occupies a current The size of the interface, the animation in the control, and at least one of the size of the current interface.
- the processor 20 is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, specifically:
- the processor 20 is configured to determine that the control is a valid control when a data attribute of the control is a text length in the control, and a text length in the control is greater than a preset first threshold; Alternatively, when the data attribute of the control is that the picture in the control occupies the size of the current interface, and the picture in the control occupies the size of the current interface is greater than a preset second threshold, determining the control The device is a valid control; or, when the data attribute of the control is the size of the current interface in the control, and the animation in the control occupies the size of the current interface is greater than a preset third threshold, determining The control is a valid control;
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the processor 20 is configured to obtain the display data according to the data of each of the valid controls, and specifically includes:
- the processor 20 is configured to determine a data integration mechanism of the second application according to the type of the second application or the registration information of the second application on the operating system, and according to the second application a data integration mechanism, integrating data of all valid controls on the current display interface of the first application, and determining the integrated data as the display data; wherein the registration information of the second application carries the Second application data integration mechanism;
- the terminal device is an Android operating system
- the Android operating system includes an application framework layer integrated with a screen data sharing unit, and the screen data sharing unit provides a first application API interface facing the first application and a second API interface for the second application;
- the screen data sharing unit acquires display data of the first application on the current display interface by using the first API interface according to the control on the current display interface of the first application;
- the screen data sharing unit shares the display data to the second application through the second API interface.
- the processor 20 is configured to determine whether the currently displayed first application is an application in a preset whitelist, and specifically includes:
- the processor 20 is specifically configured to determine context information of the first application, where the context information includes an identifier of the first application and a page identifier of a current display interface of the first application; and determining the Determining whether the identifier of an application matches the identifier of the application in the whitelist; if the identifier of the first application matches the identifier of the application in the whitelist, determining a page of the current display interface of the first application Whether the identifier matches the page identifier of the application in the whitelist; if the identifier is matched, determining that the first application is an application in the whitelist.
- the processor 20 is further configured to instruct the memory 21 to cache the display data, and delete the cached display data when the first application is exited or closed.
- the display The data is data in JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the display device 23 is further configured to display a user authorization interface, where the user authorization interface is configured to receive an authorization operation instruction of the user;
- the processor 20 is configured to: when the authorized operation instruction is an authorization instruction, share the display data to a second application; or, when the authorization operation instruction is a prohibition instruction, prohibit the second The application shares the display data.
- the terminal device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
- the present invention also provides an embodiment of a method for sharing data between applications, in which the different applications on the same mobile terminal can be considered to have obtained the data sharing authorization of the user by default.
- the method includes:
- An operating system running on the mobile terminal acquires, by using a first application program interface (API, Application Interface), a control set on a current display interface of the first application, where the control set is an interface element of the current display interface;
- API Application Program Interface
- the operating system running on the mobile terminal determines whether the current display interface of the first application is a data sharing page in a preset whitelist
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application;
- the operating system running on the mobile terminal shares the display data to the second application through a second application program interface (API).
- API application program interface
- the operating system includes an application framework, where the application framework includes a view system and a screen data sharing unit, wherein the operating system running on the mobile terminal passes through the first application interface Obtaining a collection of controls on the current display interface of the first application, including:
- An operating system running on the mobile terminal outputting, by using the display system, a current display interface of the first application;
- the display system passes the set of controls on the current display interface of the first application to the screen data sharing unit through the first application program interface.
- the control set may include one control or two controls, and may of course include three or more controls.
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application Specifically, including:
- the operating system running on the mobile terminal determines, according to the first application name, the page name of the current display interface, the control type, and the control identifier, the effective control on the current display interface of the first application by using the effective control configuration table;
- the operating system running on the mobile terminal acquires display data on the current display interface according to data of each valid control.
- the operating system running on the mobile terminal acquires display data of the first application on the current display interface according to the control set on the current display interface of the first application Specifically, including:
- the operating system running on the mobile terminal determines, according to the data attribute of each control on the current display interface of the first application, the effective control on the current display interface of the first application; a control of the data of the preset condition; the data attribute includes at least one of a length of the text in the control, a picture in the control occupies a size of the current interface, and an animation in the control occupies a size of the current interface;
- the operating system running on the mobile terminal acquires the display data according to data of each valid control.
- determining, according to the data attribute of each control on the current display interface of the first application, the effective control on the current display interface of the first application including:
- the operating system running on the mobile terminal determines that the control is a valid control
- the operating system running on the mobile terminal determines that the control is a valid control
- the operating system running on the mobile terminal Determining that the control is a valid control
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the operating system of the mobile terminal is configured to obtain display data on the current display interface according to data of each valid control, including:
- the operating system running on the mobile terminal integrates data of all valid controls on the current display interface of the first application according to the data integration mechanism of the second application, and determines the integrated data as the Display Data.
- the operating system of the mobile terminal determines whether the current display interface of the first application is a data sharing page in the preset whitelist, including:
- the operating system running on the mobile terminal determines an identifier of the first application and a page identifier of a current display interface of the first application;
- the operating system running on the mobile terminal determines whether the identifier of the first application matches the identifier of the application in the whitelist;
- the operating system running on the mobile terminal determines whether the page identifier of the current display interface of the first application is in the whitelist. The page identifier of the application matches;
- the operating system running on the mobile terminal determines that the current display interface is a data sharing page in the preset white list.
- the operating system of the mobile terminal is configured to share the display data to the second application by using a second application program interface, including:
- the operating system running on the mobile terminal obtains the second application by using an application data sharing configuration table, and the application data sharing configuration table is pre-configured with a data subscription relationship between the second application and the first application;
- the operating system running on the mobile terminal invokes the second application interface to deliver the display data to the second application.
- the application data sharing configuration table may include one or more of an application name, an interface name, a control type, and a control ID.
- the application data sharing configuration table and the white list can be one table, which can of course be separated, that is, the application data sharing configuration table is one table, and the white list is another table.
- the operating system of the mobile terminal is configured to share the display data to the second application by using a second application program interface, including:
- the operating system running on the mobile terminal receives the call request of the second application through the second application program interface;
- the operating system running at the mobile terminal delivers the display data as return data of the call request to the second application.
- the method further includes:
- the operating system running on the mobile terminal caches the display data
- the operating system running on the mobile terminal deletes the cached display data.
- the display data is data in a JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the execution body of the method for sharing data between applications is the operating system running on the mobile terminal.
- the execution body of the data sharing method between applications may be an operating system running on the mobile terminal.
- the screen data sharing unit of the application framework provides a first application program interface oriented to the first application and a second application program interface oriented to the second application.
- the present invention also provides an embodiment of a mobile terminal.
- the mobile terminal includes a memory and a processor, the memory stores operating system instruction code executed by the mobile terminal, and the processor runs an instruction code of an operating system in the memory, for:
- the display data is shared to the second application through the second application interface.
- the operating system includes an application framework, where the application framework includes a view system and a screen data sharing unit, wherein the processor runs an instruction of an operating system in the memory
- the code is configured to: obtain, by using the first application program interface, a control set on a current display interface of the first application, including:
- the processor outputs a current display interface of the first application through the display system
- the display system passes the set of controls on the current display interface of the first application to the screen data sharing unit through the first application program interface.
- the acquiring, by the processor, the display data of the first application on the current display interface according to the set of controls on the current display interface of the first application specifically:
- the processor determines, according to the first application name, a page name of the current display interface, a control type, and a control identifier, a valid control on the current display interface of the first application by using a valid control configuration table;
- the processor acquires display data on the current display interface according to data of each valid control.
- the processor is configured to obtain, according to the set of controls on the current display interface of the first application, the display data of the first application on the current display interface, specifically:
- the processor is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on a current display interface of the first application; the effective control is to carry data that meets a first preset condition
- the data attribute includes at least one of a text length in the control, a picture in the control occupies a size of a current interface, and an animation in the control occupies a size of a current interface;
- the processor acquires the display data according to data of each of the valid controls.
- the processor is configured to determine, according to a data attribute of each control on the current display interface of the first application, a valid control on the current display interface of the first application, including:
- the processor determines that the control is a valid control
- the processor determines that the control is Effective control
- the processor determines that the control is Effective control
- the first preset condition includes that the text length of the data in the control is greater than the first threshold, the size of the current interface in the control is greater than the second threshold, and the animation in the control is occupied.
- the size of the current interface is greater than any of the third thresholds.
- the processor acquires display data on the current display interface according to data of each valid control, including:
- the processor integrates data of all valid controls on the current display interface of the first application according to the data integration mechanism of the second application, and determines the integrated data as the display data.
- the processor determines whether the current display interface of the first application is a data sharing page in the preset whitelist, including:
- the processor determines whether the identifier of the first application matches an identifier of an application in the whitelist
- the processor determines whether the page identifier of the current display interface of the first application is different from the page of the application in the whitelist. Identification match
- the processor determines that the current display interface is a data sharing page in the preset whitelist.
- the processor shares the display data to the second application by using a second application interface, including:
- the processor obtains the second application by using a data sharing configuration table, where the application data sharing configuration table is pre-configured with a data subscription relationship between the second application and the first application;
- the processor invoking the second application interface to deliver the display data to the second application.
- the processor shares the display data to the second application by using a second application interface, including:
- the processor receives a call request of the second application by using the second application program interface
- the processor passes the display data as return data of the call request to the second application.
- the processor is further configured to:
- the display data is data in a JSON format, and the display data carries an identifier of the first application and/or a type of the first application.
- the mobile terminal may be a mobile phone, a tablet, a wearable device, or the like, which is not limited in this embodiment of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Telephone Function (AREA)
Abstract
本发明实施例提供一种应用数据的共享方法、装置和终端设备。该方法包括:在判断当前显示的第一应用为白名单中的应用时,根据第一应用当前显示界面上的控件获取显示数据,并根据用户输入的授权操作指令确定是否将显示数据共享给第二应用使用,该显示数据的共享并不受限于第一应用的授权权限,大大提高了用户的体验。
Description
本申请要求于2016年08月19日提交中国专利局,申请号为PCT/CN2016/096100、发明名称为“应用数据的共享方法、装置和终端设备”的PCT专利申请,其全部内容通过引用结合在本申请中。
本发明涉及通信技术,尤其涉及一种应用数据的共享方法、装置和终端设备。
随着移动设备的不断发展,各式各样的应用程序(Application,简称APP)出现在移动设备上,为用户的生活提供方便和娱乐。以安卓系统的移动设备为例,其通过APP完成某个特定功能,用户在使用APP时就会产生过程数据,而这些数据对用户是很有价值的,例如,用户在微信中和朋友聊天,聊天内容可能包含了用户的个人信息、行程信息、图片信息等,根据这些聊天内容其实可以为用户提供更多、更好的服务,比如用户在微信中对某个朋友发送了一条消息“明天下午3点在新街口吃饭”,可以在日程APP中为用户创建一个明天下午3点的日程提醒,或者,可以在地图APP中把新街口作为目的地的候选项,再或者,还可以在团购APP推荐中把新街口的美食作为推荐项。
现有技术中采用内容提供方(ContentProvider)的方式实现两个应用之间的数据共享,具体可以为:以应用A和应用B为例,假设应用B需要共享应用A当前界面的显示数据,应用B向操作系统发送一申请请求,该请求中携带应用B想要共享的Provider的第一标识符(URI),然后操作系统根据该申请请求中第一URI和操作系统中之前记录的其他应用事先申明的URI进行匹配,假设第一URI与应用A申明的Provider的URI匹配,则操作系统指示应用A所要执行的操作和返回的数据结构,然后应用A执行该操作并获得相应数据结构的数据后,将数据返回给操作系统,由操作系统将数据透传给应用B。
但是,现有技术的这种应用间数据共享的方式,应用B必须要得到应用A的授权才能共享应用A的数据,而实际情况是各个应用开发商出于商业利益的考虑,一般都不会把各自的数据共享给其他应用使用,从而造成了信息垄断,信息的互联互通性较差,用户体验度不高。
发明内容
本发明实施例提供的应用数据的共享方法、装置和终端设备,用以解决现有技术中应用之间因开发商授权限制的影响导致信息垄断、信息的互联互通性较差,用户体验度不高的技术问题。
第一方面,本发明实施例提供一种应用数据的共享方法,包括:
判断当前显示的第一应用是否为预设的白名单中的应用;
若是,则根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;
根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用;其中,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令。
上述第一方面所提供的应用数据的共享方法,通过在判断当前显示的第一应用为预设的白名单中的应用时,根据第一应用的当前显示界面上的控件获取该第一应用在当前显示界面上的显示数据,从而根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用。本发明实施例的方法,终端设备通过数据共享单元所获取的显示数据脱离第一应用的授权限制,因而第一应用在当前显示界面上的显示数据的共享对象由用户的授权操作指令直接决定,其并不受限于第一应用的开发商的授权权限,因此,只要用户决定将第一应用在当前显示界面上的显示数据进行共享,用户就可以通过相应的授权操作指令将该显示数据共享至任意类型的第二应用,这样保证了任意两个应用之间进行数据共享的开放性,以及数据的互联互通,大大提高了用户的体验。
在一种可能的设计中,所述根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,具体包括:
根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一
应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
根据每个所述有效控件的数据,获取所述显示数据。
在一种可能的设计中,所述根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,具体包括:
若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
在一种可能的设计中,所述根据每个所述有效控件的数据,获取所述显示数据,具体包括:
根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
在一种可能的设计中,所述方法适用于安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;
所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通
过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;
所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
上述各可能的设计所提供的方法,通过根据第一应用当前显示界面上每个控件的数据属性,确定第一应用当前显示界面上的有效控件,从而根据每个有效控件的数据,获取第一应用当前显示界面的显示数据,该数据获取方式仅通过遍历控件的方式就可以获取,数据获取方式简单有效,并且确保了终端设备最终共享给第二应用的数据为满足第一预设条件的数据,即确保了该数据为满足用户需求、能够为用户提供更好的服务的过程数据,因此,其很大程度上提高了用户的体验效果,使得用户与终端设备之间的交互更加智能化;同时,本实施例根据第二应用的数据整合机制,将所获取的每个有效控件的数据进行整合,并将整合后的数据作为第一应用在当前显示界面上的显示数据,从而大大提高了共享数据的有效性,使得第二应用能够利用该整合后的显示数据更好的为用户提供服务。
在一种可能的设计中,所述判断当前显示的第一应用是否为预设的白名单中的应用,具体包括:
确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;
判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;
若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;
若匹配,则确定所述第一应用为所述白名单中的应用。
在一种可能的设计中,所述方法还包括:
将所述显示数据进行缓存;
若所述第一应用退出或者关闭,将所缓存的显示数据删除。
在一种可能的设计中,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
在一种可能的设计中,所述根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用,具体包括:
显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;
若所述授权操作指令为授权指令,则将所述显示数据共享给第二应用使用;
若所述授权操作指令为禁止指令,则禁止所述第二应用共享所述显示数据。
上述各可能的设计提供的应用数据的共享方法,通过确定所述第一应用的上下文信息,并判断上下文信息中第一应用的标识是否与上述白名单中应用的标识匹配,并在第一应用的标识与所述应用的标识匹配时,进一步判断第一应用的当前显示界面对应的页面的标识是否与上述白名单中所述应用的页面的标识匹配,在第二页面的标识与白名单中所述应用的页面的标识匹配时确定第一应用为白名单中的应用,进而获取该第一应用在当前显示界面上的显示数据,从而根据用户输入的授权操作指令,确定是否将显示数据共享给第二应用使用。该方法通过数据共享单元遍历控件获取的第一应用在当前显示界面上的显示数据,其不需要第一应用执行相应的操作,因而该显示数据脱离了应用程序层中第一应用的授权限制,该显示数据独立存在于终端设备上,其并不受限于第一应用的开发商的授权权限,因此,只要用户决定将第一应用在当前显示界面上的显示数据进行共享,用户就可以通过相应的授权操作指令将该显示数据共享至任意类型的第二应用,这样保证了任意两个应用之间进行数据共享的开放性,以及数据的互联互通,大大提高了用户的体验。
第二方面,本发明实施例提供一种应用数据的共享装置,包括:判断模块、显示模块、获取模块和共享模块;
判断模块,用于判断所述显示模块当前显示的第一应用是否为预设的白名单中的应用;
获取模块,用于在所述判断模块判断所述第一应用为预设的白名单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;
共享模块,用于根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用;其中,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给
所述第二应用的禁止指令。
在一种可能的设计中,所述获取模块,具体包括:
确定单元,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
获取单元,用于根据每个所述有效控件的数据,获取所述显示数据。
在一种可能的设计中,所述确定单元,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
在一种可能的设计中,所述获取单元,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制。
在一种可能的设计中,所述装置适用于安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;
所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;
所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
在一种可能的设计中,所述判断模块,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及,判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
在一种可能的设计中,所述装置还包括:
存储模块,用于将所述显示数据进行缓存;
删除模块,用于在所述第一应用退出或者关闭时,将所缓存的显示数据删除。
在一种可能的设计中,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
在一种可能的设计中,所述显示模块,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;
所述共享模块,用于在所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,在所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
上述第二方面以及第二方面的各可能的设计所提供的应用数据的共享装置,其有益效果可以参照上述第一方面以及第一方面的各可能的设计所带来的有益效果,在此不再赘述。
第三方面,本发明实施例提供一种终端设备,包括输入设备、显示设备和处理器;
所述处理器,用于判断所述显示设备当前显示的第一应用是否为预设的白名单中的应用,并在所述第一应用为所述白名单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;
所述输入设备,用于接收用户输入的授权操作指令,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令;
所述处理器,还用于根据所述授权操作指令,确定是否将所述显示数据共享给第二应用使用。
在一种可能的设计中,所述处理器,具体用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,并根据每个所述有效控件的数据,获取所述显示数据;其中,所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个。
在一种可能的设计中,所述处理器,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,具体包括:
所述处理器,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
在一种可能的设计中,所述处理器,用于根据每个所述有效控件的数据,获取所述显示数据,具体包括:
所述处理器,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
在一种可能的设计中,所述终端设备为安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面
向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;
所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;
所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
在一种可能的设计中,所述处理器,用于判断当前显示的第一应用是否为预设的白名单中的应用,具体包括:
所述处理器,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
在一种可能的设计中,所述处理器,还用于指示存储器将所述显示数据进行缓存;并在所述第一应用退出或者关闭时,将所缓存的显示数据删除。
在一种可能的设计中,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
在一种可能的设计中,所述显示设备,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;
所述处理器,具体用于当所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,当所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
上述第三方面以及第三方面的各可能的设计所提供的终端设备,其有益效果可以参照上述第一方面以及第一方面的各可能的设计所带来的有益效果,在此不再赘述。
鉴于在同一移动终端上的不同应用可认为已缺省获得用户的数据共享授权,本发明还提供了一种应用间数据的共享方法实施例,所述方法包括:
运行在移动终端的操作系统,通过第一应用程序接口(API,Application Interface),获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;
所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;
若是,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;
所述运行在移动终端的操作系统,通过第二应用程序接口(API,Application Interface),将所述显示数据共享给第二应用。
由上可以看出,同一移动终端的不同的应用之间可以信息互通,而且还可以提高用户的体验。
可选的或进一步的,所述操作系统包括应用程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,运行在移动终端的操作系统,通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:
运行在所述移动终端的操作系统,通过所述显示系统,输出所述第一应用的当前显示界面;
所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
其中,所述控件集合可以包括一个控件、或两个控件,当然也可以包括三个或更多控件。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述运行在移动终端的操作系统,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;
所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述显示数据。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,包括:
若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
可选的或进一步的,所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:
所述运行在移动终端的操作系统,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
所述运行在移动终端的操作系统,根据所述第二应用的数据整合机制,
对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
可选的或进一步的,所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:
所述运行在移动终端的操作系统确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;
所述运行在移动终端的操作系统判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;
若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述运行在移动终端的操作系统判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;
若匹配,则所述运行在移动终端的操作系统确定当前显示界面为预设的白名单中的数据分享页面。
可选的或进一步的,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述运行在移动终端的操作系统,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;
所述运行在移动终端的操作系统,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
其中,应用数据分享配置表可以包括应用名称、界面的名称、控件类型、控件ID中的一个或多个。
可以理解的是,所述应用数据分享配置表与所述白名单可以为一个表,当然可以分开,即所述应用数据分享配置表为一个表,所述白名单为另一个表。
可选的或进一步的,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述运行在移动终端的操作系统,通过所述第二应用程序接口,接收所述第二应用的调用请求;
所述运行在移动终端的操作系统将所述显示数据作为所述调用请求的返
回数据传递给所述第二应用。
可选的或进一步的,所述方法还包括:
所述运行在移动终端的操作系统将所述显示数据进行缓存;
若所述第一应用退出或者关闭,所述运行在移动终端的操作系统将所缓存的显示数据删除。
其中,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
可以理解的是,上述一种应用间数据的共享方法的执行主体为运行在移动终端的操作系统,具体的,一种应用间数据的共享方法的执行主体可以为运行在移动终端的操作系统的应用程序框架的屏幕数据共享单元。所述的屏幕数据共享单元提供面向第一应用的第一应用程序接口和面向第二应用的第二应用程序接口。
本发明还提供了一种移动终端的实施例。所述移动终端包括存储器和处理器,所述存储器存储所述移动终端运行的操作系统指令代码,所述处理器运行所述存储器中的操作系统的指令代码,用于:
通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;
判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;
若是,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;
通过第二应用程序接口,将所述显示数据共享给第二应用。
可选的或进一步的,所述操作系统包括应用程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,所述处理器运行所述存储器中的操作系统的指令代码,用于:通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:
所述处理器,通过所述显示系统,输出所述第一应用的当前显示界面;
所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
可选的或进一步的,所述处理器根据所述第一应用的当前显示界面上的
所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述处理器,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;
所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
可选的或进一步的,所述处理器用于根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
所述处理器根据每个所述有效控件的数据,获取所述显示数据。
可选的或进一步的,所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,包括:
若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述处理器确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则所述处理器确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述处理器确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中
的动画占当前界面的大小大于所述第三阈值中的任一个。
可选的或进一步的,所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:
所述处理器,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
所述处理器,根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
可选的或进一步的,所述处理器判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:
所述处理器确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;
所述处理器判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;
若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述处理器判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;
若匹配,则所述处理器确定当前显示界面为预设的白名单中的数据分享页面。
可选的或进一步的,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述处理器,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;
所述处理器,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
可选的或进一步的,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述处理器,通过所述第二应用程序接口,接收所述第二应用的调用请求;
所述处理器将所述显示数据作为所述调用请求的返回数据传递给所述第二应用。
可选的或进一步的,所述处理器还用于:
将所述显示数据进行缓存;
若所述第一应用退出或者关闭,将所缓存的显示数据删除。
可选的或进一步的,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
其中,该移动终端可以为手机、平板、穿戴式设备等,本发明实施例对此并不限制。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的应用程序共享场景示意图;
图2为本发明实施例提供的手机的硬件结构框图;
图3为本发明实施例提供的现有技术中的安卓操作系统的结构框图;
图4为本发明实施例提供的安卓操作系统的结构框图;
图5为本发明实施例提供的应用数据的共享方法实施例一的流程示意图;
图6为本发明实施例提供的应用数据的共享方法实施例二的流程示意图;
图7为本发明实施例提供的应用数据的共享方法实施例三的流程示意图;
图8为本发明实施例提供的应用数据的共享方法实施例四的流程示意图;
图9为本发明实施例提供的用户授权界面示意图一;
图10为本发明实施例提供的用户授权界面示意图二;
图11为本发明实施例提供的应用数据的共享装置实施例一的结构示意图;
图12为本发明实施例提供的应用数据的共享装置实施例二的结构示意图;
图13为本发明实施例提供的应用数据的共享装置实施例三的结构示意图;
图14为本发明实施例提供的终端设备实施例的结构示意图。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供的应用数据的共享方法,可以适用于终端设备上任意两个应用程序之间共享应用数据的场景,参见图1所示的应用程序共享场景示意图,该场景中的应用程序为面向用户、可供用户操作的应用程序(Application,简称APP)。用户在使用APP时产生过程数据对用户来说一般是很有价值的,用户希望终端设备中的第三方应用能够利用这些过程数据为用户提供更好的服务,例如,用户在微信中和朋友聊天,聊天内容可能包含了用户的个人信息、行程信息、图片信息等,因此可以根据这些聊天内容将这些聊天内容中的部分或者全部数据共享给第三方应用,比如,根据用户在微信中对某个朋友发送的一条消息“明天下午3点在新街口吃饭”,可以在日程APP中为用户创建一个明天下午3点的日程提醒(即将消息内容共享至日程应用),或者,可以在地图APP中把新街口作为目的地的候选项(即将消息内容共享至地图APP),再或者,还可以在团购APP推荐中把新街口的美食作为推荐项(即将消息内容共享至团购APP)。
另外,本发明实施例所涉及的终端设备可以包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等。
以移动终端为手机为例,图2示出的是与本发明实施例相关的手机100的部分结构的框图。参考图2,手机100包括、RF(Radio Frequency,射频)电路110、存储器120、其他输入设备130、显示屏140、传感器150、音频电路160、输入输出(Input or Output,简称I/O)子系统170、处理器180、
以及电源190等部件。本领域技术人员可以理解,图2中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。本领领域技术人员可以理解显示屏140属于用户界面(UI,User Interface),且手机100可以包括比图示或者更少的用户界面。
下面结合图2对手机100的各个构成部件进行具体的介绍:
RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、LNA(Low Noise Amplifier,低噪声放大器)、双工器等。此外,RF电路110还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于GSM(Global System of Mobile communication,全球移动通讯系统)、GPRS(General Packet Radio Service,通用分组无线服务)、CDMA(Code Division Multiple Access,码分多址)、WCDMA(Wideband Code Division Multiple Access,宽带码分多址)、LTE(Long Term Evolution,长期演进)、电子邮件、SMS(Short Messaging Service,短消息服务)等。
存储器120可用于存储软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行手机100的各种功能应用以及数据处理。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图象播放功能等)等;存储数据区可存储根据手机100的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
其他输入设备130可用于接收输入的数字或字符信息,以及产生与手机100的用户设置以及功能控制有关的键信号输入。具体地,其他输入设备130可包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)等中的一种或多种。其他输入设备
130与I/O子系统170的其他输入设备控制器171相连接,在其他设备输入控制器171的控制下与处理器180进行信号交互。
显示屏140可用于显示由用户输入的信息或提供给用户的信息以及手机100的各种菜单,还可以接受用户输入。具体的,显示屏140可包括显示面板141,以及触控面板142。其中显示面板141可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板141。触控面板142,也称为触摸屏、触敏屏等,可收集用户在其上或附近的接触或者非接触操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板142上或在触控面板142附近的操作,也可以包括体感操作;该操作包括单点控制操作、多点控制操作等操作类型。),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板142可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位、姿势,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成处理器能够处理的信息,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板142,也可以采用未来发展的任何技术实现触控面板142。进一步的,触控面板142可覆盖显示面板141,用户可以根据显示面板141显示的内容(该显示内容包括但不限于,软键盘、虚拟鼠标、虚拟按键、图标等等),在显示面板141上覆盖的触控面板142上或者附近进行操作,触控面板142检测到在其上或附近的操作后,通过I/O子系统170传送给处理器180以确定用户输入,随后处理器180根据用户输入通过I/O子系统170在显示面板141上提供相应的视觉输出。虽然在图,2中,触控面板142与显示面板141是作为两个独立的部件来实现手机100的输入和输入功能,但是在某些实施例中,可以将触控面板142与显示面板141集成而实现手机100的输入和输出功能。
手机100还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在手机100移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,
静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机100还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路160、扬声器161,麦克风162可提供用户与手机100之间的音频接口。音频电路160可将接收到的音频数据转换后的信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,麦克风162将收集的声音信号转换为信号,由音频电路160接收后转换为音频数据,再将音频数据输出至RF电路110以发送给比如另一手机,或者将音频数据输出至存储器120以便进一步处理。
I/O子系统170用来控制输入输出的外部设备,可以包括其他设备输入控制器171、传感器控制器172、显示控制器173。可选的,一个或多个其他输入控制设备控制器171从其他输入设备130接收信号和/或者向其他输入设备130发送信号,其他输入设备130可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)。值得说明的是,其他输入控制设备控制器171可以与任一个或者多个上述设备连接。所述I/O子系统170中的显示控制器173从显示屏140接收信号和/或者向显示屏140发送信号。显示屏140检测到用户输入后,显示控制器173将检测到的用户输入转换为与显示在显示屏140上的用户界面对象的交互,即实现人机交互。传感器控制器172可以从一个或者多个传感器150接收信号和/或者向一个或者多个传感器150发送信号。
处理器180是手机100的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行手机100的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。
手机100还包括给各个部件供电的电源190(比如电池),优选的,电
源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。
尽管未示出,手机100还可以包括摄像头、蓝牙模块等,在此不再赘述。
综上,上述图2从硬件组成角度介绍了以手机为例的终端设备的结构框架,本发明实施例涉及的应用数据的共享方法,也涉及终端设备的软件层面的系统架构,需要说明的是,本发明实施例涉及的方法,可以适用于安卓(Android)系统、OS系统、Darwin系统、RTXC系统、Linux系统、Unix系统、Windows系统、嵌入式操作系统例如VxWorks等操作系统。同样的,基于上述图2以手机为例的基础上,下述图3以操作系统为手机上的Android系统为例,介绍本发明实施例的方法所涉及的软件操作系统的系统框架。
具体的,Android是一种开源的移动操作系统,作为一个移动设备平台,其层次结构包含了一个操作系统,中间件(Middle Ware)和应用程序(Application),如图3所示,Android操作系统分为如下几个层次:
(1)应用程序层(Application)
开发人员可以基于安卓软件开发工具包(Software Development Kit,简称SDK)开发应用程序,同时操作系统本身也包含了一些基础应用,例如短信、电话、图片查看器、网页(Web)浏览器等系统级应用。
(2)应用程序框架层(Application Framework)
Android的应用程序框架层为应用层提供各种应用程序接口(Application Programming Interface,简称API),它包含了用户界面(User Interface,简称UI)程序中所需的各种控件,例如:Views(视图组件)包括TextView(文本控件)、ListView(列表)、Buttons(按钮)、WebView(网页浏览器控件)
(3)系统库和运行时环境层(Libraries&Android Runtime)
这一层包括各种库和运行时环境两部分,各种库主要是C库、多媒体库、图形处理引擎等;运行时环境主要是Dalvik虚拟机,它和标准的JAVA虚拟机不同,它执行的是.dex文件,是针对移动设别进行过裁剪和优化的虚拟机。
(4)Linux内核层(Kernel)
Android是基于Linux内核开发,其核心系统服务、内存管理、进程管理、网络协议及驱动都依赖于Linux内核。该Linux内核层的下方即就是图2介绍的手机的硬件层。
上述图2和图3从硬件和软件的角度分别阐述了终端设备的架构。现有技术中终端设备的上的任意两个应用(假设为应用A和应用B)之间在进行应用数据的共享时,应用B必须要得到应用A的授权才能共享应用A的数据,而实际情况是各个应用开发商出于商业利益的考虑,一般都不会把各自的数据共享给其他应用使用,从而造成了信息垄断,信息的互联互通性较差,用户体验度不高。
因此,本发明实施例提供的应用数据的共享方法、装置和终端设备,旨在解决现有技术中应用之间因开发商授权限制的影响导致信息垄断、信息的互联互通性较差,用户体验度不高的技术问题。
参见图4所示,为了解决现有技术中的上述问题,以安卓系统为例,本发明实施例基于上述图3所示的安卓操作系统架构层次,在Android操作系统的Framework层增加了屏幕数据共享单元(Screen Data Share),以下简称数据共享单元。它提供2个API接口供显示系统(View System)和第三方应用(例如上述例子中涉及的日程、地图APP、团购APP等)使用。显示框架通过其中一个API接口将当前正在显示的应用的控件树(该控件树包括应用的当前显示界面的父控件和子控件的集合)传递给数据共享单元,数据共享单元根据该控件树获取到该应用当前显示界面的应用数据,从而通过另一个API接口将该应用数据共享给第三方应用。
可选的,下述方法实施例的执行主体可以是终端设备,还可以是集成在终端设备中的应用数据的共享装置,该装置可以通过软件、硬件或者软硬结合的方式实现。可选的,下述方法实施例以执行主体为终端设备为例来进行说明。
下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图5为本发明实施例提供的应用数据的共享方法实施例一的流程示意图。本实施例涉及的是终端设备将获取到的与预设的白名单匹配的第一应用当前显示界面的显示数据,依据用户的授权指令,确定是否将该显示数据共享至其他第三方应用的具体过程。如图5所示,该方法包括如下步骤:
S101:判断当前显示的第一应用是否为预设的白名单中的应用。
具体的,当终端设备识别到第一应用在终端设备上启动,并且显示在当前界面,终端设备判断该第一应用是否与预设的白名单中的应用的属性信息匹配。该白名单中的应用可以是开发人员根据开发经验或者相应的阈值默认设置的应用,这些应用的显示界面均包括能够为用户提供更好的服务的数据,可选的,白名单中的应用还可以是第三方应用(即想要共享其他应用的显示数据的应用)告知操作系统哪些应用的应用数据对自己来说是想要共享的,这类第三方应用告知给操作系统的应用也可以被添加至白名单中。可选的,白名单中可以包括应用的标识、该应用的类型、该应用中携带数据的页面的标识等。
S102:若匹配,则根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据。
具体的,当终端设备判断当前在终端设备上的第一应用为白名单中的应用时,即终端设备确定该第一应用携带了能够为用户提供更好的服务的数据,则终端设备可以根据该第一应用的当前显示界面上的控件获取该第一应用在当前显示界面上的显示数据,该控件为源应用当前显示界面的界面元素,例如,假设第一应用为微信,当前显示界面为微信的聊天界面,则该聊天界面整体、聊天界面中的文本内容、图像或者时间均为该聊天界面的控件。可选的,本发明实施例在获取第一应用在当前显示界面上的显示数据时,是通过图4中位于应用程序框架层上的屏幕数据共享单元来获取的,该屏幕数据共享单元提供面向第一应用的第一API接口和面向第二应用的第二API接口,位于应用程序框架层上的显示系统通过该第一API接口将获得的第一应用在当前显示界面的控件传输给屏幕数据共享单元,屏幕数据共享单元可以通过遍历当前显示界面上的控件,获得第一应用在当前显示界面上的显示数据;屏幕数据共享单元通过第二API接口将显示数据共享给第二应用。可选的,该显示数据可以是第一应用当前显示界面上显示的所有数据,还可以是终端设备将第一应用当前显示界面上显示的所有数据进行筛选后的部分数据,本发明实施例对此并不做限定。
需要说明的是,通过数据共享共享获取得到第一应用在当前显示界面上的显示数据,其不需要第一应用执行相应的操作,因而该显示数据脱离了应用程序层中第一应用的授权限制,该显示数据独立存在于终端设备上,在将
该显示数据分享给其他应用时,无需考虑第一应用的开发商是否授权。
S103:根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用。
其中,该授权操作指令包括用于指示将显示数据共享给第二应用的授权指令和用于指示禁止将上述显示数据共享给第二应用的禁止指令。
当图4中的数据共享单元获得第一应用在当前显示界面上的显示数据之后,此时,若终端设备接收到用户输入的授权操作指令,该授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令,因此终端设备可以根据该授权指令或者禁止指令确定是否将第一应用在当前显示界面上的显示数据共享给第二应用,该第二应用可以为终端设备上除第一应用之外的任一类型的应用,本发明实施例对第二应用的类型并不做限制。可选的,上述图4中涉及的数据共享单元所提供的面向第三方应用(即第二应用)的第二API接口,既可以支持第三方应用主动查询当前的显示数据,也可以支持第三方应用订阅当前的显示数据,即当终端获取到第一应用的显示数据后会根据用户的授权操作指令决定是否共享至该第三方应用,而不存在共享至其他第三方应用的可能。
由上述描述可知,当终端设备获取到第一应用在当前显示界面上的显示数据之后,该获取的显示数据相当于可以脱离第一应用不受第一应用的限制,由终端设备所有,因而该显示数据的共享对象可以由用户的授权操作指令,其并不受限于第一应用的开发商的授权权限,因此,只要用户决定将第一应用在当前显示界面上的显示数据进行共享,用户就可以通过相应的授权操作指令将该显示数据共享至任意类型的第二应用,这样保证了任意两个应用之间进行数据共享的开放性,以及数据的互联互通,大大提高了用户的体验。
本发明实施例提供的应用数据的共享方法,通过在判断当前显示的第一应用为预设的白名单中的应用时,根据第一应用的当前显示界面上的控件获取该第一应用在当前显示界面上的显示数据,从而根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用。本发明实施例的方法,终端设备通过数据共享单元所获取的显示数据脱离第一应用的授权限制,因而第一应用在当前显示界面上的显示数据的共享对象由用户的授权操作指令
直接决定,其并不受限于第一应用的开发商的授权权限,因此,只要用户决定将第一应用在当前显示界面上的显示数据进行共享,用户就可以通过相应的授权操作指令将该显示数据共享至任意类型的第二应用,这样保证了任意两个应用之间进行数据共享的开放性,以及数据的互联互通,大大提高了用户的体验。
图6为本发明实施例提供的应用数据的共享方法实施例二的流程示意图。本实施例涉及的是终端设备根据第一应用在当前显示界面上的有效邮件获取第一应用在当前显示界面上的显示数据的具体过程。在上述实施例的基础上,进一步地,上述S102具体可以包括如下步骤:
S201:根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件。
其中,所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
具体的,终端设备上的各个应用程序的UI界面上均涉及各种各样的控件,例如TextView(文本控件)、ListView(列表)、Buttons(按钮)、WebView(网页浏览器控件)以及这些控件的子类等,每个控件上分别具有相应类型的数据。当终端设备确定第一应用为白名单中的应用匹配时,终端设备可以获取该第一应用对应的控件集合(获取方式可以参见现有技术,在此不再赘述),该控件集合包括第一应用当前显示界面上的全部控件;可选的,该控件集合可以为第一应用对应的控件树,该控件树包括父控件和各种子控件,例如,假设第一应用为微信,当前显示界面为微信的聊天界面,则该聊天界面整体是一个父控件,聊天界面中的文本内容、图像或者时间就是子控件,再例如,如果文本内容中插入了表情图片,则这个表情图片就是子控件的子控件。
进一步地,终端设备在获取第一应用对应的控件集合之后,会遍历该控件集合中的所有控件,确定哪些控件携带了满足第一预设条件的数据,从而将这些携带了满足第一预设条件的数据的控件确定为有效控件。常见的携带用户数据的控件可以参见下述表1的举例:
表1
序号 | 控件类型 | 控件名 | 数据 |
1 | 文本控件 | TextView | 文本 |
2 | 文本编辑控件 | EditText | 文本 |
3 | 图像控件 | ImageView | 图片 |
4 | 网页控件 | WebView | 网页 |
需要说明的是,控件本身会携带自身数据的获取方法,例如,文本控件可以通过getText()获取文件控件上的数据。常见控件的获取数据的方法下述表2所举的例子:
表2
控件名 | 获取的数据 | 获取数据的方法 |
Text View | 文本内容 | public String getText() |
Edit Text | 文本内容 | public String getText() |
Image View | 图片二进制数据 | public Drable getDrable() |
Web View | 网页URL | public String getUrl() |
上述URL为统一资源定位符(Uniform Resource Locator,简称URL)。
因此,终端设备会通过每个控件自身所携带的获取数据的方法,获取每个控件上的数据,然后根据每个第一控件的数据的数据属性,确定该一控件上携带的数据是否满足第一预设条件,若满足,则终端设备确定该控件为有效控件,从而确定出第一应用当前显示界面上的所有有效控件,该第一预设条件为开发人员预置的关于控件上的数据对用户是否有价值所设置的条件。
可选的,上述数据属性可以包括控件中数据的文本长度、控件中的图片占当前界面的大小、控件中的动画占当前界面的大小中的至少一个,则可断的,该第一预设条件具体可以为:所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个条件。
故而,终端设备根据每个控件的数据的数据属性,并结合上述第一预设条件,确定第一应用对应的控件集合中的有效控件,具体可以为:若控件的数据的数据属性为该控件中数据的文本长度,且该第一控件中的文本长度大于预设的第一阈值,则确定该控件为有效控件;或者,若控件的数据的数据属性为该控件中的图片占当前界面的大小,且该控件中的图片占当前界面的
大小大于预设的第二阈值,则确定该控件为有效控件;或者,若控件的数据的数据属性为该控件中的动画占当前界面的大小,且该控件中的动画占当前界面的大小大于预设的第三阈值,则确定该控件为有效控件。
采用上述S201的方法,即可以确定出第一应用对应的控件集合中的所有有效控件。
S202:根据每个所述有效控件的数据,获取所述显示数据。
可选的,终端设备可以将每个有效控件上的数据的集合直接作为显示数据,还可以对每个控件上的数据进行相应的整合,将整合之后的数据作为显示数据,该整合方法具体可以参见图7所示的实施例三,如图7所示,该方法具体可以包括如下步骤:
S301:根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制。
可选的,每个第二应用在需要共享当前显示的第一应用的显示数据时,会提前在操作系统进行注册,从而向操作系统发送自己的注册信息,该注册信息中携带第二应用得数据整合机制,旨在告知操作系统自己所需要的数据的形式或者类型,终端设备基于操作系统就可以获知每个第二应用的数据整合机制。可选的,终端设备还可以根据第二应用的类型确定第二应用的数据整合机制,该第二应用的类型可以包括聊天类应用、购物类应用、快递类应用、视频类应用、音乐类应用中的任一个。
S302:根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
具体的,当终端设备获得第一应用在当前显示界面上的显示数据之后,也确定要将该显示数据共享给哪一个或者几个第二应用,则终端设备根据该第二应用的数据整合机制,对第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。例如假设当前显示的第一应用为微信,当前显示界面为微信的聊天界面,该聊天界面中展示了昵称、对话内容、时间3种不同的有效控件,若第二应用为日历应用,则该第二应用的数据整合机制为{发送者昵称、接收者昵称、消息内容、时间戳},
因此终端设备可以将第一应用中的这3个有效控件的内容作为一个整体输出,作为一次对话,格式为:{发送者昵称、接收者昵称、消息内容、时间戳},进一步可以将多次对话按照时间顺序整合成一次会话。这样,就可以将整合后的数据作为第一应用在当前显示界面上的显示数据,从而大大提高了共享数据的有效性,使得第二应用能够利用该整合后的显示数据更好的为用户提供服务。
可选的,用户在使用第一应用过程中,当前显示界面会随时发生变化,因此当前显示界面上的数据也会随着界面的变化而发生变化,故,终端设备在得到第一应用在当前显示界面的显示数据之后,可以将该显示数据进行缓存,并在用户退出第一应用或者关闭第一应用时,将所缓存的显示数据进行删除,这样大大提高了数据的安全性,避免因当前显示界面的变化而导致显示数据丢失的情况发生。
可选的,为了方便将上述显示数据更好的共享给其他第二应用使用,可以将上述显示数据设置为JSON格式的数据,该显示数据携带第一应用的标识和/或第一应用的类型。
本发明实施例提供的应用数据的共享方法,通过根据第一应用当前显示界面上每个控件的数据属性,确定第一应用当前显示界面上的有效控件,从而根据每个有效控件的数据,获取第一应用当前显示界面的显示数据,该数据获取方式仅通过遍历控件的方式就可以获取,数据获取方式简单有效,并且确保了终端设备最终共享给第二应用的数据为满足第一预设条件的数据,即确保了该数据为满足用户需求、能够为用户提供更好的服务的过程数据,因此,其很大程度上提高了用户的体验效果,使得用户与终端设备之间的交互更加智能化;同时,本实施例根据第二应用的数据整合机制,将所获取的每个有效控件的数据进行整合,并将整合后的数据作为第一应用在当前显示界面上的显示数据,从而大大提高了共享数据的有效性,使得第二应用能够利用该整合后的显示数据更好的为用户提供服务。
图8为本发明实施例提供的应用数据的共享方法实施例四的流程示意图。本实施例涉及的是在上述各实施例的基础上,终端设备将获取到的第一应用当前显示界面的显示数据,依据用户的授权指令确定是否将该显示数据
共享至第二应用的更加详尽的过程。本实施例中,白名单中的应用均为满足上述第一预设条件的应用,该白名单中的应用的的属性信息包括该应用的标识、该应用的页面的标识,该页面中所携带的数据满足上述第一预设条件(即该页面中所携带的数据可以为对用户有价值的数据)。如图8所示,该方法可以包括如下步骤:
S401:确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识。
可选的,终端设备可以从第一应用对应的控件集合中获取第一应用的上下文信息,还可以通过操作系统获取第一应用的上下文信息。该上下文信息包括第一应用的标识和第一应用的当前显示界面的页面标识。可选的,该上下文信息还可以包括该第一应用的类型。
S402:判断所述第一应用的标识是否与所述白名单中的应用的标识匹配。
具体的,该白名单中包括满足上述第一预设条件的应用的标识和该应用中展示对用户有价值的数据的页面的标识,可选的,该白名单中还可以包括满足上述第一预设条件的应用的类型。可选的,由于用户使用的应用数量较多,功能也各不相同,开发人员可以对应用市场里面的主流应用按照第一预设条件进行筛选和归类,整理出一个白名单。可选的,开发人员可以将应用市场中的应用归为以下几类,参见表3所示的例子:
表3
序号 | 类型 | 数据内容 | 数据字段 | 应用举例 |
1 | 聊天类 | 聊天内容 | 昵称、对话内容、时间 | 微信 |
2 | 购物类 | 商品信息 | 商品名、价格 | 淘宝 |
3 | 快递类 | 快递信息 | 快递单号、物流信息 | 快递100 |
4 | 音乐类 | 歌曲信息 | 歌曲名、歌手名、专辑名 | 酷我音乐 |
5 | 视频类 | 视频信息 | 视频名、选集 | 优酷视频 |
6 | 阅读类 | 文章信息 | 标题、正文、URL | 网易新闻 |
终端设备获得第一应用的上下文信息之后,终端设备将该上下文信息中的第一应用的标识与上述白名单中的各应用的标识进行匹配,如果匹配上,则执行下述S403。
S403:若所述第一应用的标识与白名单中的应用的标识匹配,则判断第
一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面的标识匹配。
S404:若匹配,则确定所述第一应用为所述白名单中的应用。
具体的,当第一应用的标识与上述白名单中的某一应用(假设为应用A)的标识匹配,则进一步地将第一应用当前显示界面的页面的标识与该应用A的页面标识再次进行匹配,如果二者均匹配上,则终端设备确定第一应用为白名单中的应用,进而执行下述S405。
S405:根据第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据。
当终端设备确定第一应用与白名单中的应用匹配时,获取该第一应用在当前显示界面上的显示数据,具体的获取过程可以参见上述实施例一至上述实施例三中的描述,在此不再赘述。
S406:显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令。
具体的,当第一应用的当前显示界面的页面标识与上述白名单中的任一应用的页面标识匹配时,则终端会向用户显示用户授权界面,提示用户输入相应的授权操作指令,从而将第一应用当前显示界面的显示数据共享至第二应用。本发明实施例中的用户授权操作指令包括用于指示将上述显示数据共享给第二应用的授权指令和用于指示禁止将上述显示数据共享给所述第二应用的禁止指令。可选的,可以参见图9所示的用户授权界面,该用户授权界面可以悬浮在当前显示界面上,还可以显示在消息通知栏中,用户可以下拉通知栏查看用户授权界面,图9仅是用户授权界面的一种示例。可选的,该用户授权界面可以包括两个选项(Option),一个选项用于接收用户的授权指令,另一个选项用于接收用户的禁止指令;可选的,该用户授权界面还可以是语音授权界面,该界面上显示一语音输入控件,用户操作该语音输入控件输入相应的语音指令,以向终端输入相应的授权或者禁止指令,可以参见图10所示,当然图10也仅是用户授权界面的一种示例。本发明实施例对用户授权界面的形式和用户输入授权操作指令的方式均不做限定。
S407:若所述授权操作指令为授权指令,则将所述显示数据共享给第二应用使用。
S408:若所述授权操作指令为禁止指令,则禁止所述第二应用共享所述显示数据。
本发明实施例提供的应用数据的共享方法,通过确定所述第一应用的上下文信息,并判断上下文信息中第一应用的标识是否与上述白名单中应用的标识匹配,并在第一应用的标识与所述应用的标识匹配时,进一步判断第一应用的当前显示界面对应的页面的标识是否与上述白名单中所述应用的页面的标识匹配,在第二页面的标识与白名单中所述应用的页面的标识匹配时确定第一应用为白名单中的应用,进而获取该第一应用在当前显示界面上的显示数据,从而根据用户输入的授权操作指令,确定是否将显示数据共享给第二应用使用。本发明实施例的方法,通过数据共享单元遍历控件获取的第一应用在当前显示界面上的显示数据,其不需要第一应用执行相应的操作,因而该显示数据脱离了应用程序层中第一应用的授权限制,该显示数据独立存在于终端设备上,其并不受限于第一应用的开发商的授权权限,因此,只要用户决定将第一应用在当前显示界面上的显示数据进行共享,用户就可以通过相应的授权操作指令将该显示数据共享至任意类型的第二应用,这样保证了任意两个应用之间进行数据共享的开放性,以及数据的互联互通,大大提高了用户的体验。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
图11为本发明实施例提供的应用数据的共享装置实施例一的结构示意图。该共享装置可以为独立的终端设备,还可以为集成在终端设备中的装置,该装置可以通过软件、硬件或者软硬结合的方式实现。如图11所示,该应用数据的共享装置包括:判断模块10、显示模块13、获取模块11和共享模块12。
其中,判断模块10,用于判断所述显示模块13当前显示的第一应用是否为预设的白名单中的应用;
获取模块11,用于在所述判断模块10判断所述第一应用为预设的白名
单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;
共享模块12,用于根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用;其中,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令。
本发明实施例提供的应用数据的共享装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
图12为本发明实施例提供的应用数据的共享装置实施例二的结构示意图。在上述实施例的基础上,进一步地,上述获取模块11,具体包括:
确定单元111,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
获取单元112,用于根据每个所述有效控件的数据,获取所述显示数据。
进一步地,所述确定单元111,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
进一步地,所述获取单元112,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,
所述第二应用的注册信息携带所述第二应用的数据整合机制。
本发明实施例提供的应用数据的共享装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
更进一步地,所述装置适用于安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;
所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;
所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
可选的,所述判断模块10,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及,判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
在上述图12所示的实施例二的基础上,图13提供了应用数据的共享装置实施例三的结构示意图,进一步地,上述装置还可以包括:存储模块14、删除模块15。存储模块14,用于将所述显示数据进行缓存;
删除模块15,用于在所述第一应用退出或者关闭时,将所缓存的显示数据删除;所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
可选的,所述显示模块13,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;
所述共享模块12,用于在所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,在所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
本发明实施例提供的应用数据的共享装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
图14为本发明实施例提供的终端设备实施例的结构示意图。如图14所示,该终端可以包括:处理器20,例如CPU;存储器21,至少一个通信总线22、显示设备23和输入设备24。通信总线22用于实现元件之间的通信连接。存储器21可能包含高速RAM存储器,也可能还包括非易失性存储器NVM,例如至少一个磁盘存储器,存储器21中可以存储各种程序,用于完成各种处理功能以及实现本实施例的方法步骤;所述输入设备24,用于向用户提供输入接口,接收用户输入的操作或指令等。
在本实施例中,所述处理器20,用于判断所述显示设备23当前显示的第一应用是否为预设的白名单中的应用,并在所述第一应用为所述白名单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;
所述输入设备24,用于接收用户输入的授权操作指令,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令;
所述处理器20,还用于根据所述授权操作指令,确定是否将所述显示数据共享给第二应用使用。
本发明实施例提供的终端设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
进一步地,所述处理器20,具体用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,并根据每个所述有效控件的数据,获取所述显示数据;其中,所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个。
可选的,所述处理器20,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,具体包括:
所述处理器20,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控
件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
可选的,所述处理器20,用于根据每个所述有效控件的数据,获取所述显示数据,具体包括:
所述处理器20,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
可选的,所述终端设备为安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;
所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;
所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
可选的,所述处理器20,用于判断当前显示的第一应用是否为预设的白名单中的应用,具体包括:
所述处理器20,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
可选的,所述处理器20,还用于指示存储器21将所述显示数据进行缓存;并在所述第一应用退出或者关闭时,将所缓存的显示数据删除。所述显
示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
可选的,所述显示设备23,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;
所述处理器20,具体用于当所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,当所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
本发明实施例提供的终端设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。
鉴于在同一移动终端上的不同应用可认为已缺省获得用户的数据共享授权,本发明还提供了一种应用间数据的共享方法实施例,所述方法包括:
运行在移动终端的操作系统,通过第一应用程序接口(API,Application Interface),获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;
所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;
若是,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;
所述运行在移动终端的操作系统,通过第二应用程序接口(API,Application Interface),将所述显示数据共享给第二应用。
由上可以看出,同一移动终端的不同的应用之间可以信息互通,而且还可以提高用户的体验。
可选的或进一步的,所述操作系统包括应用程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,运行在移动终端的操作系统,通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:
运行在所述移动终端的操作系统,通过所述显示系统,输出所述第一应用的当前显示界面;
所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
其中,所述控件集合可以包括一个控件、或两个控件,当然也可以包括三个或更多控件。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述运行在移动终端的操作系统,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;
所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述显示数据。
可选的或进一步的,所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,包括:
若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述
控件中的图片占当前界面的大小大于预设的第二阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
可选的或进一步的,所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:
所述运行在移动终端的操作系统,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
所述运行在移动终端的操作系统,根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
可选的或进一步的,所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:
所述运行在移动终端的操作系统确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;
所述运行在移动终端的操作系统判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;
若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述运行在移动终端的操作系统判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;
若匹配,则所述运行在移动终端的操作系统确定当前显示界面为预设的白名单中的数据分享页面。
可选的或进一步的,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述运行在移动终端的操作系统,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;
所述运行在移动终端的操作系统,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
其中,应用数据分享配置表可以包括应用名称、界面的名称、控件类型、控件ID中的一个或多个。
可以理解的是,所述应用数据分享配置表与所述白名单可以为一个表,当然可以分开,即所述应用数据分享配置表为一个表,所述白名单为另一个表。
可选的或进一步的,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述运行在移动终端的操作系统,通过所述第二应用程序接口,接收所述第二应用的调用请求;
所述运行在移动终端的操作系统将所述显示数据作为所述调用请求的返回数据传递给所述第二应用。
可选的或进一步的,所述方法还包括:
所述运行在移动终端的操作系统将所述显示数据进行缓存;
若所述第一应用退出或者关闭,所述运行在移动终端的操作系统将所缓存的显示数据删除。
其中,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
可以理解的是,上述一种应用间数据的共享方法的执行主体为运行在移动终端的操作系统,具体的,一种应用间数据的共享方法的执行主体可以为运行在移动终端的操作系统的应用程序框架的屏幕数据共享单元。所述的屏幕数据共享单元提供面向第一应用的第一应用程序接口和面向第二应用的第二应用程序接口。
本发明还提供了一种移动终端的实施例。所述移动终端包括存储器和处理器,所述存储器存储所述移动终端运行的操作系统指令代码,所述处理器运行所述存储器中的操作系统的指令代码,用于:
通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;
判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;
若是,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;
通过第二应用程序接口,将所述显示数据共享给第二应用。
可选的或进一步的,所述操作系统包括应用程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,所述处理器运行所述存储器中的操作系统的指令代码,用于:通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:
所述处理器,通过所述显示系统,输出所述第一应用的当前显示界面;
所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
可选的或进一步的,所述处理器根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述处理器,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;
所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
可选的或进一步的,所述处理器用于根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:
所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;
所述处理器根据每个所述有效控件的数据,获取所述显示数据。
可选的或进一步的,所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,包括:
若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述处理器确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则所述处理器确定所述控件为有效控件;
或者,
若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述处理器确定所述控件为有效控件;
其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
可选的或进一步的,所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:
所述处理器,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
所述处理器,根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
可选的或进一步的,所述处理器判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:
所述处理器确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;
所述处理器判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;
若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述处理器判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;
若匹配,则所述处理器确定当前显示界面为预设的白名单中的数据分享页面。
可选的或进一步的,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述处理器,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;
所述处理器,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
可选的或进一步的,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:
所述处理器,通过所述第二应用程序接口,接收所述第二应用的调用请求;
所述处理器将所述显示数据作为所述调用请求的返回数据传递给所述第二应用。
可选的或进一步的,所述处理器还用于:
将所述显示数据进行缓存;
若所述第一应用退出或者关闭,将所缓存的显示数据删除。
可选的或进一步的,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
其中,该移动终端可以为手机、平板、穿戴式设备等,本发明实施例对此并不限制。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。
Claims (49)
- 一种应用数据的共享方法,其特征在于,包括:判断当前显示的第一应用是否为预设的白名单中的应用;若是,则根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用;其中,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,具体包括:根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;根据每个所述有效控件的数据,获取所述显示数据。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,具体包括:若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则确定所述控件为有效控件;或者,若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则确定所述控件为有效控件;或者,若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则确定所述控件为有效控件;其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
- 根据权利要求2所述的方法,其特征在于,所述根据每个所述有效控件的数据,获取所述显示数据,具体包括:根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
- 根据权利要求1-4任一项所述的方法,其特征在于,所述方法适用于安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
- 根据权利要求1所述的方法,其特征在于,所述判断当前显示的第一应用是否为预设的白名单中的应用,具体包括:确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:将所述显示数据进行缓存;若所述第一应用退出或者关闭,将所缓存的显示数据删除。
- 根据权利要求1-7任一项所述的方法,其特征在于,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
- 根据权利要求1-8任一项所述的方法,其特征在于,所述根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用,具体包括:显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;若所述授权操作指令为授权指令,则将所述显示数据共享给第二应用使用;若所述授权操作指令为禁止指令,则禁止所述第二应用共享所述显示数据。
- 一种应用数据的共享装置,其特征在于,包括:判断模块、显示模块、获取模块和共享模块;所述判断模块,用于判断所述显示模块当前显示的第一应用是否为预设的白名单中的应用;所述获取模块,用于在所述判断模块判断所述第一应用为预设的白名单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;所述共享模块,用于根据用户输入的授权操作指令,确定是否将所述显示数据共享给第二应用使用;其中,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令。
- 根据权利要求10所述的装置,其特征在于,所述获取模块,具体包括:确定单元,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;获取单元,用于根据每个所述有效控件的数据,获取所述显示数据。
- 根据权利要求11所述的装置,其特征在于,所述确定单元,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
- 根据权利要求11所述的装置,其特征在于,所述获取单元,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制。
- 根据权利要求10-13任一项所述的装置,其特征在于,所述装置适用于安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
- 根据权利要求10所述的装置,其特征在于,所述判断模块,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及,判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一 应用为所述白名单中的应用。
- 根据权利要求10所述的装置,其特征在于,所述装置还包括:存储模块,用于将所述显示数据进行缓存;删除模块,用于在所述第一应用退出或者关闭时,将所缓存的显示数据删除。
- 根据权利要求10-16任一项所述的装置,其特征在于,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
- 根据权利要求10-17任一项所述的装置,其特征在于,所述显示模块,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;所述共享模块,用于在所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,在所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
- 一种终端设备,其特征在于,包括输入设备、显示设备和处理器;所述处理器,用于判断所述显示设备当前显示的第一应用是否为预设的白名单中的应用,并在所述第一应用为所述白名单中的应用时,根据所述第一应用的当前显示界面上的控件获取所述第一应用在当前显示界面上的显示数据,所述控件为所述当前显示界面的界面元素;所述输入设备,用于接收用户输入的授权操作指令,所述授权操作指令包括用于指示将所述显示数据共享给所述第二应用的授权指令和用于指示禁止将所述显示数据共享给所述第二应用的禁止指令;所述处理器,还用于根据所述授权操作指令,确定是否将所述显示数据共享给第二应用使用。
- 根据权利要求19所述的终端设备,其特征在于,所述处理器,具体用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,并根据每个所述有效控件的数据,获取所述显示数据;其中,所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的 大小、所述控件中的动画占当前界面的大小中的至少一个。
- 根据权利要求20所述的终端设备,其特征在于,所述处理器,用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,具体包括:所述处理器,具体用于当所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值时,确定所述控件为有效控件;或者,当所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值时,确定所述控件为有效控件;其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
- 根据权利要求20所述的终端设备,其特征在于,所述处理器,用于根据每个所述有效控件的数据,获取所述显示数据,具体包括:所述处理器,具体用于根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制,并根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;
- 根据权利要求19-22任一项所述的终端设备,其特征在于,所述终端设备为安卓操作系统,所述安卓操作系统包括集成屏幕数据共享单元的应用框架层,所述屏幕数据共享单元提供面向所述第一应用的第一应用程序API接口和面向第二应用的第二API接口;所述屏幕数据共享单元根据所述第一应用的当前显示界面上的控件,通过所述第一API接口获取所述第一应用在当前显示界面上的显示数据;所述屏幕数据共享单元通过所述第二API接口将所述显示数据共享给所述第二应用。
- 根据权利要求19所述的终端设备,其特征在于,所述处理器,用于 判断当前显示的第一应用是否为预设的白名单中的应用,具体包括:所述处理器,具体用于确定所述第一应用的上下文信息,所述上下文信息包括所述第一应用的标识和所述第一应用的当前显示界面的页面标识;以及判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应用的页面标识匹配;若匹配,则确定所述第一应用为所述白名单中的应用。
- 根据权利要求19所述的终端设备,其特征在于,所述处理器,还用于指示存储器将所述显示数据进行缓存;并在所述第一应用退出或者关闭时,将所缓存的显示数据删除。
- 根据权利要求19-25任一项所述的终端设备,其特征在于,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
- 根据权利要求19-26任一项所述的终端设备,其特征在于,所述显示设备,还用于显示用户授权界面,所述用户授权界面用于接收用户的授权操作指令;所述处理器,具体用于当所述授权操作指令为授权指令时,将所述显示数据共享给第二应用使用;或者,当所述授权操作指令为禁止指令时,禁止所述第二应用共享所述显示数据。
- 一种应用间数据的共享方法,其特征在于,包括:运行在移动终端的操作系统,通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;若是,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用。
- 根据权利要求28所述的方法,其特征在于,所述操作系统包括应用 程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,运行在移动终端的操作系统,通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:运行在所述移动终端的操作系统,通过所述显示系统,输出所述第一应用的当前显示界面;所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
- 根据权利要求28所述的方法,其特征在于,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:所述运行在移动终端的操作系统,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
- 根据权利要求28所述的方法,其特征在于,所述运行在移动终端的操作系统,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;所述运行在移动终端的操作系统,根据每个所述有效控件的数据,获取所述显示数据。
- 根据权利要求28所述的方法,其特征在于,所述运行在移动终端的操作系统,根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件,包括:若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述运行在移动终端的操作系统确定所述控件 为有效控件;或者,若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;或者,若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述运行在移动终端的操作系统确定所述控件为有效控件;其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
- 根据权利要求30或31所述的方法,其特征在于,所述运行在移动终端的操作系统,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:所述运行在移动终端的操作系统,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;所述运行在移动终端的操作系统,根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
- 根据权利要求28所述的方法,其特征在于,所述运行在移动终端的操作系统判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:所述运行在移动终端的操作系统确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;所述运行在移动终端的操作系统判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述运行在移动终端的操作系统判断所述第一应用的当前显示界面的页面标识是否与 所述白名单中所述应用的页面标识匹配;若匹配,则所述运行在移动终端的操作系统确定当前显示界面为预设的白名单中的数据分享页面。
- 根据权利要求28所述的方法,其特征在于,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:所述运行在移动终端的操作系统,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;所述运行在移动终端的操作系统,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
- 根据权利28要求的所述方法,其特征在于,所述运行在移动终端的操作系统,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:所述运行在移动终端的操作系统,通过所述第二应用程序接口,接收所述第二应用的调用请求;所述运行在移动终端的操作系统将所述显示数据作为所述调用请求的返回数据传递给所述第二应用。
- 根据权利要求28所述的方法,其特征在于,所述方法还包括:所述运行在移动终端的操作系统将所述显示数据进行缓存;若所述第一应用退出或者关闭,所述运行在移动终端的操作系统将所缓存的显示数据删除。
- 根据权利要求28-37任一项所述的方法,其特征在于,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
- 一种移动终端,其特征在于,包括存储器和处理器,所述存储器存储所述移动终端运行的操作系统指令代码,所述处理器运行所述存储器中的操作系统的指令代码,用于:通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,所述控件集合为所述当前显示界面的界面元素;判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面;若是,根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据;通过第二应用程序接口,将所述显示数据共享给第二应用。
- 根据权利要求39所述的移动终端,其特征在于,所述操作系统包括应用程序框架,所述应用程序框架包括显示系统(view system)和屏幕数据共享单元,其中,所述处理器运行所述存储器中的操作系统的指令代码,用于:通过第一应用程序接口,获取第一应用的当前显示界面上的控件集合,包括:所述处理器,通过所述显示系统,输出所述第一应用的当前显示界面;所述显示系统,通过所述第一应用程序接口,将所述第一应用的当前显示界面上的所述控件集合传递给所述屏幕数据共享单元。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:所述处理器,根据所述第一应用名称、当前显示界面的页面名称、控件类型和控件标识,通过有效控件配置表确定所述第一应用当前显示界面上的有效控件;所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器用于根据所述第一应用的当前显示界面上的所述控件集合,获取所述第一应用在所述当前显示界面上的显示数据,具体包括:所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当前显示界面上的有效控件;所述有效控件为携带满足第一预设条件的数据的控件;所述数据属性包括所述控件中的文本长度、所述控件中的图片占当前界面的大小、所述控件中的动画占当前界面的大小中的至少一个;所述处理器根据每个所述有效控件的数据,获取所述显示数据。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器用于根据所述第一应用当前显示界面上每个控件的数据属性,确定所述第一应用当 前显示界面上的有效控件,包括:若所述控件的数据属性为所述控件中的文本长度,且所述控件中的文本长度大于预设的第一阈值,则所述处理器确定所述控件为有效控件;或者,若所述控件的数据属性为所述控件中的图片占当前界面的大小,且所述控件中的图片占当前界面的大小大于预设的第二阈值,则所述处理器确定所述控件为有效控件;或者,若所述控件的数据属性为所述控件中的动画占当前界面的大小,且所述控件中的动画占当前界面的大小大于预设的第三阈值,则所述处理器确定所述控件为有效控件;其中,所述第一预设条件包括所述控件中数据的文本长度大于所述第一阈值、所述控件中的图片占当前界面的大小大于所述第二阈值、所述控件中的动画占当前界面的大小大于所述第三阈值中的任一个。
- 根据权利要求41或42所述的移动终端,其特征在于,所述处理器,根据每个有效控件的数据,获取所述当前显示界面上的显示数据,包括:所述处理器,根据所述第二应用的类型或者所述第二应用在操作系统上的注册信息,确定所述第二应用的数据整合机制;其中,所述第二应用的注册信息携带所述第二应用的数据整合机制;所述处理器,根据所述第二应用的数据整合机制,对所述第一应用当前显示界面上的所有有效控件的数据进行整合,并将整合后的数据确定为所述显示数据。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器判断所述第一应用的当前显示界面是否为预设的白名单中的数据分享页面,包括:所述处理器确定所述第一应用的标识和所述第一应用的当前显示界面的页面标识;所述处理器判断所述第一应用的标识是否与所述白名单中的应用的标识匹配;若所述第一应用的标识与所述白名单中的应用的标识匹配,则所述处理器判断所述第一应用的当前显示界面的页面标识是否与所述白名单中所述应 用的页面标识匹配;若匹配,则所述处理器确定当前显示界面为预设的白名单中的数据分享页面。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:所述处理器,通过应用数据分享配置表查询获得所述第二应用,所述应用数据分享配置表预设有所述第二应用与所述第一应用的数据订阅关系;所述处理器,调用所述第二应用程序接口,将所述显示数据传递给所述第二应用。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器,通过第二应用程序接口,将所述显示数据共享给第二应用,包括:所述处理器,通过所述第二应用程序接口,接收所述第二应用的调用请求;所述处理器将所述显示数据作为所述调用请求的返回数据传递给所述第二应用。
- 根据权利要求39所述的移动终端,其特征在于,所述处理器还用于:将所述显示数据进行缓存;若所述第一应用退出或者关闭,将所缓存的显示数据删除。
- 根据权利要求39-48任一所述的移动终端,其特征在于,所述显示数据为JSON格式的数据,且所述显示数据携带所述第一应用的标识和/或所述第一应用的类型。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201680087271.2A CN109416652B (zh) | 2016-08-19 | 2016-10-29 | 应用数据的共享方法、装置和终端设备 |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNPCT/CN2016/096100 | 2016-08-19 | ||
PCT/CN2016/096100 WO2018032516A1 (zh) | 2016-08-19 | 2016-08-19 | 应用数据的共享方法、装置和终端设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018032612A1 true WO2018032612A1 (zh) | 2018-02-22 |
Family
ID=61196268
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/096100 WO2018032516A1 (zh) | 2016-08-19 | 2016-08-19 | 应用数据的共享方法、装置和终端设备 |
PCT/CN2016/103883 WO2018032612A1 (zh) | 2016-08-19 | 2016-10-29 | 应用数据的共享方法、装置和终端设备 |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/096100 WO2018032516A1 (zh) | 2016-08-19 | 2016-08-19 | 应用数据的共享方法、装置和终端设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109416652B (zh) |
WO (2) | WO2018032516A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108415786A (zh) * | 2018-03-13 | 2018-08-17 | 联想(北京)有限公司 | 信息处理方法及装置、电子设备和计算机可读介质 |
CN116795809A (zh) * | 2023-04-27 | 2023-09-22 | 深圳市易立德信息科技有限公司 | 一种数据共享协同方法及其系统 |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109413647B (zh) * | 2018-10-18 | 2022-08-05 | 深圳壹账通智能科技有限公司 | 数据共享方法、装置、电子设备以及计算机可读存储介质 |
CN109813955B (zh) * | 2019-02-25 | 2022-11-04 | 北京元点未来科技有限公司 | 充电电压异常提示方法、系统、穿戴式设备及存储介质 |
KR20220051841A (ko) * | 2019-08-19 | 2022-04-26 | 구글 엘엘씨 | 스마트 디바이스 관리 리소스 선택기 |
CN111159738B (zh) * | 2019-12-26 | 2023-05-23 | 维沃移动通信有限公司 | 权限配置方法、应用登录方法及装置 |
CN114679511A (zh) * | 2020-12-24 | 2022-06-28 | 荣耀终端有限公司 | 操作控制方法、装置和电子设备 |
CN113888104B (zh) * | 2021-06-21 | 2024-03-01 | 北京字跳网络技术有限公司 | 一种日程分享方法、装置及设备 |
CN113885764A (zh) * | 2021-08-20 | 2022-01-04 | 阿里巴巴新加坡控股有限公司 | 数据处理方法及计算机程序产品 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014070374A1 (en) * | 2012-10-31 | 2014-05-08 | Motorola Mobility Llc | Identifying zones containing text data and zones containing graphical data and extracting tex for both zones in order to provide them to other applications |
US20140289742A1 (en) * | 2013-03-25 | 2014-09-25 | Apex Cns Co., Ltd. | Method of sharing contents |
CN104281403A (zh) * | 2013-07-08 | 2015-01-14 | Lg电子株式会社 | 移动终端和控制移动终端的方法 |
US20150020083A1 (en) * | 2013-07-10 | 2015-01-15 | Yuval Ben-Itzhak | Systems and methods for providing user-specific content on an electronic device |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4208085B2 (ja) * | 2005-08-30 | 2009-01-14 | インターナショナル・ビジネス・マシーンズ・コーポレーション | アプリケーションプログラムの制御方法およびその装置 |
CN100556007C (zh) * | 2007-03-30 | 2009-10-28 | 腾讯科技(深圳)有限公司 | 一种整合多个服务商提供的电子邮箱的方法及系统 |
US7962444B2 (en) * | 2008-05-19 | 2011-06-14 | Qualcomm Incorporated | System and method for presenting a contextual action for an indicator |
CN101923432A (zh) * | 2010-06-10 | 2010-12-22 | 北京捷通华声语音技术有限公司 | 一种移动终端中应用程序的调用方法及装置 |
US8433623B2 (en) * | 2011-06-03 | 2013-04-30 | Target Brands, Inc. | Methods for creating a gift registry web page with recommendations and assistance |
CN103324540B (zh) * | 2012-03-21 | 2016-06-29 | 宏碁股份有限公司 | 电子系统与无缝分享方法 |
US10140118B2 (en) * | 2014-03-19 | 2018-11-27 | Huawei Device (Dongguan) Co., Ltd. | Application data synchronization method and apparatus |
CN105278970A (zh) * | 2014-06-16 | 2016-01-27 | 中兴通讯股份有限公司 | 一种数据处理方法、装置和终端 |
CA2902105A1 (en) * | 2014-08-28 | 2016-02-28 | Radicalogic Technologies, Inc. Dba Rl Solutions | System and method for health care data integration |
CN104933028A (zh) * | 2015-06-23 | 2015-09-23 | 百度在线网络技术(北京)有限公司 | 信息推送方法和装置 |
CN105159788B (zh) * | 2015-09-11 | 2020-10-27 | Tcl科技集团股份有限公司 | 一种Android应用间动态共享资源的方法及系统 |
-
2016
- 2016-08-19 WO PCT/CN2016/096100 patent/WO2018032516A1/zh active Application Filing
- 2016-10-29 CN CN201680087271.2A patent/CN109416652B/zh active Active
- 2016-10-29 WO PCT/CN2016/103883 patent/WO2018032612A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014070374A1 (en) * | 2012-10-31 | 2014-05-08 | Motorola Mobility Llc | Identifying zones containing text data and zones containing graphical data and extracting tex for both zones in order to provide them to other applications |
US20140289742A1 (en) * | 2013-03-25 | 2014-09-25 | Apex Cns Co., Ltd. | Method of sharing contents |
CN104281403A (zh) * | 2013-07-08 | 2015-01-14 | Lg电子株式会社 | 移动终端和控制移动终端的方法 |
US20150020083A1 (en) * | 2013-07-10 | 2015-01-15 | Yuval Ben-Itzhak | Systems and methods for providing user-specific content on an electronic device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108415786A (zh) * | 2018-03-13 | 2018-08-17 | 联想(北京)有限公司 | 信息处理方法及装置、电子设备和计算机可读介质 |
CN108415786B (zh) * | 2018-03-13 | 2022-05-31 | 联想(北京)有限公司 | 信息处理方法及装置、电子设备和计算机可读介质 |
CN116795809A (zh) * | 2023-04-27 | 2023-09-22 | 深圳市易立德信息科技有限公司 | 一种数据共享协同方法及其系统 |
Also Published As
Publication number | Publication date |
---|---|
WO2018032516A1 (zh) | 2018-02-22 |
CN109416652A (zh) | 2019-03-01 |
CN109416652B (zh) | 2022-10-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018032612A1 (zh) | 应用数据的共享方法、装置和终端设备 | |
US11798107B2 (en) | Scenario-based application recommendation method and apparatus | |
JP6442076B2 (ja) | 推奨コンテンツに基づく対話方法、端末及びサーバ | |
KR102182917B1 (ko) | 그래픽 코드 디스플레이 방법 및 장치 | |
CN106453053B (zh) | 群组消息显示方法及装置 | |
EP3335411B1 (en) | Electronic device and method of managing application programs thereof | |
KR101983106B1 (ko) | 자원 이전을 위한 시스템 및 방법 | |
CN104618217B (zh) | 分享资源的方法、终端、服务器及系统 | |
WO2018032661A1 (zh) | 一种终端设备信息显示方法和终端设备 | |
US20160036822A1 (en) | Method and apparatus for sharing data | |
CN115454286B (zh) | 应用数据的处理方法、装置和终端设备 | |
WO2019206158A1 (zh) | 一种界面显示方法、装置及设备 | |
CN111512286B (zh) | 编排程序的方法及电子设备 | |
WO2018232758A1 (zh) | 一种rcs通信方法及设备 | |
KR20170055971A (ko) | 공유 작업 공간을 이용하여 장치들에 걸쳐 작업을 완료하는 기법 | |
CN108156508B (zh) | 弹幕信息处理的方法、装置、移动终端、服务器及系统 | |
WO2015062413A1 (en) | Terminal account managing method and device cross-reference to related applications | |
US20150350123A1 (en) | User terminal apparatus, communication system, and method of controlling user terminal apparatus | |
WO2021017691A1 (zh) | 内容显示方法及终端设备 | |
WO2015010466A1 (zh) | 信息显示方法、装置和移动终端 | |
WO2015003636A1 (zh) | 一种页面元素的拦截方法和装置 | |
KR102138787B1 (ko) | 디바이스 및 그를 이용한 컨텐츠 공유 방법 | |
TWI575458B (zh) | 基於應用的服務提供方法、裝置及系統 | |
KR101876394B1 (ko) | 단말기에 미디어 데이터를 재생하는 방법 및 장치 | |
WO2017008613A1 (zh) | 一种推荐内容推送方法、装置及其终端、服务器和系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16913367 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16913367 Country of ref document: EP Kind code of ref document: A1 |