WO2024244473A1 - Component refreshing method and electronic device - Google Patents
Component refreshing method and electronic device Download PDFInfo
- Publication number
- WO2024244473A1 WO2024244473A1 PCT/CN2024/070925 CN2024070925W WO2024244473A1 WO 2024244473 A1 WO2024244473 A1 WO 2024244473A1 CN 2024070925 W CN2024070925 W CN 2024070925W WO 2024244473 A1 WO2024244473 A1 WO 2024244473A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- component
- data
- card
- app
- electronic device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/656—Updates while running
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
Definitions
- the embodiments of the present application relate to the field of terminal technology, and in particular to a component refresh method and an electronic device.
- the information displayed by some types of components is time-sensitive. In order for users to obtain the latest information in a timely manner, it is generally necessary to refresh the data in a timely manner.
- component refresh requires pulling up the process of the component provider and the process of the component data provider. As the number and types of components on electronic devices gradually increase, the resulting power consumption and memory issues cannot be ignored.
- an embodiment of the present application provides a component refresh method.
- component data published by a data provider of the component is received; in response to a subscription event for the component data, the component data is transmitted to a component user, and the component user is used to refresh the component data and display it in the component; wherein the subscription event is used to instruct the component user to subscribe to the refresh of the component data.
- the life cycle of the component user and the component provider can be decoupled.
- the data provider of the component can publish updated data, and based on the subscription of the component user to the component data, the component can be refreshed and displayed in time.
- self-refresh can be achieved without relying on the data provider.
- This method can solve the problem that the component provider process must be pulled up for component refresh, thereby reducing the power consumption and memory problems caused by component refresh.
- the data provider is an application (APP), a system or a server; wherein the APP is the APP to which the component belongs; wherein the APP includes the APP to which the component belongs, or the APP associated with the component data of the component; wherein the APP associated with the component data of the component can be understood as, the component data of an APP can be derived from other APPs, for example, the step data of a third-party sports health APP can be derived from the step data of the system sports health APP.
- APP application
- the APP is the APP to which the component belongs
- the APP includes the APP to which the component belongs, or the APP associated with the component data of the component
- the APP associated with the component data of the component can be understood as, the component data of an APP can be derived from other APPs, for example, the step data of a third-party sports health APP can be derived from the step data of the system sports health APP.
- a component can have a data provider and a component provider, and the component provider can be used to provide component layout, control the layout of controls on the component, and control click events, etc.; wherein the data provider can be the same APP as the component provider, or a different APP, or the data provider can also be a way to publish data such as a system or server, and this application does not limit this.
- the component data is transmitted to the component user, which may be implemented as transmitting the component data to the component user through a component management service, and the component management service is used to manage the component.
- a functional unit of a component data agent may be responsible for receiving component data published by a data provider, and a component user may subscribe to data from a component data agent through a component management service to achieve data refresh of the component. It is understandable that a component data agent and a component management service are logical functional units, which may be two independent functional units or an integrated functional unit, and this application does not limit this.
- the component refresh method provided in the embodiment of the present application can be implemented through the component management service and the component data agent, and the life cycle decoupling of the component user and the component provider can be achieved, thereby reducing the power consumption and memory problems caused by component refresh.
- the card data agent may have but is not limited to the following capabilities: defining uniform resource identifiers (URIs) and corresponding data formats, providing standardized SDK interfaces, providing data storage, providing necessary data access permission checking capabilities, etc.
- URIs uniform resource identifiers
- SDK interfaces providing data storage
- necessary data access permission checking capabilities etc.
- the method before transmitting the component data to a component user in response to a subscription event to the component data, the method further includes: detecting the subscription event, wherein the subscription event is used to indicate receipt of a subscription request sent by the component user, the subscription request includes a component identifier of the component, and the subscription request is used to indicate a subscription to a refresh of the component based on the component identifier.
- component users can subscribe to component refresh data based on component identification, and data providers can publish component refresh data based on component identification.
- component identification can be used to achieve data docking between component users and data providers, so that the data published by the data provider can be refreshed to component users who subscribe to the component data.
- the subscription request also includes the subscribed data type.
- the data type by including the data type, more accurate component refresh can be achieved.
- the component is a service card or a widget.
- the component user is a host APP.
- the host APP includes but is not limited to one or more of the following APPs: desktop APP, negative one screen APP, notification bar APP, and any other APP that can create components.
- the present application provides an electronic device, the electronic device comprising multiple functional modules; the multiple functional modules interact with each other to implement the method performed by the electronic device in any of the above aspects and its embodiments.
- the multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations.
- the present application provides an electronic device comprising at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor executes the method executed by the electronic device in any of the above aspects and its various embodiments.
- the present application also provides a computer-readable storage medium, in which a computer program is stored.
- a computer program is stored.
- the computer program executes any one of the above aspects and possible methods for designing electronic devices to execute the same.
- the present application provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute any of the above aspects and possible methods of designing an electronic device.
- a computer program also referred to as code, or instruction
- an embodiment of the present application also provides a graphical user interface on an electronic device, the electronic device having a display screen, one or more memories, and one or more processors, the one or more processors being used to execute one or more computer programs stored in the one or more memories, the graphical user interface comprising a graphical user interface displayed when the electronic device executes any of the above aspects and their possible designs.
- the present application also provides a chip, which is used to read a computer program stored in a memory and execute any of the above aspects and possible methods for designing electronic devices to execute.
- the present application further provides a chip system, which includes a processor for supporting a computer device to implement any of the above aspects and possible methods for designing electronic devices to execute.
- the chip system also includes a memory, which is used to store programs and data necessary for the computer device.
- the chip system can be composed of a chip, or it can include a chip and other discrete devices.
- FIG. 1a is a schematic diagram of a scene of a card generation process
- FIG1b is a possible card display interface diagram of an electronic device
- FIG3 is a software structure block diagram of an electronic device provided in an embodiment of the present application.
- FIG4 is a schematic diagram of a scenario of a component refresh method provided in an embodiment of the present application.
- FIG5 is a schematic diagram of another scenario of a component refresh method provided in an embodiment of the present application.
- FIG6 is a schematic flow chart of a component refresh method provided in an embodiment of the present application.
- FIG. 7 is a flow chart of a component refresh method provided in an embodiment of the present application.
- the embodiments of the present application can be applied to the field of terminal technology, and specifically can be applied to scenarios in which desktop components including but not limited to service cards, desktop widgets, etc. are displayed on the display interface of an electronic device.
- a card is used as an example for introduction.
- a card is a service form that can provide a more fine-grained atomic service capability than an application (APP), and directly display the services or content that users care about most to users in the form of interactive cards.
- the card can also track the changes in services or content over time, and display the latest services or content.
- the card corresponding to the weather APP displays more timely weather information
- the card corresponding to the clock APP displays accurate time information
- the card corresponding to the sports health APP displays updated step information.
- the card can be displayed through a variety of card hosts, for example, it can be set to display on the desktop, on the negative one screen, or it can be embedded in various APPs or interactive scenarios to better meet user needs. Users can jump to the corresponding APP or a service page in the APP by clicking on the card, reducing the difficulty of application operation.
- FIG. 1a is a schematic diagram of a card generation process.
- the card generation process is generally implemented by the joint operation of the card user, the card management service, the card provider, and the data provider.
- Card user also called "card host”
- It is a host application that displays the card content and controls the location of the card in the host.
- the card user can generally be a desktop application or process of an electronic device, such as realizing the display of a card on a mobile phone desktop, etc.
- interface 100A is a mobile phone desktop interface
- area 101 shown in the mobile phone desktop interface includes cards for the calendar APP and cards for the weather APP.
- the card user can also be a host application such as a negative one-screen application or process, a notification bar process, etc.
- interface 100B is a negative one-screen display interface
- area 102 shown in the negative one-screen display interface includes a card for the phone usage time, a card for the sports and health APP, a card for the calendar APP, and a card for the weather APP.
- Card management service a resident agent service for managing the cards added to the system, including the management and use of card objects, and periodic card refresh, etc.
- the card management service may include but is not limited to the following modules:
- Refresh module After the card is added, a scheduled task is started according to the card refresh policy to periodically trigger the refresh of the card.
- the card of the calendar app can be updated daily to update the card of the calendar app to display the latest date information.
- the card of the weather app can be updated in response to a trigger event to display the latest weather information; wherein the trigger event may include but is not limited to: the user clicks on the operation instruction of the weather app card, the desktop process displays the desktop interface including the weather app card trigger event, etc.
- Lifecycle management module When a card is switched to the background or blocked, the card refresh is suspended; and the card data is updated and cleaned up in the card upgrade or uninstallation scenario.
- Object management module manages the remote procedure call (RPC) objects of the card user, which is used to verify the user's request and process callbacks after the card is updated.
- RPC remote procedure call
- Card provider a system application or third-party application that provides card layout and style, controls the card control layout and control click events, etc.
- the card provider may include but is not limited to the following modules:
- Card service module Developers can use the onCreateForm instruction to create a card, the onUpdateForm instruction to update a card, and the onDeleteForm instruction to delete a card to enable the developed application to provide corresponding card services.
- Instance management module implemented by the card provider developer, responsible for the persistent management of the card instances allocated by the card management service.
- Communication adaptation layer provided by the software development kit (SDK), it is responsible for communicating with the card management service and is used to actively push the card's updated data to the card management service.
- SDK software development kit
- Card users and card providers are not required to run resident services all the time.
- the card management service will pull up the card provider to obtain the card information.
- Data provider a server, system, or application that provides some type of specific data included in the card display content.
- the card provider corresponding to the weather APP card is the weather APP
- the corresponding data provider can be the weather APP, or a platform, system or server that specifically provides weather data.
- the data provider corresponding to the card of a third-party weather APP can be the weather APP on the mobile phone; it can be understood that the weather APP can be understood as a system application of the mobile phone.
- the card provider and the data provider may be different.
- a health app can be a card provider and provide a card that can include a step count function, while the data provider corresponding to the card is a sports health app.
- the card provider and the data provider are different.
- the card provider and the data provider may be the same.
- a sports health app can not only provide cards, but also provide step counts in combination with sensors and other devices.
- an embodiment of the present application provides a component refresh method.
- the method can define a uniform resource identifier (URI) and a corresponding data format, and can receive and cache update data published by a component provider and/or a data provider, as well as accept subscriptions from component users and push updated data to component users.
- URI uniform resource identifier
- the life cycle decoupling of component users and component providers and/or data providers can be achieved, and self-refresh that does not rely on data source applications can be achieved, thereby reducing memory usage and power consumption, and improving the performance of electronic devices.
- the electronic device can be any device that supports the component function.
- the electronic device can be an electronic device such as a mobile phone, a tablet computer, a wearable device (e.g., a watch, a bracelet, etc.), a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device (e.g., a smart TV, a smart speaker, etc.) that can display components on a desktop.
- AR augmented reality
- VR virtual reality
- UMPC ultra-mobile personal computer
- PDA personal digital assistant
- smart home device e.g., a smart TV, a smart speaker, etc.
- the electronic devices to which the embodiments of the present application can be applied include but are not limited to electronic devices equipped with Or electronic devices with other operating systems.
- the electronic device may be, for example, the terminal device introduced in the above embodiments.
- FIG2 shows a schematic diagram of the hardware structure of a possible electronic device.
- the electronic device 200 includes: a radio frequency (RF) circuit 210, a power supply 220, a processor 230, a memory 240, an input unit 250, a display unit 260, an audio circuit 270, a communication interface 280, and a Wi-Fi module 290.
- RF radio frequency
- the electronic device 200 provided in the embodiment of the present application may include more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations.
- the various components shown in FIG2 can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application-specific integrated circuits.
- the RF circuit 210 can be used for receiving and sending data during communication or calls. In particular, after receiving downlink data from the base station, the RF circuit 210 sends it to the processor 230 for processing; in addition, the uplink data to be sent is sent to the base station.
- the RF circuit 210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc.
- the RF circuit 210 can also communicate with other devices through a wireless communication network.
- the wireless communication can use any communication standard or protocol, including but not limited to global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
- 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
- email short messaging service
- Wi-Fi technology is a short-range wireless transmission technology.
- the electronic device 200 can connect to an access point (AP) through a Wi-Fi module 290 to access the data network.
- the Wi-Fi module 290 can be used to receive and send data during the communication process.
- the tablet computer can synchronize data with other electronic devices through the Wi-Fi module 290.
- the tablet computer can obtain the user's latest step count from the mobile phone, so that the sports health information can be displayed on the tablet computer.
- the APP components display information that is more consistent with the user’s actual step count.
- the electronic device 200 can be physically connected to other devices through the communication interface 280.
- the communication interface 280 is connected to the communication interface of the other device through a cable to achieve data transmission between the electronic device 200 and the other device.
- the electronic device 200 can also implement communication services and interact with other electronic devices, so the electronic device 200 needs to have a data transmission function, that is, the electronic device 200 needs to include a communication module.
- FIG. 2 shows communication modules such as the RF circuit 210, the Wi-Fi module 290, and the communication interface 280, it is understandable that the electronic device 200 has at least one of the above components or other communication modules (such as a Bluetooth module) for implementing communication to perform data transmission.
- the electronic device 200 when the electronic device 200 is a mobile phone, the electronic device 200 may include the RF circuit 210, and may also include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 2 ); when the electronic device 200 is a tablet computer, the electronic device 200 may include the Wi-Fi module, or may include a Bluetooth module (not shown in FIG. 2 ); when the electronic device 200 is a smart home device, the electronic device 200 may include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 2 ).
- the memory 240 can be used to store software programs and modules.
- the processor 230 executes various functional applications and data processing of the electronic device 200 by running the software programs and modules stored in the memory 240.
- the memory 240 may mainly include a program storage area and a data storage area.
- the program storage area can store an operating system (mainly including software programs or modules corresponding to the kernel layer, system layer, application framework layer, and application layer, etc.).
- the memory 240 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
- the memory 240 may store data published by a component provider and/or a data provider for component users to refresh the component.
- the input unit 250 can be used to receive editing operations of various types of data objects such as digital or character information input by the user, and generate key signal input related to user settings and function control of the electronic device 200.
- the input unit 250 may include a touch panel 251 and other input devices 252.
- the touch panel 251 also called a touch screen, can collect user touch operations on or near it (such as operations performed by a user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 251), and drive corresponding connection devices according to a pre-set program.
- the touch panel 251 can collect user operations on or near it; for example, when the electronic device 200 is a mobile phone, the user operations can be used for the user to view, add, change, or delete components on the mobile phone interface.
- the other input devices 252 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, etc.
- function keys such as a volume control button, a switch button, etc.
- trackball such as a mouse, a joystick, etc.
- the display unit 260 can be used to display information input by the user or information provided to the user and various menus of the electronic device 200.
- the display unit 260 is the display system of the electronic device 200, which is used to present an interface and realize human-computer interaction.
- the display unit 260 may include a display panel 261.
- the display panel 261 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
- the display unit 260 can be used to display a desktop interface including components, or a negative one-screen interface, etc., and can also be used to display information after a component is refreshed, etc.
- the processor 230 is the control center of the electronic device 200, and uses various interfaces and lines to connect various components, and executes various functions and processes data of the electronic device 200 by running or executing software programs and/or modules stored in the memory 240, and calling data stored in the memory 240, so as to realize various services based on the electronic device 200.
- the processor 230 can be used to implement the method provided in the embodiment of the present application.
- the electronic device 200 further includes an audio circuit 270, a microphone 271 and a speaker 272, which can provide an audio interface between the user and the electronic device 200.
- the audio circuit 270 can be used to convert audio data into a signal that can be recognized by the speaker 272, and transmit the signal to the speaker 272, which is converted into a sound signal for output by the speaker 272.
- the microphone 271 is used to collect external sound signals (such as the sound of a person speaking, or other sounds, etc.), and convert the collected external sound signals into signals that can be recognized by the audio circuit 270, and send them to the audio circuit 270.
- the audio circuit 270 can also be used to convert the signal sent by the microphone 271 into audio data, and then output the audio data to the RF circuit 210 to send it to, for example, another electronic device, or output the audio data to the memory 240 for subsequent further processing.
- the electronic device 200 may also include a camera, at least one sensor, etc., which will not be described in detail herein.
- the at least one sensor may include but is not limited to a pressure sensor, an air pressure sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, etc.
- the operating system (OS) involved in the embodiment of the present application is the most basic system software running on the electronic device 200.
- the software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
- the embodiment of the present application takes an operating system adopting a layered architecture as an example to illustrate the software structure of the electronic device 200.
- FIG3 is a block diagram of the software structure of an electronic device provided in an embodiment of the present application.
- the software structure of the electronic device can be a layered architecture, for example, the software can be divided into several layers, each layer has a clear role and division of labor.
- the layers communicate with each other through software interfaces.
- the operating system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (framework, FWK), the runtime and system library, the kernel layer, and the hardware layer.
- the application layer may include a series of application packages. As shown in FIG3 , the application layer may include camera, settings, skin module, user interface (UI), third-party applications, etc. Among them, third-party applications may include, for example, wireless local area network (WLAN), music, calls, Bluetooth, video, etc.
- WLAN wireless local area network
- applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer.
- API application programming interface
- Developers can interact with the underlying layers of the operating system (such as the hardware layer, kernel layer, etc.) through the application framework layer to develop their own applications.
- the application framework layer is mainly a series of services and management systems for the operating system.
- the application framework layer provides an application programming interface and a programming framework for the applications in the application layer.
- the application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
- the activity manager is used to manage the life cycle of each application and provide common navigation back functions, providing an interactive interface for all program windows.
- the window manager is used to manage window programs.
- the window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- the content provider is used to store and obtain data and make the data accessible to applications.
- the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying images, etc.
- the view system can be used to build applications.
- a display interface can be composed of one or more views.
- a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
- the phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
- the resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
- the notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
- the runtime includes the core library and the virtual machine.
- the runtime is responsible for the scheduling and management of the operating system.
- the core library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the operating system.
- the application layer and the application framework layer run in the virtual machine.
- the virtual machine executes the Java files of the application layer and the application framework layer as binary files.
- the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
- the system library can include multiple functional modules, such as surface manager, media framework, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
- functional modules such as surface manager, media framework, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
- the surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
- the media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
- the media framework can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
- a three-dimensional graphics processing library may be used to draw a three-dimensional motion trajectory image
- a two-dimensional graphics engine may be used to draw a two-dimensional motion trajectory image
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
- the electronic device 200 can run multiple applications at the same time.
- one application can correspond to one process, and in a more complex case, one application can correspond to multiple processes.
- Each process has a process number (process ID).
- the hardware structure of the electronic device can be as shown in Figure 2, and the software system architecture can be as shown in Figure 3, wherein the software programs and/or modules corresponding to the software system architecture in the electronic device can be stored in the memory 240, and the processor 230 can run the software programs and applications stored in the memory 240 to execute the process of a component refresh method provided in an embodiment of the present application.
- the implementation process of the method provided by the present application is introduced below in combination with the contents shown in Figures 4 to 7.
- the embodiment of the present application is applicable to the scenario where components are displayed on the desktop of an electronic device; wherein the components may be, for example, components in service cards, desktop widgets, etc. that require data refresh, and may be used to display some services or content of concern to users on some display interfaces of electronic devices.
- the embodiment of the present application does not limit the style, type, display position, etc. of the components; taking cards as an example, the style of the cards may be 1 ⁇ 2 style, 2 ⁇ 2 style, and the color of the cards may be blue, red, etc.
- FIG4 is a schematic diagram of a scenario of a component refresh method provided in an embodiment of the present application.
- a service card (referred to as "card") is used as an example, and the scenario may include: a card user 401, a card management service 402, a card data agent 403, a card provider 404A, and a data provider 404B.
- the card user 401 may start a timed task based on the card refresh strategy to periodically trigger the card refresh; the card management service 402 may subscribe to or query data from the card data agent 403 in response to the refresh request of the card user 401; the card provider 404A and/or the data provider 404B may publish data to the card data agent 403; after the card management service 402 receives the return data from the card data agent 403, it may continue to return data to the card user 401.
- a card data agent 403 may also be provided, and the card data agent 403 may be used to provide but not limited to the following capabilities:
- the card data agent 403 can implement agents for various types of cards by defining URIs and corresponding data formats.
- URI uniform resource identifier
- the card data agent 403 can implement agents for various types of cards by defining URIs and corresponding data formats.
- the URI of a card for a weather app and the weather data format corresponding to the weather app can be defined;
- the URI of a card for a calendar app and the date data format corresponding to the calendar app can also be defined;
- the URI of a card for a sports and health app and the step data format corresponding to the sports and health app can also be defined.
- the card management service 402 can subscribe to data from the card data agent 403 based on the URI of the data to be subscribed; and the card provider 404A and/or the data provider 404B can use the defined URI and the corresponding data format to publish updated data to the card data agent 403.
- data is usually in the form of a database (key-value) that stores data in key-value pairs; wherein key can be understood as a URI, such as the data of a sports health APP, and value can be understood as the specific data corresponding to the key, such as json (a data format) data, such as the number of steps (stepcount: 9999), date (date: 05/05), and health state (healthstate: normal).
- key can be understood as a URI, such as the data of a sports health APP
- value can be understood as the specific data corresponding to the key, such as json (a data format) data, such as the number of steps (stepcount: 9999), date (date: 05/05), and health state (healthstate: normal).
- the card data agent 403 may also provide centralized storage or distributed storage.
- the card data agent 403 may store the following data: exercise steps, power (including but not limited to local devices and distributed devices), weather, heart rate, calendar, etc.
- the card data agent 403 may allow some verified data providers 404B to publish data, thereby ensuring the security and accuracy of card data refresh.
- the card user 401 can be understood as the host application of the card, for example, it can be a desktop APP or desktop process, a negative one screen APP or a negative one screen process, etc.
- the card user 401 may trigger sending a subscription request to the card data agent 403 through the card management service 402.
- the subscription request may include a card identifier, and the card identifier may be used by the card data agent 403 to return the subscribed card data to the card user 401 based on the card identifier.
- the subscription request may include a card identifier and a subscribed data type, and the data type may be used to indicate the specific data type of the card subscribed by the card user 401, such as a step count data type, a date data type, etc.
- FIG. 5 is another scenario diagram of a component refresh method provided by an embodiment of the present application.
- the scenario may include the card user 401, the card provider 404A and the data provider 404B in FIG. 4; and the card data agent 403 in the scenario may be integrated into the card management service, for example, may be referred to as the card management service 402'.
- the card management service 402' can not only implement the logical functions of the card management service 402 introduced in FIG. 4, but also implement the logical functions of the card data agent 403 introduced in FIG. 4.
- the card user 401 may start a timed task based on the card refresh strategy to periodically trigger the card refresh; the card management service 402' may receive the refresh request of the card user 401, and in response to the refresh request, perform local data subscription and query.
- the card provider 404A and/or the data provider 404B may publish data to the card management service 402'; after the card management service 402' detects that there is newly published data in the local cache, it may return data to the card user 401.
- the logical functions of the card management service 402' can refer to the logical functions of the card management service 402 and the card data agent 403 introduced in Figure 4, which will not be repeated here.
- FIG. 6 is a flow chart of a component refresh method provided in an embodiment of the present application. The flow may include the following steps:
- Step 601a sports health publishes data.
- the sports health APP can be used as a data provider for the card corresponding to the sports health APP.
- the sports health APP can respond to the change of the number of steps and publish the latest number of steps to the card data agent in a timely manner.
- Step 601b the power management publishes the current system power.
- the data source of the power management can be the data provider of the card corresponding to the data source of the power management.
- the data source of the power management can be, for example, the operating system of the electronic device, and the data source of the power management can publish the current system power to the card data agent in a timely manner in response to the change of power.
- the card data agent receives the data published by the data provider through step 601a or step 601b, it can cache the data.
- the card provider sets a refresh policy.
- the card provider can set a refresh policy based on the data type, etc.; and can publish data according to the refresh policy.
- the refresh policy can be based on a cycle or time, etc.
- the card corresponding to the calendar APP can set a refresh policy according to a time point, and update the card corresponding to the calendar APP at 00:00 every morning.
- the refresh policy can also be based on a trigger event, and the trigger event can include but is not limited to: the user clicks on the card's operation instruction, the desktop process displays a trigger event including the desktop interface of the card, etc.
- the card data agent detects that the refresh policy is satisfied.
- the desktop process when the desktop process detects the user's operation of adding a card in the desktop process, in response to the operation, it can subscribe to data from the card data agent.
- the desktop process can carry the URI corresponding to the card when subscribing to data from the card data agent according to the specific type of the card.
- the card is a card of a sports health APP
- the URI can be the data of the sports health APP, so that at least one data corresponding to the data format defined by the sports health APP can be obtained, such as but not limited to: “stepcount: 9999", "date: 05/05", "healthstate: normal”.
- the card data agent may also return the received published data to the card user who subscribes to the data based on the card user's subscription event to the data.
- Step 604a The card data agent refreshes the number of steps to the desktop process.
- Step 604b The card data agent refreshes the current system power to the desktop process.
- Step 605 The desktop process updates the card.
- the method provided by the embodiment of the present application can solve the problem that the card provider process must be started for card refresh, thereby reducing the power consumption and memory problems caused by card refresh.
- the method can achieve the decoupling of the life cycle of the card user and the card provider, thereby achieving self-refresh without relying on the data provider.
- the method can achieve the card provider without integrating the SDK of other data providers by providing a card data agent, and the card data agent can achieve the connection between the card provider and the data provider, thereby reducing the complexity of development.
- FIG7 is another flow chart of a component refresh method provided in an embodiment of the present application.
- the method can be applied to an electronic device including a component, and the process may include the following steps:
- Step 701 Receive component data published by a data provider of the component.
- the electronic device may include a component data agent and a component management service functional unit; in this scenario, the component data agent may be responsible for receiving the component data.
- the electronic device may include a functional unit integrating a component data agent and a component management service; in this scenario, the integrated functional unit may be responsible for receiving the component data.
- Step 702 In response to a subscription event to the component data, the component data is transmitted to a component user, and the component user is used to refresh the component data and display it in the component; wherein the subscription event is used to instruct the component user to subscribe to the refresh of the component data.
- the component user in a scenario where the electronic device includes a component data proxy and a component management service functional unit, the component user can subscribe to the component data from the component data proxy through the component management service.
- the component data proxy can return the component data sent by the data provider to the component user through the component management service.
- the component user when sending a subscription request, can indicate the component ID, or can indicate the component ID and the type of data subscribed; similarly, when publishing data, the data provider can indicate the component ID, or can indicate the component ID and the type of data included in the component. Therefore, the card data proxy can achieve accurate component refresh based on the component ID, or based on the component ID and the data type.
- a component user in a scenario where the electronic device includes a functional unit that integrates a component data proxy and a component management service, a component user can subscribe to component data from the integrated functional unit.
- the present application also provides an electronic device, which includes multiple functional modules; the multiple functional modules interact with each other to implement the functions performed by the electronic device in each method described in the embodiments of the present application.
- the multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation.
- steps 601a to 605 performed by the electronic device in the embodiment shown in Figure 6 are executed; it can be understood that the card provider and card data agent shown in Figure 6 are logical functional units in the electronic device, which can be implemented by the processor in the electronic device, and the desktop process, sports health, power management, etc. are applications in the electronic device, which can also be implemented by the processor in the electronic device.
- steps 701 to 702 performed by the electronic device in the embodiment shown in Figure 7 are executed.
- the electronic device can also include a logical functional unit of a card management service, or a functional unit integrating a card management service and a card data agent.
- the present application also provides an electronic device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor performs the functions performed by the electronic device in each method described in the embodiments of the present application. For example, steps 601a to 605 performed by the electronic device in the embodiment shown in FIG. 6 are executed; it can be understood that the card provider and the card data agent shown in FIG. 6 are logical function units in the electronic device, which can be implemented by the processor in the electronic device, and the desktop process, sports health, power management, etc. are applications in the electronic device, which can also be implemented by the processor in the electronic device.
- steps 701 to 702 performed by the electronic device in the embodiment shown in FIG. 7 are executed.
- the electronic device can also include a logical function unit of a card management service, or a function unit integrating a card management service and a card data agent.
- the present application also provides a computer program product, which includes: a computer program (also referred to as a code, or an instruction), when the computer program is executed, the computer executes the methods described in the embodiments of the present application.
- the present application further provides a computer-readable storage medium, in which a computer program is stored.
- a computer program is stored.
- the computer program executes the methods described in the embodiments of the present application.
- the present application further provides a chip, which is used to read a computer program stored in a memory to implement the methods described in the embodiments of the present application.
- the present application provides a chip system, which includes a processor for supporting a computer device to implement The various methods described in the embodiments of the present application.
- the chip system also includes a memory, which is used to store the necessary programs and data of the computer device.
- the chip system can be composed of a chip, or it can include a chip and other discrete devices.
- the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.
- the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Stored Programmes (AREA)
Abstract
Description
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2023年5月26日提交中华人民共和国国家知识产权局、申请号为202310603225.5、发明名称为“一种组件刷新方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on May 26, 2023, with application number 202310603225.5 and invention name "A component refresh method and electronic device", all contents of which are incorporated by reference in this application.
本申请实施例涉及终端技术领域,尤其涉及一种组件刷新方法及电子设备。The embodiments of the present application relate to the field of terminal technology, and in particular to a component refresh method and an electronic device.
随着电子设备的普及,除了在桌面上向用户提供基础的应用图标以外,很多操作系统中也可以通过如服务卡片、桌面小组件(widget)等组件的形式,向用户提供应用程序的一些快捷功能,或者显示应用程序的一些关键信息。With the popularization of electronic devices, in addition to providing users with basic application icons on the desktop, many operating systems can also provide users with some shortcut functions of applications or display some key information of applications in the form of components such as service cards and desktop widgets.
一些类型的组件显示的信息具有时效性,为了使得用户及时地获取最新的信息,一般需要及时地进行数据刷新。目前,组件刷新需要拉起组件提供方的进程,还需要拉起组件数据提供方的进程。随着电子设备上组件的数量和类型逐渐增多,导致的功耗和内存问题不容忽视。The information displayed by some types of components is time-sensitive. In order for users to obtain the latest information in a timely manner, it is generally necessary to refresh the data in a timely manner. Currently, component refresh requires pulling up the process of the component provider and the process of the component data provider. As the number and types of components on electronic devices gradually increase, the resulting power consumption and memory issues cannot be ignored.
发明内容Summary of the invention
本申请实施例提供一种组件刷新方法及电子设备,用以解决应用进程需要常驻才能实现组件刷新的问题,可以降低电子设备的系统功耗和内存开销。The embodiments of the present application provide a component refresh method and an electronic device, which are used to solve the problem that an application process needs to be resident to implement component refresh, and can reduce the system power consumption and memory overhead of the electronic device.
第一方面,本申请实施例提供了一种组件刷新方法。该方法中,接收所述组件的数据提供方发布的组件数据;响应于对所述组件数据的订阅事件,将所述组件数据传输到组件使用方,所述组件使用方用于将所述组件数据刷新显示在所述组件中;其中,所述订阅事件用于指示所述组件使用方对所述组件数据的刷新进行订阅。In the first aspect, an embodiment of the present application provides a component refresh method. In the method, component data published by a data provider of the component is received; in response to a subscription event for the component data, the component data is transmitted to a component user, and the component user is used to refresh the component data and display it in the component; wherein the subscription event is used to instruct the component user to subscribe to the refresh of the component data.
通过该方法,可以实现组件使用方与组件提供方的生命周期解耦,组件的数据提供方可以发布更新的数据,基于组件使用方对组件数据的订阅,可以实现组件的及时刷新显示。这样,通过将组件的生命周期划分为数据发布和数据订阅,可以实现不依赖数据提供方的自刷新。该方法可以解决组件刷新必须要拉起组件提供方进程的问题,从而可以减少由于组件刷新产生的功耗和内存问题。Through this method, the life cycle of the component user and the component provider can be decoupled. The data provider of the component can publish updated data, and based on the subscription of the component user to the component data, the component can be refreshed and displayed in time. In this way, by dividing the component life cycle into data publishing and data subscription, self-refresh can be achieved without relying on the data provider. This method can solve the problem that the component provider process must be pulled up for component refresh, thereby reducing the power consumption and memory problems caused by component refresh.
另外,该方法通过提供组件数据代理通过组件数据代理可以实现组件提供方无需集成其他数据提供方的软件开发工具包(software development kit,SDK),可以有组件数据代理实现组件提供方和数据提供方的对接,从而可以降低开发复杂度。In addition, the method can realize that the component provider does not need to integrate the software development kit (SDK) of other data providers by providing a component data proxy. The component data proxy can realize the connection between the component provider and the data provider, thereby reducing the complexity of development.
在一种可能的设计中,所述数据提供方为应用程序(application,APP)、系统或服务器;其中,所述APP为所述组件所属的APP;其中,所述APP包括所述组件所属的APP、或与所述组件的组件数据关联的APP;其中,与所述组件的组件数据关联的APP可以理解为,一个APP的组件数据可以来源与其他APP,例如第三方运动健康APP的步数数据可以来源与系统运动健康APP的步数数据。另外,组件可以具有数据提供方和组件提供方,组件提供方可用于提供组件布局,控制组件上的控件布局以及控件点击事件等;其中,数据提供方可与组件提供方为相同的APP,也可以为不同的APP,或者数据提供方也可以为系统或服务器等发布数据的途径,本申请对此不进行限定。In one possible design, the data provider is an application (APP), a system or a server; wherein the APP is the APP to which the component belongs; wherein the APP includes the APP to which the component belongs, or the APP associated with the component data of the component; wherein the APP associated with the component data of the component can be understood as, the component data of an APP can be derived from other APPs, for example, the step data of a third-party sports health APP can be derived from the step data of the system sports health APP. In addition, a component can have a data provider and a component provider, and the component provider can be used to provide component layout, control the layout of controls on the component, and control click events, etc.; wherein the data provider can be the same APP as the component provider, or a different APP, or the data provider can also be a way to publish data such as a system or server, and this application does not limit this.
该设计中,在组件刷新的过程中,无需拉起组件提供方,数据提供方的进程也可以无需常驻,数据提供方在存在更新数据时,将数据发布至组件数据代理或组件管理服务。因此,可以实现降低功耗、以及可以降低对内存的占用。In this design, during the component refresh process, there is no need to pull up the component provider, and the data provider process does not need to be resident. When there is updated data, the data provider publishes the data to the component data agent or component management service. Therefore, it is possible to reduce power consumption and memory usage.
在一种可能的设计中,所述将所述组件数据传输到组件使用方,可实施为将所述组件数据通过组件管理服务传输给组件使用方,所述组件管理服务用于对所述组件进行管理。示例性的,可以通过组件数据代理的功能单元,负责接收数据提供方发布的组件数据,以及组件使用方通过组件管理服务向组件数据代理进行数据订阅,以实现对组件的数据刷新。可以理解,组件数据代理和组件管理服务为逻辑功能单元,可以为独立的两个功能单元,也可以为集成的功能单元,本申请对此不进行限定。 In one possible design, the component data is transmitted to the component user, which may be implemented as transmitting the component data to the component user through a component management service, and the component management service is used to manage the component. Exemplarily, a functional unit of a component data agent may be responsible for receiving component data published by a data provider, and a component user may subscribe to data from a component data agent through a component management service to achieve data refresh of the component. It is understandable that a component data agent and a component management service are logical functional units, which may be two independent functional units or an integrated functional unit, and this application does not limit this.
该设计中,通过组件管理服务和组件数据代理,可以实现本申请实施例提供的组件刷新方法,可以实现组件使用方和组件提供方的生命周期的解耦。从而可以减少由于组件刷新产生的功耗和内存问题。In this design, the component refresh method provided in the embodiment of the present application can be implemented through the component management service and the component data agent, and the life cycle decoupling of the component user and the component provider can be achieved, thereby reducing the power consumption and memory problems caused by component refresh.
在一些可能的设计中,卡片数据代理可以具有但不限于以下能力:定义统一资源标识符(uniform resource identifier,URI)以及对应的数据格式、提供标准化的SDK接口、提供数据存储、提供必要的数据访问权限检查能力等。In some possible designs, the card data agent may have but is not limited to the following capabilities: defining uniform resource identifiers (URIs) and corresponding data formats, providing standardized SDK interfaces, providing data storage, providing necessary data access permission checking capabilities, etc.
在一种可能的设计中,所述响应于对所述组件数据的订阅事件,将所述组件数据传输到组件使用方之前,所述方法还包括:检测到所述订阅事件,所述订阅事件用于指示接收到所述组件使用方发送的订阅请求,所述订阅请求包括所述组件的组件标识,所述订阅请求用于指示基于所述组件标识对所述组件的刷新进行订阅。In one possible design, before transmitting the component data to a component user in response to a subscription event to the component data, the method further includes: detecting the subscription event, wherein the subscription event is used to indicate receipt of a subscription request sent by the component user, the subscription request includes a component identifier of the component, and the subscription request is used to indicate a subscription to a refresh of the component based on the component identifier.
该设计中,组件使用方可以基于组件标识进行组件刷新的数据订阅,数据提供方可以基于组件标识进行组件刷新的数据发布,这样可以通过组件标识,实现对组件使用方和数据提供方的数据对接,从而可以实现将数据提供方发布的数据,刷新给订阅该组件数据的组件使用方。In this design, component users can subscribe to component refresh data based on component identification, and data providers can publish component refresh data based on component identification. In this way, component identification can be used to achieve data docking between component users and data providers, so that the data published by the data provider can be refreshed to component users who subscribe to the component data.
在一种可能的设计中,所述订阅请求中还包括订阅的数据类型。该设计中,通过包括数据类型,可以实现更准确地组件刷新。In a possible design, the subscription request also includes the subscribed data type. In this design, by including the data type, more accurate component refresh can be achieved.
在一种可能的设计中,所述组件为服务卡片、或小组件widget。在一种可能的设计中,所述组件使用方为宿主APP。所述宿主APP包括但不限于以下APP中的一种或多种:桌面APP、或负一屏APP、通知栏APP等可以创建组件的任意APP。In one possible design, the component is a service card or a widget. In one possible design, the component user is a host APP. The host APP includes but is not limited to one or more of the following APPs: desktop APP, negative one screen APP, notification bar APP, and any other APP that can create components.
第二方面,本申请提供一种电子设备,所述电子设备包括多个功能模块;所述多个功能模块相互作用,实现上述任一方面及其各实施方式中电子设备所执行的方法。所述多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且所述多个功能模块可以基于具体实现进行任意组合或分割。In a second aspect, the present application provides an electronic device, the electronic device comprising multiple functional modules; the multiple functional modules interact with each other to implement the method performed by the electronic device in any of the above aspects and its embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations.
第三方面,本申请提供一种电子设备,包括至少一个处理器和至少一个存储器,所述至少一个存储器中存储计算机程序指令,所述电子设备运行时,所述至少一个处理器执行上述任一方面及其各实施方式中电子设备执行的方法。In a third aspect, the present application provides an electronic device comprising at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor executes the method executed by the electronic device in any of the above aspects and its various embodiments.
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序被计算机执行时,使得所述计算机执行上述任一方面及其各可能的设计电子设备执行的方法。In a fourth aspect, the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes any one of the above aspects and possible methods for designing electronic devices to execute the same.
第五方面,本申请提供了一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述任一方面及其各可能的设计电子设备的方法。In a fifth aspect, the present application provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute any of the above aspects and possible methods of designing an electronic device.
第六方面,本申请实施例还提供一种电子设备上的图形用户界面,该电子设备具有显示屏、一个或多个存储器、以及一个或多个处理器,所述一个或多个处理器用于执行存储在所述一个或多个存储器中的一个或多个计算机程序,所述图形用户界面包括所述电子设备执行上述任一方面及其各可能的设计时显示的图形用户界面。In a sixth aspect, an embodiment of the present application also provides a graphical user interface on an electronic device, the electronic device having a display screen, one or more memories, and one or more processors, the one or more processors being used to execute one or more computer programs stored in the one or more memories, the graphical user interface comprising a graphical user interface displayed when the electronic device executes any of the above aspects and their possible designs.
第七方面,本申请还提供一种芯片,所述芯片用于读取存储器中存储的计算机程序,执行上述任一方面及其各可能的设计电子设备执行的方法。In a seventh aspect, the present application also provides a chip, which is used to read a computer program stored in a memory and execute any of the above aspects and possible methods for designing electronic devices to execute.
第八方面,本申请还提供一种芯片系统,该芯片系统包括处理器,用于支持计算机装置实现上述任一方面及其各可能的设计电子设备执行的方法。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存该计算机装置必要的程序和数据。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In an eighth aspect, the present application further provides a chip system, which includes a processor for supporting a computer device to implement any of the above aspects and possible methods for designing electronic devices to execute. In one possible design, the chip system also includes a memory, which is used to store programs and data necessary for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.
上述第二方面至第八方面中任一方面及其可能的设计的有益效果请具体参阅上述第一方面中各种可能的设计的有益效果,在此不再赘述。For the beneficial effects of any aspect from the second to the eighth aspect and its possible designs, please refer to the beneficial effects of the various possible designs in the first aspect, which will not be repeated here.
图1a为一种卡片的生成过程的场景示意图;FIG. 1a is a schematic diagram of a scene of a card generation process;
图1b为电子设备的一种可能的卡片显示界面图;FIG1b is a possible card display interface diagram of an electronic device;
图2为本申请实施例提供的一种可能的电子设备的硬件结构示意图;FIG2 is a schematic diagram of a possible hardware structure of an electronic device provided in an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的软件结构框图;FIG3 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
图4为本申请实施例提供的一种组件刷新方法的一种场景示意图; FIG4 is a schematic diagram of a scenario of a component refresh method provided in an embodiment of the present application;
图5为本申请实施例提供的一种组件刷新方法的另一种场景示意图;FIG5 is a schematic diagram of another scenario of a component refresh method provided in an embodiment of the present application;
图6本申请实施例提供的一种组件刷新方法的一种流程示意图;FIG6 is a schematic flow chart of a component refresh method provided in an embodiment of the present application;
图7本申请实施例提供的一种组件刷新方法的一种流程示意图。FIG. 7 is a flow chart of a component refresh method provided in an embodiment of the present application.
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本申请实施例可以应用于终端技术领域,具体可以适用于在电子设备的显示界面上显示包括但不限于服务卡片、桌面widget等桌面组件的场景中。The embodiments of the present application can be applied to the field of terminal technology, and specifically can be applied to scenarios in which desktop components including but not limited to service cards, desktop widgets, etc. are displayed on the display interface of an electronic device.
以下实施例中以卡片为例进行介绍,卡片是一种服务形态,可以提供一种比应用程序(application,APP)更细粒度的原子化服务能力,以可交互的卡片形式直接将用户最关心的服务或内容展示给用户。并且,卡片还可以跟踪服务或内容跟随时间变化的情况,显示最新的服务或内容,例如天气APP对应的卡片显示较为及时的天气信息,时钟APP对应的卡片显示为准确的时间信息,运动健康APP对应的卡片显示为更新的步数信息等。卡片可以通过多种形式的卡片宿主进行显示,例如可以设置显示在桌面上、负一屏上,或者还可以嵌入各种APP或交互场景中,以更好的满足用户需求。用户通过点击卡片可跳转到对应的APP或者APP内的某个服务页面,降低应用操作难度。In the following embodiments, a card is used as an example for introduction. A card is a service form that can provide a more fine-grained atomic service capability than an application (APP), and directly display the services or content that users care about most to users in the form of interactive cards. In addition, the card can also track the changes in services or content over time, and display the latest services or content. For example, the card corresponding to the weather APP displays more timely weather information, the card corresponding to the clock APP displays accurate time information, and the card corresponding to the sports health APP displays updated step information. The card can be displayed through a variety of card hosts, for example, it can be set to display on the desktop, on the negative one screen, or it can be embedded in various APPs or interactive scenarios to better meet user needs. Users can jump to the corresponding APP or a service page in the APP by clicking on the card, reducing the difficulty of application operation.
一种可能的场景中,参阅图1a,为一种卡片的生成过程的场景示意图。示例性的,卡片的生成过程一般由卡片使用方、卡片管理服务、卡片提供方、数据提供方的共同运作来实现。其中,In a possible scenario, refer to FIG. 1a, which is a schematic diagram of a card generation process. Exemplarily, the card generation process is generally implemented by the joint operation of the card user, the card management service, the card provider, and the data provider.
(1)卡片使用方(也可称为“卡片宿主”):是显示卡片内容的宿主应用,控制卡片在宿主中展示的位置。例如,卡片使用方一般可以为电子设备的桌面应用或进程,例如实现卡片在手机桌面上进行显示等,如图1b中界面100A为一张手机桌面界面,手机桌面界面示出的区域101包括日历APP的卡片和天气APP的卡片。又例如,卡片使用方还可以为电子设备的负一屏应用或进程、通知栏进程等宿主应用,如图1b中界面100B为负一屏显示界面,负一屏显示界面示出的区域102包括手机使用时长的卡片、运动健康APP的卡片、日历APP的卡片和天气APP的卡片。(1) Card user (also called "card host"): It is a host application that displays the card content and controls the location of the card in the host. For example, the card user can generally be a desktop application or process of an electronic device, such as realizing the display of a card on a mobile phone desktop, etc. As shown in FIG1b, interface 100A is a mobile phone desktop interface, and area 101 shown in the mobile phone desktop interface includes cards for the calendar APP and cards for the weather APP. For another example, the card user can also be a host application such as a negative one-screen application or process, a notification bar process, etc. of an electronic device, as shown in FIG1b, interface 100B is a negative one-screen display interface, and area 102 shown in the negative one-screen display interface includes a card for the phone usage time, a card for the sports and health APP, a card for the calendar APP, and a card for the weather APP.
(2)卡片管理服务:用于管理系统中所添加卡片的常驻代理服务,包括卡片对象的管理与使用,以及卡片周期性刷新等。其中,卡片管理服务可以包括但不限于以下模块:(2) Card management service: a resident agent service for managing the cards added to the system, including the management and use of card objects, and periodic card refresh, etc. The card management service may include but is not limited to the following modules:
2-1)刷新模块:在卡片添加后,根据卡片的刷新策略启动定时任务周期性触发卡片的刷新。例如,日历APP的卡片可以按日更新,以实现将日历APP的卡片更新为显示最新的日期信息。又例如,天气APP的卡片可以响应于触发事件更新,以实现显示最新发布的天气信息;其中,触发事件例如可以包括但不限于:用户点击天气APP的卡片的操作指令、桌面进程显示包括天气APP的卡片的桌面界面的触发事件等。2-1) Refresh module: After the card is added, a scheduled task is started according to the card refresh policy to periodically trigger the refresh of the card. For example, the card of the calendar app can be updated daily to update the card of the calendar app to display the latest date information. For another example, the card of the weather app can be updated in response to a trigger event to display the latest weather information; wherein the trigger event may include but is not limited to: the user clicks on the operation instruction of the weather app card, the desktop process displays the desktop interface including the weather app card trigger event, etc.
2-2)缓存模块:在卡片添加到卡片管理服务后,对卡片的视图信息进行缓存,以便下次获取卡片时可以直接返回缓存数据,降低时延。2-2) Cache module: After a card is added to the card management service, the card's view information is cached so that the cached data can be directly returned the next time the card is retrieved, reducing latency.
2-3)生命周期管理模块:对于卡片切换到后台或者被遮挡时,暂停卡片的刷新;以及卡片的升级或卸载场景下对卡片数据的更新和清理。2-3) Lifecycle management module: When a card is switched to the background or blocked, the card refresh is suspended; and the card data is updated and cleaned up in the card upgrade or uninstallation scenario.
2-4)对象管理模块:对卡片使用方的远程过程调用(remote procedure call,RPC)对象进行管理,用于使用方请求进行校验以及对卡片更新后的回调处理。2-4) Object management module: manages the remote procedure call (RPC) objects of the card user, which is used to verify the user's request and process callbacks after the card is updated.
2-5)通信适配层:负责与卡片使用方和卡片提供方进行RPC通信。2-5) Communication Adaptation Layer: responsible for RPC communication with card users and card providers.
(3)卡片提供方:用于提供卡片布局和样式的系统应用或第三方应用,控制卡片的控件布局以及控件点击事件等。其中,卡片提供方可以包括但不限于以下模块:(3) Card provider: a system application or third-party application that provides card layout and style, controls the card control layout and control click events, etc. The card provider may include but is not limited to the following modules:
3-1)卡片服务模块:开发者可以通过创建卡片的onCreateForm指令、更新卡片的onUpdateForm指令,以及删除卡片的onDeleteForm指令等,以使所开发的应用能够提供相应的卡片服务。3-1) Card service module: Developers can use the onCreateForm instruction to create a card, the onUpdateForm instruction to update a card, and the onDeleteForm instruction to delete a card to enable the developed application to provide corresponding card services.
3-2)实例管理模块:由卡片提供方开发者实现,负责对卡片管理服务分配的卡片实例进行持久化管理。3-2) Instance management module: implemented by the card provider developer, responsible for the persistent management of the card instances allocated by the card management service.
3-3)通信适配层:由软件开发工具包(software development kit,SDK)提供,负责与卡片管理服务通信,用于将卡片的更新数据主动推送到卡片管理服务中。3-3) Communication adaptation layer: provided by the software development kit (SDK), it is responsible for communicating with the card management service and is used to actively push the card's updated data to the card management service.
卡片使用方和卡片提供方可以不要求常驻运行,在卡片使用方需要添加卡片、删除卡片、或请求更新卡片等请求时,卡片管理服务会拉起卡片提供方获取卡片信息。Card users and card providers are not required to run resident services all the time. When a card user needs to add a card, delete a card, or request to update a card, the card management service will pull up the card provider to obtain the card information.
(4)数据提供方:用于提供卡片显示内容中包括的一些类型的具体数据的服务器、系统、或应用 等。例如,天气APP的卡片对应的卡片提供方为天气APP,对应的数据提供方可以为天气APP、还可以为专门提供天气数据的平台、系统或服务器等。又例如,第三方天气APP的卡片对应的数据提供方可以为手机上的天气APP;可以理解,天气APP可以理解为手机的系统应用。(4) Data provider: a server, system, or application that provides some type of specific data included in the card display content. For example, the card provider corresponding to the weather APP card is the weather APP, and the corresponding data provider can be the weather APP, or a platform, system or server that specifically provides weather data. For another example, the data provider corresponding to the card of a third-party weather APP can be the weather APP on the mobile phone; it can be understood that the weather APP can be understood as a system application of the mobile phone.
在一些场景中,卡片提供方和数据提供方可以不同,例如一个健康APP可以作为卡片提供方,提供可以包括步数功能的卡片,而该卡片对应的数据提供方为运动健康APP,此时卡片提供方和数据提供方不同。在另一些场景中,卡片提供方和数据提供方也可以相同,例如运动健康APP不仅可以提供卡片,也可以结合传感器等器件提供步数。In some scenarios, the card provider and the data provider may be different. For example, a health app can be a card provider and provide a card that can include a step count function, while the data provider corresponding to the card is a sports health app. In this case, the card provider and the data provider are different. In other scenarios, the card provider and the data provider may be the same. For example, a sports health app can not only provide cards, but also provide step counts in combination with sensors and other devices.
为了实现通过卡片、桌面widget等组件向用户提供最新的信息,需要对卡片上显示的信息进行及时地刷新。结合图1a所示的场景,卡片的信息刷新通常需要卡片管理服务触发拉起卡片提供方和数据提供方,然后接收到卡片提供方和数据提供方返回的更新信息之后,卡片管理服务返回给卡片使用方,由卡片使用方显示刷新后的信息。然而,卡片的每次刷新都需要拉起卡片提供方和数据提供方,并且随着电子设备上的卡片数量的增多,导致的内存占用问题和功耗问题也较为严重。In order to provide the latest information to users through components such as cards and desktop widgets, the information displayed on the card needs to be refreshed in a timely manner. In conjunction with the scenario shown in Figure 1a, the card information refresh usually requires the card management service to trigger the card provider and data provider to be pulled up, and then after receiving the updated information returned by the card provider and data provider, the card management service returns it to the card user, and the card user displays the refreshed information. However, each refresh of the card requires the card provider and data provider to be pulled up, and as the number of cards on the electronic device increases, the resulting memory usage and power consumption problems are also more serious.
有鉴于此,本申请实施例提供一种组件刷新方法。该方法通过设置组件数据代理功能,可以定义统一资源标识符(uniform resource identifier,URI)以及对应的数据格式,可以实现接收并缓存组件提供方和/或数据提供方发布更新数据,以及接受组件使用者的订阅,将更新的数据推送给组件使用者。通过该方法,可以实现组件使用者与组件提供方和/或数据提供方的生命周期解耦,实现不依赖数据源应用的自刷新,从而可以减少内存占用和降低功耗,提升电子设备的使用性能。In view of this, an embodiment of the present application provides a component refresh method. By setting a component data proxy function, the method can define a uniform resource identifier (URI) and a corresponding data format, and can receive and cache update data published by a component provider and/or a data provider, as well as accept subscriptions from component users and push updated data to component users. Through this method, the life cycle decoupling of component users and component providers and/or data providers can be achieved, and self-refresh that does not rely on data source applications can be achieved, thereby reducing memory usage and power consumption, and improving the performance of electronic devices.
本申请实施例中的技术方案可以应用于电子设备,电子设备可以是支持组件功能的任何设备。例如,电子设备可以是诸如手机、平板电脑、可穿戴设备(例如,手表、手环等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、智能家居设备(例如,智能电视,智能音箱等)等可以在桌面上显示组件的电子设备。可以理解的是,本申请实施例对电子设备的具体类型不作任何限制。The technical solution in the embodiments of the present application can be applied to electronic devices, and the electronic device can be any device that supports the component function. For example, the electronic device can be an electronic device such as a mobile phone, a tablet computer, a wearable device (e.g., a watch, a bracelet, etc.), a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device (e.g., a smart TV, a smart speaker, etc.) that can display components on a desktop. It is understandable that the embodiments of the present application do not impose any restrictions on the specific type of electronic device.
本申请实施例可以应用到的电子设备,示例性实施例包括但不限于搭载 或者其它操作系统的电子设备。电子设备例如可以为前述实施例中介绍到的终端设备。The electronic devices to which the embodiments of the present application can be applied include but are not limited to electronic devices equipped with Or electronic devices with other operating systems. The electronic device may be, for example, the terminal device introduced in the above embodiments.
图2示出了一种可能的电子设备的硬件结构示意图。其中,所述电子设备200包括:射频(radio frequency,RF)电路210、电源220、处理器230、存储器240、输入单元250、显示单元260、音频电路270、通信接口280、以及Wi-Fi模块290等部件。本领域技术人员可以理解,图2中示出的电子设备200的硬件结构并不构成对电子设备200的限定,本申请实施例提供的电子设备200可以包括比图示更多或更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图2中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。FIG2 shows a schematic diagram of the hardware structure of a possible electronic device. The electronic device 200 includes: a radio frequency (RF) circuit 210, a power supply 220, a processor 230, a memory 240, an input unit 250, a display unit 260, an audio circuit 270, a communication interface 280, and a Wi-Fi module 290. It can be understood by those skilled in the art that the hardware structure of the electronic device 200 shown in FIG2 does not constitute a limitation on the electronic device 200. The electronic device 200 provided in the embodiment of the present application may include more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in FIG2 can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application-specific integrated circuits.
下面结合图2对所述电子设备200的各个构成部件进行具体的介绍:The following is a detailed introduction to the various components of the electronic device 200 in conjunction with FIG. 2 :
所述RF电路210可用于通信或通话过程中,数据的接收和发送。特别地,所述RF电路210在接收到基站的下行数据后,发送给所述处理器230处理;另外,将待发送的上行数据发送给基站。通常,所述RF电路210包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。The RF circuit 210 can be used for receiving and sending data during communication or calls. In particular, after receiving downlink data from the base station, the RF circuit 210 sends it to the processor 230 for processing; in addition, the uplink data to be sent is sent to the base station. Generally, the RF circuit 210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc.
此外,RF电路210还可以通过无线通信网络和其他设备进行通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(global system of mobile communication,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、长期演进(long term evolution,LTE)、电子邮件、短消息服务(short messaging service,SMS)等。In addition, the RF circuit 210 can also communicate with other devices through a wireless communication network. The wireless communication can use any communication standard or protocol, including but not limited to global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
Wi-Fi技术属于短距离无线传输技术,所述电子设备200通过Wi-Fi模块290可以连接访问接入点(access point,AP),从而实现数据网络的访问。所述Wi-Fi模块290可用于通信过程中,数据的接收和发送。本申请实施例中,当电子设备200为平板电脑时,平板电脑可通过Wi-Fi模块290与其他电子设备同步数据等,例如平板电脑可以从手机中获取到用户最新的步数,以可以在平板电脑上的运动健康 APP的组件上显示更符合用户实际步数的信息。Wi-Fi technology is a short-range wireless transmission technology. The electronic device 200 can connect to an access point (AP) through a Wi-Fi module 290 to access the data network. The Wi-Fi module 290 can be used to receive and send data during the communication process. In the embodiment of the present application, when the electronic device 200 is a tablet computer, the tablet computer can synchronize data with other electronic devices through the Wi-Fi module 290. For example, the tablet computer can obtain the user's latest step count from the mobile phone, so that the sports health information can be displayed on the tablet computer. The APP components display information that is more consistent with the user’s actual step count.
所述电子设备200可以通过所述通信接口280与其他设备实现物理连接。可选的,所述通信接口280与所述其他设备的通信接口通过电缆连接,实现所述电子设备200和其他设备之间的数据传输。The electronic device 200 can be physically connected to other devices through the communication interface 280. Optionally, the communication interface 280 is connected to the communication interface of the other device through a cable to achieve data transmission between the electronic device 200 and the other device.
所述电子设备200还能够实现通信业务,与其他电子设备实现交互,因此所述电子设备200需要具有数据传输功能,即所述电子设备200内部需要包含通信模块。虽然图2示出了所述RF电路210、所述Wi-Fi模块290、和所述通信接口280等通信模块,但是可以理解的是,所述电子设备200中存在上述部件中的至少一个或者其他用于实现通信的通信模块(如蓝牙模块),以进行数据传输。The electronic device 200 can also implement communication services and interact with other electronic devices, so the electronic device 200 needs to have a data transmission function, that is, the electronic device 200 needs to include a communication module. Although FIG. 2 shows communication modules such as the RF circuit 210, the Wi-Fi module 290, and the communication interface 280, it is understandable that the electronic device 200 has at least one of the above components or other communication modules (such as a Bluetooth module) for implementing communication to perform data transmission.
例如,当所述电子设备200为手机时,所述电子设备200可以包含所述RF电路210,还可以包含所述Wi-Fi模块290,或可以包含蓝牙模块(图2中未示出);当所述电子设备200为平板电脑时,所述电子设备200可以包含所述Wi-Fi模块,或可以包含蓝牙模块(图2中未示出);当所述电子设备200为智能家居设备时,所述电子设备200可以包含所述Wi-Fi模块290,或可以包含蓝牙模块(图2中未示出)。For example, when the electronic device 200 is a mobile phone, the electronic device 200 may include the RF circuit 210, and may also include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 2 ); when the electronic device 200 is a tablet computer, the electronic device 200 may include the Wi-Fi module, or may include a Bluetooth module (not shown in FIG. 2 ); when the electronic device 200 is a smart home device, the electronic device 200 may include the Wi-Fi module 290, or may include a Bluetooth module (not shown in FIG. 2 ).
所述存储器240可用于存储软件程序以及模块。所述处理器230通过运行存储在所述存储器240的软件程序以及模块,从而执行所述电子设备200的各种功能应用以及数据处理。可选的,所述存储器240可以主要包括存储程序区和存储数据区。其中,存储程序区可存储操作系统(主要包括内核层、系统层、应用程序框架层和应用程序层等各自对应的软件程序或模块)。The memory 240 can be used to store software programs and modules. The processor 230 executes various functional applications and data processing of the electronic device 200 by running the software programs and modules stored in the memory 240. Optionally, the memory 240 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system (mainly including software programs or modules corresponding to the kernel layer, system layer, application framework layer, and application layer, etc.).
此外,所述存储器240可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。本申请实施例中,所述存储器240可以存储组件提供方和/或数据提供方发布的数据,以供组件使用方进行组件刷新。In addition, the memory 240 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. In the embodiment of the present application, the memory 240 may store data published by a component provider and/or a data provider for component users to refresh the component.
所述输入单元250可用于接收用户输入的数字或字符信息等多种不同类型的数据对象的编辑操作,以及产生与所述电子设备200的用户设置以及功能控制有关的键信号输入。可选的,输入单元250可包括触控面板251以及其他输入设备252。The input unit 250 can be used to receive editing operations of various types of data objects such as digital or character information input by the user, and generate key signal input related to user settings and function control of the electronic device 200. Optionally, the input unit 250 may include a touch panel 251 and other input devices 252.
其中,所述触控面板251,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在所述触控面板251上或在所述触控面板251附近的操作),并根据预先设定的程序驱动相应的连接装置。本申请实施例中,所述触控面板251可以收集用户在其上或附近的用户操作;例如,当电子设备200为手机,所述用户操作可用于用户在手机界面上查看、新增、变更或删除组件等。The touch panel 251, also called a touch screen, can collect user touch operations on or near it (such as operations performed by a user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 251), and drive corresponding connection devices according to a pre-set program. In the embodiment of the present application, the touch panel 251 can collect user operations on or near it; for example, when the electronic device 200 is a mobile phone, the user operations can be used for the user to view, add, change, or delete components on the mobile phone interface.
可选的,所述其他输入设备252可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Optionally, the other input devices 252 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, etc.
所述显示单元260可用于显示由用户输入的信息或提供给用户的信息以及所述电子设备200的各种菜单。所述显示单元260即为所述电子设备200的显示系统,用于呈现界面,实现人机交互。所述显示单元260可以包括显示面板261。可选的,所述显示面板261可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)等形式来配置。本申请实施例中,所述显示单元260可用于显示包括组件的桌面界面、或负一屏界面等,以及还可用于显示组件刷新后的信息等。The display unit 260 can be used to display information input by the user or information provided to the user and various menus of the electronic device 200. The display unit 260 is the display system of the electronic device 200, which is used to present an interface and realize human-computer interaction. The display unit 260 may include a display panel 261. Optionally, the display panel 261 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. In an embodiment of the present application, the display unit 260 can be used to display a desktop interface including components, or a negative one-screen interface, etc., and can also be used to display information after a component is refreshed, etc.
所述处理器230是所述电子设备200的控制中心,利用各种接口和线路连接各个部件,通过运行或执行存储在所述存储器240内的软件程序和/或模块,以及调用存储在所述存储器240内的数据,执行所述电子设备200的各种功能和处理数据,从而可实现基于所述电子设备200的多种业务。本申请实施例中,处理器230可用来实现本申请实施例提供的方法。The processor 230 is the control center of the electronic device 200, and uses various interfaces and lines to connect various components, and executes various functions and processes data of the electronic device 200 by running or executing software programs and/or modules stored in the memory 240, and calling data stored in the memory 240, so as to realize various services based on the electronic device 200. In the embodiment of the present application, the processor 230 can be used to implement the method provided in the embodiment of the present application.
所述电子设备200还包括用于给各个部件供电的电源220(比如电池)。可选的,所述电源220可以通过电源管理系统与所述处理器230逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The electronic device 200 also includes a power supply 220 (such as a battery) for supplying power to various components. Optionally, the power supply 220 can be logically connected to the processor 230 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
如图2所示,电子设备200还包括音频电路270、麦克风271和扬声器272,可提供用户与电子设备200之间的音频接口。音频电路270可用于将音频数据转换为扬声器272能够识别的信号,并将信号传输到扬声器272,由扬声器272转换为声音信号输出。麦克风271用于收集外部的声音信号(如人说话的声音、或者其它声音等),并将收集的外部的声音信号转换为音频电路270能够识别的信号,发送给音频电路270。音频电路270还可用于将麦克风271发送的信号转换为音频数据,再将音频数据输出至RF电路210以发送给比如另一电子设备,或者将音频数据输出至存储器240以便后续进一步处理。 As shown in FIG2 , the electronic device 200 further includes an audio circuit 270, a microphone 271 and a speaker 272, which can provide an audio interface between the user and the electronic device 200. The audio circuit 270 can be used to convert audio data into a signal that can be recognized by the speaker 272, and transmit the signal to the speaker 272, which is converted into a sound signal for output by the speaker 272. The microphone 271 is used to collect external sound signals (such as the sound of a person speaking, or other sounds, etc.), and convert the collected external sound signals into signals that can be recognized by the audio circuit 270, and send them to the audio circuit 270. The audio circuit 270 can also be used to convert the signal sent by the microphone 271 into audio data, and then output the audio data to the RF circuit 210 to send it to, for example, another electronic device, or output the audio data to the memory 240 for subsequent further processing.
尽管未示出,所述电子设备200还可以包括摄像头、至少一种传感器等,在此不再赘述。至少一种传感器可以包含但不限于压力传感器、气压传感器、加速度传感器、距离传感器、指纹传感器、触摸传感器、温度传感器等。Although not shown, the electronic device 200 may also include a camera, at least one sensor, etc., which will not be described in detail herein. The at least one sensor may include but is not limited to a pressure sensor, an air pressure sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, etc.
本申请实施例涉及的操作系统(operating system,OS),是运行在电子设备200上的最基本的系统软件。电子设备200的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以采用分层架构的操作系统为例,示例性说明电子设备200的软件结构。The operating system (OS) involved in the embodiment of the present application is the most basic system software running on the electronic device 200. The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an operating system adopting a layered architecture as an example to illustrate the software structure of the electronic device 200.
图3为本申请实施例提供的一种电子设备的软件结构框图。如图3所示,电子设备的软件结构可以是分层架构,例如可以将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将操作系统分为五层,从上至下分别为应用程序层,应用程序框架层(framework,FWK),运行时和系统库,内核层,以及硬件层。FIG3 is a block diagram of the software structure of an electronic device provided in an embodiment of the present application. As shown in FIG3, the software structure of the electronic device can be a layered architecture, for example, the software can be divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (framework, FWK), the runtime and system library, the kernel layer, and the hardware layer.
应用程序层可以包括一系列应用程序包。如图3所示,应用程序层可以包括相机、设置、皮肤模块、用户界面(user interface,UI)、第三方应用程序等。其中,第三方应用程序例如可以包括无线局域网(wireless local area network,WLAN)、音乐、通话、蓝牙、视频等。The application layer may include a series of application packages. As shown in FIG3 , the application layer may include camera, settings, skin module, user interface (UI), third-party applications, etc. Among them, third-party applications may include, for example, wireless local area network (WLAN), music, calls, Bluetooth, video, etc.
一种可能的实现方式中,应用程序可以使用java语言开发,通过调用应用程序框架层所提供的应用程序编程接口(application programming interface,API)来完成,开发者可以通过应用程序框架层来与操作系统的底层(例如硬件层、内核层等)进行交互,开发自己的应用程序。该应用程序框架层主要是操作系统的一系列的服务和管理系统。In one possible implementation, applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer. Developers can interact with the underlying layers of the operating system (such as the hardware layer, kernel layer, etc.) through the application framework layer to develop their own applications. The application framework layer is mainly a series of services and management systems for the operating system.
应用程序框架层为应用程序层的应用程序提供应用编程接口和编程框架。应用程序框架层包括一些预定义函数。如图3所示,应用程序框架层可以包括活动管理器,窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。The application framework layer provides an application programming interface and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
活动管理器用于管理各个应用程序生命周期并提供常用的导航回退功能,为所有程序的窗口提供交互的接口。The activity manager is used to manage the life cycle of each application and provide common navigation back functions, providing an interactive interface for all program windows.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
运行时包括核心库和虚拟机。运行时负责操作系统的调度和管理。The runtime includes the core library and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是操作系统的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The core library consists of two parts: one is the function that the Java language needs to call, and the other is the core library of the operating system. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体框架(media framework),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。The system library can include multiple functional modules, such as surface manager, media framework, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了二维和3D图层的融合。The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
媒体框架支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体框架可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media framework can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
二维图形引擎是二维绘图的绘图引擎。 A 2D graphics engine is a drawing engine for 2D drawings.
在一些实施例中,三维图形处理库可以用于绘制三维的运动轨迹图像,二维图形引擎可以用于绘制二维的运动轨迹图像。In some embodiments, a three-dimensional graphics processing library may be used to draw a three-dimensional motion trajectory image, and a two-dimensional graphics engine may be used to draw a two-dimensional motion trajectory image.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
硬件层可以包括各类传感器,例如加速度传感器、重力传感器、触摸传感器等。The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, touch sensors, etc.
通常电子设备200可以同时运行多个应用程序。较为简单的,一个应用程序可以对应一个进程,较为复杂的,一个应用程序可以对应多个进程。每个进程具备一个进程号(进程ID)。Usually, the electronic device 200 can run multiple applications at the same time. In a simpler case, one application can correspond to one process, and in a more complex case, one application can correspond to multiple processes. Each process has a process number (process ID).
应理解,本申请实施例中“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。It should be understood that in the embodiments of the present application, "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple. "Multiple" refers to two or more. "And/or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the previous and next associated objects are in an "or" relationship.
另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In addition, it should be understood that, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
应理解,电子设备的硬件结构可以如图2所示,软件系统架构可以如图3所示,其中,电子设备中的软件系统架构对应的软件程序和/或模块可以存储在存储器240中,处理器230可以运行存储器240中存储的软件程序和应用,以执行本申请实施例提供的一种组件刷新方法的流程。It should be understood that the hardware structure of the electronic device can be as shown in Figure 2, and the software system architecture can be as shown in Figure 3, wherein the software programs and/or modules corresponding to the software system architecture in the electronic device can be stored in the memory 240, and the processor 230 can run the software programs and applications stored in the memory 240 to execute the process of a component refresh method provided in an embodiment of the present application.
为了便于理解本申请提供的一种组件刷新方法,以下结合图4至图7中所示的内容,对采用本申请提供的方法的实现过程进行介绍。本申请实施例适用于在电子设备的桌面上显示组件的场景中;其中,组件例如可以为服务卡片、桌面widget等中需要进行数据刷新的组件,可用于在电子设备的一些显示界面上为用户展示一些关心的服务或内容。需要说明的是,本申请实施例不限定组件的样式、类型、显示位置等;以卡片为例,卡片的样式可以为1×2样式、2×2样式,卡片的颜色可以为蓝色、红色等。In order to facilitate understanding of a component refresh method provided by the present application, the implementation process of the method provided by the present application is introduced below in combination with the contents shown in Figures 4 to 7. The embodiment of the present application is applicable to the scenario where components are displayed on the desktop of an electronic device; wherein the components may be, for example, components in service cards, desktop widgets, etc. that require data refresh, and may be used to display some services or content of concern to users on some display interfaces of electronic devices. It should be noted that the embodiment of the present application does not limit the style, type, display position, etc. of the components; taking cards as an example, the style of the cards may be 1×2 style, 2×2 style, and the color of the cards may be blue, red, etc.
一种可能的实施例中,参阅图4,为本申请实施例提供的一种组件刷新方法的场景示意图。以下实施例中以服务卡片(可简称为“卡片”)作为示例,该场景可以包括:卡片使用方401、卡片管理服务402、卡片数据代理403、卡片提供方404A和数据提供方404B。图4中的卡片使用方401、卡片管理服务402、卡片提供方404A和数据提供方404B。示例性的,卡片使用方401可基于卡片的刷新策略启动定时任务周期性触发卡片的刷新;卡片管理服务402响应于卡片使用方401的刷新请求,可以向卡片数据代理403进行数据订阅或数据查询;卡片提供方404A和/或数据提供方404B可向卡片数据代理403进行数据发布;卡片管理服务402接收到卡片数据代理403的返回数据之后,可以继续向卡片使用方401返回数据。从图4中可以看出,本申请实施例中还可提供卡片数据代理403,卡片数据代理403可用于提供但不限于以下能力:In a possible embodiment, refer to FIG4, which is a schematic diagram of a scenario of a component refresh method provided in an embodiment of the present application. In the following embodiments, a service card (referred to as "card") is used as an example, and the scenario may include: a card user 401, a card management service 402, a card data agent 403, a card provider 404A, and a data provider 404B. The card user 401, the card management service 402, the card provider 404A, and the data provider 404B in FIG4. Exemplarily, the card user 401 may start a timed task based on the card refresh strategy to periodically trigger the card refresh; the card management service 402 may subscribe to or query data from the card data agent 403 in response to the refresh request of the card user 401; the card provider 404A and/or the data provider 404B may publish data to the card data agent 403; after the card management service 402 receives the return data from the card data agent 403, it may continue to return data to the card user 401. As can be seen from FIG. 4 , in the embodiment of the present application, a card data agent 403 may also be provided, and the card data agent 403 may be used to provide but not limited to the following capabilities:
(1)定义统一资源标识符(uniform resource identifier,URI)以及对应的数据格式。在一些可能的实施例中,卡片数据代理403通过定义URI以及对应的数据格式,可以实现多种类型的卡片的代理。例如,可以定义天气APP的卡片的URI,以及天气APP对应的天气数据格式;也可以定义日历APP的卡片的URI,以及日历APP对应的日期数据格式;还可以定义运动健康APP的卡片的URI,以及运动健康APP对应的步数数据格式等。这样,卡片管理服务402可以基于需要订阅的数据的URI,向卡片数据代理403进行数据订阅;以及,卡片提供方404A和/或数据提供方404B可以采用定义的URI以及对应的数据格式,将更新数据发布到卡片数据代理403中。(1) Define a uniform resource identifier (URI) and a corresponding data format. In some possible embodiments, the card data agent 403 can implement agents for various types of cards by defining URIs and corresponding data formats. For example, the URI of a card for a weather app and the weather data format corresponding to the weather app can be defined; the URI of a card for a calendar app and the date data format corresponding to the calendar app can also be defined; the URI of a card for a sports and health app and the step data format corresponding to the sports and health app can also be defined. In this way, the card management service 402 can subscribe to data from the card data agent 403 based on the URI of the data to be subscribed; and the card provider 404A and/or the data provider 404B can use the defined URI and the corresponding data format to publish updated data to the card data agent 403.
在一些可能的实施例中,数据通常采用以键值对存储数据的数据库(key-value)的形式;其中,key可以理解为URI,例如运动健康APP的数据,value可以理解为key对应的具体数据,例如可以为json(一种数据格式)数据,例如步数(stepcount:9999)、日期(date:05/05)、健康状况(healthstate:正常)。示例性的,卡片管理服务402可以向卡片数据代理403传输一个URI,以及通过回调函数(callback)来接收回调的数据;以卡片提供方404A为例,卡片提供方404A在发布数据时,可以传输一个URI以及URI对应的具体数据,从而可以实现卡片数据代理403存储卡片提供方404A发布的数据,以供卡片管理服务402订阅。In some possible embodiments, data is usually in the form of a database (key-value) that stores data in key-value pairs; wherein key can be understood as a URI, such as the data of a sports health APP, and value can be understood as the specific data corresponding to the key, such as json (a data format) data, such as the number of steps (stepcount: 9999), date (date: 05/05), and health state (healthstate: normal). Exemplarily, the card management service 402 can transmit a URI to the card data agent 403, and receive the callback data through a callback function (callback); taking the card provider 404A as an example, when publishing data, the card provider 404A can transmit a URI and the specific data corresponding to the URI, so that the card data agent 403 can store the data published by the card provider 404A for subscription by the card management service 402.
(2)提供标准化的SDK接口;其中SDK接口可用于数据发布的订阅、查询访问。参阅图1a所示的模块示意图,卡片数据代理403也可以提供通信适配层;通信适配层可由SDK提供,负责与卡片提供方404A和/或数据提供方404B通信,用于接收卡片提供方404A和/或数据提供方404B发布的数据; 还可负责与卡片管理服务402通信,用于接收卡片管理服务402的数据订阅,并将刷新的数据发送给卡片管理服务402。(2) Provide a standardized SDK interface; the SDK interface can be used for subscription, query and access of data publishing. Referring to the module diagram shown in FIG. 1a , the card data agent 403 can also provide a communication adaptation layer; the communication adaptation layer can be provided by the SDK and is responsible for communicating with the card provider 404A and/or the data provider 404B to receive the data published by the card provider 404A and/or the data provider 404B; It can also be responsible for communicating with the card management service 402 to receive data subscriptions from the card management service 402 and send refreshed data to the card management service 402 .
(3)提供数据存储。一些可能的实施例中,卡片数据代理403还可以提供集中式存储、或分布式存储等。例如,卡片数据代理403可存储以下数据:运动步数、电量(可包括但不限于本机设备、分布式设备)、天气、心率、日历等。(3) Providing data storage. In some possible embodiments, the card data agent 403 may also provide centralized storage or distributed storage. For example, the card data agent 403 may store the following data: exercise steps, power (including but not limited to local devices and distributed devices), weather, heart rate, calendar, etc.
(4)提供必要的数据访问权限检查能力。在一些实施例中,卡片数据代理403可以允许部分经过验证的数据提供方404B发布数据,从而可以保障卡片的数据刷新的安全性和准确性。(4) Providing necessary data access permission checking capabilities. In some embodiments, the card data agent 403 may allow some verified data providers 404B to publish data, thereby ensuring the security and accuracy of card data refresh.
其中,卡片使用方401可以理解为卡片的宿主应用,例如可以为桌面APP或桌面进程、负一屏APP或负一屏进程等。Among them, the card user 401 can be understood as the host application of the card, for example, it can be a desktop APP or desktop process, a negative one screen APP or a negative one screen process, etc.
在一些可能的实施例中,卡片使用方401在创建卡片之后,可以触发通过卡片管理服务402向卡片数据代理403发送订阅请求。一种可选的实施例中,订阅请求中可以包括卡片标识,所述卡片标识可用于卡片数据代理403基于该卡片标识向卡片使用方401返回订阅的卡片数据。另一种可选的实施例中,订阅请求中可以包括卡片标识和订阅的数据类型,所述数据类型可用于指示卡片使用方401订阅的卡片的具体数据类型,例如步数(stepcount)数据类型、日期(date)数据类型等。In some possible embodiments, after creating a card, the card user 401 may trigger sending a subscription request to the card data agent 403 through the card management service 402. In an optional embodiment, the subscription request may include a card identifier, and the card identifier may be used by the card data agent 403 to return the subscribed card data to the card user 401 based on the card identifier. In another optional embodiment, the subscription request may include a card identifier and a subscribed data type, and the data type may be used to indicate the specific data type of the card subscribed by the card user 401, such as a step count data type, a date data type, etc.
另一种可能的实施例中,参阅图5,为本申请实施例提供的一种组件刷新方法的另一场景示意图。该场景可以包括图4中的卡片使用方401、卡片提供方404A和数据提供方404B;以及该场景中的卡片数据代理403可以集成到卡片管理服务中,例如可称为卡片管理服务402’。可以理解,卡片管理服务402’不仅可以实现图4介绍到的卡片管理服务402的逻辑功能,还可以实现图4介绍到的卡片数据代理403的逻辑功能。示例性的,卡片使用方401可基于卡片的刷新策略启动定时任务周期性触发卡片的刷新;卡片管理服务402’可以接收卡片使用方401的刷新请求,响应于该刷新请求,进行本地数据订阅和查询。卡片提供方404A和/或数据提供方404B可向卡片管理服务402’进行数据发布;卡片管理服务402’检测到本地缓存中存在新发布的数据后,可向卡片使用方401返回数据。其中,卡片管理服务402’的逻辑功能可参阅图4介绍的卡片管理服务402和卡片数据代理403的逻辑功能,在此不再赘述。In another possible embodiment, refer to FIG. 5, which is another scenario diagram of a component refresh method provided by an embodiment of the present application. The scenario may include the card user 401, the card provider 404A and the data provider 404B in FIG. 4; and the card data agent 403 in the scenario may be integrated into the card management service, for example, may be referred to as the card management service 402'. It can be understood that the card management service 402' can not only implement the logical functions of the card management service 402 introduced in FIG. 4, but also implement the logical functions of the card data agent 403 introduced in FIG. 4. Exemplarily, the card user 401 may start a timed task based on the card refresh strategy to periodically trigger the card refresh; the card management service 402' may receive the refresh request of the card user 401, and in response to the refresh request, perform local data subscription and query. The card provider 404A and/or the data provider 404B may publish data to the card management service 402'; after the card management service 402' detects that there is newly published data in the local cache, it may return data to the card user 401. Among them, the logical functions of the card management service 402' can refer to the logical functions of the card management service 402 and the card data agent 403 introduced in Figure 4, which will not be repeated here.
以图4介绍的场景作为示例,图6为本申请实施例提供的一种组件刷新方法的流程示意图。该流程可以包括以下步骤:Taking the scenario described in FIG. 4 as an example, FIG. 6 is a flow chart of a component refresh method provided in an embodiment of the present application. The flow may include the following steps:
步骤601a、运动健康发布数据。在一些可能的实施例中,运动健康APP可以作为运动健康APP对应的卡片的数据提供方。本申请实施例中,运动健康APP可以响应于步数的变更,向卡片数据代理及时地发布最新的步数。Step 601a, sports health publishes data. In some possible embodiments, the sports health APP can be used as a data provider for the card corresponding to the sports health APP. In the embodiment of the present application, the sports health APP can respond to the change of the number of steps and publish the latest number of steps to the card data agent in a timely manner.
步骤601b、电量管理发布当前系统电量。在一些可能的实施例中,电量管理的数据源可以作为电量管理的数据源对应的卡片的数据提供方。本申请实施例中,电量管理的数据源例如可以为电子设备的操作系统,电量管理的数据源可以响应于电量的变更,向卡片数据代理及时地发布当前系统电量。Step 601b, the power management publishes the current system power. In some possible embodiments, the data source of the power management can be the data provider of the card corresponding to the data source of the power management. In the embodiment of the present application, the data source of the power management can be, for example, the operating system of the electronic device, and the data source of the power management can publish the current system power to the card data agent in a timely manner in response to the change of power.
可以理解,卡片数据代理通过步骤601a或步骤601b接收到数据提供方发布的数据之后,可以对数据进行缓存。It can be understood that after the card data agent receives the data published by the data provider through step 601a or step 601b, it can cache the data.
步骤602、卡片提供方设置刷新策略。在一些可能的实施例中,卡片提供方可以根据数据类型等设置刷新策略;以及可以按照刷新策略进行数据发布。例如,刷新策略可以为按周期或按时间等,例如日历APP对应的卡片可以按照时间点设置刷新策略,在每天凌晨00:00时更新日历APP对应的卡片。又例如,刷新策略还可以为按照触发事件,触发事件例如可以包括但不限于:用户点击卡片的操作指令、桌面进程显示包括卡片的桌面界面的触发事件等。Step 602, the card provider sets a refresh policy. In some possible embodiments, the card provider can set a refresh policy based on the data type, etc.; and can publish data according to the refresh policy. For example, the refresh policy can be based on a cycle or time, etc. For example, the card corresponding to the calendar APP can set a refresh policy according to a time point, and update the card corresponding to the calendar APP at 00:00 every morning. For another example, the refresh policy can also be based on a trigger event, and the trigger event can include but is not limited to: the user clicks on the card's operation instruction, the desktop process displays a trigger event including the desktop interface of the card, etc.
步骤603、卡片数据代理检测到满足刷新策略。在一些可能的实施例中,桌面进程在检测到用户在桌面进程中添加卡片的操作,响应于该操作,可以向卡片数据代理进行数据订阅。其中,桌面进程可以根据卡片的具体类型,向卡片数据代理进行数据订阅时携带该卡片对应的URI,例如该卡片为运动健康APP的卡片,则URI可以为运动健康APP的数据,这样可以获取运动健康APP定义的数据格式对应的至少一种数据,比如可以包括但不限于:“stepcount:9999”、“date:05/05”、“healthstate:正常”。Step 603, the card data agent detects that the refresh policy is satisfied. In some possible embodiments, when the desktop process detects the user's operation of adding a card in the desktop process, in response to the operation, it can subscribe to data from the card data agent. Among them, the desktop process can carry the URI corresponding to the card when subscribing to data from the card data agent according to the specific type of the card. For example, if the card is a card of a sports health APP, the URI can be the data of the sports health APP, so that at least one data corresponding to the data format defined by the sports health APP can be obtained, such as but not limited to: "stepcount: 9999", "date: 05/05", "healthstate: normal".
在另一些可能的实施例中,卡片数据代理也可以在接收到卡片提供方和/或数据提供方发布的数据之后,基于卡片使用方对该数据的订阅事件,将接收到的发布数据返回给订阅该数据的卡片使用方。 In some other possible embodiments, after receiving the data published by the card provider and/or data provider, the card data agent may also return the received published data to the card user who subscribes to the data based on the card user's subscription event to the data.
步骤604a、卡片数据代理向桌面进程刷新步数。Step 604a: The card data agent refreshes the number of steps to the desktop process.
步骤604b、卡片数据代理向桌面进程刷新当前系统电量。Step 604b: The card data agent refreshes the current system power to the desktop process.
步骤605、桌面进程更新卡片。Step 605: The desktop process updates the card.
通过本申请实施例提供的方法,可以解决卡片刷新必须要拉起卡片提供方进程的问题,从而可以减少由于卡片刷新产生的功耗和内存问题。并且,该方法可以实现卡片使用方和卡片提供方的生命周期解耦,从而可以实现不依赖数据提供方的自刷新。以及,该方法通过提供卡片数据代理通过卡片数据代理可以实现卡片提供方无需集成其他数据提供方的SDK,可以有卡片数据代理实现卡片提供方和数据提供方的对接,从而可以降低开发复杂度。The method provided by the embodiment of the present application can solve the problem that the card provider process must be started for card refresh, thereby reducing the power consumption and memory problems caused by card refresh. In addition, the method can achieve the decoupling of the life cycle of the card user and the card provider, thereby achieving self-refresh without relying on the data provider. In addition, the method can achieve the card provider without integrating the SDK of other data providers by providing a card data agent, and the card data agent can achieve the connection between the card provider and the data provider, thereby reducing the complexity of development.
在一种可能的实施方式中,图7为本申请实施例提供的一种组件刷新方法的另一种流程示意图。该方法可以应用于包括组件的电子设备中,流程可以包括以下步骤:In a possible implementation, FIG7 is another flow chart of a component refresh method provided in an embodiment of the present application. The method can be applied to an electronic device including a component, and the process may include the following steps:
步骤701、接收所述组件的数据提供方发布的组件数据。Step 701: Receive component data published by a data provider of the component.
在一种可选的实施例中,电子设备中可以包括组件数据代理和组件管理服务的功能单元;在此场景下,组件数据代理可以负责接收所述组件数据。In an optional embodiment, the electronic device may include a component data agent and a component management service functional unit; in this scenario, the component data agent may be responsible for receiving the component data.
在另一种可选的实施例中,电子设备中可以包括组件数据代理和组件管理服务集成在一起的功能单元;在此场景下,可以由集成的功能单元负责接收所述组件数据。In another optional embodiment, the electronic device may include a functional unit integrating a component data agent and a component management service; in this scenario, the integrated functional unit may be responsible for receiving the component data.
步骤702、响应于对所述组件数据的订阅事件,将所述组件数据传输到组件使用方,所述组件使用方用于将所述组件数据刷新显示在所述组件中;其中,所述订阅事件用于指示所述组件使用方对所述组件数据的刷新进行订阅。Step 702: In response to a subscription event to the component data, the component data is transmitted to a component user, and the component user is used to refresh the component data and display it in the component; wherein the subscription event is used to instruct the component user to subscribe to the refresh of the component data.
在一种可选的实施例中,电子设备中包括组件数据代理和组件管理服务的功能单元的场景下,组件使用方可以通过组件管理服务向组件数据代理进行组件数据的订阅。这样,组件数据代理可以将数据提供方发送的组件数据通过组件管理服务返回给组件使用方。示例性的,组件使用方在发送订阅请求时可以指示组件标识,或者可以指示组件标识和订阅的数据类型;同理,数据提供方在进行数据发布时,可以指示组件标识,或者可以指示组件标识和组件包括的数据类型。因此,卡片数据代理可以基于组件标识,或者基于组件标识和数据类型,实现准确的组件刷新。In an optional embodiment, in a scenario where the electronic device includes a component data proxy and a component management service functional unit, the component user can subscribe to the component data from the component data proxy through the component management service. In this way, the component data proxy can return the component data sent by the data provider to the component user through the component management service. Exemplarily, when sending a subscription request, the component user can indicate the component ID, or can indicate the component ID and the type of data subscribed; similarly, when publishing data, the data provider can indicate the component ID, or can indicate the component ID and the type of data included in the component. Therefore, the card data proxy can achieve accurate component refresh based on the component ID, or based on the component ID and the data type.
在另一种可选的实施例中,电子设备中包括组件数据代理和组件管理服务集成在一起的功能单元的场景下,组件使用方可以向集成的功能单元进行组件数据的订阅。In another optional embodiment, in a scenario where the electronic device includes a functional unit that integrates a component data proxy and a component management service, a component user can subscribe to component data from the integrated functional unit.
基于以上实施例,本申请还提供一种电子设备,所述电子设备包括多个功能模块;所述多个功能模块相互作用,实现本申请实施例所描述的各方法中电子设备所执行的功能。所述多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且所述多个功能模块可以基于具体实现进行任意组合或分割。如执行图6所示实施例中电子设备执行的步骤601a至605;可以理解,图6中示出的卡片提供方、卡片数据代理为电子设备中的逻辑功能单元,可通过电子设备中的处理器实现,桌面进程、运动健康、电量管理等为电子设备中的应用程序,也可以通过电子设备中的处理器实现。或者,执行图7所示实施例中电子设备执行的步骤701至702。可以理解,电子设备中还可以包括卡片管理服务的逻辑功能单元,或者卡片管理服务与卡片数据代理集成的功能单元。Based on the above embodiments, the present application also provides an electronic device, which includes multiple functional modules; the multiple functional modules interact with each other to implement the functions performed by the electronic device in each method described in the embodiments of the present application. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation. For example, steps 601a to 605 performed by the electronic device in the embodiment shown in Figure 6 are executed; it can be understood that the card provider and card data agent shown in Figure 6 are logical functional units in the electronic device, which can be implemented by the processor in the electronic device, and the desktop process, sports health, power management, etc. are applications in the electronic device, which can also be implemented by the processor in the electronic device. Alternatively, steps 701 to 702 performed by the electronic device in the embodiment shown in Figure 7 are executed. It can be understood that the electronic device can also include a logical functional unit of a card management service, or a functional unit integrating a card management service and a card data agent.
基于以上实施例,本申请还提供一种电子设备,该电子设备包括至少一个处理器和至少一个存储器,所述至少一个存储器中存储计算机程序指令,所述电子设备运行时,所述至少一个处理器执行本申请实施例所描述的各方法中电子设备所执行的功能。如执行图6所示实施例中电子设备执行的步骤601a至605;可以理解,图6中示出的卡片提供方、卡片数据代理为电子设备中的逻辑功能单元,可通过电子设备中的处理器实现,桌面进程、运动健康、电量管理等为电子设备中的应用程序,也可以通过电子设备中的处理器实现。或者,执行图7所示实施例中电子设备执行的步骤701至702。可以理解,电子设备中还可以包括卡片管理服务的逻辑功能单元,或者卡片管理服务与卡片数据代理集成的功能单元。基于以上实施例,本申请还提供一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行本申请实施例所描述的各方法。Based on the above embodiments, the present application also provides an electronic device, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor performs the functions performed by the electronic device in each method described in the embodiments of the present application. For example, steps 601a to 605 performed by the electronic device in the embodiment shown in FIG. 6 are executed; it can be understood that the card provider and the card data agent shown in FIG. 6 are logical function units in the electronic device, which can be implemented by the processor in the electronic device, and the desktop process, sports health, power management, etc. are applications in the electronic device, which can also be implemented by the processor in the electronic device. Alternatively, steps 701 to 702 performed by the electronic device in the embodiment shown in FIG. 7 are executed. It can be understood that the electronic device can also include a logical function unit of a card management service, or a function unit integrating a card management service and a card data agent. Based on the above embodiments, the present application also provides a computer program product, which includes: a computer program (also referred to as a code, or an instruction), when the computer program is executed, the computer executes the methods described in the embodiments of the present application.
基于以上实施例,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序被计算机执行时,使得所述计算机执行本申请实施例所描述的各方法。Based on the above embodiments, the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the methods described in the embodiments of the present application.
基于以上实施例,本申请还提供了一种芯片,所述芯片用于读取存储器中存储的计算机程序,实现本申请实施例所描述的各方法。Based on the above embodiments, the present application further provides a chip, which is used to read a computer program stored in a memory to implement the methods described in the embodiments of the present application.
基于以上实施例,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机装置实现 本申请实施例所描述的各方法。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存该计算机装置必要的程序和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Based on the above embodiments, the present application provides a chip system, which includes a processor for supporting a computer device to implement The various methods described in the embodiments of the present application. In a possible design, the chip system also includes a memory, which is used to store the necessary programs and data of the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的保护范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims (11)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310603225.5 | 2023-05-26 | ||
| CN202310603225.5A CN119025295A (en) | 2023-05-26 | 2023-05-26 | Component refreshing method and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024244473A1 true WO2024244473A1 (en) | 2024-12-05 |
Family
ID=93537695
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/070925 Pending WO2024244473A1 (en) | 2023-05-26 | 2024-01-05 | Component refreshing method and electronic device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119025295A (en) |
| WO (1) | WO2024244473A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2017107851A1 (en) * | 2015-12-24 | 2017-06-29 | 阿里巴巴集团控股有限公司 | Method and device for releasing and updating desktop application component |
| US20180174229A1 (en) * | 2016-12-21 | 2018-06-21 | Wix.Com Ltd | Actionable widget cards |
| CN113721805A (en) * | 2021-08-23 | 2021-11-30 | 郑州时空隧道信息技术有限公司 | Express delivery small assembly and control method based on express delivery small assembly |
| CN115309470A (en) * | 2022-07-13 | 2022-11-08 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for loading widgets and storage medium |
| CN115756534A (en) * | 2022-11-10 | 2023-03-07 | 广东明创软件科技有限公司 | Card interface updating method and device, electronic equipment and storage medium |
-
2023
- 2023-05-26 CN CN202310603225.5A patent/CN119025295A/en active Pending
-
2024
- 2024-01-05 WO PCT/CN2024/070925 patent/WO2024244473A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2017107851A1 (en) * | 2015-12-24 | 2017-06-29 | 阿里巴巴集团控股有限公司 | Method and device for releasing and updating desktop application component |
| US20180174229A1 (en) * | 2016-12-21 | 2018-06-21 | Wix.Com Ltd | Actionable widget cards |
| CN113721805A (en) * | 2021-08-23 | 2021-11-30 | 郑州时空隧道信息技术有限公司 | Express delivery small assembly and control method based on express delivery small assembly |
| CN115309470A (en) * | 2022-07-13 | 2022-11-08 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for loading widgets and storage medium |
| CN115756534A (en) * | 2022-11-10 | 2023-03-07 | 广东明创软件科技有限公司 | Card interface updating method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119025295A (en) | 2024-11-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11703990B2 (en) | Animated visual cues indicating the availability of associated content | |
| CN113110941B (en) | Managing delivery of code and dependency data using application containers | |
| US20150035860A1 (en) | Buffers for display acceleration | |
| EP3683664A1 (en) | Icon display method, device, and system | |
| EP4492232A1 (en) | Workflow processing method and apparatus, and device, storage medium and program product | |
| CN117806516A (en) | A floating window display method and electronic device | |
| CN115454286A (en) | Application data processing method and device and terminal equipment | |
| CN114095610B (en) | A notification message processing method and computer-readable storage medium | |
| CN113391743B (en) | A display method and electronic device | |
| EP4160416A1 (en) | Device control method and device | |
| CN114443189A (en) | An image processing method and electronic device | |
| WO2025152449A1 (en) | Control center editing method and electronic device | |
| CN117707718B (en) | Process management method, electronic device and readable storage medium | |
| CN116095230B (en) | Application program recommendation method, terminal device and readable storage medium | |
| WO2024244473A1 (en) | Component refreshing method and electronic device | |
| CN112612633B (en) | Inter-process communication method, inter-process communication device, storage medium and terminal | |
| CN116449936A (en) | Information transmission method, device, storage medium and terminal equipment | |
| CN117724780B (en) | Information acquisition method | |
| CN117724825B (en) | Interface display method and electronic equipment | |
| CN117707719B (en) | Process management method, electronic device and readable storage medium | |
| CN112995246B (en) | Content acquisition method, system, user terminal and content server | |
| WO2025148347A1 (en) | Area-based screen refreshing method and electronic device | |
| WO2024104131A1 (en) | Method for gaining window focus in multi-window scenario, device and system | |
| WO2025152444A1 (en) | Web core-based thread scheduling method and electronic device | |
| WO2025157296A1 (en) | Task migration method and related apparatus |
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: 24813679 Country of ref document: EP Kind code of ref document: A1 |