Event handling method, system, device, computer equipment and storage medium
By determining the target operator of the device and creating corresponding business processes, the problem of how the device supports multiple operator logic is solved, and the flexibility of device operation and multi-operator support is achieved.
Patent Information
- Application Number
- CN202210130278.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-11
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2042-02-11
AI Technical Summary
How to make the device support multiple operator logic and improve the flexibility of the device operation.
By determining the target operator of the current device, creating the business process corresponding to the target operator, obtaining and applying preset processing conditions to process events.
The device supports the logic of multiple operators, improves the flexibility of device operation, and allows each operator to have its own unique business processes.
Smart Images

Figure CN114490134B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and particularly to an event processing method, system, device, computer equipment, and storage medium. Background Art
[0002] Many operator devices are required to support the OMADM protocol for device configuration or firmware upgrade. However, each operator will customize the details during system configuration or firmware upgrade, presenting different user experiences.
[0003] However, how to make the device support multiple operator logics is a major problem currently faced. Summary of the Invention
[0004] Embodiments of this application provide an event processing method, system, device, computer equipment, and storage medium, which can formulate corresponding service processes for each operator to support multiple operator logics and improve the flexibility of device operation.
[0005] An embodiment of this application provides an event processing method, including: determining a target operator corresponding to the current device; creating a service process corresponding to the target operator, where the service process is used to determine a preset processing condition and process an event according to the preset processing condition; in response to a processing request for a to-be-processed event, obtaining the preset processing condition corresponding to the target operator through the service process; and when the to-be-processed event meets the preset processing condition, processing the to-be-processed event through the service process.
[0006] An embodiment of this application provides an event processing system, including: a service process creation module and multiple operator modules corresponding to different operators. The operator module includes a preset processing condition obtaining module and an event processing module. The process creation module is used to determine a target operator corresponding to the current device and create a service process corresponding to the target operator, where the service process is used to determine a preset processing condition and process an event according to the preset processing condition; the preset processing condition obtaining module is used to obtain the preset processing condition corresponding to the target operator through the service process in response to a processing request for a to-be-processed event; and the event processing module is used to process the to-be-processed event through the service process when the to-be-processed event meets the preset processing condition.
[0007] An embodiment of the present application further provides an event processing device, including: a first determination unit configured to determine a target operator corresponding to the current device; a creation unit configured to create a service process corresponding to the target operator, where the service process is used to determine a preset processing condition and process an event according to the preset processing condition; a second determination unit configured to, in response to a processing request for a to-be-processed event, obtain the preset processing condition corresponding to the target operator through the service process; and a processing unit configured to, when the to-be-processed event meets the preset processing condition, process the to-be-processed event through the service process.
[0008] An embodiment of the present application further provides a computer device, including a memory storing multiple instructions; the processor loads the instructions from the memory to execute the steps in any one of the event processing methods provided by the embodiments of the present application.
[0009] An embodiment of the present application further provides a computer-readable storage medium storing multiple instructions, where the instructions are suitable for being loaded by a processor to execute the steps in any one of the event processing methods provided by the embodiments of the present application.
[0010] The embodiment of the present application can determine a target operator corresponding to the current device; create a service process corresponding to the target operator, where the service process is used to obtain a preset processing condition and process an event according to the preset processing condition; in response to a processing request for a to-be-processed event, obtain the preset processing condition corresponding to the target operator through the service process; and when the to-be-processed event meets the preset processing condition, process the to-be-processed event through the service process.
[0011] By adopting the solution provided by the embodiment of the present application, by determining the target operator corresponding to the current device, the current device not only has the generality of supporting multiple operators, but also can have the specificity for the target operator by creating a service process corresponding to the target operator, meeting the application scenarios of multiple operators. In addition, the embodiment of the present application creates a targeted service process and preset processing conditions for the target operator, so as to formulate different service processes for each operator, which is beneficial to multi-operator support and expansion. Thus, the present application can formulate corresponding service processes for each operator to support the logics of multiple operators and improve the flexibility of device operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0013] Figure 1a It is a schematic diagram of the scenario of the event processing system provided by the embodiment of the present application;
[0014] Figure 1b It is a schematic flowchart of the event processing method provided by the embodiment of the present application;
[0015] Figure 1c It is a schematic structural diagram of the state machine factory provided by the embodiment of the present application;
[0016] Figure 1d It is another schematic flowchart of the event processing system provided by the embodiment of the present application;
[0017] Figure 2a It is a schematic structural diagram of the event processing system provided by the embodiment of the present application;
[0018] Figure 2b It is a schematic flowchart of the process for generating the business unit of the operator provided by the embodiment of the present application;
[0019] Figure 2c It is a schematic flowchart of the process for determining the target operator provided by the embodiment of the present application;
[0020] Figure 2d It is a schematic diagram of the state machine working provided by the embodiment of the present application;
[0021] Figure 3 It is a schematic structural diagram of the event processing device provided by the embodiment of the present application;
[0022] Figure 4 It is a schematic structural diagram of the computer device provided by the embodiment of the present application. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0024] The embodiments of the present application provide an event processing method, system, device, computer device, and storage medium.
[0025] Among them, the event processing device may be specifically integrated in an electronic device, and the electronic device may be a device such as a terminal or a server. Among them, the terminal may be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC); the server may be a single server or a server cluster composed of multiple servers.
[0026] In some embodiments, the event processing device may also be integrated in multiple electronic devices. For example, the event processing device may be integrated in multiple servers, and the multiple servers may implement the event processing method of the present application.
[0027] In some embodiments, the server may also be implemented in the form of a terminal.
[0028] For example, referring to Figure 1a , in some embodiments, a schematic diagram of a scenario of an event processing system is provided, and the system can implement the event processing method. The event processing system may include a terminal 1000, a server 2000, and a network 3000. The server 2000 and the terminal 1000 can perform data interaction through the network 3000.
[0029] Among them, the terminal is used to determine the target operator corresponding to the current device; create a service process corresponding to the target operator, and the service process is used to determine a preset processing condition and process an event according to the preset processing condition; in response to a processing request for a to-be-processed event, obtain the preset processing condition corresponding to the target operator through the service process; when the to-be-processed event meets the preset processing condition, process the to-be-processed event through the service process. Among them, the server is used to perform data interaction with the terminal. Among them, the network is used for data transmission between the server and the terminal, and the network can be a wireless network or a wired network. For example, the wireless network is a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc.
[0030] The following will be described in detail respectively.
[0031] In this embodiment, an event processing method is provided. As Figure 1b shown, the specific process of the event processing method may be as follows:
[0032] 110. Determine the target operator corresponding to the current device.
[0033] Among them, the current device refers to the carrier running the event processing method of the embodiment of the present application, and the current device may carry software or systems provided by different operators. For example, the current device may be a terminal such as a mobile phone or a tablet computer.
[0034] Among them, the target operator refers to the operator determined according to the current device. In actual application, the corresponding target operator may be determined through the current device information, or the operator may preset the target operator corresponding to the device. For example, for a mobile phone, it may carry systems customized by different operators. For example, when the mobile phone uses the service of operator A, it may carry the system customized by operator A, and operator A is the target operator corresponding to the mobile phone.
[0035] In some embodiments, determining the target operator corresponding to the current device includes:
[0036] Obtaining the device information of the current device;
[0037] Determining the target operator from multiple operators according to the device information.
[0038] Among them, the device information refers to the information in the current device that can be used to determine the target operator, which may include device identification information (such as identification code), device parameters, and other device information that can be used to determine the target operator, and can be specifically set according to the application scenario. For example, for a mobile phone, the device information may be SIM card information (user identification card, which may include the mobile phone number), MEID number (Mobile Equipment Identification Number), IMEI (International Mobile Equipment Identity) number, etc., and the service provider that the mobile phone should use can be determined through the obtained device information. In actual applications, the current device can determine the target operator from multiple operators locally according to the device information. For example, the current device determines the operator providing services for it as the target operator according to the SIM card information; it can also determine the target operator through the information interaction between the current device and the server. For example, in the server, there may be a form recording the correspondence between each device information and the operator. After the current device obtains the device information, it sends the device information to the server, and the server determines the operator corresponding to the device information as the target operator through this form.
[0039] Since the current device can support multiple operators, determining the target operator corresponding to the current device through the device information provides a running environment matching the current device for the event processing method of the embodiments of the present application, avoiding running errors. In actual applications, the device information of the current device can be modified to make the current device correspond to different target devices. In addition, by setting that the current device can support multiple operators, the current device has versatility, and by setting that the current device can determine the target operator according to the device information, the current device has specificity, meeting the application scenarios of multiple operators.
[0040] In some embodiments, before, in response to a processing request for a to-be-processed event, obtaining the preset processing condition corresponding to the target operator through a service process, further includes:
[0041] For each operator, determining the preset processing condition corresponding to the operator.
[0042] Among them, the preset processing condition refers to the condition used to determine whether the current device processes the to-be-processed event, and can be preset according to experience or application scenarios. For example, such as Figure 1cAs shown, the preset processing conditions can be represented by the states of a state machine. For example, the state machine can include states 1 to 4. Among them, state 1 pays attention to events C, D, and E; state 2 pays attention to events A, C, and E; state 3 pays attention to events A, B, D, and E; state 4 pays attention to events B, C, and E. That is, when the state of the state machine meets state 1, events C, D, and E can be processed, and so on for the events in states 2 to 4.
[0043] Since the current device can support multiple operators, different preset processing conditions can be determined for different operators. For example, as Figure 1c shown, it can be set that the state machine of operator A includes states 1 to 4 as described above, and the state machine of operator B can include states 1 to 4. Among them, state 1 pays attention to events A, B, C, D, and E; state 2 pays attention to events C, D, and E; state 3 pays attention to events A, C, D, and E; state 4 pays attention to events C and E. In this way, for operator A and operator B, even when the state machine is in the same state, the events that the current terminal can process can be different, so as to achieve differential settings for different operators, enable each operator to implement its own state machine, and make real-time responses to the events it pays attention to, so as to improve the efficiency of reacting to different events.
[0044] The events to be processed refer to the events set according to the application scenario of the current device. For example, as Figure 1d shown, when the event processing method in the embodiment of the present application is applied to the firmware update or system configuration process of the current device, events such as user interaction, network change, battery power, and memory need to be considered. Therefore, the events to be processed can include at least one of memory change events, network change events, user interaction result events, power change events, Session start events, Session end events, Timer expiration events, etc.
[0045] 120. Create a service process corresponding to the target operator, and the service process is used to obtain the preset processing conditions and process events according to the preset processing conditions.
[0046] Among them, the service process refers to the software or system running process for the target operator. For example, the corresponding target operator can be identified according to the device information of the current device, and the service unit of the target operator can be identified, and the corresponding service process can be created, so that a UI interface, preset processing conditions, and event processing methods customized by the target operator are presented during the use of the current device, etc. In actual application, the current device can obtain the information required to create the service process from the server.
[0047] By creating targeted service processes for target operators, different service units can be formulated for each operator, which is conducive to multi-operator support and expansion.
[0048] 130. In response to a processing request for a to-be-processed event, obtain a preset processing condition corresponding to the target operator through the service process.
[0049] Among them, the processing request for the to-be-processed event can be generated by the trigger of a preset task or triggered by an event, etc., and can be specifically set according to the type of event and the application scenario. In practical applications, when the current device obtains the information required to create a service process from the server, it can simultaneously obtain the preprocessing condition corresponding to the target operator. It is also possible to store the preprocessing conditions corresponding to all operators in the current device, so as to find the preprocessing condition corresponding to the target operator from the preprocessing conditions corresponding to multiple operators through the service process.
[0050] In some embodiments, before obtaining the preset processing condition corresponding to the target operator through the service process in response to the processing request for the to-be-processed event, it further includes:
[0051] Create a task queue through the service process;
[0052] In response to a trigger instruction for a preset task, add the preset task to the task queue through the service process;
[0053] Generate a processing request for the to-be-processed event through the service process according to the trigger instruction of the preset task.
[0054] Among them, the task queue refers to a queue used to store tasks waiting to be executed. As Figure 1d shown, the trigger instruction for the preset task can be an instruction initiated by a user, the current device, or the server, etc. For example, this instruction can be generated by a user operation. When the user clicks the button to update the firmware of the current device, it triggers the firmware update to create an update task. After receiving the trigger instruction for the preset task, the current device can create the preset task according to the trigger instruction and add the preset task to the task queue to wait for execution. When creating the preset task, a processing request for the to-be-processed event will also be generated according to the trigger instruction. The to-be-processed event can be an event corresponding to the preset task. For example, when updating the firmware of the current device, events such as memory change events, network change events, user interaction result events, and power change events need to be considered. Therefore, these events can all be to-be-processed events, and thus processing requests for these events can be generated.
[0055] In practical applications, since the current device is not limited to executing the tasks corresponding to the events to be processed, or there may be multiple preset tasks, and each preset task corresponds to multiple events to be processed. At this time, a task queue is established to store all the preset tasks to be processed, so as to facilitate subsequent calling and execution one by one, and avoid running errors.
[0056] Before obtaining the preset processing conditions corresponding to the target operator in response to a processing request for an event to be processed, an event queue for storing events to be processed can also be created through a service process. After generating a processing request for an event to be processed through the service process, the event to be processed can be added to the event queue to wait for processing. In this way, the event queue can be used to store the tasks to be processed corresponding to different preset tasks. When executing, the corresponding tasks in the task queue can be called in the order of the events to be processed in the event queue, so as to process the events to be processed by executing the tasks.
[0057] In some embodiments, in response to a processing request for an event to be processed, obtaining the preset processing conditions corresponding to the target operator through a service process includes:
[0058] In response to a processing request for an event to be processed, obtain a task queue through a service process, where the task queue is used to store tasks;
[0059] Through the service process, determine the task corresponding to the event to be processed in the task queue as the target task;
[0060] Execute the target task through the service process to obtain the preset processing conditions corresponding to the target operator.
[0061] When processing an event to be processed, the task corresponding to the event to be processed currently being processed in the task queue can be determined as the target task, and the preset processing conditions corresponding to the target operator can be obtained through the target task. When the target task obtains the preset processing conditions corresponding to the target operator, the service process will match the event to be processed with the preset processing conditions to determine whether the event to be processed meets the preset processing conditions. By calling the target task corresponding to the event to be processed to obtain the preset processing conditions, the event to be processed is associated with the target task again, avoiding processing events to be processed that are irrelevant to the target task and avoiding running errors. For example, when using a state machine to determine whether an event to be processed meets the preset processing conditions, the target task can determine its corresponding state machine according to the target operator, and can also send the event to be processed to the state machine for judgment. As Figure 1d shown, if event 1 is an event to be processed, then task 2 corresponding to the event to be processed 1 can be determined as the target task, and the target task can be executed, and the state machine corresponding to the target operator can be obtained to use the state machine to determine whether to process event 1.
[0062] It should be noted that when a task in the task queue corresponds to multiple pending events, in order to save resources, the pending events corresponding to the same task can repeatedly call the task in the task queue to process the pending events. Alternatively, multiple pending events corresponding to the same task can be sent to the task so that the task can process the pending events.
[0063] 140. When the pending event meets the preset processing conditions, the business process processes the pending event.
[0064] After obtaining the processing request for the pending event, it can be determined in the business process whether to process the pending event according to the preset processing conditions. For example, the current device can record multiple preset processing conditions corresponding to the target operator. If the preset processing conditions are represented by the states of a state machine, when the current state of the state machine focuses on the preprocessing event, it is considered that the pending event meets the preset processing conditions, and thus the business process can process the pending event. For the above-mentioned operator A, when the pending event is A, when the state of the state machine is state 1 or state 3, it is considered that the pending event meets the preset processing conditions, that is, when the state machine is in state 1 or state 3, the pending event A can be processed, and when it is in other states, the pending event is not processed.
[0065] In some embodiments, processing the pending event through the business process includes:
[0066] Create session information corresponding to the pending event through the business process;
[0067] Send the session information to the server;
[0068] Obtain the data information corresponding to the session information sent by the server.
[0069] Among them, the session information refers to the information used for the current device to communicate with the server, and may include, but is not limited to, request information, identification information, etc. For example, when performing a firmware update on the current device, session information including a firmware download request, verification information, etc. can be created and sent to the server. After receiving the session information and passing the verification information, the server sends the corresponding firmware download information to the current device according to the firmware download request so that it can perform a firmware update based on this information.
[0070] By creating session information for interacting with the server, the interaction between the current device and the server is realized to obtain data information corresponding to the event to be processed from the server. At the same time, by interacting in the form of session information, the session can be cleared immediately after the current session, improving the utilization rate of storage space and the running efficiency of the current device. It should be noted that in the above process, the steps of "sending the session information to the server" and "obtaining the data information corresponding to the session information sent by the server" can be executed by the business process or by other processes.
[0071] The event processing solution provided by the embodiments of the present application can be applied to various terminal scenarios. For example, taking a mobile phone as an example, determine the target operator corresponding to the current device; create a business process corresponding to the target operator, and the business process is used to obtain preset processing conditions and process events according to the preset processing conditions; in response to a processing request for an event to be processed, obtain the preset processing conditions corresponding to the target operator through the business process; when the event to be processed meets the preset processing conditions, process the event to be processed through the business process.
[0072] By adopting the solution provided by the embodiments of the present application, by determining the target operator corresponding to the current device, the current device not only has the versatility to support multiple operators, but also can have the exclusivity for the target operator by creating a business process corresponding to the target operator, meeting the application scenarios of multiple operators. In addition, the embodiments of the present application create targeted business processes and preset processing conditions for the target operator, so that different business processes can be formulated for each operator, which is beneficial to the support and expansion of multiple operators.
[0073] As can be seen from the above, the embodiments of the present application can formulate corresponding business processes for each operator to support multiple operator logics and improve the flexibility of device operation.
[0074] To better implement the above method, the embodiments of the present application also provide an event processing system, which can be specifically integrated in an electronic device, and the electronic device can be devices such as a terminal and a server. Among them, the terminal can be devices such as a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, and a personal computer; the server can be a single server or a server cluster composed of multiple servers.
[0075] For example, in this embodiment, taking the event processing system specifically integrated in the terminal as an example, the method of the embodiments of the present application will be described in detail.
[0076] For example, as Figure 2a shown, the event processing system can include a business process creation module 210, an event processing module 230, and multiple operator modules 220. The multiple operator modules correspond to different operators, where:
[0077] A process creation module 210, configured to determine a target operator corresponding to the current device; and create a service process corresponding to the target operator, where the service process is configured to obtain preset processing conditions and process events according to the preset processing conditions;
[0078] An operator module 220, configured to, in response to a processing request for a to-be-processed event, obtain preset processing conditions corresponding to the target operator through the service process;
[0079] An event processing module 230, configured to, when the to-be-processed event meets the preset processing conditions, process the to-be-processed event through the service process.
[0080] The operator module can be a module customized for each operator according to operator requirements or application scenarios. In practical applications, in the embodiments of the present application, the concept of a factory can be used, with each module regarded as a service unit. For the convenience of creation during operation, a configuration file and a service unit factory for operators are defined for each project. Through the configuration file and the service unit factory, service units (operator modules) corresponding to each operator can be created during operation. This approach is beneficial for multi-operator support and expansion. As Figure 2b shown, based on the configuration files of Operator A, Operator B, and Operator C, by establishing an abstract factory, service units of Operator A, service units of Operator B, and service units of Operator C can be respectively formed in the service unit factory. After obtaining the target operator corresponding to the current device, a service process can be created and run based on the service unit of this operator. For the service units of each operator, they include an event management module, a timer module, a task scheduling module, and a state machine module that can be customized according to requirements or application scenarios. The process creation module, task module, and engine module in the embodiments of the present application may not belong to the operator module.
[0081] When there are new requirements for the supported operators, only the service unit of the corresponding operator needs to be found and modified, without any impact on the logic of other operators. That is, when the process creation module determines the module corresponding to the target operator, the subsequent event processing process can be executed through this operator module.
[0082] OMA (Open Mobile Alliance) is an organization formed by the merger of two standardization organizations, namely the WAP Forum and the Open Mobile Alliance. The full name of DM is Device Management, that is, terminal management. It is a protocol specifically for terminal management derived from the OMA SyncML (Synchronization Markup Language, a platform-independent information synchronization standard protocol). OMADM defines a set of standards for information interaction between the server and the terminal. Through this protocol, firmware updates and system configurations can be achieved. The method provided in this application can be applied to the Android system and the KaiOS system based on the OMADM protocol to configure the device or upgrade the firmware using the OMADM protocol. System configuration means configuring the parameters in the system, and firmware update includes firmware download and firmware installation.
[0083] For example, when the event processing system of the embodiment of this application is actually applied to the OMADM program, its working process can be as follows: The current device is powered on; the OMADM program receives the power-on startup signal and starts running; it automatically identifies the device information and SIM card information to determine the target operator; initializes the operator configuration information and creates an operator service unit factory (service process); the OMADM program is ready and can obtain modules and event processing modules in real time according to preset processing conditions to process the concerned events. In the embodiment of this application, a general framework is adopted. When the program is running, the current operator is identified according to the device information, and the service unit of the identified operator is created through the service unit factory. Therefore, during the use of the device, the UI interface, task scheduling method, event processing, and state machine transition customized by the operator are presented. Thus, the embodiment of this application can achieve relative independence between each operator, adding a new operator will not affect the implementation logic of the operators that have been supported; modifying the requirements of the existing operators will not affect the logic of other operators; each Session runs relatively independently and the services do not interfere with each other; an event-driven event processing framework is adopted, and the threads run efficiently; the commonalities of multiple operators are extracted, and the differences are implemented separately. The independence between operator modules is strong and there is no mutual dependence; the download process is divided into independent blocks according to the services, without interference with each other, and can be flexibly restored, etc.
[0084] The following will be described in detail when the event processing system of the embodiment of this application is applied to the OMADM program.
[0085] The OMADM program is a system application that is programmed into the system before the device leaves the factory. After the device is shipped, it can run automatically when the user starts the device. The OMADM program can support multiple operators simultaneously. Without any modification to the application, after being pre-installed into the Android system or KaiOS system, it can identify the current operator based on the device information.
[0086] Specifically, the process creation module may further include a UI (Graphical User Interface) module. The UI module is used to display the system interface of the current device, for example, interact with the user, prompt the user with some installation information, error information, download progress, and obtain the user's selection results, etc. The UI module is the external interface of the OMADM program and can be customized for different operators to display different prompts.
[0087] In some embodiments, determining the target operator corresponding to the current device includes:
[0088] Obtaining the device information of the current device;
[0089] Determining the target operator from multiple operators according to the device information.
[0090] As Figure 2c shown, after obtaining the device information, it is possible to obtain the information of Operator A, Operator B, Operator C, and Operator D, and determine the target operator from these operators based on the device information. For example, Operator A corresponding to the device information is determined as the target operator.
[0091] Specifically, the operator module may include a task scheduling module and an event management module.
[0092] In some embodiments, before obtaining the preset processing conditions corresponding to the target operator in response to the processing request for the event to be processed, it further includes:
[0093] Creating a task queue through the service process;
[0094] In response to the trigger instruction for the preset task, adding the preset task to the task queue through the service process;
[0095] Generating a processing request for the event to be processed through the service process according to the trigger instruction of the preset task.
[0096] The above process can be carried out by the task scheduling module. The task scheduling module can control task initiation, process task creation initiated by the user, device, and server, and determine whether the task is executable. For example, receiving a task request from the adaptation layer, creating a task and handing it over to the event management module. The task scheduling module can be customized for different operators to formulate different scheduling strategies.
[0097] In some embodiments, in response to a processing request for a to-be-processed event, obtaining a preset processing condition corresponding to a target operator, including:
[0098] In response to a processing request for a to-be-processed event, obtaining a task queue through a service process, where the task queue is used to store tasks;
[0099] Through the service process, determining a task corresponding to the to-be-processed event in the task queue as a target task;
[0100] Executing the target task through the service process to obtain a preset processing condition corresponding to the target operator.
[0101] The above process can be performed by an event management module. The event management module is responsible for receiving events and dispatching them to corresponding tasks, and can pass the events to the task module. For example, the event management module can adopt an event-driven framework to process events occurring at an event source in real time. When the state machine is in a certain state and receives a certain event, it can respond according to the current state or ignore this event.
[0102] In addition, the event processing system may further include a task module. The task module can hand over the received events to the state machine for processing. It will save some information during the operation of the state machine. The task module will also switch the state machine to a new state according to the result of processing events by the current state machine. In addition, as Figure 1d shown, when the worker thread in the engine module finishes processing an event, it will also send the event in the Session to the event queue to wait for the next execution.
[0103] Specifically, the operator module may include a state machine module, where the state machine module can perform operator customization to implement its own rules. It should be noted that in the embodiments of the present application, the event management module and the state machine module can process data through a scheduling thread, and the engine module can process data through a worker thread to achieve parallel processing of the event management, the state judgment process, and the interaction process with the server, improving the event processing efficiency.
[0104] In some embodiments, before obtaining a preset processing condition corresponding to a target operator through a service process in response to a processing request for a to-be-processed event, it further includes:
[0105] For each operator, determining a preset processing condition corresponding to the operator.
[0106] The above process can be carried out by the state machine module, which can also be used to determine whether the event to be processed meets the preset processing conditions. The state machine module can be used to define a set of states according to the business process and switch between these states. The state machine module can process events and interact with different modules according to different events and scenarios. It can be customized for operators, and different states can only process the events they are concerned about.
[0107] When the OMADM program runs, it needs to pay attention to a wide range of event sources, such as user interaction results, system events, etc. This requires the program to react in real time to different events. Different operators may focus on different events. Therefore, the differential implementation of operators is particularly important. As Figure 1c shown, in the state machine factory, each operator implements its own state machine and makes real-time responses to the events it is concerned about. In specific applications, the state machine module corresponding to the target operator can be obtained from the state machine factory to perform state judgment.
[0108] The operator module can also include a timer module, which can be used to set or cancel a timer. For example, it can receive a timer request in the state machine and can be customized for operators.
[0109] In some embodiments, the event to be processed is processed through a service process, including:
[0110] Create session information corresponding to the event to be processed through the service process;
[0111] Send the session information to the server;
[0112] Obtain the data information corresponding to the session information sent by the server.
[0113] The event processing module can be an engine module. The steps in the above process can be carried out by the engine module. The engine module can be used to implement the SyncML protocol and the firmware download protocol for the interaction with the server. The engine module can accept the scheduling of the state machine. For example, the engine module can be used to run the DM Session, download the DD, run the DMTree Session, or download the firmware. Operator non-differentiation can be carried out for the Engine module, that is, all operators use the same engine module. The engine module only processes the basic OMADM protocol and the download protocol and is stateless. All states are maintained by the state machine module. In actual applications, scheduling can be carried out according to the operator's needs, supporting multiple Sessions (session control) in parallel and not interfering with each other. For example, as Figure 2dAs shown, a download task is currently in progress. This task is State Machine 1 and is currently in State 3. At this time, a DM Session initiated by the server is received, and State Machine 2 can be created. Currently, State Machine 1 and State Machine 2 run independently, and their logics do not interfere with each other.
[0114] In specific implementation, each of the above modules can be implemented as an independent entity, or can be arbitrarily combined and implemented as the same or several entities. For the specific implementation of each of the above modules, reference can be made to the method embodiments described above, which will not be elaborated here.
[0115] As can be seen from the above, the event processing system of this embodiment can support multiple operators at the same time. After extracting the operator differences, the factory mode is used to isolate the operations between different operators. The code architecture is clear, which makes the subsequent code maintenance convenient and the logic clear. When a new operator needs to be supported, only new implementations need to be added without modifying the existing logic, complying with the open-closed principle. It supports parallel multi-Sessions and can flexibly adjust the Session running mode according to the operator's requirements. The modules comply with the interface isolation principle, improving the cohesion of the system, reducing external interactions, lowering the coupling of the system, and enhancing the flexibility and maintainability of the system.
[0116] To better implement the above method, an event processing device is further provided in an embodiment of the present application. The event processing device can be specifically integrated in an electronic device, and the electronic device can be a device such as a terminal or a server. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, or a personal computer; the server can be a single server or a server cluster composed of multiple servers.
[0117] For example, in this embodiment, taking the event processing device being specifically integrated in the terminal as an example, the method of the embodiment of the present application will be described in detail.
[0118] For example, as Figure 3 shown, the event processing device may include a first determination unit 310, a creation unit 320, a second determination unit 330, and a processing unit 340, as follows:
[0119] (1) First determination unit 310
[0120] It is used to determine the target operator corresponding to the current device.
[0121] In some implementation manners, the first determination unit 310 may specifically be used for:
[0122] Obtain the device information of the current device;
[0123] Determine the target operator from multiple operators according to the device information.
[0124] (2) Creation Unit 320
[0125] It is used to create a service process corresponding to the target operator, and the service process is used to obtain preset processing conditions and process events according to the preset processing conditions.
[0126] In some embodiments, the creation unit 320 can also be used for:
[0127] For each operator, determine the preset processing conditions corresponding to the operator.
[0128] (3) Second Determination Unit 330
[0129] It is used to respond to a processing request for a to-be-processed event, and obtain the preset processing conditions corresponding to the target operator through the service process.
[0130] In some embodiments, the second determination unit 330 can specifically be used for:
[0131] Respond to a processing request for a to-be-processed event, and obtain a task queue through the service process. The task queue is used to store tasks;
[0132] Through the service process, determine the task corresponding to the to-be-processed event in the task queue as the target task;
[0133] Execute the target task through the service process to obtain the preset processing conditions corresponding to the target operator.
[0134] In some embodiments, the second determination unit 330 can also be used for:
[0135] Create a task queue through the service process;
[0136] Respond to a trigger instruction for a preset task, and add the preset task to the task queue through the service process;
[0137] Generate a processing request for the to-be-processed event through the service process according to the trigger instruction of the preset task.
[0138] (4) Processing Unit 340
[0139] When the to-be-processed event meets the preset processing conditions, process the to-be-processed event through the service process.
[0140] In some embodiments, the processing unit 340 can specifically be used for:
[0141] When the to-be-processed event meets the preset processing conditions, create session information corresponding to the to-be-processed event through the service process;
[0142] Send the session information to the server;
[0143] Obtain the data information corresponding to the session information sent by the server.
[0144] In specific implementation, each of the above units can be implemented as an independent entity, or can be arbitrarily combined and implemented as the same or several entities. For the specific implementation of each of the above units, reference can be made to the method embodiments described above, which will not be elaborated here.
[0145] As can be seen from the above, this embodiment can formulate corresponding service processes for each operator to support multiple operator logics and improve the flexibility of device operation.
[0146] Correspondingly, an embodiment of the present application further provides a computer device, which can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant (Personal Digital Assistant, PDA), or other terminal devices.
[0147] Such as Figure 4 shown, Figure 4 is a schematic structural diagram of the computer device provided by an embodiment of the present application. The computer device 400 includes a processor 410 with one or more processing cores, a memory 420 with one or more computer-readable storage media, and a computer program stored in the memory 420 and executable on the processor. Among them, the processor 410 is electrically connected to the memory 420. Those skilled in the art can understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and it may include more or fewer components than shown in the figure, or combine certain components, or arrange different components.
[0148] The processor 410 is the control center of the computer device 400, connecting various parts of the entire computer device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 420, and calling the data stored in the memory 420, it executes various functions of the computer device 400 and processes data, thereby performing overall monitoring of the computer device 400.
[0149] In the embodiment of the present application, the processor 410 in the computer device 400 will load the instructions corresponding to the processes of one or more application programs into the memory 420 according to the following steps, and the processor 410 will run the application programs stored in the memory 420 to implement various functions:
[0150] Determine the target operator corresponding to the current device; create a service process corresponding to the target operator, where the service process is used to determine preset processing conditions and process events according to the preset processing conditions; in response to a processing request for a to-be-processed event, obtain the preset processing conditions corresponding to the target operator through the service process; when the to-be-processed event meets the preset processing conditions, process the to-be-processed event through the service process.
[0151] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.
[0152] Optionally, as Figure 4 shown, the computer device 400 further includes: a touch display screen 430, a radio frequency circuit 440, an audio circuit 450, an input unit 460, and a power supply 470. Among them, the processor 410 is electrically connected to the touch display screen 430, the radio frequency circuit 440, the audio circuit 450, the input unit 460, and the power supply 470 respectively. Those skilled in the art can understand that Figure 4 the computer device structure shown in
[0153] The touch display screen 430 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 430 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using any suitable object or accessory such as a finger or a stylus on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 410, and can receive and execute the commands sent by the processor 410. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of touch event. Subsequently, the processor 410 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 430 to implement input and output functions. However, in some embodiments, the touch panel and the display panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 430 can also be used as part of the input unit 460 to implement the input function.
[0154] The radio frequency circuit 440 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.
[0155] The audio circuit 450 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 450 can transmit the electrical signal after converting the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 450 and then converted into audio data. After the audio data is output to the processor 410 for processing, it is sent to another computer device through the radio frequency circuit 440, or the audio data is output to the memory 420 for further processing. The audio circuit 450 may also include an earphone jack to provide communication between the peripheral earphone and the computer device.
[0156] The input unit 460 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0157] The power supply 470 is used to supply power to each component of the computer device 400. Optionally, the power supply 470 can be logically connected to the processor 410 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 470 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0158] Although Figure 4 not shown in the figure, the computer device 400 may further include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0159] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0160] As can be seen from the above, the computer device provided in this embodiment can formulate corresponding service processes for each operator to support multiple operator logics and improve the flexibility of device operation.
[0161] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0162] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute the steps in any event processing method provided by the embodiment of the present application. For example, the computer program can execute the following steps:
[0163] Determine the target operator corresponding to the current device; create a service process corresponding to the target operator, where the service process is used to determine preset processing conditions and process events according to the preset processing conditions; in response to a processing request for a to-be-processed event, obtain the preset processing conditions corresponding to the target operator through the service process; when the to-be-processed event meets the preset processing conditions, process the to-be-processed event through the service process.
[0164] The specific implementation of each of the above operations can be referred to the previous embodiments and will not be elaborated here.
[0165] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk, optical disc, etc.
[0166] Since the computer program stored in the storage medium can execute the steps in any of the event processing methods provided in the embodiments of the present application, the beneficial effects achievable by any of the event processing methods provided in the embodiments of the present application can be achieved. For details, see the previous embodiments and will not be elaborated here.
[0167] The above has introduced in detail an event processing method, device, storage medium and computer device provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. An event processing method, characterized in that, it includes: Determine the target operator corresponding to the current device; Create a service process corresponding to the target operator, where the service process is used to obtain preset processing conditions and process events according to the preset processing conditions; In response to a processing request for a to-be-processed event, execute a task corresponding to the to-be-processed event through the service process to obtain the preset processing conditions corresponding to the target operator, wherein, the to-be-processed event refers to an event set for the application scenario of the current device; When the to-be-processed event meets the preset processing conditions, process the to-be-processed event through the service process, where processing the to-be-processed event through the service process includes: Create session information corresponding to the to-be-processed event through the service process; Send the session information to the server; Obtain data information corresponding to the session information sent by the server.
2. The event processing method according to claim 1, characterized in that, The step of "In response to a processing request for a to-be-processed event, execute a task corresponding to the to-be-processed event through the service process to obtain the preset processing conditions corresponding to the target operator" includes: In response to a processing request for a to-be-processed event, obtain a task queue through the service process, where the task queue is used to store tasks; Through the service process, determine the task corresponding to the to-be-processed event in the task queue as the target task; Execute the target task through the service process to obtain the preset processing conditions corresponding to the target operator.
3. The event processing method according to claim 2, characterized in that, Before the step of "In response to a processing request for a to-be-processed event, execute a task corresponding to the to-be-processed event through the service process to obtain the preset processing conditions corresponding to the target operator", it further includes: Create a task queue through the service process; In response to a trigger instruction for a preset task, add the preset task to the task queue through the service process; Generate a processing request for the to-be-processed event through the service process according to the trigger instruction of the preset task.
4. The event processing method according to claim 1, characterized in that, The step of "Determine the target operator corresponding to the current device" includes: Obtain the device information of the current device; Determine the target operator from multiple operators according to the device information.
5. The event processing method according to claim 4, characterized in that, Before the step of "In response to a processing request for a to-be-processed event, execute a task corresponding to the to-be-processed event through the service process to obtain the preset processing conditions corresponding to the target operator", it further includes: For each of the operators, determine the preset processing conditions corresponding to the operator.
6. An event processing system, characterized in that, it includes a service process creation module, an event processing module, and multiple operator modules, where the multiple operator modules correspond to different operators, and among them, The process creation module is used to determine the target operator corresponding to the current device; and create a service process corresponding to the target operator, where the service process is used to obtain preset processing conditions and process pending events according to the preset processing conditions. The processing of the pending event according to the preset processing conditions includes: When the pending event meets the preset processing conditions, create session information corresponding to the pending event through the service process; Send the session information to the server; Obtain data information corresponding to the session information sent by the server; The operator module is used to, in response to a processing request for a pending event, execute a task corresponding to the pending event through the service process to obtain the preset processing conditions corresponding to the target operator, where the pending event refers to an event set for the application scenario of the current device; The event processing module is used to, when the pending event meets the preset processing conditions, process the pending event through the service process.
7. An event processing device Characterized in that It includes: A first determination unit for determining the target operator corresponding to the current device; A creation unit for creating a service process corresponding to the target operator, where the service process is used to obtain preset processing conditions and process events according to the preset processing conditions; A second determination unit for, in response to a processing request for a pending event, executing a task corresponding to the pending event through the service process to obtain the preset processing conditions corresponding to the target operator; A processing unit for, when the pending event meets the preset processing conditions, processing the pending event through the service process, where processing the pending event through the service process includes: Creating session information corresponding to the pending event through the service process; Sending the session information to the server; Obtaining data information corresponding to the session information sent by the server.
8. A computer device Characterized in that It includes a processor and a memory, and the memory stores multiple instructions; the processor loads the instructions from the memory to execute the steps in the event processing method according to any one of claims 1 to 5.
9. A computer-readable storage medium Characterized in that The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the event processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Cloud platform supporting fusion network service and operating method thereof
CN101969391A
Method and apparatus for loading configuration information, and computer device
CN107743305A