Broadcast event processing method and electronic device
By configuring the event receiving status and matching frequency based on the business situation when the application is shut down through the event handling service, the power consumption problem caused by invalid restarts is solved, more efficient broadcast event processing is achieved, and the power consumption of electronic devices is reduced.
Patent Information
- Application Number
- PCT/CN2024/142452
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-21
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-27
AI Technical Summary
In the prior art, when electronic devices process broadcast events, invalid application restarts lead to increased power consumption, especially when the application terminates immediately after receiving an irrelevant broadcast event, resulting in unnecessary power waste.
The event handling service configures the application's event receiving state based on the business situation when the application is shut down. The application is only started when it is in an event-receiving state, and matching and frequency judgment are performed before sending broadcast events to reduce invalid start-ups.
It effectively reduces invalid application startups, lowers the power consumption of electronic devices, and improves battery efficiency.
Smart Images

Figure CN2024142452_27112025_PF_FP_ABST
Abstract
Description
Broadcast event processing method and electronic device
[0001] The present application claims priority to the Chinese patent application No. 202410641867.9, filed on May 21, 2024, and entitled "Broadcast event processing method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of terminal, and in particular, to a broadcast event processing method and an electronic device. BACKGROUND
[0003] At present, the operating system of an electronic device can generate broadcast events, such as lock screen, package uninstall, network change, language change, time zone change, and the like. These broadcast events can notify the system service or application of the electronic device that the corresponding event has occurred. The system service or application can process these broadcast events, such as performing a series of operations or implementing corresponding functions, and the like.
[0004] Generally, the configuration file of an application can save all broadcast events that the application can process. After receiving a certain broadcast event, if the configuration file of the application includes the broadcast event, the system service can launch the application so that the application processes the broadcast event.
[0005] However, this way of launching the application to process the broadcast event can cause a lot of invalid launches, thereby increasing the power consumption of the electronic device. For example, after launching the application, the application does not have tasks or businesses related to the broadcast event, so the application does not need to process the broadcast event. SUMMARY
[0006] The present application provides a broadcast event processing method and an electronic device, which can reduce the invalid launch of the application in the electronic device and reduce the power consumption of the electronic device.
[0007] To achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, a broadcast event processing method is provided. The method can be applied to an event processing service in an electronic device, and the electronic device further includes an application. In the method, the event processing service obtains a broadcast event generated in the electronic device and an application subscribing to the broadcast event. If the application is closed and the application is in a state of being able to receive an event, the event processing service launches the application, wherein the state of being able to receive an event is configured by the application according to the business running at the time of closing. Then, the event processing service sends the broadcast event to the application.
[0009] In the method, the application can configure a state of receiving events of the application according to a service running when the application is closed. After receiving the broadcast event, the event processing service can pull up the application only when the application subscribes to the broadcast event and is in the state of receiving events. In this way, whether to pull up the application can be determined according to the service of the application, so as to reduce invalid pulling up and reduce power consumption of the electronic device.
[0010] In an implementation of the first aspect, if there is a service running when the application is closed, the application is in the state of receiving events; and if there is no service running when the application is closed, the application is in the state of not receiving events.
[0011] In this implementation, it is considered that some broadcast events can trigger update of the service of the application. If there is a service running when the application is closed, in order to ensure update of the service, the application needs to be in the state of receiving events, so as to receive the broadcast event that can trigger the update of the service in time when the application is closed, and be pulled up in time and updated. If there is no service running when the application is closed, the application does not need to concern about the update of the service when the application is closed, and thus the application is in the state of not receiving events. In this way, the application will not receive any broadcast event when the application is closed, and will not be pulled up by the event processing service, so as to reduce some invalid pulling up and reduce power consumption of the electronic device.
[0012] In an implementation of the first aspect, if the application is closed and the application is in the state of receiving events, the event processing service pulls up the application, and the method can further include: the event processing service acquires a pulling frequency of the application, where the pulling frequency indicates a number of times that the application is pulled up in a unit time. Then, if the application is closed, the application is in the state of receiving events, and the number of times that the application is pulled up in the unit time does not exceed the pulling frequency, the event processing service can pull up the application.
[0013] In this implementation, the event processing service can further determine the pulling frequency on the basis of determining the state of receiving events of the application, so as to avoid that the application is pulled up too many times in the unit time, and also to reduce power consumption of the electronic device.
[0014] In an implementation of the first aspect, if the application is closed and the application is in the state of receiving events, the event processing service pulls up the application, and the method can further include: the event processing service acquires attribute information corresponding to the application, where the attribute information is configured by the application according to a service running when the application is closed, and the attribute information is used to indicate at least one broadcast event associated with the service. Then, if the application is closed, the application is in the state of receiving events, and the broadcast event matches the attribute information, the event processing service can pull up the application.
[0015] In this implementation, since the attribute information is configured according to the service running when the application is closed, the event processing service can determine, according to the attribute information, whether the received broadcast event is related to the service running when the application is closed. In addition, before the application receives the broadcast event, the event processing service has already determined, according to the attribute information, whether the broadcast event can be sent to the application, thereby reducing the process of the application determining by itself.
[0016] In an implementation of the first aspect, if the application is closed, the application is in a state of being able to receive events, and the broadcast event matches the attribute information, the event processing service pulls up the application, and the method can further include: the event processing service acquires a pull-up frequency of the application. Then, if the application is closed, the application is in a state of being able to receive events, the broadcast event matches the attribute information, and the number of times the application is pulled up in a unit of time does not exceed the pull-up frequency, the event processing service can pull up the application.
[0017] In this implementation, the event processing service can further determine the pull-up frequency based on the determination of the state of the application receiving events and whether the broadcast event matches the attribute information, thereby avoiding the number of times the application is pulled up in a unit of time being too many, and reducing the power consumption of the electronic device.
[0018] In an implementation of the first aspect, the broadcast event includes at least one of a screen-off event, a language change event, a time zone change event, a time system change event, a network state change event, and a data packet offloading event. For example, after the application receives these broadcast events, the application can update the corresponding service in response to the broadcast event.
[0019] In an implementation of the first aspect, the application is a calendar application, and the service is a card component service or a timed reminder service. In this implementation, the event processing service can send the broadcast event to the calendar application, so that the calendar application updates the card component service or the timed reminder service in response to the broadcast event.
[0020] In an implementation of the first aspect, the application is a network charging application, and the service is a data packet offloading monitoring service. In this implementation, the event processing service can send the broadcast event to the network charging application, so that the network charging application updates the data packet offloading service that needs to be monitored, such as adding a new data packet offloading event that needs to be monitored.
[0021] In a second aspect, a method for processing a broadcast event is provided. The method is applied to an application in an electronic device, and the electronic device further comprises an event processing service. In the method, the application configures a state of the application for receiving the event according to a service running when the application is closed. Then, if the application is in the state of receiving the event, the application is pulled up by the event processing service obtaining the broadcast event, and the application subscribes to the broadcast event. Next, the application can receive the broadcast event sent by the event processing service.
[0022] In the method, the application can configure the state of the application for receiving the event according to the service running when the application is closed. After receiving the broadcast event, the event processing service pulls up the application only if the application is in the state of receiving the event. In this way, the service of the application can be considered to determine whether to pull up the application, thereby reducing invalid pulling up and reducing power consumption of the electronic device.
[0023] In an implementation form of the second aspect, the application configures the state of the application for receiving the event according to the service running when the application is closed, which can specifically include: if there is a service running when the application is closed, the application configures the state of the application for receiving the event; and if there is no service running when the application is closed, the application configures the state of the application for not receiving the event.
[0024] In this implementation form, it is considered that some broadcast events can trigger update of the service of the application. If there is a service running when the application is closed, the application needs to be in the state of receiving the event in order to ensure update of the service, so as to receive the broadcast event triggering the update of the service when the application is closed, and be pulled up and updated in time. If there is no service running when the application is closed, the application does not need to concern about the update of the service when the application is closed, and thus the application is in the state of not receiving the event. In this way, the application will not receive any broadcast event when the application is closed, and will not be pulled up by the event processing service, thereby reducing invalid pulling up and reducing power consumption of the electronic device.
[0025] In an implementation form of the second aspect, after the application receives the broadcast event sent by the event processing service, the method further includes: if the broadcast event is associated with the service running when the application is closed, the application updates relevant data of the service in response to the broadcast event.
[0026] In this implementation, the event processing service judges the state of receiving events, and then sends the broadcast event to the application, and the application judges whether to respond to the broadcast event by itself. Since the application is set to the receivable state when the business is running in the closed state, the broadcast event sent by the event processing service after judgment has a high probability of being related to the business running in the closed state of the application, and thus this way can exclude some broadcast events irrelevant to the business running in the closed state of the application, and reduce the invalid pull of the application.
[0027] In an implementation of the second aspect, the method further includes: configuring, by the application, the attribute information of the application according to the business running in the closed state of the application, wherein the attribute information is used to indicate at least one broadcast event associated with the business; and if in the state of receiving events, the application is pulled by the event processing service obtaining the broadcast event, which can specifically include: if in the state of receiving events and the broadcast event matches the attribute information, the application is pulled by the event processing service obtaining the broadcast event.
[0028] In this implementation, since the attribute information is configured according to the business running in the closed state of the application, the event processing service can determine whether the received broadcast event is related to the business running in the closed state of the application according to the attribute information. And before the application receives the broadcast event, the event processing service has determined whether the broadcast event can be sent to the application according to the attribute information, thereby reducing the process of the application judging by itself.
[0029] In an implementation of the second aspect, after the application receives the broadcast event sent by the event processing service, the method further includes: updating, by the application, the related data of the business in response to the broadcast event.
[0030] In this implementation, before the application receives the broadcast event, the event processing service has determined whether the broadcast event can be sent to the application according to the attribute information, thereby reducing the process of the application judging by itself. And the event processing service can further accurately determine whether the application can be pulled by judging the state of receiving events of the application and the broadcast event, thereby further reducing the invalid pull of the application.
[0031] In an implementation of the second aspect, if in the state of receiving events, the application is pulled by the event processing service obtaining the broadcast event, which can specifically include: if in the state of receiving events and the number of times of pulling the application in a unit time does not exceed the pull frequency of the application, the application is pulled by the event processing service obtaining the broadcast event.
[0032] In this implementation, the event processing service can further determine the pull-up frequency based on the state of the application receiving the event, so as to avoid the application being pulled up too many times in a unit of time, and reduce the power consumption of the electronic device.
[0033] In an implementation of the second aspect, if the application is in the state of being able to receive the event, the application is pulled up by the event processing service obtaining the broadcast event, which can specifically include: if the application is in the state of being able to receive the event, the broadcast event matches the attribute information, and the number of times of pulling up the application in a unit of time does not exceed the pull-up frequency of the application, the application is pulled up by the event processing service obtaining the broadcast event.
[0034] In this implementation, the event processing service can further determine the pull-up frequency based on the state of the application receiving the event and whether the broadcast event matches the attribute information, so as to avoid the application being pulled up too many times in a unit of time, and reduce the power consumption of the electronic device.
[0035] In a third aspect, a processing method of a broadcast event is provided, which is applied to an electronic device including an event processing service and an application. The method includes: configuring, by the application, a state of the application receiving an event according to a service running when the application is closed; pulling up, by the event processing service, the application if the application is closed and the application is in the state of being able to receive the event; and sending, by the event processing service, a broadcast event to the application.
[0036] In a fourth aspect, an electronic device is provided, which includes an event processing service and an application.
[0037] The application is configured to configure a state of the application receiving an event according to a service running when the application is closed.
[0038] The event processing service is configured to pull up the application if the application is closed and the application is in the state of being able to receive the event.
[0039] The event processing service is further configured to send a broadcast event to the application.
[0040] In a fifth aspect, an electronic device is provided, which includes a memory and one or more processors; the memory is coupled to the processors; and the memory stores computer program codes including computer instructions, which, when executed by the processors, cause the electronic device to perform the processing method of the broadcast event as described in the third aspect.
[0041] In a sixth aspect, a computer readable storage medium is provided, which includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the processing method of the broadcast event as described in the third aspect.
[0042] In a seventh aspect, a computer program product is provided, which, when running on a computer, causes the computer to perform the processing method of a broadcast event as described in the first aspect and any implementation form thereof, or the processing method of a broadcast event as described in the second aspect and any implementation form thereof.
[0043] The processing method of a broadcast event provided by the third aspect, the electronic device provided by the fourth aspect, the electronic device provided by the fifth aspect, the computer readable storage medium provided by the sixth aspect and the computer program product provided by the seventh aspect can achieve the beneficial effects as described with reference to the first aspect and any implementation form thereof, or the beneficial effects as described with reference to the second aspect and any implementation form thereof, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0044] FIG. 1 shows a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0045] FIG. 2 shows a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0046] FIG. 3 shows a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0047] FIG. 4 shows a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0048] FIG. 5 shows a flowchart of a processing method of a broadcast event according to an embodiment of the present application;
[0049] FIG. 6 shows a page displayed by an electronic device according to an embodiment of the present application;
[0050] FIG. 7 shows a flowchart of a processing method of a broadcast event according to an embodiment of the present application;
[0051] FIG. 8 shows a flowchart of a processing method of a broadcast event according to an embodiment of the present application;
[0052] FIG. 9 shows a flowchart of a processing method of a broadcast event according to an embodiment of the present application;
[0053] FIG. 10 shows a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, " / " represents an "or" relationship between the objects before and after the " / ", for example, A / B can represent A or B; in the present application, "and / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone, where A and B can be singular or plural. In the description of the present application, unless otherwise specified, "multiple" means two or more than two. "At least one of the following" or the like means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, "first", "second", and the like are used to distinguish the same items or similar items with basically the same function and effect. Those skilled in the art can understand that "first", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different. At the same time, in the embodiments of the present application, "exemplary" or "for example" means to serve as an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner, for understanding.
[0055] In addition, the business scenarios described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that as new business scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0056] The operating system of an electronic device usually provides the ability to broadcast events, such as events of broadcasting a lock screen, uninstalling a package, network changes, language changes, and time zone changes. The broadcasted events are also called broadcast events. System services or applications process these broadcast events, such as performing a series of operations or implementing corresponding functions.
[0057] The configuration file of an application saves all broadcast events that the application can process. In the case that the application is closed or not started, after a system service receives a certain broadcast event, if the configuration file of the application includes the broadcast event, the system service will pull up the application, so that the application processes the broadcast event.
[0058] However, in many scenarios, the application is pulled up to find that it does not need to handle the broadcast event this time, and then the application will end immediately. This results in an invalid pull-up. For example, a calendar application receives a language change event and a time zone change event in order to refresh the text in the notification or card component issued at the time of the event, but if the calendar application has never issued a notification or card component, the notification or card component will not be refreshed according to the voice change and the time zone change even if the application is pulled up, resulting in an invalid pull-up.
[0059] It can be seen that whether to respond to the broadcast event is determined by the application itself after the application is pulled up. However, this situation can result in many invalid pull-ups, thereby increasing the power consumption of the electronic device.
[0060] Currently, in some technical solutions, matching conditions can be added in a static configuration file, and a system service (such as a resident broadcast event service) parses the matching conditions and matches the received broadcast event with the matching conditions, and sends the broadcast event that passes the matching to the application, and also pulls up the application. However, this only modifies the static configuration file. When the system service pulls up the application according to the modified configuration file and the received broadcast event, if the application still does not have a task or business related to the broadcast event, the application will also be invalidly pulled up, and the power consumption of the electronic device will also be increased.
[0061] In addition, updating the configuration file can also cause the application to be updated. If the above conditions or broadcast events are added in the configuration file multiple times, the application will be updated or upgraded multiple times, which can also increase the power consumption of the electronic device.
[0062] Based on the above, an embodiment of the present application provides a broadcast event processing method. In the method, an application configures a state of the application receiving an event according to a business running when the application is closed. If the application is closed and the application is in the state of being able to receive the event, an event processing service pulls up the application, and the event processing service sends a broadcast event to the application.
[0063] In the above method, the application can configure the state of the application receiving the event according to the business running when the application is closed. After receiving the broadcast event, the event processing service pulls up the application only if the application subscribing to the broadcast event is in the state of being able to receive the event. In this way, whether to pull up the application can be determined by considering the business of the application, thereby reducing invalid pull-ups and reducing the power consumption of the electronic device.
[0064] The method for processing a broadcast event provided by the embodiments of the present application can be applied to an electronic device. Referring to FIG. 1, the electronic device can include an event publisher, an event processing service (or a public event service), and an event subscriber. For example, the electronic device can further include a conditional dynamic setting module (not shown in the figure).
[0065] The event publisher can be a plurality of management modules (or services) in the electronic device. For example, a power management module (or service), a screen management module (or service), a package management module (or service), a network management module (or service), a time zone management module (or service), a language management module (or service), and the like.
[0066] The event publisher can publish (or generate) a broadcast event. For example, when a user presses a power key, the power management module can monitor the screen state related to the power key, such as a screen-off state, a screen-on state, and the like, and the power management module can publish a screen-off event, a screen-on event, and the like. For example, when the electronic device is in a screen-on state and does not receive any operation or display task, the electronic device can automatically switch to a screen-off state, and the screen management module can monitor the screen state and publish a screen-off event. For example, when an application is uninstalled, at least one data package corresponding to the application will be uninstalled, and the package management module can monitor the uninstalled data package and publish a data package uninstallation event. For example, the electronic device can switch a network in response to a user operation or automatically switch a network, such as switching from a 4G (or 5G) network to a wireless network, and the network management module can monitor the network state of the electronic device and publish a network state change event. For example, the electronic device can switch a time zone (or time system) in response to a user operation or automatically switch a time zone (or time system), and the time zone management module can monitor the time zone (or time system) change of the electronic device and publish a time zone change event (or a time system change event). For example, the electronic device can switch a language in response to a user operation or automatically switch a language, and the language management module can monitor the language change of the electronic device and publish a language change event.
[0067] The time system can include a plurality of time systems, such as a 24-hour system, a 12-hour system, and the like.
[0068] The event processing service is usually from the operating system (OS) of the electronic device and is a system service. The event processing service can monitor the broadcast event and determine the event subscriber that subscribes to the broadcast event. The event processing service further sends the monitored broadcast event to the event subscriber, and the event subscriber responds to the broadcast event or processes the broadcast event.
[0069] In some possible application scenarios, the power management service, the screen management service, the package management service, the network management service, the time zone management service, the language management service, and the like, can also come from an operating system of the electronic device and belong to system services.
[0070] The event subscriber can receive and process the broadcast event. The event subscriber can be a system service of the operating system, or an application in the electronic device. The application in the electronic device can be a system application, such as a calendar application, a clock application, a weather application, a contacts application, or the like, or a third-party application, such as a chat application, a game application, a shopping application, a network billing application, or the like.
[0071] In some possible application scenarios, the event subscriber can monitor the broadcast event that has been subscribed to, or receive the broadcast event sent by the event processing service, so that the event subscriber processes the broadcast event. For example, the calendar application can monitor the language change event, and in response to the event, change the language used in the calendar application, for example, change the language used from Chinese to English, or the like. Alternatively, the calendar application can also receive the language change event sent by the event processing service, and in response to the event, change the language used from Chinese to English.
[0072] In some possible application scenarios, when the event subscriber is closed, the event processing service can pull up the event subscriber to start the event subscriber, and send the broadcast event to the event subscriber. After receiving the broadcast event, the event processing service determines the state of the event subscriber receiving the event. If the event subscriber is in a state of being able to receive the event, the event processing service can pull up the event subscriber. If the event subscriber is in a state of being unable to receive the event, the event processing service does not pull up the event subscriber.
[0073] For example, when the calendar application is closed, after the event processing service receives the language change event, if the calendar application is in a state of being able to receive the event, the event processing service first pulls up the calendar application. After the calendar application is started and receives the language change event, the calendar application can change the language used in the calendar application in response to the event.
[0074] The state of the event subscriber receiving the event is set by the event subscriber, and the conditional dynamic setting module can provide a system interface for the event subscriber, so that the event subscriber calls the system interface to receive the state of the event. In some possible application scenarios, after the state of receiving the event is set, the conditional dynamic setting module saves the state information of receiving the event to a database corresponding to the electronic device.
[0075] The event subscriber can set the state of the event subscriber receiving the event according to the running business of the closed event subscriber, as shown in FIG. 2. The business can be triggered by the user operating the event subscriber, or the cloud device sending an instruction to the event subscriber to control the running of the event subscriber. The business can represent the user or the cloud device instructing the event subscriber to perform a corresponding function, for example, the user sets "remind to handle XX transaction at 15:00" on the calendar application, so that the calendar application runs the timing reminder business. Alternatively, the cloud device instructs the network billing application (such as "Skylink" application) to monitor some associated businesses, so that the "Skylink" application runs the monitoring business.
[0076] The above-mentioned business can also run after the event subscriber is started, or can run when the event subscriber is closed. For example, when the calendar application is closed, if the timing time of the timing reminder business has not arrived, the business needs to continue running when the calendar application is closed to achieve the purpose of timing reminder. For another example, the "Skylink" application needs to monitor the situation of the associated business to determine the network cost generated by the associated business, and the monitoring business also needs to run when the "Skylink" application is closed to achieve the purpose of real-time monitoring of the associated business.
[0077] The event subscriber can determine whether the business needs to run when the event subscriber is closed according to the characteristics or attributes of the running business. For example, if there is a running business when the event subscriber is closed, the event subscriber can be configured to be in a state of being able to receive events; and if there is no running business when the event subscriber is closed, the event subscriber can be configured to be in a state of being unable to receive events.
[0078] The state of being able to receive events means that the event subscriber can receive the broadcast event sent by the event processing service, and the state of being unable to receive events means that the event subscriber does not receive the broadcast event sent by the event processing service.
[0079] It can be understood that some broadcast events can trigger the update of the event subscriber business (or the update of the business data), and if there is a running business when the event subscriber is closed, in order to ensure the update of the business, the event subscriber needs to be in a state of being able to receive events, so as to receive the broadcast event that can trigger the update of the business in time when closed, and be pulled up and updated in time. If there is no running business when the event subscriber is closed, there is no need to focus on the update of the business when the event subscriber is closed, so the event subscriber is in a state of being unable to receive events, so that the event subscriber will not receive any broadcast event when closed, and will not be pulled up by the event processing service, thereby reducing some invalid pull-ups and reducing the low power consumption of the electronic device.
[0080] In some possible application scenarios, the state in which the event subscriber receives the event can be regarded as a switch for setting the event receiving function of the event subscriber. The state in which the event can be received indicates that the event receiving function is enabled, and the state in which the event cannot be received indicates that the event receiving function is disabled.
[0081] After the event subscriber is pulled up, the event subscriber receives the broadcast event sent by the event processing service in the foregoing manner. Then, the event subscriber can continue to determine whether the broadcast event can trigger the business update running when the event subscriber is closed (or determine whether the broadcast event is related to the business running when the event subscriber is closed), and if the broadcast event can trigger the business update running when the event subscriber is closed, the event subscriber can update related data of the business in response to the broadcast event, to update the business. If the broadcast event cannot trigger the business update running when the event subscriber is closed, the event subscriber does not perform any processing operation in response to the broadcast event.
[0082] In this scheme, the event processing service determines the state in which the event is received, and then sends the broadcast event to the event subscriber, and the event subscriber determines whether to respond to the broadcast event. Since the event subscriber is set to the state in which the event can be received only when the business is running when the event subscriber is closed, the broadcast event sent by the event processing service after the determination has a high probability of being related to the business running when the event subscriber is closed, and thus this manner can exclude some broadcast events that are not related to the business running when the event subscriber is closed, and reduce invalid pulling of the event subscriber.
[0083] In some possible application scenarios, the event subscriber can also configure attribute information of the event subscriber according to the business running when the event subscriber is closed, as shown in FIG. 3. The attribute information can indicate at least one broadcast event associated with the business, or indicate at least one broadcast event used to trigger the business update. It can be understood that the content of the attribute information is dynamically configured according to the business running when the event subscriber is closed, and belongs to variable content. The event processing service can further determine whether to send the broadcast event to the event subscriber according to the attribute information.
[0084] For example, after the event processing service determines that the event subscriber is in the state in which the event can be received, the event processing service does not send the broadcast event to the event subscriber for processing, but matches the broadcast event with the attribute information. If the broadcast event matches the attribute information, the event processing service pulls up the event subscriber, and sends the broadcast event to the event subscriber. If the broadcast event does not match the attribute information, the event processing service does not pull up the event subscriber, and does not send the broadcast event to the event subscriber.
[0085] The broadcast event matches the attribute information means that the broadcast event is any one of the at least one broadcast event indicated by the attribute information; and the broadcast event does not match the attribute information means that the broadcast event is not any one of the at least one broadcast event indicated by the attribute information.
[0086] Since the attribute information is configured according to the service running when the event subscriber is closed, the event processing service can determine, according to the attribute information, whether the received broadcast event is related to the service running when the event subscriber is closed.
[0087] If the event subscriber receives the broadcast event sent by the event processing service in the manner shown in FIG. 3, the event subscriber can directly update the related data of the service in response to the broadcast event to update the service.
[0088] In this scheme, the event processing service has determined, according to the attribute information, whether the broadcast event can be sent to the event subscriber before the event subscriber receives the broadcast event, thereby reducing the process of the event subscriber determining by itself. Moreover, the event processing service can further accurately determine whether the event subscriber can be pulled up by judging the state of the event subscriber receiving the event and judging the broadcast event, thereby further reducing the invalid pulling up of the event subscriber.
[0089] In some possible application scenarios, the event subscriber corresponds to a pre-set configuration file. The configuration file can include at least one broadcast event associated with (or capable of triggering the event subscriber to update) the service of the event subscriber, at least one broadcast event to which the event subscriber needs to subscribe, or the like, or in other words, the configuration file stores all preset broadcast events. It can be understood that the configuration file is a static file. The configuration file can be, for example, Manifest.xml in an Android system.
[0090] The event subscriber can determine, based on the configuration file, whether the received broadcast event is associated with the service running when the event subscriber is closed; or the event subscriber can also configure the attribute information based on the configuration file, that is, determine, according to the configuration file, at least one broadcast event associated with the service running when the event subscriber is closed.
[0091] In some possible application scenarios, the attribute information can also be displayed or stored in the form of an event list, and the attribute information or the event list and the like can be stored in a database corresponding to the electronic device.
[0092] The above setting of the state of the event subscriber receiving the event, the configuration of the attribute information, and the like are not performed on the static configuration file of the event subscriber, nor will the configuration file be changed, thereby reducing the case of the event subscriber being upgraded or updated multiple times, and also reducing the power consumption of the electronic device.
[0093] And, in some possible application scenarios, the setting of the state of receiving events, the attribute information, etc. described above are dynamic processes. And, the setting of the state of receiving events can be equivalent to setting a switching condition for the event processing service with respect to the event subscriber, which is a judgment on whether the event subscriber can receive any broadcast event as a whole; the setting of the attribute information is equivalent to setting a condition for the specific event content of the broadcast event, or setting a condition for the specific data carried by the broadcast event, which is a judgment on whether the broadcast event received by the event processing service is a certain broadcast event.
[0094] For example, the event subscriber determines that there is no business that needs to be run when the device is turned off when running for the first time, and then the event subscriber sets itself to a state of not receiving events. When the event subscriber determines that there is a business that needs to be run when the device is turned off when running for the second time, the event subscriber modifies the state of itself to a state of receiving events. As can be seen, the setting of the state of receiving events and the attribute information described above is dynamically set according to the business situation of the event subscriber, which can fully consider the business situation of the event subscriber when the device is turned off in the process of processing broadcast events, thereby reducing the invalid pull of the event subscriber.
[0095] It can be understood that there can be at least one event processing service in the electronic device. When there is one event processing service, the event processing service can serve as a hub corresponding to at least one event subscriber that has a subscription demand for broadcast events. When there are multiple event processing services, one event processing service can correspond to one event subscriber, or one event processing service can correspond to multiple event subscribers. The number of event processing services is not limited in the embodiments of the present application.
[0096] In other possible application scenarios, referring to FIG. 4, the electronic device can include an operating system and at least one application.
[0097] The operating system can provide a plurality of system services to implement different functions, one of which can receive a broadcast event generated in the electronic device and pull up an application that subscribes to the broadcast event. The system service can serve as the event processing service in the application scenario described above and implement the functions that the event processing service can implement. In addition, the application in the electronic device can serve as the event subscriber in the application scenario described above and implement the functions that the event subscriber can implement.
[0098] The electronic device described above can be a mobile phone, a tablet computer, a notebook computer, a personal computer, a smart watch, a smart bracelet, and the like, which can carry an operating system and install an application.
[0099] The following further describes the method for processing the broadcast event, taking an application as an event subscriber as an example.
[0100] Referring to FIG. 5, the method for processing the broadcast event can include the following steps S501-S504.
[0101] S501, the application configures a state of the application receiving events according to a service running when the application is closed.
[0102] Taking the application as a calendar application as an example, the calendar application can display dates, display holidays, provide a timed reminder, display pending items, and the like. A user can select a corresponding function on the calendar application according to his or her own needs, such as selecting a timed reminder function, so that the calendar application runs a timed reminder service.
[0103] Alternatively, the user can also select to display a card component corresponding to the calendar application on the desktop of the electronic device according to his or her own needs, so that the electronic device can view dates, holidays, pending items, and the like without displaying an application page of the calendar application. In this case, the calendar application can also run a card component service to support the corresponding card component to display the same content as the calendar application.
[0104] For example, a notification message published by the calendar application to perform a timed reminder function can be seen in (a) of FIG. 6; and a card component corresponding to the calendar application can be seen in (b) of FIG. 6.
[0105] In some possible application scenarios, the above-mentioned timed reminder service and card component service can be run after the calendar application is started, or can be run when the calendar application is closed. If any one of the services related to the calendar application is run when the calendar application is closed, the calendar application can be configured to be in a state of being able to receive events; if none of the services related to the calendar application is run when the calendar application is closed, the calendar application can be configured to be in a state of being unable to receive events.
[0106] Taking the application as a "Skylink" application as an example, the "Skylink" application can monitor some services that need to use a network. These services can be services of the "Skylink" application itself, or services of other applications in the electronic device. The "Skylink" application monitors these services to charge for these services and determine a network fee used. In addition, a change in the services monitored by the "Skylink" application, such as uninstallation or installation, can also affect the running of the "Skylink" application. Therefore, the "Skylink" application needs to run a service of monitoring data packet uninstallation and a service of monitoring data packet installation, so as to update the services or data of the "Skylink" application in a timely manner.
[0107] In some possible application scenarios, the above-mentioned monitoring data packet offloading service can run after the "Skylink" application is started, or can run when the "Skylink" application is closed. If there is a monitoring service when the "Skylink" application is closed, the "Skylink" application can be configured to be in a state of being able to receive an event; if there is no monitoring service when the "Skylink" application is closed, the "Skylink" application can be configured to be in a state of being unable to receive an event.
[0108] In the above-mentioned solution, the application can configure the state of the application receiving an event according to the service running when the application is closed, and associate whether the application can receive a broadcast event with the service running when the application is closed. In this way, when a broadcast event is processed subsequently, the service of the application can also be considered, so that the process can be more accurate.
[0109] S502, the event processing service acquires a broadcast event generated in the electronic device and an application subscribing to the broadcast event.
[0110] In some possible application scenarios, the broadcast event can include at least one of a screen-off event, a language change event, a time zone change event, a time system change event, a network state change event, and a data packet offloading event.
[0111] In addition, in some possible application scenarios, because the configuration file of the application includes a broadcast event that the application needs to subscribe to, the event processing service can first acquire and parse the configuration file of the application, and determine the application subscribing to the current broadcast event according to the content in the parsed configuration file.
[0112] For example, the configuration file of the calendar application includes a language change event and a time zone change event, the configuration file of the clock application includes a screen-off event, a time zone change event, and a time system change event, and the configuration file of the "Skylink" application includes a network state change event and a data packet offloading event. If the event processing service receives a language change event, it can be determined that the application subscribing to the broadcast event is the calendar application; if the event processing service receives a time system change event, it can be determined that the application subscribing to the broadcast event is the clock application; and if the event processing service receives a network state change event, it can be determined that the application subscribing to the broadcast event is the "Skylink" application.
[0113] S503, if the application is closed and the application is in a state of being able to receive an event, the event processing service pulls up the application.
[0114] For example, the event processing service receives a language change event, and if the calendar application is closed and the calendar application is in a state of being able to receive the event, the event processing service pulls up the calendar application. Alternatively, the event processing service receives a time system change event, and if the clock application is closed and the clock application is in a state of being able to receive the event, the event processing service pulls up the clock application. Alternatively, the event processing service receives a network state change event, and if the "sky eye" application is closed and in a state of being able to receive the event, the event processing service pulls up the "sky eye" application.
[0115] In some possible application scenarios, if the application is closed and the application is in a state of being unable to receive the event, the event processing service does not pull up the application.
[0116] Some broadcast events can trigger an update of an application service. If there is a running service when the application is closed, in order to ensure the update of the service, the application needs to be in a state of being able to receive the event, so as to receive the broadcast event that can trigger the update of the service in time when the application is closed, and be pulled up in time and updated. If there is no running service when the application is closed, it is not necessary to focus on the update of the service when the application is closed, and therefore the application is in a state of being unable to receive the event. In this way, the application does not receive any broadcast event when the application is closed, and is not pulled up by the event processing service, thereby reducing some invalid pull-ups and reducing the low power consumption of the electronic device.
[0117] In some possible application scenarios, the application can further include pull-up frequency information. The pull-up frequency is used to indicate the number of times the application is pulled up in a unit of time, for example, once in 10 minutes or 10 times a day. The pull-up frequency can be customized by a user, or configured by a developer in an application development stage or an update stage. The pull-up frequency can be regarded as preset information.
[0118] When the application is closed, the event processing service can further determine whether to pull up the application according to the pull-up frequency of the application, the state of the application receiving the event, and the like.
[0119] For example, if the application is closed, the application is in a state of being able to receive the event, and the number of times the application is pulled up in a unit of time does not exceed the pull-up frequency, the event processing service pulls up the application. If the application is closed, the application is in a state of being able to receive the event, and the number of times the application is pulled up in a unit of time exceeds or is equal to the pull-up frequency, the event processing service does not pull up the application.
[0120] For example, when the calendar application is closed, if the calendar application is in a state of being able to receive the event, and the number of times the calendar application is pulled up in one day (for example, 2 times) does not exceed the pull-up frequency (for example, 10 times), the event processing service can pull up the calendar application.
[0121] For another example, when the "Skylink" application is closed, if the "Skylink" application is in a state of being able to receive an event, and the number of times (e.g., 1 time) that the "Skylink" application is pulled up within 10 minutes is equal to the pull-up frequency (e.g., 1 time), then the event processing service does not pull up the "Skylink" application.
[0122] In this way, the event processing service can further determine the pull-up frequency on the basis of the state of the application receiving an event, thereby avoiding the application being pulled up too many times within a unit of time, and reducing the power consumption of the electronic device.
[0123] S504, the event processing service sends a broadcast event to the application.
[0124] The event processing service sends a broadcast event to the application when the application is in a state of being able to receive an event. After the application receives the broadcast event, the application can perform a corresponding operation in response to the broadcast event, such as updating a service corresponding to the broadcast event.
[0125] In some possible application scenarios, after the application receives the broadcast event, the application can continue to determine whether the broadcast event is associated with a service running when the application is closed, and if so, the application processes in response to the broadcast event. If not, the application does not respond to the broadcast event, i.e., does not perform any processing operation for the broadcast event.
[0126] For example, after the calendar application receives the language change event, it is determined that the language change event is associated with the timed reminder service running when the calendar application is closed. In this case, the calendar application changes the language of the content to be reminded in the timed reminder service in response to the language change event. If the calendar application receives the network state change event, it is determined that the network state change event is not associated with the timed reminder service running when the calendar application is closed. In this case, the calendar application does not respond to the network state change event.
[0127] In this scheme, the application can determine whether to respond to the broadcast event by itself. On the basis of the event processing service having made a determination once based on the state of the application receiving an event, the application continues to make a further determination, thereby excluding some broadcast events that are not associated with the service running when the application is closed, and reducing the invalid pull-up of the application.
[0128] In some possible application scenarios, after the application configures the state of the application receiving an event, the application can also save the state information in a database corresponding to the electronic device, wherein the database can be maintained by a cloud device or a server, or the database can correspond to a part of the storage space in the electronic device. In addition, the event processing service can obtain the above state information of the application from the database, and determine whether the application is in a state of being able to receive an event according to the state information.
[0129] In this way, the state information is stored in the database rather than in the configuration file, so that the configuration file is not modified, and the application does not need to be upgraded, and the power consumption of the electronic device can be reduced. In addition, when the event processing service obtains the state information, the configuration file of the application does not need to be parsed, so that the time for processing the broadcast event can be reduced, and the efficiency can be improved.
[0130] In the scheme of S501-S504, the application can configure the state of the event reception of the application itself according to the running service when the application is closed. After receiving the broadcast event, the event processing service pulls up the application only when the application subscribed to the broadcast event is in a state of being able to receive the event. In this way, whether to pull up the application can be determined according to the service of the application, so that invalid pulling up can be reduced, and the power consumption of the electronic device can be reduced.
[0131] In some other possible application scenarios, the application can also configure attribute information of the application according to the running service when the application is closed. The attribute information can indicate at least one broadcast event associated with the running service when the application is closed.
[0132] For example, when the calendar application is closed, the timing reminder service is running. In order to ensure that when the language and time zone of the electronic device change, the language and reminder time of the reminder content corresponding to the timing reminder service can also change accordingly, the attribute information configured by the calendar application can include a language change event and a time zone change event associated with the timing reminder service.
[0133] For another example, when the "Skylink" application is closed, the monitoring services A and B corresponding to the data packet offloading services are running. In order to ensure that the "Skylink" application can update the corresponding services in time after the data packets corresponding to the services A and B are offloaded, the attribute information configured by the "Skylink" application can include a data packet A offloading event corresponding to the service A and a data packet B offloading event corresponding to the service B.
[0134] For another example, the cloud device not only manages the "Skylink" application, but also manages other applications associated with the "Skylink" application on the electronic device. The cloud device can obtain the services of the other applications and the data packet information corresponding thereto, and send the data packet information to the "Skylink" application, so that the "Skylink" application receives the monitoring data packet offloading task indicated by the cloud device, and runs the monitoring data packet offloading service. Further, the "Skylink" application can determine whether the service needs to be running when the "Skylink" application is closed, and configure the attribute information of the application according to the running service.
[0135] After the event processing service receives the broadcast event and determines the application subscribed to the broadcast event, the application can be further determined to be pulled up based on the attribute information, so as to further ensure the effectiveness of the application pull-up.
[0136] For example, referring to FIG. 7, the processing method of the broadcast event can further include the following steps S701-S705.
[0137] S701, the application configures a state of the application receiving the event according to a service running when the application is closed.
[0138] S702, the event processing service acquires the broadcast event generated in the electronic device and the application subscribed to the broadcast event.
[0139] S703, the event processing service acquires attribute information of the application.
[0140] S704, if the application is closed, the application is in the state of being able to receive the event, and the broadcast event matches the attribute information, the event processing service pulls up the application.
[0141] In addition, if the application is closed, the application is in the state of being able to receive the event, but the broadcast event does not match the attribute information, the event processing service will not pull up the application.
[0142] For example, the attribute information of the calendar application includes a language change event and a time zone change event. The event processing service receives the language change event, if the calendar application is closed, and the event processing service determines that the calendar application is in the state of being able to receive the event and the language change event matches the attribute information of the calendar application, the event processing service pulls up the calendar application.
[0143] For another example, the attribute information of the "Skylink" application includes a data packet A offloading event and a data packet B offloading event. The event processing service receives the data packet A offloading event, if the "Skylink" application is closed, and the event processing service determines that the "Skylink" application is in the state of being able to receive the event and the data packet A offloading event matches the attribute information of the "Skylink" application, the event processing service pulls up the "Skylink" application.
[0144] S705, the event processing service sends the broadcast event to the application.
[0145] In the above solutions S701-S705, the application determines whether the broadcast event can be sent to the application according to the attribute information before receiving the broadcast event, thereby reducing the process of determining by the application. If the application subscribed to the broadcast event is in a state of being able to receive the event and the broadcast event matches the attribute information of the application, the event processing service pulls up the application. In this way, whether the application is pulled up can be determined according to the business of the application, thereby reducing invalid pulling up and reducing the power consumption of the electronic device.
[0146] In some possible application scenarios, the event processing service can further determine according to the pulling up frequency of the application when performing S704.
[0147] For example, if the application is closed, the application is in a state of being able to receive the event, the broadcast event matches the attribute information of the application, and the number of times of pulling up the application in a unit of time does not exceed the pulling up frequency of the application, the event processing service pulls up the application. If the application is closed, the application is in a state of being able to receive the event, the broadcast event matches the attribute information of the application, and the number of times of pulling up the application in a unit of time exceeds the pulling up frequency of the application or is equal to the pulling up frequency of the application, the event processing service does not pull up the application.
[0148] In this way, the event processing service can further determine according to the pulling up frequency on the basis of determining the state of the application receiving the event and whether the broadcast event matches the attribute information, thereby avoiding that the number of times of pulling up the application in a unit of time is too large, and reducing the power consumption of the electronic device.
[0149] In some possible application scenarios, after the application configures the attribute information, the attribute information can be stored in a database corresponding to the electronic device. The database can be maintained by a cloud device or a server, or the database can correspond to a part of storage space in the electronic device. The event processing service can obtain the attribute information of the application from the database, and determine whether to pull up the application based on the attribute information.
[0150] In this way, the attribute information is stored in the database instead of the configuration file, so that the configuration file is not modified, and the application does not need to be upgraded, thereby reducing the power consumption of the electronic device. In addition, the event processing service does not need to parse the configuration file of the application when obtaining the attribute information, thereby reducing the processing time of the broadcast event and improving the efficiency.
[0151] In some possible application scenarios, the application can also provide a function page for the user to set the pull-up frequency. The setting manner of the pull-up frequency can include that the user selects a value corresponding to the pull-up frequency on the function page, and can also include that the user inputs a value corresponding to the pull-up frequency on the function page. Further, the application can configure the pull-up frequency of the application in response to the setting operation of the user.
[0152] It can be known from the above that the processing method of the broadcast event provided in the embodiments of the present application can reduce invalid pull-up of the application, reduce the number of upgrades of the application, and thus reduce the power consumption of the electronic device.
[0153] For example, referring to (a) in FIG. 8, after the application 1 runs the service A (or performs the service action A), some data a is generated. The data a can be displayed on the display page of the electronic device, or can exist in the database corresponding to the electronic device. The data a can be related to the system state B. When the system state B changes, the application 1 needs to refresh the data a. Therefore, if the application 1 is closed, the event processing service performs step S8101 to monitor the broadcast event of the system state B change, and when the broadcast event of the system state B change occurs, performs step S8102 to pull up the application 1 and sends the broadcast event to the application 1, so that the application 1 responds.
[0154] However, if the service A is not running (or the service action A does not occur), the event processing service monitoring the broadcast event of the system state B change will produce invalid application pull-up behavior, thereby increasing the power consumption of the electronic device.
[0155] In the processing method of the broadcast event provided in the embodiments of the present application, referring to (b) in FIG. 8, the application 1 can configure the state of receiving the event, that is, when the service A is running, the application 1 is in a state of being able to receive the event, so that when the broadcast event of the system state B change occurs, the event processing service performs step S8201 to monitor the broadcast event of the system state B change, and then performs step S8202 to pull up the application 1; when no service is running, the application 1 is in a state of being unable to receive the event, so that when the broadcast event of the system state B change occurs, the event processing service will not pull up the application 1. In this way, invalid pull-up of the application 1 can be reduced, and the power consumption of the electronic device can be reduced.
[0156] For example, referring to (a) of FIG. 9, the application 2 corresponding event processing service initially needs to monitor the offloading of the data packet A, the data packet B and the data packet C, wherein the data packet A offloading event, the data packet B offloading event and the data packet C offloading event are configured in the configuration file of the application 2. However, with the evolution of the service, the monitoring of the data packet D offloading needs to be added. If the added data packet D offloading event is added to the configuration file of the application 2, the application 2 needs to be upgraded. That is, the application 2 needs to be upgraded once for each new offloading event. The increase in the number of times of upgrading the application 2 will obviously increase the power consumption of the electronic device.
[0157] In the method for processing broadcast events provided by the embodiments of the present application, referring to (b) of FIG. 9, the application 2 can directly refresh the attribute information, for example, adding the data packet D offloading event in the attribute information. Since the configuration file is not modified, the application 2 does not need to be upgraded, which can reduce the number of times of upgrading the application 2, thereby reducing the power consumption of the electronic device.
[0158] In some schemes, the multiple embodiments of the present application can be combined, and the combined scheme is implemented. Optionally, some operations in the flow of each method embodiment are combined, and / or the order of some operations is changed. Moreover, the execution order between the steps of each flow is only exemplary, and does not constitute a limitation on the execution order between the steps, and other execution orders between the steps can also be used. The execution order is not intended to indicate the only execution order in which the operations can be performed. A person of ordinary skill in the art can think of various ways to reorder the operations described in the embodiments of the present application. In addition, it should be pointed out that the process details involved in the embodiments of the present application are also applicable in a similar manner to other embodiments, or different embodiments can be combined for use.
[0159] In addition, some steps in the method embodiments can be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiments can be optional and can be deleted in some use scenarios. Alternatively, other possible steps can be added to the method embodiments.
[0160] Moreover, each method embodiment can be implemented individually or in combination.
[0161] It can be understood that, in order to achieve the above functions, the foregoing electronic device includes hardware and / or software modules corresponding to each function. The algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0162] The embodiments can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware. It should be noted that the division of the modules in the embodiments is illustrative, and is only a logical functional division. Actual implementation can have another division manner.
[0163] The embodiments of the present application also provide an electronic device, as shown in FIG. 10, which can include one or more processors 1001, a memory 1002 and a communication interface 1003.
[0164] The memory 1002, the communication interface 1003 and the processor 1001 are coupled. For example, the memory 1002, the communication interface 1003 and the processor 1001 can be coupled together through a bus 1004.
[0165] The communication interface 1003 is configured to perform data transmission with other devices. The memory 1002 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 1001, causes the electronic device to perform the processing method of the broadcast event in the embodiments of the present application.
[0166] The processor 1001 can be a processor or controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. The processor can implement or execute various example logical blocks, modules, and circuits described in connection with the present disclosure. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0167] The bus 1004 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, or the like. The bus 1004 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 10, but this does not mean that there is only one bus or only one type of bus.
[0168] The embodiments of the present application also provide a computer readable storage medium, which includes computer instructions, when the computer instructions are run on an electronic device, the electronic device executes the related method steps in the above method embodiments.
[0169] The embodiments of the present application also provide a computer program product, when the computer program product is run on a computer, the computer program product causes the computer to execute the related method steps in the above method embodiments.
[0170] The electronic device, the computer readable storage medium, or the computer program product provided in the present application are used to execute the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method provided above, which will not be described here again.
[0171] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0172] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are only illustrative, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.
[0173] The units described as separate components can or can not be physically separated, and the components shown as units can be one physical unit or a plurality of physical units, that is, can be located in one place or can be distributed to a plurality of different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0174] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0175] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product in essence or the part that contributes or the whole or part of the technical solutions can be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium that can store program codes.
[0176] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of processing a broadcast event, characterized by, An event processing service applied to an electronic device, the electronic device further comprising an application, the method comprising: acquiring a broadcast event generated in the electronic device and an application subscribing to the broadcast event; if the application is closed and the application is in a state capable of receiving an event, pulling up the application, wherein the state capable of receiving an event is configured by the application according to a service running when the application is closed; sending the broadcast event to the application.
2. The method of claim 1, wherein, if there is a service running when the application is closed, the application is in a state capable of receiving an event; if there is no service running when the application is closed, the application is in a state incapable of receiving an event.
3. The method according to claim 1 or 2, characterized in that, the if the application is closed and the application is in a state capable of receiving an event, pulling up the application, comprising: acquiring a pull-up frequency of the application, wherein the pull-up frequency represents a number of times the application is pulled up per unit time; if the application is closed, the application is in a state capable of receiving an event, and the number of times the application is pulled up per unit time does not exceed the pull-up frequency, pulling up the application.
4. The method according to claim 1 or 2, characterized in that, the if the application is closed and the application is in a state capable of receiving an event, pulling up the application, comprising: acquiring attribute information corresponding to the application, wherein the attribute information is configured by the application according to a service running when the application is closed, and the attribute information is used to indicate at least one broadcast event associated with the service; if the application is closed, the application is in a state capable of receiving an event, and the broadcast event matches the attribute information, pulling up the application.
5. The method of claim 4, wherein, the if the application is closed, the application is in a state capable of receiving an event, and the broadcast event matches the attribute information, pulling up the application, comprising: acquiring a pull-up frequency of the application, wherein the pull-up frequency represents a number of times the application is pulled up per unit time; if the application is closed, the application is in a state capable of receiving an event, the broadcast event matches the attribute information, and the number of times the application is pulled up per unit time does not exceed the pull-up frequency, pulling up the application.
6. The method according to any one of claims 1 to 5, characterized in that, The broadcast event comprises at least one of a screen-off event, a language change event, a time zone change event, a time system change event, a network state change event, and a data packet offloading event.
7. The method according to any one of claims 1 to 6, characterized in that, The application is a calendar application, and the service is a card component service or a timed reminder service.
8. The method according to any one of claims 1 to 6, characterized in that, The application is a network charging application, and the service is a data packet offloading monitoring service.
9. A method of processing a broadcast event, characterized by, An application applied to an electronic device, the electronic device further comprising an event processing service, the method comprising: configuring a state of the application receiving an event according to a service running when the application is closed; if in the state capable of receiving an event, pulling up the event processing service acquired to a broadcast event, wherein the broadcast event is generated in the electronic device, and the application subscribes to the broadcast event; receiving the broadcast event sent by the event processing service.
10. The method of claim 9, wherein, the configuring a state of the application receiving an event according to a service running when the application is closed, comprising: if there is running service when the application is closed, configuring the application to be in a state of being able to receive events; if there is no running service when the application is closed, configuring the application to be in a state of being unable to receive events.
11. The method according to claim 9 or 10, characterized in that, after the receiving of the broadcast event sent by the event processing service, the method further comprises: if the broadcast event is associated with the service running when the application is closed, updating relevant data of the service in response to the broadcast event.
12. The method of claim 10, wherein, the method further comprises: configuring attribute information of the application according to the service running when the application is closed; the attribute information is used to indicate at least one broadcast event associated with the service; the event processing service being pulled up to the broadcast event if in the state of being able to receive events, comprises: the event processing service being pulled up to the broadcast event if in the state of being able to receive events and the broadcast event matches the attribute information.
13. The method of claim 12, wherein, after the receiving of the broadcast event sent by the event processing service, the method further comprises: updating relevant data of the service in response to the broadcast event.
14. The method according to any one of claims 9-11, characterized in that, the event processing service being pulled up to the broadcast event if in the state of being able to receive events, comprises: the event processing service being pulled up to the broadcast event if in the state of being able to receive events and the number of times of being pulled up to the application in a unit time does not exceed the pull-up frequency of the application.
15. The method of claim 12, wherein, the event processing service being pulled up to the broadcast event if in the state of being able to receive events and the broadcast event matches the attribute information, comprises: the event processing service being pulled up to the broadcast event if in the state of being able to receive events, the broadcast event matches the attribute information and the number of times of being pulled up to the application in a unit time does not exceed the pull-up frequency of the application.
16. The method according to any one of claims 9-15, characterized in that, The broadcast event comprises at least one of a screen-off event, a language change event, a time zone change event, a time system change event, a network state change event and a data packet offloading event.
17. The method according to any one of claims 9-16, characterized in that, The application is a calendar application, and the service is a card component service or a timed reminder service.
18. The method according to any one of claims 9-16, characterized in that, The application is a network charging application, and the service is a data packet offloading monitoring service.
19. A method of processing a broadcast event, characterized by, The method is applied to an electronic device, and the electronic device comprises an event processing service and an application. The application configures a state of receiving events according to a service running when the application is closed; if the application is closed and the application is in the state of being able to receive events, the event processing service pulls up the application; The event processing service sends the broadcast event to the application.
20. An electronic device, comprising: The method comprises an event processing service and an application. The application is configured to receive events according to a service running when the application is closed. if the application is closed and the application is in the state of being able to receive events, the event processing service is configured to pull up the application; The event processing service is further configured to send the broadcast event to the application.
21. An electronic device, comprising: An electronic device comprising a memory, one or more processors; the memory coupled with the processors; wherein the memory has computer program codes stored therein, the computer program codes comprising computer instructions that, when executed by the processors, cause the electronic device to perform the method of processing a broadcast event as claimed in claim 19.
22. A computer-readable storage medium, characterized in that, A computer program product comprising computer instructions that, when run on an electronic device, cause the electronic device to perform the method of processing a broadcast event as claimed in claim 19.
23. A computer program product, characterised in that, The computer program product, when run on a computer, causes the computer to perform the method of processing a broadcast event as claimed in any one of claims 1-8, or, the method of processing a broadcast event as claimed in any one of claims 9-18.
Citation Information
Patent Citations
Control method of application broadcast and terminal
CN106528386A
Broadcast control method, device, terminal and computer readable storage medium
CN111858081A
Broadcast optimization method and device, mobile terminal and storage medium
CN112559206A
Application management method and electronic equipment
CN113918060A
Application freezing method and device and electronic equipment
CN116339847A