Broadcast event processing method and electronic equipment
By configuring the event receiving status 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 handling is achieved, and the power consumption of electronic devices is reduced.
Patent Information
- Application Number
- CN202410641867.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2025-11-21
AI Technical Summary
In the prior art, electronic devices increase power consumption when processing broadcast events due to ineffective application restarts, especially when applications terminate immediately after receiving broadcast events that do not require processing, resulting in wasted resources.
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 launched when it is in a state that can receive events, and broadcast events are sent when necessary to reduce invalid launches.
It effectively reduces the power consumption of electronic devices, avoids the startup of unnecessary applications, and improves resource utilization efficiency.
Smart Images

Figure CN120994045A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular, to a broadcast event processing method and an electronic device. BACKGROUND
[0002] 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.
[0003] Generally, the configuration file of an application can save all broadcast events that the application can process. After receiving a 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.
[0004] 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 a task or business related to the broadcast event, and thus the application does not need to process the broadcast event. SUMMARY
[0005] 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.
[0006] To achieve the above object, embodiments of the present application adopt the following technical solutions:
[0007] 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 a business condition running at the time of being closed. Then, the event processing service sends the broadcast event to the application.
[0008] In the above method, the application can configure the state of receiving an event of the application itself according to the business condition running at the time of being closed. After receiving the broadcast event, if the application subscribing to the broadcast event is in the state of being able to receive an event, the event processing service launches the application. In this way, the business condition of the application can be considered to determine whether to launch the application, thereby reducing invalid launches and reducing the power consumption of the electronic device.
[0009] In an implementation form of the first aspect, if there is running service when the application is closed, the application is in a state of being able to receive events; if there is no running service when the application is closed, the application is in a state of being unable to receive events.
[0010] In this implementation form, considering that some broadcast events can trigger update of application service, if there is running service when the application is closed, in order to ensure update of the service, the application needs to be in a state of being able to receive events, so as to receive the broadcast events that can trigger 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, there is no need to concern about update of the service when the application is closed, and thus the application is in a state of being unable to receive events, so that the application will not receive any broadcast events when the application is closed, and will not be pulled up by the event processing service, thereby reducing some invalid pull-ups and reducing power consumption of the electronic device.
[0011] In an implementation form of the first aspect, if the application is closed and the application is in a state of being able to receive events, the event processing service pulls up the application, which can further include that the event processing service acquires a pull-up frequency of the application, wherein the pull-up 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 a state of being able to receive events, and the number of times that the application is pulled up in the unit time does not exceed the pull-up frequency, the event processing service can pull up the application.
[0012] In this implementation form, the event processing service can further make a judgment on the pull-up frequency on the basis of judging the state of the application receiving events, thereby avoiding that the application is pulled up too many times in the unit time, and reducing power consumption of the electronic device.
[0013] In an implementation form of the first aspect, if the application is closed and the application is in a state of being able to receive events, the event processing service pulls up the application, which can further include that the event processing service acquires attribute information corresponding to the application, wherein the attribute information is configured by the application according to the running service 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 a state of being able to receive events, and the broadcast event matches the attribute information, the event processing service can pull up the application.
[0014] In this implementation form, since the attribute information is configured according to the running service 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 running service when the application is closed. In addition, before the application receives the broadcast event, the event processing service has 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.
[0015] In an implementation form of the first aspect, if the application is closed, the application is in a state of being able to receive the event, and the broadcast event matches the attribute information, the event processing service pulls up the application, and the method can further include that 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 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, the event processing service can pull up the application.
[0016] In this implementation form, the event processing service can further make a judgment on the pull-up frequency on the basis of judging the state of the application receiving the event and whether the broadcast event matches the attribute information, so as to avoid the number of times of pulling up the application in a unit of time being too much, and to reduce the power consumption of the electronic device.
[0017] In an implementation form 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 the broadcast event, the application can update the corresponding service in response to the broadcast event.
[0018] In an implementation form of the first aspect, the application is a calendar application, and the service is a card component service or a timing reminder service. In this implementation form, 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 timing reminder service in response to the broadcast event.
[0019] In an implementation form of the first aspect, the application is a network charging application, and the service is a monitoring data packet offloading service. In this implementation form, 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 to be monitored, such as adding a new data packet offloading event to be monitored.
[0020] In a second aspect, a method for processing a broadcast event is provided, and the method is applied to an application in an electronic device, and the electronic device further includes an event processing service. In the method, the application configures a state of receiving an event according to a service running when the application is closed. Then, if the application is in the state of being able to receive the event, the application is pulled up by the event processing service acquiring a broadcast event, wherein the broadcast event is generated in the electronic device, and the application subscribes to the broadcast event. Next, the application can receive the broadcast event sent by the event processing service.
[0021] In the method, the application can configure a state of event receiving 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 the event. 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.
[0022] In an implementation of the second aspect, the application configures the application to be in the state of receiving the event according to a service running when the application is closed, which can specifically include: if there is a service running when the application is closed, the application is configured to be in the state of receiving the event; and if there is no service running when the application is closed, the application is configured to be in the state of not receiving the event.
[0023] 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, 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 that can trigger the update of the service in time 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 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, so as to reduce invalid pulling up and reduce power consumption of the electronic device.
[0024] In an implementation 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 a service running when the application is closed, the application updates related data of the service in response to the broadcast event.
[0025] In this implementation, the event processing service judges the state of receiving the event, and then sends the broadcast event to the application, and the application judges whether to respond to the broadcast event. Since the application is configured to be in the state of receiving the event only when there is a service running when the application is closed, the broadcast event sent by the event processing service after the judgment has a high probability of being associated with the service running when the application is closed, so that this method can exclude some broadcast events that are not associated with the service running when the application is closed, and reduce invalid pulling up of the application.
[0026] In an implementation form of the second aspect, the method further includes: configuring, according to a service running when the application is closed, attribute information of the application, wherein the attribute information is used to indicate at least one broadcast event associated with the service; and if the application is in a state of being able to receive the event, the application is pulled up by the event processing service to which the broadcast event is acquired, which can specifically include: if the application is in the state of being able to receive the event and the broadcast event matches the attribute information, the application is pulled up by the event processing service to which the broadcast event is acquired.
[0027] In this implementation form, 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 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.
[0028] 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: in response to the broadcast event, the application updates related data of the service.
[0029] In this implementation form, before the application receives the broadcast event, the event processing service has 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. In addition, the event processing service can further accurately determine whether the application can be pulled up by judging the state of the application receiving the event and the broadcast event, thereby further reducing invalid pulling up of the application.
[0030] In an implementation form 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 to which the broadcast event is acquired, which can specifically include: if the application is in the state of being able to receive the event and the number of times the application is pulled up in a unit time does not exceed a pull-up frequency of the application, the application is pulled up by the event processing service to which the broadcast event is acquired.
[0031] In this implementation form, the event processing service can further determine the pull-up frequency on the basis of judging the state of the application receiving the event, thereby avoiding the number of times the application is pulled up in a unit time being too many and reducing power consumption of the electronic device.
[0032] In an implementation form 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 to which the broadcast event is acquired, 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 the application is pulled up in a unit time does not exceed a pull-up frequency of the application, the application is pulled up by the event processing service to which the broadcast event is acquired.
[0033] In this implementation manner, the event processing service can further determine the pull-up frequency on the basis of determining 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 to reduce the power consumption of the electronic device.
[0034] In a third aspect, a method for processing a broadcast event is provided. The method 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 receiving the event; and sending, by the event processing service, a broadcast event to the application.
[0035] In a fourth aspect, an electronic device is provided. The electronic device includes an event processing service and an application.
[0036] The application is configured to configure a state of the application receiving an event according to a service running when the application is closed.
[0037] The event processing service is configured to pull up the application if the application is closed and the application is in the state of receiving the event.
[0038] The event processing service is further configured to send a broadcast event to the application.
[0039] In a fifth aspect, an electronic device is provided. The electronic device includes a memory and one or more processors. The memory is coupled to the processors. The memory stores computer program codes including computer instructions. When the computer instructions are executed by the processors, the electronic device performs the method for processing a broadcast event according to the third aspect.
[0040] In a sixth aspect, a computer readable storage medium is provided. The computer readable storage medium includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the method for processing a broadcast event according to the third aspect.
[0041] In a seventh aspect, a computer program product is provided. When the computer program product is executed on a computer, the computer performs the method for processing a broadcast event according to the first aspect and any implementation manner thereof, or performs the method for processing a broadcast event according to the second aspect and any implementation manner thereof.
[0042] The broadcast event processing method provided in the third aspect, the electronic device provided in the fourth aspect, the electronic device provided in the fifth aspect, the computer readable storage medium provided in the sixth aspect, and the computer program product provided in the seventh aspect can achieve the beneficial effects as described with reference to the first aspect and any of the implementation manners thereof, or the beneficial effects as described with reference to the second aspect and any of the implementation manners thereof, which will not be described herein again. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 A structure diagram of an electronic device provided in an embodiment of the present application is shown Figure 1 ;
[0044] Figure 2 A structure diagram of an electronic device provided in an embodiment of the present application is shown Figure 2 ;
[0045] Figure 3 A structure diagram of an electronic device provided in an embodiment of the present application is shown Figure 3 ;
[0046] Figure 4 A structure diagram of an electronic device provided in an embodiment of the present application is shown Figure 4 ;
[0047] Figure 5 A flow diagram of a broadcast event processing method provided in an embodiment of the present application is shown Figure 1 ;
[0048] Figure 6 A page diagram displayed by an electronic device provided in an embodiment of the present application is shown
[0049] Figure 7 A flow diagram of a broadcast event processing method provided in an embodiment of the present application is shown Figure 2 ;
[0050] Figure 8 A flow diagram of a broadcast event processing method provided in an embodiment of the present application is shown Figure 3 ;
[0051] Figure 9 A flow diagram of a broadcast event processing method provided in an embodiment of the present application is shown Figure 4 ;
[0052] Figure 10 A structure diagram of an electronic device provided in an embodiment of the present application is shown Figure 5 . DETAILED DESCRIPTION
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] However, in many scenarios, the application is pulled up, and it is found that the broadcast event does not need to be processed this time, and then the application will end immediately. This results in an invalid pull-up. For example, the 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.
[0058] It can be seen that whether the broadcast event needs to be responded to is determined by the application itself only 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.
[0059] 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.
[0060] 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.
[0061] Based on the above, the embodiments of the present application provide a broadcast event processing method. In the method, the 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, the application is pulled up by an event processing service, and the event processing service sends the broadcast event to the application.
[0062] In the above method, the application can configure the state of the event receiving of the application itself 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 the application is pulled up can be determined by considering the business of the application, thereby reducing invalid pull-ups and reducing the power consumption of the electronic device.
[0063] The broadcast event processing method provided by the embodiments of the present application can be applied to an electronic device. Referring to Figure 1As shown, the electronic device can include an event publisher, an event processing service (or public event service), and an event subscriber. The electronic device can also include a conditional dynamic setting module (not shown in the figure), for example.
[0064] The event publisher can be a variety 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), etc.
[0065] The event publisher can publish (or generate) a broadcast event. For example, when a user presses a power button, the power management module can monitor the screen state related to the power button, such as a screen-off state, a screen-on state, etc., and the power management module can publish a screen-off event, a screen-on event, etc. For example, when the electronic device is on screen and does not receive any operation or display task, the electronic device will automatically turn off the screen, 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 the network in response to the user's operation, or can automatically switch the network, for example, from a 4G (or 5G) network to a wireless network, etc., 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 the time zone (or time system) in response to the user's operation, or can automatically switch the 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 time system change event). For example, the electronic device can switch the language in response to the user's operation, or can automatically switch the language, and the language management module can monitor the language change of the electronic device and publish a language change event.
[0066] The time system can include a variety of time systems, such as a 24-hour system, a 12-hour system, etc.
[0067] 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 above-mentioned broadcast event and determine the event subscriber that subscribes to the broadcast event. The event processing service sends the monitored broadcast event to the event subscriber, and the event subscriber responds to the broadcast event or processes the broadcast event.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] In some possible application scenarios, the event subscriber can be pulled up by the event processing service when the event subscriber is closed, 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.
[0072] 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.
[0073] 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.
[0074] The event subscriber can set the state of the event subscriber receiving the event according to the running state of the business, for example,Figure 2 The business can be triggered by the user operating the event subscriber, or can be triggered by the cloud device sending an instruction to the event subscriber to control 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.
[0075] 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 associated businesses to determine the network cost generated by the associated businesses, and when the "Skylink" application is closed, the monitoring business also needs to run to achieve the purpose of real-time monitoring of the associated businesses.
[0076] 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.
[0077] The state of being able to receive events means that the event subscriber can receive the broadcast events 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 events sent by the event processing service.
[0078] 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 events that can trigger the update of the business in time when the event subscriber is 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 events when the event subscriber is 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.
[0079] In some possible application scenarios, the event subscriber's configuration of the event receiving status can also be regarded as a switch to enable or disable its event receiving function. The "can receive events" status indicates that the event receiving function is enabled, while the "cannot receive events" status indicates that the event receiving function is disabled.
[0080] After being restarted, the event subscriber will receive a broadcast event sent by the event handling service in the manner described above. The event subscriber can then determine whether the broadcast event can trigger an update of the service that was running when the event subscriber was shut down (or whether the broadcast event is related to the service that was running when the event subscriber was shut down). If the broadcast event can trigger an update of the service that was running when the event subscriber was shut down, the event subscriber can respond to the broadcast event by updating the relevant data for that service. If the broadcast event cannot trigger an update of the service that was running when the event subscriber was shut down, the event subscriber will not respond to the broadcast event and will not perform any processing operations.
[0081] In this approach, the event handling service determines the status of received events and then broadcasts the event to the event subscribers. The event subscribers then decide whether to respond to the broadcast event. Since the event subscribers only set the receiveable state when there is still business running at the time of shutdown, the broadcast event sent by the event handling service after its judgment is highly likely to be related to the business running at the time of shutdown. Therefore, this method can exclude some broadcast events that are not related to the business running at the time of shutdown, reducing invalid restarts of the event subscribers.
[0082] In some potential application scenarios, event subscribers can also configure their own attribute information based on the business processes running when the event is shut down. See [link to relevant documentation]. Figure 3 As shown. The attribute information can indicate at least one broadcast event associated with the service, or at least one broadcast event used to trigger an update to the service. It is understood that the content of this attribute information is dynamically configured based on the service running when the event subscriber is turned off, and is therefore variable. The event handling service can further determine whether to send the broadcast event to the event subscriber based on this attribute information.
[0083] For example, after determining that an event subscriber is in a state where it can receive events, the event handling service will not directly send the broadcast event to the event subscriber for processing. Instead, it will match the broadcast event with attribute information. If the broadcast event matches the attribute information, the event handling service will launch the event subscriber and send the broadcast event to it. If the broadcast event does not match the attribute information, the event handling service will not launch the event subscriber and will not send the broadcast event to it.
[0084] In this context, a broadcast event matching the attribute information indicates that the broadcast event is any one of the at least one broadcast events indicated by the attribute information; a broadcast event not matching the attribute information indicates that the broadcast event is not any one of the at least one broadcast events indicated by the attribute information.
[0085] Since the attribute information is configured based on the business that was running when the event subscriber was shut down, the event handling service can determine whether the received broadcast event is related to the business that was running when the event subscriber was shut down based on the attribute information.
[0086] If the event subscriber receives the event handling service through the above... Figure 3 Broadcast events sent in the manner shown can be responded to directly by updating the relevant data of the service in order to update the service.
[0087] In this approach, before the event subscriber receives a broadcast event, the event handling service has already determined whether the broadcast event can be sent to the event subscriber based on attribute information, thus reducing the need for the event subscriber to make its own judgment. Furthermore, by judging the event subscriber's event reception status and the broadcast event itself, the event handling service can further accurately determine whether the event subscriber can be reactivated, thereby further reducing invalid reactivations of the event subscriber.
[0088] In some potential application scenarios, event subscribers have pre-configured configuration files. These configuration files can include at least one broadcast event associated with (or that can trigger updates to) the event subscriber's business, at least one broadcast event the event subscriber needs to subscribe to, etc. In other words, the configuration file stores preset broadcast events. It's understood that the configuration file is a static file. For example, the configuration file can be the Manifest.xml file in the Android system.
[0089] Event subscribers can determine whether a received broadcast event is associated with a service that was running when the event subscriber was shut down, based on a configuration file; or, event subscribers can configure attribute information based on a configuration file, that is, determine at least one broadcast event associated with a service that was running when the event subscriber was shut down, according to the configuration file.
[0090] In some possible application scenarios, the above attribute information can also be displayed or saved in the form of an event list, and the attribute information or event list can be stored in the database corresponding to the electronic device.
[0091] The setting of the state of receiving events, the configuration of attribute information, and the like are not performed on a static configuration file of the event subscriber, nor do they change the configuration file, thereby reducing the case of multiple upgrades or updates of the event subscriber and reducing power consumption of the electronic device.
[0092] In some possible application scenarios, the setting of the state of receiving events, attribute information, and the like is a dynamic process. The setting of the state of receiving events can be equivalent to setting a switching condition of the event processing service for the event subscriber, which is a judgment on whether the event subscriber can receive any broadcast event as a whole. The setting of attribute information is equivalent to setting a condition for specific event content of the broadcast event or a condition for 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.
[0093] For example, when the event subscriber is determined to have no business that needs to be run when the electronic device is turned off for the first time, the event subscriber sets itself to the state of not receiving events. When the event subscriber is determined to have business that needs to be run when the electronic device is turned off for the second time, the event subscriber modifies the state to the state of receiving events. It can be seen that the setting of the state of receiving events and attribute information is dynamically set according to the business of the event subscriber, which can fully consider the business of the event subscriber when the electronic device is turned off in the process of processing the broadcast event, thereby reducing invalid pulling of the event subscriber.
[0094] It can be understood that the electronic device can include at least one event processing service. When the event processing service is one, the event processing service can serve as a hub corresponding to at least one event subscriber that has a subscription demand for the broadcast event. When the event processing service is multiple, 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.
[0095] In another possible application scenario, referring to FIG. 1, the electronic device can include an operating system and at least one application. Figure 4
[0096] The operating system can provide a plurality of system services to implement different functions. One of the system services 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 above application scenario 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 above application scenario and implement the functions that the event subscriber can implement.
[0097] The electronic device can be a mobile phone, a tablet computer, a notebook computer, a personal computer, a smart watch, a smart bracelet, or the like, which can be equipped with an operating system and installed applications.
[0098] The application is taken as an event subscriber as an example below to further illustrate the method for processing the broadcast event.
[0099] Referring to Figure 5 The method for processing the broadcast event can include the following steps S501-S504.
[0100] S501, the application configures a state of receiving an event according to a service running when the application is closed.
[0101] The calendar application can display dates, display holidays, provide a timed reminder, display pending items, and the like. The user can select a corresponding function on the calendar application according to his / her own needs, such as selecting a timed reminder function, so that the calendar application runs a timed reminder service.
[0102] Alternatively, the user can also select a card component corresponding to the calendar application to be displayed on the desktop of the electronic device according to his / 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.
[0103] 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. Figure 6 Figure 6
[0104] In some possible application scenarios, the timed reminder service and the card component service, and the like, 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 an event; 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 an event.
[0105] Taking the "Skylink" application as an example, the "Skylink" application can monitor some services that need to use the network, which 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 the network fees used. In addition, changes in the services monitored by the "Skylink" application, such as uninstallation and installation, can also affect the operation of the "Skylink" application. Therefore, the "Skylink" application needs to run services that monitor data packet uninstallation and services that monitor data packet installation to update its own services or data in a timely manner.
[0106] In some possible application scenarios, the above-mentioned services that monitor data packet uninstallation can be run after the "Skylink" application is started, or can be run when the "Skylink" application is closed. If there are services that monitor the "Skylink" application when it is closed, the "Skylink" application can be configured to be in a state in which it can receive events; if there are no services that monitor the "Skylink" application when it is closed, the "Skylink" application can be configured to be in a state in which it cannot receive events.
[0107] In the above solution, the application can configure the state in which the application receives events according to the services that run when the application is closed, and associate whether the application can receive broadcast events with the services that run when the application is closed. In this way, when the broadcast event is processed subsequently, the services of the application can also be considered, so that the process can be more accurate.
[0108] S502, the event processing service acquires a broadcast event generated in the electronic device and an application that subscribes to the broadcast event.
[0109] 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 uninstallation event.
[0110] In addition, in some possible application scenarios, since the configuration file of the application includes the broadcast event to which the application needs to subscribe, the event processing service can first acquire and parse the configuration file of the application, and determine the application that subscribes to the current broadcast event according to the content in the parsed configuration file.
[0111] For example, the profile of the calendar application includes a language change event, a time zone change event, etc., the profile of the clock application includes an off-screen event, a time zone change event, a time system change event, etc., and the profile of the "Skype" application includes a network state change event, a hand data packet offloading event, etc. If the event processing service receives a language change event, the application subscribed to the broadcast event can be determined as the calendar application. If the event processing service receives a time system change event, the application subscribed to the broadcast event can be determined as the clock application. If the event processing service receives a network state change event, the application subscribed to the broadcast event can be determined as the "Skype" application.
[0112] S503, if the application is closed and the application is in a state capable of receiving an event, the event processing service pulls up the application.
[0113] 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 capable of receiving an 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 capable of receiving an event, the event processing service pulls up the clock application. Alternatively, the event processing service receives a network state change event, and if the "Skype" application is closed and in a state capable of receiving an event, the event processing service pulls up the "Skype" application.
[0114] In some possible application scenarios, if the application is closed and the application is in a state incapable of receiving an event, the event processing service does not pull up the application.
[0115] 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 capable of receiving an event, so as to receive the broadcast event capable of triggering 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, the application does not need to focus on the update of the service when the application is closed, and thus the application is in a state incapable of receiving an 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 pulling up and reducing the low power consumption of the electronic device.
[0116] In some possible application scenarios, the application can further include information such as a pulling up frequency. The pulling up frequency is used to indicate the number of times that the application is pulled up in a unit of time, for example, once in 10 minutes or 10 times a day. The pulling up frequency can be customized by a user, or configured by a developer in an application development stage or an update stage. The pulling up frequency can be regarded as preset information.
[0117] 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 in which the application receives the event, and the like.
[0118] For example, if the application is closed, the application is in a state in which the application can receive the event, and the number of times that 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 in which the application can receive the event, and the number of times that 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.
[0119] For example, when the calendar application is closed, if the calendar application is in a state in which the calendar application can receive the event, and the number of times that the calendar application is pulled up in 1 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.
[0120] For another example, when the "Tiantong" application is closed, if the "Tiantong" application is in a state in which the "Tiantong" application can receive the event, and the number of times that the "Tiantong" application is pulled up in 10 minutes (for example, 1 time) is equal to the pull-up frequency (for example, 1 time), the event processing service does not pull up the "Tiantong" application.
[0121] In this way, the event processing service can further determine the pull-up frequency on the basis of the state in which the application receives the event, so that the number of times that the application is pulled up in a unit of time is prevented from being too large, and the power consumption of the electronic device can be reduced.
[0122] S504, the event processing service sends a broadcast event to the application.
[0123] The event processing service sends the broadcast event to the application in a state in which the application can receive the event. After the application receives the broadcast event, the application can perform a corresponding operation in response to the broadcast event, for example, updating a service corresponding to the broadcast event.
[0124] 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 that is running when the application is closed. If the broadcast event is associated, the application processes the broadcast event. If the broadcast event is not associated, the application does not respond to the broadcast event, that is, the application does not perform any processing operation on the broadcast event.
[0125] For example, after receiving the language change event, the calendar application determines that the language change event is associated with the timing 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 timing reminder service in response to the language change event. If the calendar application receives the network state change event, and determines that the network state change event is not associated with the timing reminder service running when the calendar application is closed, the calendar application does not respond to the network state change event.
[0126] In this solution, the application can determine by itself whether to respond to the broadcast event. Based on the determination made by the event processing service based on the state of the application receiving the event, the application makes further determination, so that some broadcast events that are not associated with the service running when the application is closed can be excluded, and invalid pulling of the application can be reduced.
[0127] In some possible application scenarios, after the application configures the state of the application receiving the event, the state 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. In addition, the event processing service can obtain the state information of the application from the database, and determine whether the application is in the state of receiving the event according to the state information.
[0128] In this way, the state information is stored in the database instead of the configuration file, so that the configuration file does not need to be modified, and the application does not need to be upgraded, and the power consumption of the electronic device can be reduced. In addition, the event processing service does not need to parse the configuration file of the application when obtaining the state information, so that the processing time of the broadcast event can be reduced, and the efficiency can be improved.
[0129] In the solution of S501-S504, the application can configure the state of the application receiving the event according to the service running when the application is closed. After receiving the broadcast event, the event processing service pulls the application only when the application subscribing to the broadcast event is in the state of receiving the event. In this way, whether to pull the application can be determined according to the service of the application, so that invalid pulling of the application can be reduced, and the power consumption of the electronic device can be reduced.
[0130] In some possible application scenarios, the application can also configure attribute information of the application according to the service running when the application is closed. The attribute information can indicate at least one broadcast event associated with the service running when the application is closed.
[0131] For example, the calendar application runs the timing reminder service when the calendar application is closed. In order to ensure that the language, time zone, and the like of the electronic device change, the language, reminder time, and the like of the reminder content corresponding to the timing reminder service 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.
[0132] For another example, the "Skylink" application runs the monitoring service A and the data packet offloading service corresponding to the service B when the "Skylink" application is closed. In order to ensure that the data packet corresponding to the service A or the service B is offloaded, the "Skylink" application can update the corresponding service in time, and 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.
[0133] 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 service and the corresponding data packet information of the other applications, 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 run when the "Skylink" application is closed, and configure the attribute information of the application according to the running service.
[0134] After the event processing service receives the broadcast event and determines the application subscribing to the broadcast event, the event processing service can further determine whether to pull up the application based on the attribute information, so as to further ensure the effectiveness of the application pull-up.
[0135] For example, referring to FIG. 7, Figure 7 As shown in FIG. 7, the processing method of the broadcast event can further include the following steps S701-S705.
[0136] S701, the application configures the state of the application receiving the event according to the service running when the application is closed.
[0137] S702, the event processing service obtains the broadcast event generated in the electronic device and the application subscribing to the broadcast event.
[0138] S703, the event processing service obtains the attribute information of the application.
[0139] S704, if the application is closed, the application is in a state of being able to receive the event, and the broadcast event matches the attribute information, the event processing service pulls up the application.
[0140] In addition, if the application is closed, the application is in a 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.
[0141] 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 a state of being able to receive an event and the language change event matches the attribute information of the calendar application, the event processing service pulls up the calendar application.
[0142] For another example, the attribute information of the "SkyWire" 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 "SkyWire" application is closed, and the event processing service determines that the "SkyWire" application is in a state of being able to receive an event and the data packet A offloading event matches the attribute information of the "SkyWire" application, the event processing service pulls up the "SkyWire" application.
[0143] S705. The event processing service sends a broadcast event to the application.
[0144] In the above solution of S701-S705, the event processing service determines whether the broadcast event can be sent to the application according to the attribute information before the application receives the broadcast event, thereby reducing the process of the application determining by itself. If the application that subscribes to the broadcast event is in a state of being able to receive an event and the broadcast event matches the attribute information of the application, the event processing service pulls up the application. In this way, the business situation of the application can be considered to determine whether to pull up the application, thereby reducing invalid pulling up and reducing the power consumption of the electronic device.
[0145] In some possible application scenarios, the event processing service can further determine according to the pulling up frequency of the application when performing S704.
[0146] For example, if the application is closed, the application is in a state of being able to receive an event, the broadcast event matches the attribute information of the application, and the number of times that the application is pulled up 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 an event, the broadcast event matches the attribute information of the application, and the number of times that the application is pulled up 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.
[0147] 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 an event and whether the broadcast event matches the attribute information, thereby avoiding that the application is pulled up too many times in a unit of time, and reducing the power consumption of the electronic device.
[0148] In some potential application scenarios, after configuring attribute information, the application can store this information in a database corresponding to the electronic device. This database can be maintained by a cloud device or server, or it can correspond to a portion of the storage space within the electronic device. Furthermore, the event handling service can retrieve the application's attribute information from the database and determine whether to launch the application based on this information.
[0149] By storing this attribute information in a database instead of a configuration file, modifications to the configuration file are unnecessary, eliminating the need for application upgrades and reducing power consumption of electronic devices. Furthermore, when the event handling service retrieves this attribute information, it does not need to parse the application's configuration file, thus reducing broadcast event processing time and improving efficiency.
[0150] In some potential application scenarios, the application can also provide users with a function page to set the launch frequency. The launch frequency can be set by the user selecting a value on the function page, or by the user entering a value. Furthermore, the application can respond to the user's setting and configure the application's launch frequency accordingly.
[0151] As can be seen from the above, the broadcast event processing method provided in this application embodiment can reduce invalid application launches, reduce the number of application upgrades, and thus reduce the power consumption of electronic devices.
[0152] For example, see Figure 8 As shown in (a), after running business A (or performing business action A), application 1 generates some data 'a'. Data 'a' may be displayed on the electronic device's screen or may exist in the database corresponding to the electronic device. Data 'a' may be related to system state B. When system state B changes, application 1 needs to refresh data 'a'. Therefore, if application 1 is closed, the event handling service will execute step S8101 to monitor the broadcast event of system state B change. When the broadcast event of system state B change occurs, step S8102 will be executed to start application 1 and send the broadcast event to application 1, causing application 1 to respond.
[0153] However, if service A is not running (or service action A has not occurred), then the broadcast event of the event handling service monitoring system state B change will generate invalid application restart behavior, thereby increasing the power consumption of electronic devices.
[0154] In the method for handling broadcast events provided in the embodiments of this application, see [link to relevant documentation]. Figure 8As shown in (b), Application 1 can be configured to receive events. Specifically, when Service A is running while the application is off, Application 1 is in a state where it can receive events. Therefore, when a broadcast event indicating a change in system state B occurs, the event handling service executes step S8201, detects the broadcast event, and then executes step S8202, thereby restarting Application 1. When no service is running while the application is off, Application 1 is in a state where it cannot receive events. Therefore, when a broadcast event indicating a change in system state B occurs, the event handling service will not restart Application 1. This method reduces some invalid restarts of Application 1 and also reduces the power consumption of electronic devices.
[0155] For example, see Figure 9 As shown in (a), the event handling service corresponding to Application 2 initially needs to monitor the unloading of data packets A, B, and C. The unloading events for data packets A, B, and C are configured in Application 2's configuration file. However, as the business evolves, monitoring for the unloading of data packet D needs to be added. If the newly added unloading event for data packet D is added to Application 2's configuration file, it will lead to an upgrade of Application 2. In other words, Application 2 needs to be upgraded every time a new unloading event is added. The increased number of upgrades for Application 2 will obviously increase the power consumption of electronic devices.
[0156] In the method for handling broadcast events provided in the embodiments of this application, see [link to relevant documentation]. Figure 9 As shown in (b), Application 2 can directly refresh the attribute information, such as adding a data packet D unload event to the attribute information. Since the configuration file is not modified, Application 2 does not need to be upgraded, which can reduce the number of upgrades of Application 2 and thus reduce the power consumption of electronic devices.
[0157] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described in the embodiments of this application. In addition, it should be noted that the process details involved in one embodiment of this application are also applicable to other embodiments in a similar manner, or different embodiments may be combined.
[0158] In addition, some steps in the method embodiments can be 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 in the method embodiments.
[0159] In addition, each method embodiment can be implemented independently or in combination.
[0160] It can be understood that, in order to realize the above functions, the foregoing electronic device comprises hardware and / or software modules corresponding to each function. The algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is realized in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0161] The present embodiment 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 realized in the form of hardware. It should be noted that the division of modules in the present embodiment is illustrative and is only a logical functional division. Actual implementation can have another division manner.
[0162] The present embodiment also provides an electronic device. As shown in the figure, the electronic device can include one or more processors 1001, a memory 1002, and a communication interface 1003. Figure 10
[0163] 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.
[0164] 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 present embodiment.
[0165] The processor 1001 can be a processor or a 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 devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute the various exemplary logical blocks, modules and circuits described in connection with the present disclosure. The processor can also be a combination of implementing computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.
[0166] The bus 1004 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 1004 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.
[0167] The embodiments of the present application also provide a computer readable storage medium, which includes computer instructions, when the computer instructions run on an electronic device, the electronic device executes the related method steps in the above method embodiments.
[0168] The embodiments of the present application also provide a computer program product, when the computer program product runs on a computer, the computer executes the related method steps in the above method embodiments.
[0169] The electronic device, the computer readable storage medium or the computer program product provided by the present application are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved are referable to the beneficial effects in the corresponding method provided above, which will not be repeated here.
[0170] 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 exemplified, 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.
[0171] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device 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 device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0172] The units described as separate components can or can not be physically separated, and the components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place or distributed to multiple different places. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0173] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, 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.
[0174] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this 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. The software product is 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 program code storage media.
[0175] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed by 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 for processing broadcast events, characterized in that, An event processing service applied in an electronic device, the electronic device further including an application, the method comprising: Acquire broadcast events generated in the electronic device and applications that subscribe to the broadcast events; If the application is closed and the application is in an event-receiving state, then the application is launched, wherein the event-receiving state is configured by the application based on the business running when it is closed; Send the broadcast event to the application.
2. The method according to claim 1, characterized in that, If there are running services when the application is closed, the application is in a state that can receive events; if there are no running services when the application is closed, the application is in a state that cannot receive events.
3. The method according to claim 1 or 2, characterized in that, The step of launching the application if it is closed and in an event-receiving state includes: The frequency of the application launch is obtained, wherein the frequency of the launch represents the number of times the application is launched per unit time. If the application is closed, the application is in an event-receiving state, and the number of times the application is launched within a unit of time does not exceed the launch frequency, then the application is launched.
4. The method according to claim 1 or 2, characterized in that, The step of launching the application if it is closed and in an event-receiving state includes: Obtain attribute information corresponding to the application, wherein the attribute information is configured by the application according to the business that runs when the application is closed, and the attribute information is used to indicate at least one broadcast event associated with the business; If the application is closed, the application is in an event-receiving state, and the broadcast event matches the attribute information, then the application is launched.
5. The method according to claim 4, characterized in that, The step of launching the application if the application is closed, the application is in a state that can receive events, and the broadcast event matches the attribute information includes: The frequency of the application launch is obtained, wherein the frequency of the launch represents the number of times the application is launched per unit time. If the application is closed, the application is in an event-receiving state, the broadcast event matches the attribute information, and the number of times the application is launched within a unit of time does not exceed the launch frequency, then the application is launched.
6. The method according to any one of claims 1-5, characterized in that, The broadcast events include at least one of the following: screen off event, language change event, time zone change event, time system change event, network status change event, and packet offloading event.
7. The method according to any one of claims 1-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-6, characterized in that, The application is a network billing application, and the service is a data packet offloading monitoring service.
9. A method for processing broadcast events, characterized in that, An application in an electronic device, the electronic device further including an event handling service, the method comprising: Configure the event receiving status of the application based on the business operations running when the application is closed; If the application is in the state of being able to receive events, it is activated by the event handling service that receives the broadcast event, wherein the broadcast event is generated in the electronic device and the application subscribes to the broadcast event; Receive the broadcast event sent by the event handling service.
10. The method according to claim 9, characterized in that, The step of configuring the state of the application receiving events based on the business status running when the application is closed includes: If there are running services when the application is closed, then configure the application to be in an event-receiving state; If no services are running when the application is shut down, the application is configured to be in a state where it cannot receive events.
11. The method according to claim 9 or 10, characterized in that, After receiving the broadcast event sent by the event handling service, the method further includes: If the broadcast event is associated with a service that was running when the application was shut down, then in response to the broadcast event, the relevant data of the service is updated.
12. The method according to claim 10, characterized in that, The method further includes: Configure the application's attribute information based on the services that run when the application is closed; the attribute information is used to indicate at least one broadcast event associated with the service; If the event is in the state where it can receive events, the event handling service that receives the broadcast event will be activated, including: If the event is in the state of being able to receive events and the broadcast event matches the attribute information, then the event handling service that received the broadcast event will be activated.
13. The method according to claim 12, characterized in that, After receiving the broadcast event sent by the event handling service, the method further includes: In response to the broadcast event, update the relevant data for the service.
14. The method according to any one of claims 9-11, characterized in that, If the event is in the state where it can receive events, the event handling service that receives the broadcast event will be activated, including: If the application is in the state of being able to receive events and the number of times the application is launched within a unit of time does not exceed the launch frequency of the application, then the event handling service that received the broadcast event will launch the application.
15. The method according to claim 12, characterized in that, If the event is in the state of being able to receive events and the broadcast event matches the attribute information, then the event handling service that received the broadcast event is activated, including: If the application is in the state of being able to receive events, the broadcast event matches the attribute information, and the number of times the application is launched within a unit of time does not exceed the launch frequency of the application, then the event handling service that received the broadcast event will launch the application.
16. The method according to any one of claims 9-15, characterized in that, The broadcast events include at least one of the following: screen off event, language change event, time zone change event, time system change event, network status change event, and 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 billing application, and the service is a data packet offloading monitoring service.
19. A method for processing broadcast events, characterized in that, Applied to an electronic device, the electronic device including an event handling service and an application; the method includes: The application configures the state of the events it receives based on the business operations it is running when it is closed. If the application is closed and the application is in an event-receiving state, the event handling service will restart the application. The event handling service sends the broadcast event to the application.
20. An electronic device, characterized in that, This includes event handling services and applications; The application is configured to receive events based on the business operations running when the application is closed. If the application is closed and the application is in an event-receiving state, the event handling service is used to restart the application; The event handling service is also used to send the broadcast event to the application.
21. An electronic device, characterized in that, The device includes a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the broadcast event processing method as described in claim 19.
22. A computer-readable storage medium, characterized in that, It includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method for processing broadcast events as described in claim 19.
23. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the broadcast event processing method as described in any one of claims 1-8, or to perform the broadcast event processing method as described in any one of claims 9-18.
Citation Information
Patent Citations
Broadcast receiving method, system and equipment
CN105516487A
Broadcast event processing method and device
CN110998525A
Communication method and device for multicast broadcast service, medium and electronic equipment
CN113490155A
Broadcast event processing method and device
WO2019028680A1